示例#1
0
 protected void Button17_Click(object sender, DirectEventArgs e)
 {
     try
     {
         DaoTaoController      daotao   = new DaoTaoController();
         DAL.DM_GiaoVienDaoTao giaovien = new DAL.DM_GiaoVienDaoTao();
         giaovien.ChucVu             = txt_chucvu.Text;
         giaovien.CreatedBy          = CurrentUser.ID;
         giaovien.CreatedDate        = DateTime.Now;
         giaovien.DiaChiLienHe       = txt_diachi.Text;
         giaovien.DiDong             = txt_didong.Text;
         giaovien.DiDong             = txt_didong.Text;
         giaovien.DonViCongTac       = txt_donvicongtac.Text;
         giaovien.DTCoQuan           = txt_dtcq.Text;
         giaovien.Email              = txt_email.Text;
         giaovien.GioiTinh           = bool.Parse(cbx_gioitinh.SelectedItem.Value);
         giaovien.HocVan             = txt_hocvan.Text;
         giaovien.HoTenGV            = gv_txtHoten.Text;
         giaovien.KinhNghiemGiangDay = txt_kinhnghiem.Text;
         giaovien.LaNhanvienCty      = chk_nvcongty.Checked;
         giaovien.MaGV     = gv_txtMaGiaoVien.Text;
         giaovien.MA_DONVI = new UserController().GetDonViByUserID(CurrentUser.ID).FirstOrDefault().MA_DONVI;
         if (df_ngaysinh.SelectedDate.ToString().Contains("01/01/0001") == false)
         {
             giaovien.NgaySinh = df_ngaysinh.SelectedDate;
         }
         if (e.ExtraParams["Command"] == "Edit")
         {
             daotao.UpdateGiaoVien(giaovien);
             RM.RegisterClientScriptBlock("zz", "#{grp_GiaoVienDaoTaoStore}.reload();");
             wdGiaoVien.Hide();
         }
         else
         {
             daotao.InsertGiaoVien(giaovien);
             daotao.ThemGiaoVienVaoKhoaHoc(new DAL.GiaoVien_KhoaDaoTao()
             {
                 CreatedBy   = CurrentUser.ID,
                 CreatedDate = DateTime.Now,
                 MaGiaoVien  = giaovien.MaGV,
                 MaKhoaHoc   = hdfRecordID.Text
             });
             RM.RegisterClientScriptBlock("zz", "#{grp_GiaoVienDaoTaoStore}.reload();");
             if (e.ExtraParams["Close"] == "True")
             {
                 wdGiaoVien.Hide();
             }
         }
     }
     catch (Exception ex)
     {
         Dialog.ShowError("Lối xảy ra " + ex.Message);
     }
 }
示例#2
0
 protected void btnOK_Click(object sender, DirectEventArgs e)
 {
     try
     {
         DaoTaoController dtController = new DaoTaoController();
         foreach (var item in RowSelectionModel5.SelectedRows)
         {
             DAL.GiaoVien_KhoaDaoTao gv = new DAL.GiaoVien_KhoaDaoTao()
             {
                 CreatedBy   = CurrentUser.ID,
                 CreatedDate = DateTime.Now,
                 MaGiaoVien  = item.RecordID,
                 MaKhoaHoc   = hdfRecordID.Text
             };
             dtController.ThemGiaoVienVaoKhoaHoc(gv);
         }
         wdChonTuDanhSachGiaoVien.Hide();
         RM.RegisterClientScriptBlock("ds", "#{grp_GiaoVienDaoTaoStore}.reload();");
     }
     catch (Exception ex)
     {
         Dialog.ShowError("Lối xảy ra " + ex.Message);
     }
 }