Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
 public WorkOrder.WorkOrderDataTable GetWorkOrdersByWOnumProj(int wonum, string proj)
 {
     return(WOadapter.GetWOByNumProj(wonum, proj));
 }