public bool UpdateWO(int word_WOnum, string word_Proj, int?word_StatNum, string word_Status, int?word_statFlag, DateTime word_Date, string word_Author, string word_Title, int?word_Priority, string word_Descr, string word_Justify, string word_Cmnts, int?word_PMorSME, int?word_BusnOwner, DateTime?word_reqDueDate) { int rowsAffected = WOadapter.Update(word_WOnum, word_Proj, word_StatNum, word_Status, word_statFlag, word_Date, word_Author, word_Title, word_Priority, word_Descr, word_Justify, word_Cmnts, word_PMorSME, word_BusnOwner, word_reqDueDate, word_WOnum, word_Proj); return(rowsAffected == 1); }
public bool InsertWorkOrder(int word_wonum, string word_proj, int?word_statnum, string word_status, int?word_statflag, DateTime?word_date, string word_author, string word_title, string word_doc, string word_docver, int?word_priority, string word_descr, string word_justify, string word_cmnts, int?word_pmorsme, int?word_busnowner, DateTime word_reqduedate) { WorkOrder.WorkOrderDataTable WrkOrds = new WorkOrder.WorkOrderDataTable(); WorkOrder.WorkOrderRow WrkOrd = WrkOrds.NewWorkOrderRow(); // do data insertions // work out logic to get new work order number //string uname = User.Identity.Name; if (word_proj == null) { return(false); } else { WrkOrd.word_Proj = word_proj; int wonum = GetMaxWOnum(word_proj); //if (wonum > 0 && wonum>word_wonum) //{ WrkOrd.word_WOnum = wonum; //} //else //{ // return false; //} } //WrkOrd.word_StatNum = 9995; if (word_statnum == null) { WrkOrd.Setword_StatNumNull(); } else { WrkOrd.word_StatNum = word_statnum.Value; } if (word_status == null) { WrkOrd.Setword_StatusNull(); } else { WrkOrd.word_Status = word_status; } if (word_statflag == null) { WrkOrd.word_statFlag = 0; } else { WrkOrd.word_statFlag = word_statflag.Value; } WrkOrd.word_Date = DateTime.Today; if (word_author == null) { WrkOrd.Setword_AuthorNull(); } else { WrkOrd.word_Author = word_author; } if (word_title == null) { WrkOrd.Setword_TitleNull(); } else { WrkOrd.word_Title = word_title; } if (word_doc == null) { WrkOrd.word_Doc = ""; //WrkOrd.Setword_DocNull(); } else { WrkOrd.word_Doc = word_doc; } if (word_docver == null) { WrkOrd.word_DocVer = ""; //WrkOrd.Setword_DocVerNull(); } else { WrkOrd.word_DocVer = word_docver; } if (word_priority == null) { WrkOrd.Setword_PriorityNull(); } else { WrkOrd.word_Priority = word_priority.Value; } if (word_descr == null) { WrkOrd.word_Descr = ""; //WrkOrd.Setword_DescrNull(); } else { WrkOrd.word_Descr = word_descr; } if (word_justify == null) { WrkOrd.word_Justify = ""; //WrkOrd.Setword_JustifyNull(); } else { WrkOrd.word_Justify = word_justify; } if (word_cmnts == null) { WrkOrd.word_Cmnts = ""; //WrkOrd.Setword_CmntsNull(); } else { WrkOrd.word_Cmnts = word_cmnts; } if (word_pmorsme == null) { WrkOrd.Setword_PMorSMENull(); } else { WrkOrd.word_PMorSME = word_pmorsme.Value; } if (word_busnowner == null) { WrkOrd.Setword_BusnOwnerNull(); } else { WrkOrd.word_BusnOwner = word_busnowner.Value; } if (word_reqduedate == null || word_reqduedate.Year < 2000) { WrkOrd.Setword_reqDueDateNull(); } else { WrkOrd.word_reqDueDate = word_reqduedate; } WrkOrds.AddWorkOrderRow(WrkOrd); int rowsAffected = WOadapter.Update(WrkOrds); //Insert(WrkOrd.word_WOnum, word_proj, WrkOrd.word_StatNum, //WrkOrd.word_Status, WrkOrd.word_statFlag, WrkOrd.word_Date, WrkOrd.word_Author, WrkOrd.word_Title, //WrkOrd.word_Doc, WrkOrd.word_DocVer, WrkOrd.word_Priority, WrkOrd.word_Descr, WrkOrd.word_Justify, WrkOrd.word_Cmnts, //WrkOrd.word_PMorSME, WrkOrd.word_BusnOwner, WrkOrd.word_reqDueDate); //.Update(WrkOrds); WorkOrder.WorkOrderDataTable WOdataT = new WorkOrder.WorkOrderDataTable(); WOdataT.AddWorkOrderRow(WrkOrd); //return WOdataT; return(rowsAffected == 1); }
public bool UpdateWorkOrder(int word_WOnum, string word_Proj, int?word_StatNum, string word_Status, int?word_statFlag, DateTime word_Date, string word_Author, string word_Title, string word_Doc, string word_DocVer, int?word_Priority, string word_Descr, string word_Justify, string word_Cmnts, int?word_PMorSME, int?word_BusnOwner, DateTime?word_reqDueDate, int Original_word_WOnum, string Original_word_Proj) { WorkOrder.WorkOrderDataTable WrkOrds = WOadapter.GetWOByNumProj(word_WOnum, word_Proj);//new WorkOrder.WorkOrderDataTable(); if (WrkOrds.Count == 0) { return(false); } WorkOrder.WorkOrderRow WrkOrd = WrkOrds[0]; // do data insertions WrkOrd.word_Proj = word_Proj; word_WOnum = GetMaxWOnum(word_Proj); if (word_StatNum == null) { WrkOrd.Setword_StatNumNull(); } else { WrkOrd.word_StatNum = word_StatNum.Value; } if (word_Status == null) { WrkOrd.Setword_StatusNull(); } else { WrkOrd.word_Status = word_Status; } if (word_statFlag == null) { WrkOrd.word_statFlag = 0; } else { WrkOrd.word_statFlag = word_statFlag.Value; } if (word_Date == null) { WrkOrd.Setword_DateNull(); } else { WrkOrd.word_Date = word_Date; } if (word_Author == null) { WrkOrd.Setword_AuthorNull(); } else { WrkOrd.word_Author = word_Author; } if (word_Title == null) { WrkOrd.Setword_TitleNull(); } else { WrkOrd.word_Title = word_Title; } if (word_Doc == null) { WrkOrd.Setword_DocNull(); } else { WrkOrd.word_Doc = word_Doc; } if (word_DocVer == null) { WrkOrd.Setword_DocVerNull(); } else { WrkOrd.word_DocVer = word_DocVer; } if (word_Priority == null) { WrkOrd.Setword_PriorityNull(); } else { WrkOrd.word_Priority = word_Priority.Value; } if (word_Descr == null) { WrkOrd.Setword_DescrNull(); } else { WrkOrd.word_Descr = word_Descr; } if (word_Justify == null) { WrkOrd.Setword_JustifyNull(); } else { WrkOrd.word_Justify = word_Justify; } if (word_Cmnts == null) { WrkOrd.Setword_CmntsNull(); } else { WrkOrd.word_Cmnts = word_Cmnts; } if (word_PMorSME == null) { WrkOrd.Setword_PMorSMENull(); } else { WrkOrd.word_PMorSME = word_PMorSME.Value; } if (word_BusnOwner == null) { WrkOrd.Setword_BusnOwnerNull(); } else { WrkOrd.word_BusnOwner = word_BusnOwner.Value; } if (word_reqDueDate == null) { WrkOrd.Setword_reqDueDateNull(); } else { WrkOrd.word_reqDueDate = word_reqDueDate.Value; } int rowsAffected = WOadapter.Update(WrkOrds); //int rowsAffected = WOadapter.Update(WrkOrd.word_WOnum, WrkOrd.word_Proj, WrkOrd.word_StatNum, //WrkOrd.word_Status, WrkOrd.word_statFlag, WrkOrd.word_Date, WrkOrd.word_Author, //WrkOrd.word_Title, WrkOrd.word_Doc, WrkOrd.word_DocVer, WrkOrd.word_Priority, //WrkOrd.word_Descr, WrkOrd.word_Justify, WrkOrd.word_Cmnts, //WrkOrd.word_PMorSME, WrkOrd.word_BusnOwner, WrkOrd.word_reqDueDate, WrkOrd.word_WOnum, WrkOrd.word_Proj); return(rowsAffected == 1); }