Пример #1
0
    private void AddEditLines()
    {
        String Sql;

        SelectList.Clear();

        try
        {
            for (int iDish = 1; iDish <= cDishes; iDish++)
            {
                TableRow r = new TableRow();

                for (int iCell = 0; iCell < 9; iCell++)
                {
                    r.Cells.Add(new TableCell());
                }

                r.Cells[0].Text = "<b>" + iDish + "</b>";

                HtmlInputHidden txtDishSeq = new HtmlInputHidden();
                txtDishSeq.ID = "txtDishSeq" + iDish;
                r.Cells[1].Controls.Add(txtDishSeq);

                // Remove
                CheckBox chkRemove = new CheckBox();
                chkRemove.ID = "chkRemove" + iDish;
                chkRemove.Attributes.Add("onClick", "SetDirty();");
                r.Cells[2].Controls.Add(chkRemove);
                r.Cells[2].HorizontalAlign = HorizontalAlign.Center;

                // DishItem
                TextBox txtDishItem = new TextBox();
                txtDishItem.ID           = "txtDishItem" + iDish;
                txtDishItem.MaxLength    = 50;
                txtDishItem.CssClass     = "DishItem";
                txtDishItem.AutoPostBack = true;
                txtDishItem.Attributes.Add("onChange", "HideDirty();");
                txtDishItem.TextChanged += new System.EventHandler(this.btnUpdate_Click);
                r.Cells[4].Controls.Add(txtDishItem);

                System.Web.UI.WebControls.Image imgDishItem = new System.Web.UI.WebControls.Image();
                imgDishItem.ID          = "ddDishItem" + iDish;
                imgDishItem.ImageUrl    = "Images/DropDown.gif";
                imgDishItem.BorderWidth = 0;
                imgDishItem.ImageAlign  = ImageAlign.AbsMiddle;
                r.Cells[4].Controls.Add(imgDishItem);

                Sql = "Select Distinct DishItem From mcJobDishes Order By DishItem";
                SelectList slDishItem = new SelectList("DishItem" + iDish, ref txtDishItem);
                slDishItem.ImageButton(imgDishItem);
                slDishItem.AutoPostBack = true;
                slDishItem.Height       = 400;
                slDishItem.ClearValues();
                slDishItem.AddDBValues(db, Sql);

                txtDishItem         = new TextBox();
                txtDishItem.ID      = "txtOrigDishItem" + iDish;
                txtDishItem.Visible = false;
                r.Cells[4].Controls.Add(txtDishItem);

                // Qty
                TextBox txtQty = new TextBox();
                txtQty.ID = "txtQty" + iDish;
                txtQty.Style.Add("width", "50px");
                txtQty.Attributes.Add("onChange", "SetDirty();");
                r.Cells[6].Controls.Add(txtQty);

                txtQty         = new TextBox();
                txtQty.ID      = "txtOrigQty" + iDish;
                txtQty.Visible = false;
                r.Cells[6].Controls.Add(txtQty);

                // Note
                TextBox txtNote = new TextBox();
                txtNote.ID        = "txtNote" + iDish;
                txtNote.MaxLength = 128;
                txtNote.Style.Add("width", "150px");
                if (iDish == cDishes)
                {
                    //txtNote.AutoPostBack = true;
                    txtNote.Attributes.Add("onBlur", "this.value+=' ';ClearDirty();__doPostBack('" + txtNote.ID + "','');");
                    txtNote.Attributes.Add("onChange", "ClearDirty();");
                    txtNote.TextChanged += new System.EventHandler(this.btnUpdate_Click);
                }
                else
                {
                    txtNote.Attributes.Add("onChange", "SetDirty();");
                }
                r.Cells[8].Controls.Add(txtNote);

                txtNote         = new TextBox();
                txtNote.ID      = "txtOrigNote" + iDish;
                txtNote.Visible = false;
                r.Cells[8].Controls.Add(txtNote);

                tblDishes.Rows.Add(r);
            }
        }
        catch (Exception Ex)
        {
            Err Err = new Err(Ex);
            Response.Write(Err.Html());
        }
    }
