private void button_update_Click(object sender, EventArgs e) { 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), int.Parse(label_slhv.Text), int.Parse(label_sbtd.Text)); if (busQuydinh.UpdateQuydinh(dto)) { MessageBox.Show("Thay đổi quy định thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); Thaydoiquydinh_Load(sender, e); } else { MessageBox.Show("Có lỗi xảy ra, thay đổi quy định thất bại!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public NhanLichChuyenBay() { InitializeComponent(); dc = new DataConnection(); busQuyDinh = new BLL.QuydinhBLL(); busChuyenbay = new ChuyenbayBLL(); busChitietchuyenbay = new BLL.ChitietchuyenbayBLL(); busTinhtrangve = new BLL.TinhtrangveBLL(); busHangve = new BLL.HangveBLL(); dtoQuyDinh = new DTO.Quydinh(0, 0, 0, 0, 0, 0, 0, 0); dtoChuyenBay = new DTO.Chuyenbay("0", "0", DateTime.Now, 1, "0"); dtoChitietchuyenbay = new DTO.Chitietchuyenbay("", "", "", 0, ""); dtoTinhtrangve = new DTO.Tinhtrangve("", "", "", 0, 0, 0); busQuyDinh.Get_Infor(dtoQuyDinh); }
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(); } } }
public void UpdateSoluongHV() { 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), int.Parse(RefreshSoluongHV()), 0); busQuydinh.Update_SL_HangveHienTai(dto); Thaydoiquydinh_Load(null, null); }
public void UpdateSoluongSB() { 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(null, null); }