public bool OpenJob() { var jobClose = new JobClosing(this.Session.ConnectionPool); var jobCloseDs = new JobClosingDataSet(); string msg = ""; string allmsg = ""; bool req; jobClose.GetNewJobClosing(jobCloseDs); try { jobClose.OnChangeJobNum(this.Jobnumber, jobCloseDs, out msg); allmsg += msg; jobCloseDs.JobClosing.Rows[0]["JobComplete"] = "False"; jobCloseDs.JobClosing.Rows[0]["JobClosed"] = "False"; jobClose.PreCloseJob(jobCloseDs, out req); jobClose.CloseJob(jobCloseDs, out msg); //add logging } catch (Exception exp) { MessageBox.Show(exp.Message); } return(true); }
public void Close(DateTime ClosingDate, out string message) { //Job Closing Routine. bool requserinput; var jobClose = new JobClosing(this.Session.ConnectionPool); var jobCloseDs = new JobClosingDataSet(); jobClose.GetNewJobClosing(jobCloseDs); try { string msg = ""; string allmsg = ""; jobClose.OnChangeJobNum(this.Jobnumber, jobCloseDs, out msg); allmsg += msg; jobCloseDs.JobClosing.Rows[0]["JobClosed"] = "True"; jobCloseDs.JobClosing.Rows[0]["QuantityContinue"] = "True"; jobCloseDs.JobClosing.Rows[0]["JobComplete"] = "True"; jobCloseDs.JobClosing.Rows[0]["JobCompletionDate"] = ClosingDate.ToString(); jobCloseDs.JobClosing.Rows[0]["ClosedDate"] = ClosingDate.ToString(); jobCloseDs.JobClosing.Rows[0]["RowMod"] = "U"; jobClose.PreCloseJob(jobCloseDs, out requserinput); if (requserinput == true) { allmsg += "Require UserInput!"; } jobClose.CloseJob(jobCloseDs, out msg); allmsg += msg; message = allmsg; } catch (Exception joberr) { Log.LogThis(joberr.Message, eloglevel.error); throw; } }