Пример #2
0
    private void AddEditLines()
    {
        String Sql;

        SelectList.Clear();

        for (int iService = 1; iService <= cServices; iService++)
        {
            TableRow r = new TableRow();

            for (int iCell = 0; iCell < 10; iCell++)
            {
                r.Cells.Add(new TableCell());
            }

            r.Cells[0].Text = "<b>" + iService + "</b>";

            HtmlInputHidden txtServiceSeq = new HtmlInputHidden();
            txtServiceSeq.ID = "txtServiceSeq" + iService;
            r.Cells[1].Controls.Add(txtServiceSeq);

            // Remove
            CheckBox chkRemove = new CheckBox();
            chkRemove.ID = "chkRemove" + iService;
            chkRemove.Attributes.Add("onClick", "SetDirty();");
            r.Cells[2].Controls.Add(chkRemove);
            r.Cells[2].HorizontalAlign = HorizontalAlign.Center;

            // ServiceItem
            TextBox txtServiceItem = new TextBox();
            txtServiceItem.ID           = "txtServiceItem" + iService;
            txtServiceItem.MaxLength    = 50;
            txtServiceItem.CssClass     = "ServiceItem";
            txtServiceItem.AutoPostBack = true;
            txtServiceItem.Attributes.Add("onChange", "HideDirty();");
            txtServiceItem.TextChanged += new System.EventHandler(this.btnUpdate_Click);
            r.Cells[4].Controls.Add(txtServiceItem);

            System.Web.UI.WebControls.Image imgServiceItem = new System.Web.UI.WebControls.Image();
            imgServiceItem.ID          = "ddServiceItem" + iService;
            imgServiceItem.ImageUrl    = "Images/DropDown.gif";
            imgServiceItem.BorderWidth = 0;
            imgServiceItem.ImageAlign  = ImageAlign.AbsMiddle;
            r.Cells[4].Controls.Add(imgServiceItem);

            Sql = "Select Distinct ServiceItem From mcJobServices Order By ServiceItem";
            SelectList slServiceItem = new SelectList("ServiceItem" + iService, ref txtServiceItem);
            slServiceItem.ImageButton(imgServiceItem);
            slServiceItem.AutoPostBack = true;
            slServiceItem.ClearValues();
            slServiceItem.AddDBValues(db, Sql);

            txtServiceItem         = new TextBox();
            txtServiceItem.ID      = "txtOrigServiceItem" + iService;
            txtServiceItem.Visible = false;
            r.Cells[4].Controls.Add(txtServiceItem);

            // MCC Resp
            CheckBox chkMCCResp = new CheckBox();
            chkMCCResp.ID = "chkMCCResp" + iService;
            chkMCCResp.Attributes.Add("onClick", "SetDirty();");
            r.Cells[6].Controls.Add(chkMCCResp);
            r.Cells[6].HorizontalAlign = HorizontalAlign.Center;

            chkMCCResp         = new CheckBox();
            chkMCCResp.ID      = "chkOrigMCCResp" + iService;
            chkMCCResp.Visible = false;
            r.Cells[6].Controls.Add(chkMCCResp);

            // Customer Resp
            CheckBox chkCustomerResp = new CheckBox();
            chkCustomerResp.ID = "chkCustomerResp" + iService;
            chkCustomerResp.Attributes.Add("onClick", "SetDirty();");
            r.Cells[7].Controls.Add(chkCustomerResp);
            r.Cells[7].HorizontalAlign = HorizontalAlign.Center;

            chkCustomerResp         = new CheckBox();
            chkCustomerResp.ID      = "chkOrigCustomerResp" + iService;
            chkCustomerResp.Visible = false;
            r.Cells[7].Controls.Add(chkCustomerResp);

            // Note
            TextBox txtNote = new TextBox();
            txtNote.ID        = "txtNote" + iService;
            txtNote.MaxLength = 128;
            txtNote.Style.Add("width", "150px");
            if (iService == cServices)
            {
                //txtNote.AutoPostBack = true;
                txtNote.Attributes.Add("onBlur", "this.value+=' ';ClearDirty();__doPostBack('" + txtNote.ID + "','');");
                txtNote.Attributes.Add("onChange", "ClearDirty();");
                txtNote.TextChanged += new System.EventHandler(this.btnUpdate_Click);
            }
            else
            {
                txtNote.Attributes.Add("onChange", "SetDirty();");
            }
            r.Cells[9].Controls.Add(txtNote);

            txtNote         = new TextBox();
            txtNote.ID      = "txtOrigNote" + iService;
            txtNote.Visible = false;
            r.Cells[9].Controls.Add(txtNote);

            tblServices.Rows.Add(r);
        }
    }
