Hi,
I have customization which starts activity for selected jobs with one button press. Everything works great until one of the line gets exception like job already active or etc. after exception loop stops and for example if it had to start activity on 5 jobs and it gets exception on second job, the loop stops.
The question is how can I continue loop by skipping line which has an exception. Loop script bellow:
for (int i = 0; i < c; i++)
{
if(Convert.ToBoolean(edv.dataView[i]["Calculated_CheckMark"])== true)
{
string job = edv.dataView[i]["JobOper_JobNum"].ToString();
LaborAdapter la = new LaborAdapter(oTrans);
la.BOConnect();
la.StartActivityByEmp(tabID, type);
la.DefaultJobNum(job);
la.CheckResourceGroup("", out vMessage);
la.OverridesResource("");
la.DefaultWCCode("", out vMessage);
la.LaborRateCalc();
int seq = (int)edv.dataView[i]["JobOper_OprSeq"];
la.DefaultOprSeq(seq, out vMessage);
la.LaborRateCalc();
la.CheckWarnings(out vMessage);
int lseq = la.LaborData.LaborDtl[0].LaborHedSeq;
string resourceID = la.LaborData.LaborDtl[0].ResourceID.ToString();
la.CheckEmployeeActivity(tabID, lseq, job, 0, seq, resourceID,out opMessage);
la.CheckFirstArticleWarning(out pcMsg);
//MessageBox.Show(opMessage);
la.Update();
la.Dispose();
}
}