예제 #1
0
파일: PopupForm.cs 프로젝트: kduy410/QLKS
        private void btnYes_Click(object sender, EventArgs e)
        {
            int temp = getName();
            int num  = (int)Val(txtNumber.Text);

            if (num != 0)
            {
                if (temp == 0)
                {
                    LsFoodForm.Instance().listViewSV.SelectedItems[0].SubItems[3].Text = num.ToString();
                    addItemToOrder(LsFoodForm.Instance().listViewSV, LsOrderForm.Instance().listViewSV);
                }
                else if (temp == 1)
                {
                    LsDrinkForm.Instance().listViewSV.SelectedItems[0].SubItems[3].Text = num.ToString();
                    addItemToOrder(LsDrinkForm.Instance().listViewSV, LsOrderForm.Instance().listViewSV);
                }
                else if (temp == 2)
                {
                    LsItemForm.Instance().listViewSV.SelectedItems[0].SubItems[3].Text = num.ToString();
                    addItemToOrder(LsItemForm.Instance().listViewSV, LsOrderForm.Instance().listViewSV);
                }
            }
            else
            {
                MessageBox.Show("Số lượng không thể bằng 0, Xin chọn số lượng", "Question", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            return;
        }
예제 #2
0
파일: LsItemForm.cs 프로젝트: kduy410/QLKS
 protected internal static LsItemForm Instance()
 {
     if (_instance == null)
     {
         _instance = new LsItemForm();
     }
     return(_instance);
 }
예제 #3
0
        public void loadDV()
        {
            LsFoodForm.Instance().loadListType(0);

            LsDrinkForm.Instance().loadListType(1);

            LsItemForm.Instance().loadListType(2);

            LsOrderForm.Instance().loadDSDV();
        }
예제 #4
0
 private void btnItem_Click(object sender, EventArgs e)
 {
     if (!pnList.Controls.Contains(LsItemForm.Instance()))
     {
         pnList.Controls.Add(LsItemForm._instance);
         LsItemForm._instance.Dock = DockStyle.Fill;
         LsItemForm._instance.BringToFront();
         LsItemForm._instance.Visible = true;
     }
     else
     {
         LsItemForm._instance.BringToFront();
         LsItemForm._instance.Visible = true;
     }
 }
예제 #5
0
파일: PopupForm.cs 프로젝트: kduy410/QLKS
        private int getName()
        {
            int x = -1;

            if (lblForm.Text.Equals(LsFoodForm.Instance().ToString()))
            {
                x = 0;
            }
            else if (lblForm.Text.Equals(LsDrinkForm.Instance().ToString()))
            {
                x = 1;
            }
            else if (lblForm.Text.Equals(LsItemForm.Instance().ToString()))
            {
                x = 2;
            }
            return(x);
        }