Example #1
0
        /// <summary>
        /// Clear the Query and anything related
        /// </summary>
        public void Clear()
        {
            // reset all member vars to clean state

            Builder.Clear();
            SelectList.Clear();
            WhereMap.Clear();
            QueryName    = string.Empty;
            AliasName    = string.Empty;
            QueryComment = string.Empty;
            RawQuery     = string.Empty;
            BatchQueryList.Clear();
        }
Example #2
0
        /// <summary>
        /// 更新按钮点击事件
        /// </summary>
        /// <param name="obj"></param>
        public void UpdateBtnClick(object obj)
        {
            if (string.IsNullOrEmpty(StartLoop.Trim()) || string.IsNullOrEmpty(EndLoop.Trim()))
            {
                MessageBox.Show("请输入循环数范围!");
                return;
            }
            int startLoop = 0;
            int endLoop   = 0;

            try
            {
                startLoop = Convert.ToInt32(StartLoop);
                endLoop   = Convert.ToInt32(EndLoop);
            }
            catch (Exception ex)
            {
                MessageBox.Show("请输入正确的循环数,整数!");
                return;
            }

            if (SelectList != null)
            {
                SelectList.Clear();
            }
            SelectList = DataManager.Instance.SelectModelList(CheckCount, CheckValueType, startLoop, endLoop, CheckHoleName);
            //设置总个数
            counts = selectList.Count;
            if (counts == 0)
            {
                Pages       = 0;
                CurrentPage = 0;
            }
            else if (counts <= pageCount)
            {
                Pages       = 1;
                CurrentPage = 1;
            }
            else
            {
                //设置总页数
                Pages       = counts % pageCount == 0 ? counts / pageCount : counts / pageCount + 1;
                CurrentPage = 1;
            }
            updateView();
        }
        public VideoViewModel()
        {
            InitData();
            AssignCommands();

            Messenger.Default.Register <int>(this, "DVM2VVM", msg =>
            {
                if (msg == 0 && VideoList != null)
                {
                    foreach (var item in VideoList)
                    {
                        item.IsChoose = -1;
                    }
                }
                if (SelectList != null && SelectList.Count > 0)
                {
                    SelectList.Clear();
                }
            });
        }
Example #4
0
    private void AddLines()
    {
        //String Sql;
        SelectList.Clear();

        //int NumItems = (cItems > 0 ? cItems : 1);
        int NumItems = cItems;

        for (int iItem = 1; iItem <= NumItems; iItem++)
        {
            TableRow tr = BuildFoodTableRow(iItem.ToString());
            tblFood.Rows.Add(tr);

            // because the previous page values are still floating around and get matched up when the row is added to the table
            // we need to blank the out here
            Label lbl = (Label)tr.FindControl("lblIngredSel" + iItem);
            lbl.ToolTip             = string.Empty;
            lbl.Attributes["style"] = string.Empty;
            TextBox txt = (TextBox)tr.FindControl("txtCategory" + iItem);
            txt.CssClass = "FoodCategory";
            txt          = (TextBox)tr.FindControl("txtMenuItem" + iItem);
            txt.CssClass = "MenuItem";
            lbl          = (Label)tr.FindControl("lblQuote" + iItem);
            lbl.Text     = "$0.00";
            lbl          = (Label)tr.FindControl("lblPrice" + iItem);
            lbl.Text     = "$0.00";
            lbl          = (Label)tr.FindControl("lblInaccuratePrice" + iItem);
            lbl.Text     = "";
            lbl          = (Label)tr.FindControl("lblExtQuote" + iItem);
            lbl.Text     = "$0.00";
            lbl          = (Label)tr.FindControl("lblExtPrice" + iItem);
            lbl.Text     = "$0.00";
            lbl          = (Label)tr.FindControl("lblOverUnder" + iItem);
            lbl.Text     = "0% over";
        }
    }
 public void Clear(bool ignoreItemList)
 {
     _ignoreItemList = ignoreItemList;
     SelectList.Clear();
 }
Example #6
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);
        }
    }
Example #7
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());
        }
    }
Example #8
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);
        }
    }