Ejemplo n.º 1
0
        protected void popup_CategoryInfo_btnPlusMinus_Click(object sender, EventArgs e)
        {
            bool isNumeric = decimal.TryParse(txtQty_CategoryInfo.Text, out decimal dQty);

            if (!isNumeric)
            {
                dQty = 0;
            }

            Button btn = (Button)sender;

            if (btn.CommandName == "plus")
            {
                dQty += 1;
            }
            else
            {
                decimal dMinQty = ApplicationSession.category.MinQty;
                if (dQty > dMinQty)
                {
                    dQty -= 1;
                }
            }

            txtQty_CategoryInfo.Text = dQty.ToString();
            ModalPopupExtender_CategoryInfo.Show();
        }
Ejemplo n.º 2
0
        public void DisplayModalPopupExtender_CategoryInfo()
        {
            CCategory cat = ApplicationSession.category;

            lblName_CategoryInfo.Text = cat.Caption;
            if (cat.OrderDate != null)
            {
                DateTime dt = (DateTime)cat.OrderDate;
                txtDate_CategoryInfo.Text = dt.ToString("yyyy-MM-dd");
                txtTime_CategoryInfo.Text = dt.ToString("hh\\:mm");
            }

            if (cat.OrderQty == 0)
            {
                cat.OrderQty = cat.MinQty;
            }
            txtQty_CategoryInfo.Text = cat.OrderQty_ToString;

            if (cat.MinQty > 0)
            {
                lblMinQty_CategoryInfo.Visible = true;
                lblMinQty_CategoryInfo.Text    = "Minimum Order: " + cat.MinQty_ToString + " pax";
            }
            else
            {
                lblMinQty_CategoryInfo.Visible = false;
            }


            ModalPopupExtender_CategoryInfo.Show();
        }