You want to follow the trace to a T (for the most part)
So you want to make all those calls that they do, going straight to Update is generally a bad idea.
The first call to GetByID on LaborImpl() gets a hold of the current clocked in Labor record for the Employee and that returns the LaborDataSet which then is passed around to the other functions.
You would instanciate the Labor ADapter… like this and make the calls
var la = new LaborAdapter(oTrans);
la.BOConnect();
la.GetByID(123456); //123456 being the current Labor Hed Sequence for the clocked in Employee (get it via BAQ, BOReader etc)
la.StartActivity(123456,"P"); //Start Production Activity
la.DefaultJobNum("MyJobNum");
//..... etc... there are instances where you have to set the value of the data set and you can do it like this
la.LaborData.LaborDtl[0].Field="XX"; //Note that Index 0 is the first on the collection you'd have to find the right one would generally be la.LaborData.LaborDtl[la.LaborData.LaborDtl.Count-1]
la.Update();
Here is an example of creating a Labor record (Time & Expense like ) just to show you how do address fields, and how to set values and such. You’ll just mimic the same but with the right BO calls as outlined in the trace.
LaborAdapter la = new LaborAdapter(oTrans);
la.BOConnect();
LaborDataSet lds;
la.GetNewLaborHed1("1",false, DateTime.Today);
la.Update();
la.GetNewLaborDtlWithHdr(DateTime.Today,0,DateTime.Today,0,(int)dr["Calculated_LbrHedSeq"]);
la.DefaultJobNum(dr["JobProd_JobNum"].ToString());
la.LaborRateCalc();
la.DefaultOprSeq((int)drO["OprSeq"], out msg);
la.LaborRateCalc();
la.DefaultLaborQty(1, out msg);
la.CheckWarnings(out msg);
LaborDataSet.LaborDtlRow ld = (LaborDataSet.LaborDtlRow)lds.LaborDtl.Select("RowMod='A'")[0];
la.Update();
ld.RowMod="U";
la.ValidateChargeRateForTimeType(out msg);
la.SubmitForApproval(false, out msg)