Example #1
0
    private void RemoveEditServices()
    {
        for (int iService = 1; iService <= cServices; iService++)
        {
            TableRow tr = tblServices.Rows[iService + 1];

            CheckBox chkRemove = (CheckBox)tr.FindControl("chkRemove" + iService);
            if (chkRemove != null && chkRemove.Checked)
            {
                String Sql = "";
                try
                {
                    Int32 ServiceSeq = Str.Num(WebPage.FindTextBox(ref tr, "txtServiceSeq" + iService));
                    Sql = "Delete From mcJobServices Where JobRno = " + JobRno + " And ServiceSeq = " + ServiceSeq;
                    db.Exec(Sql);
                }
                catch (Exception Ex)
                {
                    Err Err = new Err(Ex, Sql);
                    Response.Write(Err.Html());
                }
            }
        }
    }
Example #2
0
    private void RemoveEditDishes()
    {
        for (int iDish = 1; iDish <= cDishes; iDish++)
        {
            TableRow tr = tblDishes.Rows[iDish];

            CheckBox chkRemove = (CheckBox)tr.FindControl("chkRemove" + iDish);
            if (chkRemove != null && chkRemove.Checked)
            {
                String Sql = "";
                try
                {
                    Int32 DishSeq = Str.Num(WebPage.FindTextBox(ref tr, "txtDishSeq" + iDish));
                    Sql = "Delete From mcJobDishes Where JobRno = " + JobRno + " And DishSeq = " + DishSeq;
                    db.Exec(Sql);
                }
                catch (Exception Ex)
                {
                    Err Err = new Err(Ex, Sql);
                    Response.Write(Err.Html());
                }
            }
        }
    }
Example #3
0
    private void RemoveCrew()
    {
        for (int iCrew = 1; iCrew <= cCrew; iCrew++)
        {
            TableRow tr = tblCrew.Rows[iCrew];

            CheckBox chkRemove = (CheckBox)tr.FindControl("chkRemove" + iCrew);
            if (chkRemove != null && chkRemove.Checked)
            {
                String Sql = "";
                try
                {
                    Int32 CrewSeq = Str.Num(WebPage.FindTextBox(ref tr, "txtCrewSeq" + iCrew));
                    Sql = "Delete From mcJobCrew Where JobRno = " + JobRno + " And CrewSeq = " + CrewSeq;
                    db.Exec(Sql);
                }
                catch (Exception Ex)
                {
                    Err Err = new Err(Ex, Sql);
                    Response.Write(Err.Html());
                }
            }
        }
    }
Example #4
0
    private void SaveEditServices()
    {
        String Sql = "";

        for (int iService = 1; iService <= cServices; iService++)
        {
            TableRow tr = tblServices.Rows[iService + 1];

            CheckBox chkRemove = (CheckBox)tr.FindControl("chkRemove" + iService);
            if (chkRemove != null && !chkRemove.Checked)
            {
                Int32 ServiceSeq = Str.Num(WebPage.FindTextBox(ref tr, "txtServiceSeq" + iService));

                String ServiceItem     = WebPage.FindTextBox(ref tr, "txtServiceItem" + iService);
                String OrigServiceItem = WebPage.FindTextBox(ref tr, "txtOrigServiceItem" + iService);

                bool MCCResp     = FindCheckBox(ref tr, "chkMCCResp" + iService);
                bool OrigMCCResp = FindCheckBox(ref tr, "chkOrigMCCResp" + iService);

                bool CustomerResp     = FindCheckBox(ref tr, "chkCustomerResp" + iService);
                bool OrigCustomerResp = FindCheckBox(ref tr, "chkOrigCustomerResp" + iService);

                String Note     = WebPage.FindTextBox(ref tr, "txtNote" + iService);
                String OrigNote = WebPage.FindTextBox(ref tr, "txtOrigNote" + iService);

                if (ServiceItem != OrigServiceItem ||
                    MCCResp != OrigMCCResp ||
                    CustomerResp != OrigCustomerResp ||
                    Note != OrigNote)
                {
                    DateTime Tm = DateTime.Now;

                    try
                    {
                        if (ServiceSeq == 0)
                        {
                            ServiceSeq = db.NextSeq("mcJobServices", "JobRno", JobRno, "ServiceSeq");

                            Sql =
                                "Insert Into mcJobServices (JobRno, ServiceSeq, CreatedDtTm, CreatedUser) Values (" +
                                JobRno + ", " +
                                ServiceSeq + ", " +
                                DB.PutDtTm(Tm) + ", " +
                                DB.PutStr(g.User) + ")";
                            db.Exec(Sql);

                            MCCResp = true;                             // set on by default for new selections
                        }

                        Sql =
                            "Update mcJobServices Set " +
                            "ServiceItem = " + DB.PutStr(ServiceItem, 50) + ", " +
                            "MCCRespFlg = " + DB.PutBool(MCCResp) + ", " +
                            "CustomerRespFlg = " + DB.PutBool(CustomerResp) + ", " +
                            "Note = " + DB.PutStr(Note, 128) + ", " +
                            "UpdatedDtTm = " + DB.PutDtTm(Tm) + ", " +
                            "UpdatedUser = "******" " +
                            "Where JobRno = " + JobRno + " " +
                            "And ServiceSeq = " + ServiceSeq;
                        db.Exec(Sql);
                    }
                    catch (Exception Ex)
                    {
                        Err Err = new Err(Ex, Sql);
                        Response.Write(Err.Html());
                    }
                }
            }
        }
    }
Example #5
0
    private void SaveEditDishes()
    {
        String Sql = "";

        for (int iDish = 1; iDish <= cDishes; iDish++)
        {
            TableRow tr = tblDishes.Rows[iDish];

            CheckBox chkRemove = (CheckBox)tr.FindControl("chkRemove" + iDish);
            if (chkRemove != null && !chkRemove.Checked)
            {
                Int32 DishSeq = Str.Num(WebPage.FindTextBox(ref tr, "txtDishSeq" + iDish));

                String DishItem     = WebPage.FindTextBox(ref tr, "txtDishItem" + iDish);
                String OrigDishItem = WebPage.FindTextBox(ref tr, "txtOrigDishItem" + iDish);

                int Qty     = Str.Num(WebPage.FindTextBox(ref tr, "txtQty" + iDish));
                int OrigQty = Str.Num(WebPage.FindTextBox(ref tr, "txtOrigQty" + iDish));

                String Note     = WebPage.FindTextBox(ref tr, "txtNote" + iDish);
                String OrigNote = WebPage.FindTextBox(ref tr, "txtOrigNote" + iDish);

                //if Paper/Glass
                if (!chkRemove.Visible)
                {
                    //this is the Paper/Glass
                    bool fPaper = (Request.Form["rbEditPaperGlass"] == "rbEditPaper");

                    DishItem = cnPaperGlass;
                    Qty      = 0;
                    Note     = (fPaper ? cnPaper : cnGlass);
                }

                if (DishItem != OrigDishItem ||
                    Qty != OrigQty ||
                    Note != OrigNote)
                {
                    DateTime Tm = DateTime.Now;

                    try
                    {
                        if (DishSeq == 0)
                        {
                            DishSeq = db.NextSeq("mcJobDishes", "JobRno", JobRno, "DishSeq");

                            Sql =
                                "Insert Into mcJobDishes (JobRno, DishSeq, CreatedDtTm, CreatedUser) Values (" +
                                JobRno + ", " +
                                DishSeq + ", " +
                                DB.PutDtTm(Tm) + ", " +
                                DB.PutStr(g.User) + ")";
                            db.Exec(Sql);
                        }

                        Sql =
                            "Update mcJobDishes Set " +
                            "DishItem = " + DB.PutStr(DishItem, 50) + ", " +
                            "Qty = " + Qty + ", " +
                            "Note = " + DB.PutStr(Note, 128) + ", " +
                            "UpdatedDtTm = " + DB.PutDtTm(Tm) + ", " +
                            "UpdatedUser = "******" " +
                            "Where JobRno = " + JobRno + " " +
                            "And DishSeq = " + DishSeq;
                        db.Exec(Sql);
                    }
                    catch (Exception Ex)
                    {
                        Err Err = new Err(Ex, Sql);
                        Response.Write(Err.Html());
                    }
                }
            }
        }
    }
