Esempio n. 1
0
        private void button_slsanbaytd_Click(object sender, EventArgs e)
        {
            if (textBox_changeslsb.Text == "")
            {
                MessageBox.Show("Bạn chưa nhập số lượng sân bay tối đa muốn thay đổi", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (int.Parse(label_sbtd.Text) <= int.Parse(textBox_changeslsb.Text))
            {
                DTO.Quydinh dto = new DTO.Quydinh(int.Parse(textBox_tgbaytt.Text), int.Parse(textBox_sbtgtd.Text), int.Parse(textBox_tgdungtt.Text), int.Parse(textBox_ttdungtd.Text), int.Parse(textBox_tgchamnhatdv.Text), int.Parse(textBox_tghuydv.Text), 0, int.Parse(textBox_changeslsb.Text));
                busQuydinh.UpdateSanBayTD(dto);
                Thaydoiquydinh_Load(sender, e);
            }
            else
            {
                DataTable dtSanBay = busSanbay.GetSL_SB_Hoat_Dong();
                if (dtSanBay.Rows.Count > 0)
                {
                    soluong = int.Parse(dtSanBay.Rows[0]["SL"].ToString());
                }

                if (soluong <= int.Parse(textBox_changeslsb.Text))
                {
                    DTO.Quydinh dto = new DTO.Quydinh(int.Parse(textBox_tgbaytt.Text), int.Parse(textBox_sbtgtd.Text), int.Parse(textBox_tgdungtt.Text), int.Parse(textBox_ttdungtd.Text), int.Parse(textBox_tgchamnhatdv.Text), int.Parse(textBox_tghuydv.Text), 0, int.Parse(textBox_changeslsb.Text));
                    busQuydinh.UpdateSanBayTD(dto);
                    Thaydoiquydinh_Load(sender, e);
                }
                else
                {
                    MessageBox.Show("Để giảm số lượng sân bay tối đa bạn cần xóa bớt sân bay ", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    QL_Sanbay frm = new QL_Sanbay(soluong - int.Parse(textBox_changeslsb.Text));
                    frm.UIParent = this;
                    //show dialog
                    frm.ShowDialog();
                }
            }
        }
Esempio n. 2
0
        private void sânBayToolStripMenuItem_Click(object sender, EventArgs e)
        {
            QL_Sanbay frmSanbay = new QL_Sanbay();

            frmSanbay.ShowDialog();
        }