protected void btn_Submit_Click(object sender, EventArgs e) { try { _obj_Rec_ApplicantGrade = new RECRUITMENT_APPLICANTGRADE(); // _obj_Rec_ApplicantGrade = new RECRUITMENT_APPLICANTGRADE _obj_Rec_ApplicantGrade.APPLGRADE_DESCRIPTION = txt_Description.Text.Replace("'", "''"); _obj_Rec_ApplicantGrade.APPLGRADE_CREATEDBY = Convert.ToInt32(Session["UserId"]); _obj_Rec_ApplicantGrade.APPLGRADE_CREADTEDATE = DateTime.Now; _obj_Rec_ApplicantGrade.APPLGRADE_LASTMDFBY = Convert.ToInt32(Session["UserId"]); _obj_Rec_ApplicantGrade.APPLGRADE_LASTMDFDATE = DateTime.Now; _obj_Rec_ApplicantGrade.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString()); switch (((Button)sender).ID.ToUpper()) { case "BTN_UPDATE": _obj_Rec_ApplicantGrade.APPLGRADE_ID = Convert.ToInt32(lbl_GradeId.Text); _obj_Rec_ApplicantGrade.APPGRADE_SETID = Convert.ToInt32(RCMB_Type.SelectedItem.Value); _obj_Rec_ApplicantGrade.APPGRADE_NAME = txt_Name.Text.Replace("'", "''"); _obj_Rec_ApplicantGrade.MODE = 4; if (Convert.ToString(Recruitment_BLL.get_ApplicantGrade(_obj_Rec_ApplicantGrade).Rows[0]["Count"]) != "1") { Recruitment_BLL.ShowMessage(this, "This Combination Already Exists"); return; } _obj_Rec_ApplicantGrade.MODE = 3; if (Recruitment_BLL.set_ApplicantGrade(_obj_Rec_ApplicantGrade)) { Recruitment_BLL.ShowMessage(this, "Information Updated Successfully"); } else { Recruitment_BLL.ShowMessage(this, "Information Not Updated"); } LoadGrid(); RG_ApplicantGrade.DataBind(); RM_ApplicantGrade.SelectedIndex = 0; break; case "BTN_SUBMIT": _obj_Rec_ApplicantGrade.APPGRADE_SETID = Convert.ToInt32(RCMB_Type.SelectedItem.Value); _obj_Rec_ApplicantGrade.APPGRADE_NAME = txt_Name.Text.Replace("'", "''"); _obj_Rec_ApplicantGrade.MODE = 4; if (Convert.ToString(Recruitment_BLL.get_ApplicantGrade(_obj_Rec_ApplicantGrade).Rows[0]["Count"]) != "0") { Recruitment_BLL.ShowMessage(this, "This Combination Already Exists"); return; } _obj_Rec_ApplicantGrade.MODE = 2; if (Recruitment_BLL.set_ApplicantGrade(_obj_Rec_ApplicantGrade)) { Recruitment_BLL.ShowMessage(this, "Information Saved Successfully"); } else { Recruitment_BLL.ShowMessage(this, "Information Not Saved"); } LoadGrid(); RG_ApplicantGrade.DataBind(); RM_ApplicantGrade.SelectedIndex = 0; break; default: break; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_applicantgrade", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); return; } }