Anyone have experience updating an operation sequence via c#? I am trying to use this adapter, but not sure how to get it to fire. Where do I put in the current operation sequence, and the operation sequence I want it to become?
JobEntryAdapter adapterJobEntry = new JobEntryAdapter(this.oTrans);
adapterJobEntry.BOConnect();
adapterJobEntry.GetByID(job.Text);
EpiDataView edvPA2 = new EpiDataView();
edvPA2.dataView = new DataView(adapterJobEntry.JobEntryData.JobOper);
EpiDataView edvPA3 = new EpiDataView();
edvPA3.dataView = new DataView(adapterJobEntry.JobEntryData.JobOpDtl);
int z = adapterJobEntry.JobEntryData.JobOper.Rows.Count;
int i = 0;
int j = 0;
while (Convert.ToInt32(edvPA3.dataView[j]["OprSeq"]) != Convert.ToInt32(currentop.Value))
{
j = j+1;
}
while (Convert.ToInt32(edvPA2.dataView[i]["OprSeq"]) != Convert.ToInt32(currentop.Value))
{
i = i+1;
}
if (i == 0)
{
MessageBox.Show("This is the first operation in the sequence, you cannot move it up any further.");
return;
}
//Op that we want to move
int x = Convert.ToInt32(currentop.Value);
//Op that we are switching with
int y = Convert.ToInt32(edvPA2.dataView[i-1]["OprSeq"]);
adapterJobEntry.ChangeJobOperOprSeq();
DataRow editRow = adapterJobEntry.JobEntryData.JobOper.Rows[i-1];
editRow.BeginEdit();
editRow["OprSeq"] = 777;
editRow.EndEdit();
adapterJobEntry.Update();
All I want to do for now is change the current operation sequence to be 777. If I can figure that out, I can finish the rest of this project. Thanks for the help!