Okay, first off, you’ll want to call the EngWorkBench adapter. You’ll be calling pretty much everything from there.
I think this is roughly what you need to do to just check out the part, nuke the details, and check back in. You’ll have to look at the method parameters in object explorer. There’s a lot of them and adding them would clutter the code snippet up. Most of them are obvious anyway. If not, set them to false/blank.
using (var adapter = new EngWorkBenchAdapter(oTrans))
{
adapter.BOConnect();
adapter.CheckOut(...)
//this should also unapprove the part, so you can skip that step.
//I believe ipReturn needs to be true to return the dataset for the following calls.
adapter.ClearAll(...);
//I don't *think* you have to loop this if you have alt methods.
var ecoRevTable = adapter.EngWorkBenchData.ECORev;
foreach (DataRow row in ecoRevTable.Rows)
{
if ((string)row[ecoRevTable.PartNumColumn] == "YourPart" &&
(string)row[ecoRevTable.RevisionNumColumn] == "YourRev")
{
row.BeginEdit();
row[ecoRevTable.ApprovedColumn] = true;
row[ecoRevTable.RowModColumn] = "U";
row.EndEdit();
//This will mark the main and alt methods as approved.
}
}
adapter.Update();
//You might need to move this into the loop.
//Sometimes the system gets angry when you update multiple rows in one go.
EngWorkBenchAdapter.CheckIn(...)
}