Beispiel #1
0
 private void Sua()
 {
     try
     {
         var frm = new FrmXepPhong
         {
             txtmasinhvien = {Text = dgv_DanhSach.ActiveRow.Cells["MaSV"].Text},
             txthotendem = {Text = dgv_DanhSach.ActiveRow.Cells["HoSV"].Text},
             txttensinhvien = {Text = dgv_DanhSach.ActiveRow.Cells["TenSV"].Text},
             txtNgaySinh = {Text = dgv_DanhSach.ActiveRow.Cells["NgaySinh"].Text},
             cbolop = {Text = dgv_DanhSach.ActiveRow.Cells["MaLop"].Text},
             cboPhongthi = { Text = dgv_DanhSach.ActiveRow.Cells["TenPhong"].Text },
             IdKythi = _idkythi,
             IdPhong = int.Parse(dgv_DanhSach.ActiveRow.Cells["IdPhong"].Text),
             bUpdate = true
         };
         frm.ShowDialog();
         if (frm.bUpdate) return;
         dgv_DanhSach.ActiveRow.Cells["IdPhong"].Value = frm.cboPhongthi.Value.ToString();
         dgv_DanhSach.ActiveRow.Cells["TenPhong"].Value = frm.cboPhongthi.Text;
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }
 private void Sua()
 {
     try
     {
         if (!string.IsNullOrEmpty(dgv_DanhSach.ActiveRow.Cells["PhongThi"].Text))
         {
             MessageBox.Show(@"Sinh viên đã được xếp phòng");
             return;
         }
         var frm = new FrmXepPhong
         {
             txtmasinhvien = { Text = dgv_DanhSach.ActiveRow.Cells["IdSV"].Text },
             txthotendem = { Text = dgv_DanhSach.ActiveRow.Cells["HoSV"].Text },
             txttensinhvien = { Text = dgv_DanhSach.ActiveRow.Cells["TenSV"].Text },
             txtNgaySinh = { Text = dgv_DanhSach.ActiveRow.Cells["NgaySinh"].Text },
             cbolop = { Text = dgv_DanhSach.ActiveRow.Cells["MaLop"].Text },
             IdKythi = _idkythi,
             bUpdate= false
         };
         frm.ShowDialog();
         if (!frm.bUpdate) return;
         MessageBox.Show(@"Lưu lại thành công", @"Thông báo");
         dgv_DanhSach.ActiveRow.Cells["PhongThi"].Value = frm.cboPhongthi.Text;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         Log2File.LogExceptionToFile(ex);
     }
 }