Пример #3
0
    private void AddLines()
    {
        String Sql;

        SelectList.Clear();

        for (int iCrew = 1; iCrew <= cCrew; iCrew++)
        {
            TableRow r = new TableRow();

            for (int iCell = 0; iCell < 11; iCell++)
            {
                r.Cells.Add(new TableCell());
            }

            r.Cells[0].Text = "<b>" + iCrew + "</b>";

            HtmlInputHidden txtCrewSeq = new HtmlInputHidden();
            txtCrewSeq.ID = "txtCrewSeq" + iCrew;
            r.Cells[1].Controls.Add(txtCrewSeq);

            // Remove
            CheckBox chkRemove = new CheckBox();
            chkRemove.ID = "chkRemove" + iCrew;
            chkRemove.Attributes.Add("onClick", "SetDirty();");
            r.Cells[2].Controls.Add(chkRemove);
            r.Cells[2].HorizontalAlign = HorizontalAlign.Center;

            // CrewMember
            TextBox txtCrewMember = new TextBox();
            txtCrewMember.ID        = "txtCrewMember" + iCrew;
            txtCrewMember.MaxLength = 50;
            txtCrewMember.CssClass  = "CrewMember";
            txtCrewMember.Attributes.Add("onChange", "SetDirty();");
            r.Cells[4].Controls.Add(txtCrewMember);

            System.Web.UI.WebControls.Image imgCrewMember = new System.Web.UI.WebControls.Image();
            imgCrewMember.ID          = "ddCrewMember" + iCrew;
            imgCrewMember.ImageUrl    = "Images/DropDown.gif";
            imgCrewMember.BorderWidth = 0;
            imgCrewMember.ImageAlign  = ImageAlign.AbsMiddle;
            r.Cells[4].Controls.Add(imgCrewMember);

            Sql = "Select Distinct CrewMember From mcJobCrew Order By CrewMember";
            SelectList slCrewMember = new SelectList("CrewMember" + iCrew, ref txtCrewMember);
            slCrewMember.ImageButton(imgCrewMember);
            slCrewMember.ClearValues();
            slCrewMember.AddDBValues(db, Sql);

            txtCrewMember         = new TextBox();
            txtCrewMember.ID      = "txtOrigCrewMember" + iCrew;
            txtCrewMember.Visible = false;
            r.Cells[4].Controls.Add(txtCrewMember);

            // Assignment
            TextBox txtAssignment = new TextBox();
            txtAssignment.ID        = "txtAssignment" + iCrew;
            txtAssignment.MaxLength = 50;
            txtAssignment.CssClass  = "Assignment";
            txtAssignment.Attributes.Add("onChange", "SetDirty();");
            r.Cells[6].Controls.Add(txtAssignment);

            System.Web.UI.WebControls.Image imgAssignment = new System.Web.UI.WebControls.Image();
            imgAssignment.ID          = "ddAssignment" + iCrew;
            imgAssignment.ImageUrl    = "Images/DropDown.gif";
            imgAssignment.BorderWidth = 0;
            imgAssignment.ImageAlign  = ImageAlign.AbsMiddle;
            r.Cells[6].Controls.Add(imgAssignment);

            Sql = "Select Distinct CrewAssignment From mcJobCrew Order By CrewAssignment";
            SelectList slAssignment = new SelectList("Assignment" + iCrew, ref txtAssignment);
            slAssignment.ImageButton(imgAssignment);
            slAssignment.ClearValues();
            slAssignment.AddDBValues(db, Sql);

            txtAssignment         = new TextBox();
            txtAssignment.ID      = "txtOrigAssignment" + iCrew;
            txtAssignment.Visible = false;
            r.Cells[6].Controls.Add(txtAssignment);

            // Report Time
            TextBox txtReportTime = new TextBox();
            txtReportTime.ID       = "txtReportTime" + iCrew;
            txtReportTime.CssClass = "JobTime";
            txtReportTime.Attributes.Add("onChange", "ValidateTime(this);SetDirty();");
            r.Cells[8].Controls.Add(txtReportTime);

            txtReportTime         = new TextBox();
            txtReportTime.ID      = "txtOrigReportTime" + iCrew;
            txtReportTime.Visible = false;
            r.Cells[8].Controls.Add(txtReportTime);

            // Note
            TextBox txtNote = new TextBox();
            txtNote.ID        = "txtNote" + iCrew;
            txtNote.MaxLength = 128;
            txtNote.Style.Add("width", "150px");
            if (iCrew == cCrew)
            {
                //txtNote.AutoPostBack = true;
                txtNote.Attributes.Add("onBlur", "this.value+=' ';ClearDirty();__doPostBack('" + txtNote.ID + "','');");
                txtNote.Attributes.Add("onChange", "ClearDirty();");
                txtNote.TextChanged += new System.EventHandler(this.btnUpdate_Click);
            }
            else
            {
                txtNote.Attributes.Add("onChange", "SetDirty();");
            }
            r.Cells[10].Controls.Add(txtNote);

            txtNote         = new TextBox();
            txtNote.ID      = "txtOrigNote" + iCrew;
            txtNote.Visible = false;
            r.Cells[10].Controls.Add(txtNote);

            tblCrew.Rows.Add(r);
        }
    }