protected void btnAddSubjectList_Click(object sender, DirectEventArgs e) { try { CacMonThiTuyenController control = new CacMonThiTuyenController(); DAL.CacMonThiTuyen mt = new CacMonThiTuyen(); mt.Vong = int.Parse("0" + txt_Vong.Text); mt.TrongSo = decimal.Parse("0" + txt_TrongSo.Text); mt.PlanID = int.Parse("0" + hdfRecordID.Text); mt.GhiChu = txt_GhiChuMonThi.Text; mt.MaMonThi = int.Parse("0" + hdfMaMonThi.Text); mt.DiemDat = double.Parse("0" + txt_DiemDat.Text); mt.NguoiChamThi = int.Parse("0" + hdfNguoiChamThi.Text); var dt = DataController.DataHandler.GetInstance().ExecuteDataTable("SELECT * FROM TuyenDung.HoiDongTuyenDung hdtd WHERE hdtd.PrKeyHoSo = " + decimal.Parse("0" + hdfNguoiChamThi.Text) + "AND hdtd.PlanID = " + int.Parse("0" + hdfRecordID.Text)); if (dt.Rows.Count == 0) { HoiDongTuyenDungController ctrol = new HoiDongTuyenDungController(); DAL.HoiDongTuyenDung hd = new HoiDongTuyenDung(); hd.CreatedBy = CurrentUser.ID; hd.CreatedDate = DateTime.Now; hd.PlanID = int.Parse("0" + hdfRecordID.Text); hd.PrKeyHoSo = decimal.Parse("0" + hdfNguoiChamThi.Text); hd.VongThi = int.Parse("0" + txt_Vong.Text); ctrol.Insert(hd); grpCouncilRecruitment.Reload(); RowSelectionModel1.ClearSelections(); btnDeleteCouncilRecruitment.Disabled = true; btnEditCouncilRecruitment.Disabled = true; } if (e.ExtraParams["type"] == "edit") { mt.ID = int.Parse("0" + hdfCacMonThiTuyen.Text); control.Update(mt); wdMonThi.Hide(); } else { control.Insert(mt); if (e.ExtraParams["Close"] == "True") { wdMonThi.Hide(); } } gpCacMonThiTuyen.Reload(); RM.RegisterClientScriptBlock("resetWdMonThi", "resetWdMonThi();"); } catch (Exception ex) { Dialog.ShowError("Lỗi xảy ra " + ex.Message); } }
protected void btnAddGiamKhao_Click(object sender, DirectEventArgs e) { try { HoiDongTuyenDungController control = new HoiDongTuyenDungController(); DAL.HoiDongTuyenDung hd = new HoiDongTuyenDung(); hd.CreatedBy = CurrentUser.ID; hd.CreatedDate = DateTime.Now; hd.Note = txtNoteHoiDong.Text; hd.PlanID = int.Parse("0" + hdfRecordID.Text); hd.PrKeyHoSo = decimal.Parse("0" + hdfGiamKhao.Text); hd.VongThi = int.Parse("0" + txt_VongCham.Text); if (e.ExtraParams["type"] == "edit") { hd.ID = int.Parse("0" + hdfCouncilRecruitment.Text); control.Update(hd); //Dialog.ShowNotification(CommonMessage.INSERT_SUCCESSFULLY); wdHoiDong.Hide(); } else { control.Insert(hd); //Dialog.ShowNotification(CommonMessage.INSERT_SUCCESSFULLY); if (e.ExtraParams["Close"] == "true") { wdHoiDong.Hide(); } } RM.RegisterClientScriptBlock("resetWdHoiDong", "resetWdHoiDong();"); grpCouncilRecruitment.Reload(); } catch (Exception ex) { Dialog.ShowError("Lỗi xảy ra " + ex.Message); } }