コード例 #1
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         if (checkEmptyList())
         {
             DialogResult dr = MessageBox.Show("Xác nhận dịch vụ?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
             if (dr == DialogResult.Yes)
             {
                 listToSQL();
                 MessageBox.Show("Cập nhật dịch vụ thành công.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 loadDV();
                 StateForm.Instance().load_all();
             }
             else
             {
                 return;
             }
         }
         else
         {
             MessageBox.Show("Order của bạn đang trống, Xin hãy chọn dịch vụ", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         throw;
     }
 }
コード例 #2
0
        private void btnStatus_Click(object sender, EventArgs e)
        {
            HomeForm  hf = HomeForm.Instance();
            StateForm cf = StateForm.Instance();

            if (!hf.panel3.Controls.Contains(cf))
            {
                hf.panel3.Controls.Add(cf);
                cf.Dock = DockStyle.Fill;
                cf.BringToFront();
                cf.Visible = true;

                cf.lblRoom.Text     = lblRoom.Text;
                cf.lblRoomType.Text = lblRoomType.Text;
                cf.load_listGuest();
                cf.load_all();

                this.Hide();
            }
            else
            {
                cf.lblRoom.Text     = lblRoom.Text;
                cf.lblRoomType.Text = lblRoomType.Text;
                cf.load_listGuest();
                cf.load_all();

                cf.BringToFront();
                cf.Visible = true;

                this.Hide();
            }
        }
コード例 #3
0
 private void btnYes_Click(object sender, EventArgs e)
 {
     if (lblForm.Text.Equals(LsOrderForm.Instance().ToString()))
     {
         int num = (int)Val(txtNumber.Text);
         if (num != 0)
         {
             LsOrderForm.Instance().listViewSV.SelectedItems[0].SubItems[3].Text = num.ToString();
         }
         else
         {
             DialogResult dr = MessageBox.Show("Số lượng không thể bằng 0, bạn có muốn xoá nó!!!", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
             if (dr == DialogResult.Yes)
             {
                 LsOrderForm.Instance().listViewSV.SelectedItems[0].Remove();
                 StateForm.Instance().load_all();
                 this.Hide();
             }
             else
             {
                 return;
             }
         }
     }
     return;
 }
コード例 #4
0
 public static StateForm Instance()
 {
     if (_instance == null)
     {
         _instance = new StateForm();
     }
     return(_instance);
 }
コード例 #5
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("Bạn muốn huỷ dịch vụ hiện tại?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                if (lblForm.Text.Equals(LsOrderForm.Instance().ToString()))
                {
                    LsOrderForm.Instance().listViewSV.SelectedItems[0].Remove();
                    LsOrderForm.Instance().removeItemSQL(lblID.Text);
                    StateForm.Instance().load_all();
                    this.Hide();
                }
            }
            else
            {
                return;
            }
        }