Beispiel #1
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     try
     {
         this.hopDongDetails.idLoaiHopDong       = Convert.ToInt32((cbLoaiHopDong.SelectedItem as LoaiHopDong).idLoaiHopDong);
         this.hopDongDetails.ngayBatDau          = datetimeNgayBatDau.Value;
         this.hopDongDetails.ngayKetThuc         = dateTimeNgayKetThuc.Value;
         this.hopDongDetails.nguoiBaoLanh_TTHDLD = txtNguoiBaoLanh.Text;
         this.hopDongDetails.soHopDong_TTHDLD    = txtSoHopDong.Text;
         this.hopDongDetails.chucDanh            = txtChucDanh.Text;
         this.hopDongDetails.ghiChu = txtGhiChu.Text;
         if (hopDongServices.UpdateHopDongLaoDong(this.hopDongDetails))
         {
             MessageBox.Show("Đã Cập Nhật Thông Tin Thành Công!", "Thông Báo!", MessageBoxButtons.OK);
             hopDongDetails = null;
             FireEvent(true);
             this.Close();
         }
         else
         {
             MessageBox.Show("Đã Có Lỗi Xảy Ra! Vui Lòng Kiểm Tra Lại Thông Tin!", "Lỗi!",
                             MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         if (UserProfile.permission == 1)
         {
             MessageBox.Show(ex.ToString(), "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
         {
             MessageBox.Show("Đã Có Lỗi Xảy Ra! Vui Lòng Kiểm Tra Lại Thông Tin!", "Lỗi!",
                             MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }