protected void btn_update_Click(object sender, EventArgs e) { try { if (Page.IsValid) { if (validateapprovers()) { _obj_Rec_ApprovalProcess = new RECRUITMENT_APPROVALPROCESS(); _obj_Rec_ApprovalProcess.APPRO_ID = Convert.ToInt32(lbl_AP_Id.Text); // _obj_Rec_ApprovalProcess.APPRO_BU_ID = Convert.ToInt32(rcmb_BusinessUnitType.SelectedItem.Value); _obj_Rec_ApprovalProcess.APPRO_1LEVEL = Convert.ToInt32(rcmb_1Level.SelectedValue); _obj_Rec_ApprovalProcess.APPRO_2LEVEL = Convert.ToInt32(rcmb_2Level.SelectedValue); _obj_Rec_ApprovalProcess.APPRO_3LEVEL = Convert.ToInt32(rcmb_3Level.SelectedValue); // _obj_Rec_ApprovalProcess.APPRO_ISAPPROVER2 = Convert.ToBoolean(chk_Approver2.Checked); _obj_Rec_ApprovalProcess.APPRO_LASTMDFBY = Convert.ToInt32(Session["USER_ID"]); _obj_Rec_ApprovalProcess.APPRO_LASTMDFDATE = DateTime.Now; _obj_Rec_ApprovalProcess.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); //if (chk_Approver2.Checked == true) //{ // if (rcmb_Approver2.SelectedItem.Value == "0") // { // Recruitment_BLL.ShowMessage(this, "Please select approver2"); // return; // } //} _obj_Rec_ApprovalProcess.Mode = 20; bool status = Recruitment_BLL.set_EmpSetup(_obj_Rec_ApprovalProcess); if (status == true) { Recruitment_BLL.ShowMessage(this, "Record Updated Successfully"); LoadGrid(); btn_Save.Visible = true; Rm_ApproverProcess_PAGE.SelectedIndex = 0; //chk_Approver2.Checked = false; return; } } } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_ApprovalProcess", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Save_Click(object sender, EventArgs e) { try { if (Page.IsValid) { if (validateapprovers()) { //_obj_Rec_ApprovalProcess = new RECRUITMENT_APPROVALPROCESS(); ////_obj_Rec_ApprovalProcess.APPRO_BU_ID = Convert.ToInt32(rcmb_BusinessUnitType.SelectedItem.Value); //_obj_Rec_ApprovalProcess.APPRO_1LEVEL = Convert.ToInt32(rcmb_2Level.SelectedValue); //_obj_Rec_ApprovalProcess.APPRO_3LEVEL = Convert.ToInt32(rcmb_3Level.SelectedValue); ////if (rcmb_Approver1.SelectedItem.Value == "0") ////{ //// Recruitment_BLL.ShowMessage(this, "Please Select Approval1"); //// return; ////} //// _obj_Rec_ApprovalProcess.APPRO_APPROVER1_ID = Convert.ToInt32(rcmb_Approver1.SelectedItem.Value); ////if (rcmb_Approver2.SelectedItem.Value != "0") ////{ //// if (chk_Approver2.Checked == false) //// { //// Recruitment_BLL.ShowMessage(this, "Please check an Approval2 "); //// return; //// } ////} ////if (chk_Approver2.Checked == true) ////{ //// if (rcmb_Approver2.SelectedItem.Value == "0") //// { //// Recruitment_BLL.ShowMessage(this, "Please select approver2"); //// return; //// } ////} ////_obj_Rec_ApprovalProcess.APPRO_3LEVEL = Convert.ToInt32(rcmb_3Level.SelectedValue); //// _obj_Rec_ApprovalProcess.APPRO_ISAPPROVER2 = Convert.ToBoolean(chk_Approver2.Checked); //_obj_Rec_ApprovalProcess.Mode = 6; //_obj_Rec_ApprovalProcess.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString()); //DataTable dtemp = Recruitment_BLL.get_EmpSetup(_obj_Rec_ApprovalProcess); //if (Convert.ToInt32(dtemp.Rows[0]["Count"]) != 0) //{ // Recruitment_BLL.ShowMessage(this, "Business Unit already assigned"); // rcmb_2Level.Enabled = true; //} //else //{ _obj_Rec_ApprovalProcess = new RECRUITMENT_APPROVALPROCESS(); //_obj_Rec_ApprovalProcess.APPRO_BU_ID = Convert.ToInt32(rcmb_BusinessUnitType.SelectedItem.Value); _obj_Rec_ApprovalProcess.APPRO_1LEVEL = Convert.ToInt32(rcmb_1Level.SelectedValue); _obj_Rec_ApprovalProcess.APPRO_2LEVEL = Convert.ToInt32(rcmb_2Level.SelectedValue); _obj_Rec_ApprovalProcess.APPRO_3LEVEL = Convert.ToInt32(rcmb_3Level.SelectedValue); // _obj_Rec_ApprovalProcess.APPRO_ISAPPROVER2 = Convert.ToBoolean(chk_Approver2.Checked); _obj_Rec_ApprovalProcess.APPRO_CREATEDBY = Convert.ToInt32(Session["USER_ID"]); _obj_Rec_ApprovalProcess.APPRO_CREATEDDATE = DateTime.Now; _obj_Rec_ApprovalProcess.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); //_obj_Rec_ApprovalProcess.APPRO_LASTMDFBY = Convert.ToInt32(Session["USER_ID"]); //_obj_Rec_ApprovalProcess.APPRO_LASTMDFDATE = DateTime.Now; _obj_Rec_ApprovalProcess.Mode = 3; bool status = Recruitment_BLL.set_EmpSetup(_obj_Rec_ApprovalProcess); if (status == true) { Recruitment_BLL.ShowMessage(this, "Record Inserted Successfully"); btn_Save.Visible = true; LoadGrid(); Rm_ApproverProcess_PAGE.SelectedIndex = 0; //DataTable dt = new DataTable(); ////rcmb_BusinessUnitType.SelectedIndex = 0; ////rcmb_EmployeeType.SelectedIndex = 0; ////rcmb_Approver1.SelectedIndex = 0; ////rcmb_Approver2.SelectedIndex = 0; ////rcmb_Approver2.Enabled = true; ////rcmb_BusinessUnitType.Enabled = true; ////rcmb_EmployeeType.Enabled = true; //// rcmb_Approver1.Enabled = true; //rcmb_1Level.DataSource = dt; //rcmb_1Level.DataBind(); //rcmb_3Level.DataSource = dt; //rcmb_3Level.DataBind(); //rcmb_2Level.DataSource = dt; //rcmb_2Level.DataBind(); ////chk_Approver2.Checked = false; //return; } // } } } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_ApprovalProcess", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }