Example #1
0
 private void btnNhapXuong_Click(object sender, EventArgs e)
 {
     if ((int)QuyDinhBLL.GetQuyDinh().SoXeSuaChuaToiDa > int.Parse(labSoXeTiepNhan.Text))
     {
         Entities.Xe xe = new Entities.Xe(txtBienSo.Text, cboHieuXe.Text, txtHoTenCX.Text, txtDiaChi.Text, txtSDT.Text, txtEmail.Text, DateTime.ParseExact(labNgayNhap.Text, "dd/MM/yyyy", null));
         try
         {
             if (XeBLL.ThemXe(xe))
             {
                 btnInPhieu.Enabled = true;
                 MessageBox.Show("Xe đã được thêm thành công!", "Thông báo", MessageBoxButtons.OK);
                 GetDataGridView();
                 GetSoXeTiepNhan();
             }
             else
             {
                 MessageBox.Show("Biển số xe đã tồn tại", "Thông báo", MessageBoxButtons.OK);
             }
         }
         catch (Exception ex)
         { MessageBox.Show("Vui lòng nhập đầy đủ thông tin cần thiết!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Warning); }
     }
     else
     {
         btnNhapXuong.Enabled = false;
         MessageBox.Show("Số xe sửa chửa trong ngày vượt quá quy định cho phép", "Lỗi!", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
 }
Example #2
0
 public FormPhieuGiaHan()
 {
     InitializeComponent();
     id             = "";
     phieuGiaHanBLL = new PhieuGiaHanBLL();
     phieuDangKyBLL = new PhieuDangKyBLL();
     nhanVienBLL    = new NhanVienBLL();
     quyDinhBLL     = new QuyDinhBLL();
 }
Example #3
0
 private void btnThayDoi_Click(object sender, EventArgs e)
 {
     try
     {
         QuyDinh quyDinh = new QuyDinh(int.Parse(txtSoXe.Text));
         if (!string.IsNullOrEmpty(txtSoXe.Text))
         {
             QuyDinhBLL.ThayDoiQuyDinh(quyDinh);
             txtSoXeSuaChuaToiDa.Text = QuyDinhBLL.GetQuyDinh().SoXeSuaChuaToiDa.ToString();
             txtSoXe.Clear();
             MessageBox.Show("Số xe sửa chữa tối đa trong ngày đã được thay đổi thành " + txtSoXe.Text, "Thông báo", MessageBoxButtons.OK);
         }
         else
         {
             MessageBox.Show("Vui lòng nhập số lượng xe", "Thông báo", MessageBoxButtons.OK);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Vui lòng nhập số lượng", "Thông báo", MessageBoxButtons.OK);
     }
 }
Example #4
0
 public FormQuyDinh()
 {
     InitializeComponent();
     quyDinhBLL = new QuyDinhBLL();
 }
Example #5
0
 private void frmThayDoiQuyDinh_Load(object sender, EventArgs e)
 {
     txtSoXeSuaChuaToiDa.Text = QuyDinhBLL.GetQuyDinh().SoXeSuaChuaToiDa.ToString();
 }