Пример #1
0
        private void btnSuaQD_Click(object sender, EventArgs e)
        {
            dlgQDKhenThuong dlg = new dlgQDKhenThuong(EDIT_MODE.SUA);

            dlg.drQuyetDinh = drQuyetDinh;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                SuaThanhCong();
            }
        }
Пример #2
0
 private void btnThem_Click(object sender, EventArgs e)
 {
     if (dtSinhVien == null)
     {
         return;
     }
     DataRow[] arrDr = dtSinhVien.Select("Chon = 1");
     if (arrDr.Length > 0)
     {
         dlgQDKhenThuong dlg = new dlgQDKhenThuong(EDIT_MODE.THEM);
         dlg.drQuyetDinh = dtQuyetDinh.NewRow();
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             try
             {
                 DataRow drNew;
                 dtQuyetDinh.Rows.Add(dlg.drQuyetDinh);
                 pSV_SinhVien_KhenThuongInfo.IDSV_QuyetDinhKhenThuong = int.Parse(dlg.drQuyetDinh["SV_QuyetDinhKhenThuongID"].ToString());
                 foreach (DataRow dr in arrDr)
                 {
                     pSV_SinhVien_KhenThuongInfo.IDSV_SinhVien            = int.Parse(dr["SV_SinhVienID"].ToString());
                     pSV_SinhVien_KhenThuongInfo.SV_SinhVien_KhenThuongID = oBSV_SinhVien_KhenThuong.Add(pSV_SinhVien_KhenThuongInfo);
                     drNew         = dtKhenThuong.NewRow();
                     drNew["Chon"] = false;
                     drNew["SV_SinhVien_KhenThuongID"] = pSV_SinhVien_KhenThuongInfo.SV_SinhVien_KhenThuongID;
                     drNew["SV_SinhVienID"]            = pSV_SinhVien_KhenThuongInfo.IDSV_SinhVien;
                     drNew["MaSinhVien"] = dr["MaSinhVien"];
                     drNew["HoVaTen"]    = dr["HoVaTen"];
                     drNew["Ten"]        = dr["Ten"];
                     drNew["NgaySinh"]   = dr["NgaySinh"];
                     drNew["GioiTinh"]   = dr["GioiTinh"];
                     drNew["TenLop"]     = dr["TenLop"];
                     dtKhenThuong.Rows.Add(drNew);
                     dr["Chon"] = false;
                 }
             }
             catch (Exception ex)
             {
                 ThongBaoLoi(ex.Message);
             }
         }
     }
     else
     {
         ThongBao("Chưa chọn sinh viên nào để thêm.");
     }
 }