Example #6
0
    private void SaveCrew()
    {
        String Sql     = "";
        String JobDate = "";

        try
        {
            Sql     = "Select JobDate From mcJobs Where JobRno = " + JobRno;
            JobDate = Fmt.Dt(db.SqlDtTm(Sql));
        }
        catch (Exception Ex)
        {
            Err Err = new Err(Ex, Sql);
            Response.Write(Err.Html());
        }

        for (int iCrew = 1; iCrew <= cCrew; iCrew++)
        {
            TableRow tr = tblCrew.Rows[iCrew];

            CheckBox chkRemove = (CheckBox)tr.FindControl("chkRemove" + iCrew);
            if (chkRemove != null && !chkRemove.Checked)
            {
                Int32 CrewSeq = Str.Num(WebPage.FindTextBox(ref tr, "txtCrewSeq" + iCrew));

                String CrewMember     = WebPage.FindTextBox(ref tr, "txtCrewMember" + iCrew);
                String OrigCrewMember = WebPage.FindTextBox(ref tr, "txtOrigCrewMember" + iCrew);

                String Assignment     = WebPage.FindTextBox(ref tr, "txtAssignment" + iCrew);
                String OrigAssignment = WebPage.FindTextBox(ref tr, "txtOrigAssignment" + iCrew);

                String ReportTime     = WebPage.FindTextBox(ref tr, "txtReportTime" + iCrew);
                String OrigReportTime = WebPage.FindTextBox(ref tr, "txtOrigReportTime" + iCrew);

                String Note     = WebPage.FindTextBox(ref tr, "txtNote" + iCrew);
                String OrigNote = WebPage.FindTextBox(ref tr, "txtOrigNote" + iCrew);

                if (CrewMember != OrigCrewMember ||
                    Assignment != OrigAssignment ||
                    ReportTime != OrigReportTime ||
                    Note != OrigNote)
                {
                    DateTime Tm = DateTime.Now;

                    try
                    {
                        if (CrewSeq == 0)
                        {
                            CrewSeq = db.NextSeq("mcJobCrew", "JobRno", JobRno, "CrewSeq");

                            Sql =
                                "Insert Into mcJobCrew (JobRno, CrewSeq, CreatedDtTm, CreatedUser) Values (" +
                                JobRno + ", " +
                                CrewSeq + ", " +
                                DB.PutDtTm(Tm) + ", " +
                                DB.PutStr(g.User) + ")";
                            db.Exec(Sql);
                        }

                        Sql =
                            "Update mcJobCrew Set " +
                            "CrewMember = " + DB.PutStr(CrewMember, 50) + ", " +
                            "CrewAssignment = " + DB.PutStr(Assignment, 50) + ", " +
                            "ReportTime = " + DB.PutDtTm(JobDate, ReportTime) + ", " +
                            "Note = " + DB.PutStr(Note, 128) + ", " +
                            "UpdatedDtTm = " + DB.PutDtTm(Tm) + ", " +
                            "UpdatedUser = "******" " +
                            "Where JobRno = " + JobRno + " " +
                            "And CrewSeq = " + CrewSeq;
                        db.Exec(Sql);
                    }
                    catch (Exception Ex)
                    {
                        Err Err = new Err(Ex, Sql);
                        Response.Write(Err.Html());
                    }
                }
            }
        }
    }