private void LoadCombos() { try { _obj_smhr_businessunit = new SMHR_BUSINESSUNIT(); _obj_smhr_period = new SMHR_PERIOD(); _obj_SMHR_LoginInfo = new SMHR_LOGININFO(); _obj_SMHR_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_SMHR_LoginInfo.LOGIN_ID = Convert.ToInt32(Session["USER_ID"]); DataTable dt_BUDetails = BLL.get_Business_Units(_obj_SMHR_LoginInfo); ddl_BusinessUnit.DataSource = dt_BUDetails; ddl_BusinessUnit.DataValueField = "BUSINESSUNIT_ID"; ddl_BusinessUnit.DataTextField = "BUSINESSUNIT_CODE"; ddl_BusinessUnit.DataBind(); ddl_BusinessUnit.Items.Insert(0, new RadComboBoxItem("Select")); SMHR_DEPARTMENT _obj_smhr_department = new SMHR_DEPARTMENT(); _obj_smhr_department.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_smhr_department.MODE = 5; DataTable dt_dept = BLL.get_Department(_obj_smhr_department); ddl_Department.DataSource = dt_dept; ddl_Department.DataValueField = "DEPARTMENT_ID"; ddl_Department.DataTextField = "DEPARTMENT_NAME"; ddl_Department.DataBind(); ddl_Department.Items.Insert(0, new RadComboBoxItem("Select")); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "ConsultingDoctors", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadCombos() { try { _obj_Department = new SMHR_DEPARTMENT(); _obj_Department.MODE = 7; _obj_Department.BUID = Convert.ToInt32(rcmb_BU.SelectedValue); DataTable dt = BLL.get_Department(_obj_Department); ddl_Department.DataSource = dt; ddl_Department.DataTextField = "DEPARTMENT_NAME"; ddl_Department.DataValueField = "DEPARTMENT_ID"; ddl_Department.DataBind(); ddl_Department.Items.Insert(0, new RadComboBoxItem("Select")); SMHR_DIVISION _obj_Smhr_Division = new SMHR_DIVISION(); _obj_Smhr_Division.OPERATION = operation.Approve; _obj_Smhr_Division.BUID = Convert.ToInt32(rcmb_BU.SelectedValue); _obj_Smhr_Division.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt1 = BLL.get_DivisionMapping(_obj_Smhr_Division); ddl_Diviison.DataSource = dt1; ddl_Diviison.DataValueField = "SMHR_DIV_ID"; ddl_Diviison.DataTextField = "SMHR_DIV_CODE"; ddl_Diviison.DataBind(); ddl_Diviison.Items.Insert(0, new RadComboBoxItem("Select")); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "DepartmentDivisionMapping", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rcmb_Bu_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { if (rcmb_Bu.SelectedIndex > 0) { rcmb_Department.Items.Clear(); _obj_Department = new SMHR_DEPARTMENT(); _obj_Department.MODE = 7; _obj_Department.BUID = Convert.ToInt32(rcmb_Bu.SelectedValue); DataTable dt = BLL.get_Department(_obj_Department); rcmb_Department.DataSource = dt; rcmb_Department.DataTextField = "DEPARTMENT_NAME"; rcmb_Department.DataValueField = "DEPARTMENT_ID"; rcmb_Department.DataBind(); rcmb_Department.Items.Insert(0, new RadComboBoxItem("Select")); } else { rcmb_Department.ClearSelection(); rcmb_Department.Items.Clear(); rcmb_Department.Items.Insert(0, new RadComboBoxItem("Select", "0")); } rcmb_Division.ClearSelection(); rcmb_Division.Items.Clear(); rcmb_Division.Items.Insert(0, new RadComboBoxItem("Select", "0")); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_SubDivision", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
//private void LoadDepartment() //{ // try // { // _obj_SMHR_Department = new SMHR_DEPARTMENT(); // _obj_SMHR_Department.MODE = 9; // _obj_SMHR_Department.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString()); // _obj_SMHR_Department.BUID = Convert.ToInt32(ddl_BusinessUnit.SelectedItem.Value); // dt_Details = BLL.get_Department(_obj_SMHR_Department); // if (dt_Details.Rows.Count > 0) // { // Rg_DepartmentHeadsMapping.Visible = true; // Rg_DepartmentHeadsMapping.DataSource = dt_Details; // Rg_DepartmentHeadsMapping.DataBind(); // btn_submit.Visible = true; // btn_Cancel.Visible = true; // } // else // { // Rg_DepartmentHeadsMapping.Visible = false; // btn_submit.Visible = false; // btn_Cancel.Visible = false; // } // } // catch (Exception ex) // { // SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_DepartmentHeads", ex.StackTrace, DateTime.Now); // } //} #endregion private void Load_Department() { try { if (ddl_BusinessUnit.SelectedIndex != 0) { _obj_SMHR_Department = new SMHR_DEPARTMENT(); _obj_SMHR_Department.MODE = 7; _obj_SMHR_Department.DIRECTORATE_ID = Convert.ToInt32(rad_Directorate.SelectedValue); _obj_SMHR_Department.BUID = Convert.ToInt32(ddl_BusinessUnit.SelectedValue); DataTable dt = BLL.get_Department(_obj_SMHR_Department); Rg_DepartmentHeadsMapping.Visible = true; Rg_DepartmentHeadsMapping.DataSource = dt; Rg_DepartmentHeadsMapping.DataBind(); btn_submit.Visible = true; btn_Cancel.Visible = true; } else { Rg_DepartmentHeadsMapping.Visible = false; //Rg_DepartmentHeadsMapping.sele btn_submit.Visible = false; btn_Cancel.Visible = false; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "DepartmentHeads", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadDepartment() { try { if (rad_BusinessUnit.SelectedIndex != 0) { _obj_SMHR_Department = new SMHR_DEPARTMENT(); _obj_SMHR_Department.MODE = 7; _obj_SMHR_Department.DIRECTORATE_ID = Convert.ToInt32(rad_Directorate.SelectedValue); _obj_SMHR_Department.BUID = Convert.ToInt32(rad_BusinessUnit.SelectedValue); DataTable dt = BLL.get_Department(_obj_SMHR_Department); rad_Department.DataSource = dt; rad_Department.DataTextField = "DEPARTMENT_NAME"; rad_Department.DataValueField = "DEPARTMENT_ID"; rad_Department.DataBind(); rad_Department.Items.Insert(0, new RadComboBoxItem("Select")); } else { rad_Department.Items.Insert(0, new RadComboBoxItem("Select")); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frmEmployeePensionComputations", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rcmb_BU_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) { try { if (rcmb_BU.SelectedIndex > 0) { rcmb_Dept.Items.Clear(); rcmb_JobReq.Items.Clear(); _obj_SMHR_Department = new SMHR_DEPARTMENT(); _obj_SMHR_Department.MODE = 9; _obj_SMHR_Department.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString()); _obj_SMHR_Department.BUID = Convert.ToInt32(rcmb_BU.SelectedItem.Value); DataTable dt_Details = BLL.get_Department(_obj_SMHR_Department); if (dt_Details.Rows.Count != 0) { rcmb_Dept.DataSource = dt_Details; rcmb_Dept.DataTextField = "DEPARTMENT_NAME"; rcmb_Dept.DataValueField = "DEPARTMENT_ID"; rcmb_Dept.DataBind(); rcmb_Dept.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select")); } //TO LOAD JOB REQUISITION _obj_Rec_AssignEmptoRSL = new RECRUITMENT_ASSIGNEMPTORSL(); _obj_Rec_AssignEmptoRSL.ASSIGNEMP_BUID = Convert.ToInt32(rcmb_BU.SelectedItem.Value); _obj_Rec_AssignEmptoRSL.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Rec_AssignEmptoRSL.MODE = 4; DataTable DT = Recruitment_BLL.get_AssigmEMPtoRSL(_obj_Rec_AssignEmptoRSL); if (DT.Rows.Count > 0) { rcmb_JobReq.DataSource = DT; rcmb_JobReq.DataTextField = "JOBREQ_REQCODE"; rcmb_JobReq.DataValueField = "JOBREQ_ID"; rcmb_JobReq.DataBind(); rcmb_JobReq.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select")); } } else { rcmb_Dept.ClearSelection(); rcmb_Dept.Items.Clear(); rcmb_Dept.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); rcmb_JobReq.ClearSelection(); rcmb_JobReq.Items.Clear(); rcmb_JobReq.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } rcmb_EMP.ClearSelection(); rcmb_EMP.Items.Clear(); rcmb_EMP.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "AssignEmpRSL", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadDepartment() { try { if (rcmb_EmpReg_BU.SelectedIndex != 0) { obj_SMHR_Department = new SMHR_DEPARTMENT(); obj_SMHR_Department.MODE = 7; if (rad_Directorate.SelectedValue != "") { obj_SMHR_Department.DIRECTORATE_ID = Convert.ToInt32(rad_Directorate.SelectedValue); } else { obj_SMHR_Department.DIRECTORATE_ID = Convert.ToInt32(ViewState["dirID"]); } if (Convert.ToInt32(rcmb_EmpReg_BU.SelectedValue) > 0) { obj_SMHR_Department.BUID = Convert.ToInt32(rcmb_EmpReg_BU.SelectedValue); } else { obj_SMHR_Department.BUID = Convert.ToInt32(ViewState["buID"]); } DataTable dt = BLL.get_Department(obj_SMHR_Department); if (dt.Rows.Count > 0) { rad_Department.DataSource = dt; rad_Department.DataTextField = "DEPARTMENT_NAME"; rad_Department.DataValueField = "DEPARTMENT_ID"; rad_Department.DataBind(); rad_Department.Items.Insert(0, new RadComboBoxItem("Select")); } else { // rfv_Department.Enabled = false; rad_Department.Items.Insert(0, new RadComboBoxItem("Select")); } } else { rad_Department.Items.Insert(0, new RadComboBoxItem("Select")); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Equipment", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadDepartment() { #region MyRegion //try //{ // _obj_SMHR_Department = new SMHR_DEPARTMENT(); // _obj_SMHR_Department.MODE = 20; // _obj_SMHR_Department.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString()); // dt_Details = BLL.get_Department(_obj_SMHR_Department); // if (dt_Details.Rows.Count != 0) // { // rad_AssetDepartment.DataSource = dt_Details; // rad_AssetDepartment.DataTextField = "DEPARTMENT_NAME"; // rad_AssetDepartment.DataValueField = "DEPARTMENT_ID"; // rad_AssetDepartment.DataBind(); // rad_AssetDepartment.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select")); // } //} //catch (Exception ex) //{ // SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Assets_Master", ex.StackTrace, DateTime.Now); // Response.Redirect("~/Frm_ErrorPage.aspx"); // return; //} #endregion try { if (rad_BusinessUnit.SelectedIndex != 0) { _obj_SMHR_Department = new SMHR_DEPARTMENT(); _obj_SMHR_Department.MODE = 7; _obj_SMHR_Department.DIRECTORATE_ID = Convert.ToInt32(rad_Directorate.SelectedValue); _obj_SMHR_Department.BUID = Convert.ToInt32(rad_BusinessUnit.SelectedValue); DataTable dt = BLL.get_Department(_obj_SMHR_Department); rad_AssetDepartment.DataSource = dt; rad_AssetDepartment.DataTextField = "DEPARTMENT_NAME"; rad_AssetDepartment.DataValueField = "DEPARTMENT_ID"; rad_AssetDepartment.DataBind(); rad_AssetDepartment.Items.Insert(0, new RadComboBoxItem("Select")); } else { rad_AssetDepartment.Items.Insert(0, new RadComboBoxItem("Select")); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Assets_Master", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rcmb_DestinationBU_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { _obj_SMHR_DEPARTMENT = new SMHR_DEPARTMENT(); _obj_SMHR_DEPARTMENT.MODE = 14; _obj_SMHR_DEPARTMENT.BUID = Convert.ToInt32(rcmb_DestinationBU.SelectedItem.Value); _obj_SMHR_DEPARTMENT.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt_dept = BLL.get_Department(_obj_SMHR_DEPARTMENT); rcmb_DestinationDept.DataSource = dt_dept; rcmb_DestinationDept.DataTextField = "DEPARTMENT_NAME"; rcmb_DestinationDept.DataValueField = "DEPARTMENT_ID"; rcmb_DestinationDept.DataBind(); rcmb_DestinationDept.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); rcmb_DestinationCurr.Items.Clear(); _obj_SMHR_BUSINESSUNIT = new SMHR_BUSINESSUNIT(); _obj_SMHR_BUSINESSUNIT.OPERATION = operation.Empty1; _obj_SMHR_BUSINESSUNIT.BUSINESSUNIT_ID = Convert.ToInt32(rcmb_DestinationBU.SelectedItem.Value); _obj_SMHR_BUSINESSUNIT.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt_Currency = BLL.get_BusinessUnit(_obj_SMHR_BUSINESSUNIT); rcmb_DestinationCurr.DataSource = dt_Currency; rcmb_DestinationCurr.DataTextField = "CURR_CODE"; rcmb_DestinationCurr.DataValueField = "BUSINESSUNIT_CURRENCY_ID"; rcmb_DestinationCurr.DataBind(); rcmb_DestinationCurr.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); _obj_SMHR_BUSINESSUNIT.OPERATION = operation.Select; DataTable dt_Bu = BLL.get_BusinessUnit(_obj_SMHR_BUSINESSUNIT); if (dt_Bu.Rows.Count != 0) { ViewState["buStartDate"] = Convert.ToString(dt_Bu.Rows[0]["BUSINESSUNIT_STARTDATE"]); } if (rcmb_DestinationBU.SelectedIndex > 0) { getPosition(); } lbl_DestinationJob.Text = ""; txt_AnnualGross.Text = ""; txt_AnnualBasic.Text = ""; txt_MonthlyGross.Text = ""; txt_MonthlyBasic.Text = ""; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "EmployeeCopy", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); return; } }
protected void LoadDepartments() { SMHR_DEPARTMENT _obj_SMHR_Department = new SMHR_DEPARTMENT(); _obj_SMHR_Department.MODE = 20; _obj_SMHR_Department.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dtDept = BLL.get_Department(_obj_SMHR_Department); rcmb_Department.DataSource = dtDept; rcmb_Department.DataTextField = "DEPARTMENT_NAME"; rcmb_Department.DataValueField = "DEPARTMENT_ID"; rcmb_Department.DataBind(); rcmb_Department.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select")); }
public void LoadMainGrid() { try { _obj_smhr_Department = new SMHR_DEPARTMENT(); _obj_smhr_Department.MODE = 5; _obj_smhr_Department.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); Rg_Department.DataSource = BLL.get_Department(_obj_smhr_Department); Rm_HDPT_page.SelectedIndex = 0; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Department", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadDepartment() { try { _obj_SMHR_Department = new SMHR_DEPARTMENT(); _obj_SMHR_Department.MODE = 9; if ((Convert.ToInt32(Session["EMP_ID"]) == 0)) { _obj_SMHR_Department.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString()); _obj_SMHR_Department.BUID = 5;//Convert.ToInt32(ViewState["Emp_BusinessUnitID"].ToString()); dt_Details = BLL.get_Department(_obj_SMHR_Department); if (dt_Details.Rows.Count > 0) { Rad_Department.Visible = true; Rad_Department.DataSource = dt_Details; Rad_Department.DataTextField = "DEPARTMENT_NAME"; Rad_Department.DataValueField = "DEPARTMENT_ID"; Rad_Department.DataBind(); Rad_Department.Items.Insert(0, new RadComboBoxItem("Select")); } } else { _obj_SMHR_Department.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString()); _obj_SMHR_Department.BUID = Convert.ToInt32(Session["BUSINESSUNIT_ID"].ToString().Split(',')[0]); dt_Details = BLL.get_Department(_obj_SMHR_Department); if (dt_Details.Rows.Count > 0) { Rad_Department.Visible = true; Rad_Department.DataSource = dt_Details; Rad_Department.DataTextField = "DEPARTMENT_NAME"; Rad_Department.DataValueField = "DEPARTMENT_ID"; Rad_Department.DataBind(); Rad_Department.Items.Insert(0, new RadComboBoxItem("Select")); } Rad_Department.SelectedValue = Convert.ToString(ViewState["deptid"].ToString()); Rad_Department.Enabled = false; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Clearance", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); return; } }
private void LoadDepartments() { rcmb_Department.Items.Clear(); try { _obj_SMHR_Department = new SMHR_DEPARTMENT(); //_obj_SMHR_Department.MODE = 9; _obj_SMHR_Department.MODE = 16; _obj_SMHR_Department.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString()); _obj_SMHR_Department.BUID = Convert.ToInt32(rcmb_BusinessUnit.SelectedItem.Value); if (rcmb_BusinessUnit.SelectedIndex > 0 && rcmb_Directorate.SelectedIndex > 0) { _obj_SMHR_Department.MODE = 7; _obj_SMHR_Department.DIRECTORATE_ID = Convert.ToInt32(rcmb_Directorate.SelectedItem.Value); } else { _obj_SMHR_Department.DIRECTORATE_ID = 0; } DataTable DT = BLL.get_Department(_obj_SMHR_Department); if (DT.Rows.Count > 0) { rcmb_Department.DataSource = DT; rcmb_Department.DataValueField = "DEPARTMENT_ID"; rcmb_Department.DataTextField = "DEPARTMENT_NAME"; rcmb_Department.DataBind(); rcmb_Department.Items.Insert(0, new RadComboBoxItem("Select", "0")); } else { rcmb_Department.Items.Clear(); rcmb_Department.Text = string.Empty; rcmb_Department.Items.Insert(0, new RadComboBoxItem("Select", "0")); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "EmployeeList", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); return; } }
private void loadDepartment() { try { SMHR_DEPARTMENT _obj_smhr_department = new SMHR_DEPARTMENT(); _obj_smhr_department.BUID = Convert.ToInt32(rcmb_BusinessUnit.SelectedItem.Value); _obj_smhr_department.MODE = 7; DataTable dt_dept = BLL.get_Department(_obj_smhr_department); ddl_Department.DataSource = dt_dept; ddl_Department.DataValueField = "DEPARTMENT_ID"; ddl_Department.DataTextField = "DEPARTMENT_NAME"; ddl_Department.DataBind(); ddl_Department.Items.Insert(0, new RadComboBoxItem("Select")); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Employee_Payslip", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void ddl_BusinessUnit_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { SMHR_DEPARTMENT _obj_smhr_department = new SMHR_DEPARTMENT(); // _obj_smhr_department.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_smhr_department.BUID = Convert.ToInt32(ddl_BusinessUnit.SelectedItem.Value); _obj_smhr_department.MODE = 7; DataTable dt_dept = BLL.get_Department(_obj_smhr_department); rcb_Department.DataSource = dt_dept; rcb_Department.DataValueField = "DEPARTMENT_ID"; rcb_Department.DataTextField = "DEPARTMENT_NAME"; rcb_Department.DataBind(); rcb_Department.Items.Insert(0, new RadComboBoxItem("Select")); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "EmployeeLeaveEncashment", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadDepartment() { try { if (Convert.ToString(Session["SELFSERVICE"]) == "ADMIN") { SMHR_DEPARTMENT _obj_smhr_department = new SMHR_DEPARTMENT(); // _obj_smhr_department.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_smhr_department.BUID = Convert.ToInt32(rcmb_BusinessUnit.SelectedItem.Value); _obj_smhr_department.MODE = 7; DataTable dt_dept = BLL.get_Department(_obj_smhr_department); rcmb_Department.DataSource = dt_dept; rcmb_Department.DataValueField = "DEPARTMENT_ID"; rcmb_Department.DataTextField = "DEPARTMENT_NAME"; rcmb_Department.DataBind(); rcmb_Department.Items.Insert(0, new RadComboBoxItem("Select")); } else { _obj_smhr_emp_payitems = new SMHR_EMP_PAYITEMS(); _obj_smhr_emp_payitems.EMP_ID = Convert.ToInt32(Session["EMP_ID"]); _obj_smhr_emp_payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_smhr_emp_payitems.OPERATION = operation.Self; DataTable dt_BU = BLL.get_EmpDetails(_obj_smhr_emp_payitems); rcmb_Department.DataSource = dt_BU; rcmb_Department.DataTextField = "DEPARTMENT_NAME"; rcmb_Department.DataValueField = "DEPARTMENT_ID"; rcmb_Department.DataBind(); rcmb_Department.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "-1")); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Pay_Slip", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadDepartment() { try { if (ddl_BusinessUnit.SelectedIndex > 0) { SMHR_DEPARTMENT _obj_SMHR_Department = new SMHR_DEPARTMENT(); _obj_SMHR_Department.MODE = 7; // if (rad_Directorate.SelectedIndex > 0) // { _obj_SMHR_Department.DIRECTORATE_ID = Convert.ToInt32(rcmb_Directorate.SelectedValue); // } //else //{ // _obj_SMHR_Department.MODE = 16; // _obj_SMHR_Department.DIRECTORATE_ID = 0; //} _obj_SMHR_Department.BUID = Convert.ToInt32(ddl_BusinessUnit.SelectedValue); DataTable dt = BLL.get_Department(_obj_SMHR_Department); ddl_Department.DataSource = dt; ddl_Department.DataTextField = "DEPARTMENT_NAME"; ddl_Department.DataValueField = "DEPARTMENT_ID"; ddl_Department.DataBind(); ddl_Department.Items.Insert(0, new RadComboBoxItem("All")); } else { ddl_Department.Items.Clear(); ddl_Department.Items.Insert(0, new RadComboBoxItem("Select")); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Nssf", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Copy_Click(object sender, EventArgs e) { try { if (rcmb_SourceBU.SelectedIndex == 0) { BLL.ShowMessage(this, "Please Select Source Business Unit"); } else if (rcmb_SourceBU.SelectedIndex > 0) { _obj_SMHR_EMPLOYEE = new SMHR_EMPLOYEE(); _obj_SMHR_DEPARTMENT = new SMHR_DEPARTMENT(); CheckBox chk = new CheckBox(); Label lbl_Emp_Id = new Label(); Label lbl_BuId = new Label(); Label lbl_DepartmentId = new Label(); Label lbl_Error = new Label(); Label lbl_EmpCode = new Label(); Label lbl_SalStruct = new Label(); Label lbl_GrossSal = new Label(); Label lbl_EmpDoj = new Label(); for (int iEmpId = 0; iEmpId < rg_Employee.Items.Count; iEmpId++) { chk = rg_Employee.Items[iEmpId].FindControl("chk_Select") as CheckBox; lbl_Emp_Id = rg_Employee.Items[iEmpId].FindControl("lbl_EmployeeID") as Label; lbl_BuId = rg_Employee.Items[iEmpId].FindControl("lbl_BuId") as Label; lbl_DepartmentId = rg_Employee.Items[iEmpId].FindControl("lbl_DepartmentId") as Label; lbl_Error = rg_Employee.Items[iEmpId].FindControl("lbl_Error") as Label; lbl_EmpCode = rg_Employee.Items[iEmpId].FindControl("lbl_EmpCode") as Label; lbl_SalStruct = rg_Employee.Items[iEmpId].FindControl("lbl_SalStruct") as Label; lbl_GrossSal = rg_Employee.Items[iEmpId].FindControl("lbl_GrossSal") as Label; lbl_EmpDoj = rg_Employee.Items[iEmpId].FindControl("lbl_EmpDoj") as Label; if (chk.Checked) { iChkCount = iChkCount + 1; _obj_SMHR_EMPLOYEE.OPERATION = operation.Check_Emp; _obj_SMHR_EMPLOYEE.EMP_EMPCODE = Convert.ToString(lbl_EmpCode.Text); _obj_SMHR_EMPLOYEE.EMP_BUSINESSUNIT_ID = Convert.ToInt32(rcmb_DestinationBU.SelectedItem.Value); _obj_SMHR_EMPLOYEE.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt_Check = BLL.get_Employee(_obj_SMHR_EMPLOYEE); if (dt_Check.Rows.Count != 0) { if (Convert.ToString(dt_Check.Rows[0][0]) == "0") { //if (Convert.ToInt32(lbl_GrossSal.Text) == 0) //{ // BLL.ShowMessage(this,"Transfer not allowed.This employee has already been transferred and has Gross Salary as 0"); // return; //} if (Convert.ToDateTime(lbl_EmpDoj.Text) > Convert.ToDateTime(ViewState["buStartDate"])) { _obj_SMHR_EMPLOYEE.OPERATION = operation.EMP_COPY; _obj_SMHR_EMPLOYEE.emp_SOURCEBU = Convert.ToInt32(rcmb_SourceBU.SelectedItem.Value); _obj_SMHR_EMPLOYEE.EMP_ID = Convert.ToInt32(lbl_Emp_Id.Text); _obj_SMHR_EMPLOYEE.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_SMHR_EMPLOYEE.EMP_BUSINESSUNIT_ID = Convert.ToInt32(rcmb_DestinationBU.SelectedItem.Value); _obj_SMHR_EMPLOYEE.EMP_DEPARTMENT_ID = Convert.ToInt32(rcmb_DestinationDept.SelectedItem.Value); _obj_SMHR_EMPLOYEE.EMP_PAYCURRENCY = Convert.ToInt32(rcmb_DestinationCurr.SelectedItem.Value); _obj_SMHR_EMPLOYEE.EMP_EMPCODE = Convert.ToString(lbl_EmpCode.Text); _obj_SMHR_EMPLOYEE.EMP_SALALRYSTRUCT_ID = Convert.ToInt32(lbl_SalStruct.Text); _obj_SMHR_EMPLOYEE.EMP_DESIGNATION_ID = Convert.ToInt32(rcmb_DestinationPosition.SelectedItem.Value); if ((Convert.ToString(txt_AnnualGross.Text) == "") || (Convert.ToString(txt_AnnualGross.Text) == string.Empty)) { _obj_SMHR_EMPLOYEE.emp_ANNUAL_GROSSSALARY = 0.00; } else { _obj_SMHR_EMPLOYEE.emp_ANNUAL_GROSSSALARY = Convert.ToDouble(txt_AnnualGross.Text); } if ((Convert.ToString(txt_AnnualBasic.Text) == "") || (Convert.ToString(txt_AnnualBasic.Text) == string.Empty)) { _obj_SMHR_EMPLOYEE.emp_ANNUAL_BASICSALARY = 0.00; } else { _obj_SMHR_EMPLOYEE.emp_ANNUAL_BASICSALARY = Convert.ToDouble(txt_AnnualBasic.Text); } _obj_SMHR_EMPLOYEE.EMP_GROSSSAL = Convert.ToDouble(txt_MonthlyGross.Text); _obj_SMHR_EMPLOYEE.EMP_BASIC = Convert.ToDouble(txt_MonthlyBasic.Text); bool status = BLL.set_Employee(_obj_SMHR_EMPLOYEE); if (status == true) { _obj_SMHR_EMPLOYEE.OPERATION = operation.Update_New; _obj_SMHR_EMPLOYEE.EMP_ID = Convert.ToInt32(lbl_Emp_Id.Text); _obj_SMHR_EMPLOYEE.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_SMHR_EMPLOYEE.EMP_BUSINESSUNIT_ID = Convert.ToInt32(rcmb_SourceBU.SelectedItem.Value); bool status1 = BLL.set_Employee(_obj_SMHR_EMPLOYEE); //generating XML file _obj_SMHR_EMPLOYEE.OPERATION = operation.Select_New; _obj_SMHR_EMPLOYEE.EMP_EMPCODE = Convert.ToString(lbl_EmpCode.Text); DataTable dtDetails = BLL.getEmployee(_obj_SMHR_EMPLOYEE); if (dtDetails.Rows.Count > 0) { _obj_SMHR_BUSINESSUNIT = new SMHR_BUSINESSUNIT(); _obj_SMHR_BUSINESSUNIT.OPERATION = operation.Select; _obj_SMHR_BUSINESSUNIT.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_SMHR_BUSINESSUNIT.BUSINESSUNIT_ID = Convert.ToInt32(rcmb_DestinationBU.SelectedValue); DataTable dt = BLL.get_BusinessUnit(_obj_SMHR_BUSINESSUNIT); string DateVal = DateTime.Now.ToString("ddMMyyyy"); DataTable dt_1 = BLL.ExecuteQuery("SELECT MASTERNO FROM SMHR_GLOBALCONFIG WHERE GLOBALCONFIG_ORGANISATION_ID = '" + Convert.ToInt32(Session["ORG_ID"]) + "'"); //string strPath = "C:\\AXXML\\SMHR\\IN\\" + lbl_Code.Text + ".xml"; string strPath = "C:\\AXXML\\SMHR\\IN\\" + Convert.ToString(dt.Rows[0]["BUSINESSUNIT_CODE"]) + "_SMHR_MST_" + DateVal + "_" + dt_1.Rows[0]["MASTERNO"] + ".xml"; bool statusXml = BLL.ExecuteNonQuery("UPDATE SMHR_GLOBALCONFIG SET MASTERNO = MASTERNO + 1 WHERE " + "GLOBALCONFIG_ORGANISATION_ID = '" + Convert.ToInt32(Session["ORG_ID"]) + "'"); XmlTextWriter myXmlTextWriter = new XmlTextWriter(strPath, null); myXmlTextWriter.Formatting = Formatting.Indented; myXmlTextWriter.WriteStartDocument(false); myXmlTextWriter.WriteStartElement("xml"); myXmlTextWriter.WriteStartElement("EmplTable", null); myXmlTextWriter.WriteElementString("EmplId", null, Convert.ToString(lbl_EmpCode.Text)); if (Convert.ToString(dtDetails.Rows[0]["GENDER"]).Trim() == "Male") { myXmlTextWriter.WriteElementString("EmplGender", null, Convert.ToString(1)); } else { myXmlTextWriter.WriteElementString("EmplGender", null, Convert.ToString(2)); } myXmlTextWriter.WriteElementString("PartyId", null, Convert.ToString(lbl_Emp_Id.Text)); myXmlTextWriter.WriteElementString("status", null, Convert.ToString(1)); myXmlTextWriter.WriteElementString("Name", null, Convert.ToString(dtDetails.Rows[0]["EMPNAME"])); myXmlTextWriter.WriteElementString("NameAlias", null, Convert.ToString(dtDetails.Rows[0]["EMPNAME"])); myXmlTextWriter.WriteElementString("Type", null, Convert.ToString(1)); myXmlTextWriter.WriteElementString("FirstName", null, Convert.ToString(dtDetails.Rows[0]["APPLICANT_FIRSTNAME"])); myXmlTextWriter.WriteElementString("MiddleName", null, Convert.ToString(dtDetails.Rows[0]["APPLICANT_MIDDLENAME"])); myXmlTextWriter.WriteElementString("LastName", null, Convert.ToString(dtDetails.Rows[0]["APPLICANT_LASTNAME"])); myXmlTextWriter.WriteElementString("Dimension", null, Convert.ToString(rcmb_DestinationDept.SelectedItem.Text.Replace("'", "''"))); myXmlTextWriter.WriteEndElement(); //Write the XML to file and close the myXmlTextWriter myXmlTextWriter.Flush(); myXmlTextWriter.Close(); } BLL.ShowMessage(this, "Employees has been transferred"); rcmb_SourceBU.SelectedIndex = 0; rcmb_DestinationBU.ClearSelection(); rcmb_DestinationBU.Items.Clear(); rcmb_DestinationBU.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); rg_Employee.Visible = false; rcmb_DestinationCurr.Items.Clear(); rcmb_DestinationDept.Items.Clear(); rcmb_DestinationPosition.Items.Clear(); txt_AnnualGross.Text = ""; txt_AnnualBasic.Text = ""; txt_MonthlyGross.Text = ""; txt_MonthlyBasic.Text = ""; } } else { BLL.ShowMessage(this, "Cannot Transfer.Employee Date Of Join Falls before Start Date Of Destination Business Unit"); } } else { BLL.ShowMessage(this, "One or more of the selected employee already exist in Destination Business Unit"); } } } } if (iChkCount == 0) { BLL.ShowMessage(this, "Please Select Employee"); return; } } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "EmployeeCopy", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); return; } }
protected void lnk_Edit_Command(object sender, CommandEventArgs e) { try { rcmb_Status.Enabled = true; rtxt_DCode.Enabled = false; LoadCombos(); _obj_smhr_Department = new SMHR_DEPARTMENT(); DataTable dt_Values = new DataTable(); _obj_smhr_Department.MODE = 6; _obj_smhr_Department.DEPARTMENT_ID = Convert.ToInt32(e.CommandArgument); dt_Values = BLL.get_Department(_obj_smhr_Department); lbl_depID.Text = Convert.ToString(dt_Values.Rows[0]["DEPARTMENT_ID"]); //rtbCode.Text = Convert.ToString(dt_Values.Rows[0]["DEPARTMENT_CODE"]); rtxt_DName.Text = Convert.ToString(dt_Values.Rows[0]["DEPARTMENT_NAME"]); rtxt_DCode.Text = Convert.ToString(dt_Values.Rows[0]["DEPARTMENT_CODE"]); rtxt_Desc.Text = Convert.ToString(dt_Values.Rows[0]["DEPARTMENT_DESC"]); rcmb_BusinessUnit.SelectedIndex = rcmb_BusinessUnit.Items.FindItemIndexByValue(Convert.ToString(dt_Values.Rows[0]["DEPARTMENT_BUID"])); //Load Directorate _obj_Smhr_Directorate = new SMHR_DIRECTORATE(); _obj_Smhr_Directorate.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Smhr_Directorate.BUSINESSUNIT_ID = Convert.ToInt32(rcmb_BusinessUnit.SelectedItem.Value.ToString()); DataTable DT = BLL.get_Directorate(_obj_Smhr_Directorate); rcmb_BusinessUnit_Directorate.DataTextField = "DIRECTORATE_CODE"; rcmb_BusinessUnit_Directorate.DataValueField = "DIRECTORATE_ID"; rcmb_BusinessUnit_Directorate.DataSource = DT; rcmb_BusinessUnit_Directorate.DataBind(); rcmb_BusinessUnit_Directorate.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); rcmb_BusinessUnit_Directorate.SelectedValue = Convert.ToString(dt_Values.Rows[0]["DIRECTORATE_ID"]); if (dt_Values.Rows[0]["DEPARTMENT_ISACTIVE"] != System.DBNull.Value) { int Status = Convert.ToInt32(dt_Values.Rows[0]["DEPARTMENT_ISACTIVE"]); rcmb_Status.SelectedIndex = rcmb_Status.Items.FindItemIndexByValue(Convert.ToString(Status)); } else { //chk_Active.Checked = false; } //code for security if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2) { btn_Edit.Visible = false; } else { btn_Edit.Visible = true; } //rtbCode.Enabled = false; rtxt_DName.Enabled = false; rcmb_BusinessUnit.Enabled = false; rcmb_BusinessUnit_Directorate.Enabled = false; btn_Save.Visible = false; Rm_HDPT_page.SelectedIndex = 1; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Department", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Save_Click1(object sender, EventArgs e) { try { _obj_smhr_Department = new SMHR_DEPARTMENT(); _obj_smhr_Department.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString()); _obj_smhr_Department.BUID = Convert.ToInt32(rcmb_BusinessUnit.SelectedItem.Value); _obj_smhr_Department.DIRECTORATE_ID = Convert.ToInt32(rcmb_BusinessUnit_Directorate.SelectedItem.Value); //_obj_smhr_Department.DEPARTMENT_CODE = Convert.ToString(rtbCode.Text); _obj_smhr_Department.DEPARTMENT_NAME = Convert.ToString(rtxt_DName.Text).Replace("'", "''"); _obj_smhr_Department.DEPARTMENT_CODE = Convert.ToString(rtxt_DCode.Text).Replace("'", "'"); _obj_smhr_Department.DEPARTMENT_DESC = Convert.ToString(rtxt_Desc.Text).Replace("'", "''"); int Status = Convert.ToInt32(rcmb_Status.SelectedItem.Value); // if (chk_Active.Checked) _obj_smhr_Department.DEPARTMENT_ISACTIVE = Convert.ToBoolean(Status); // else //_obj_smhr_Department.DEPARTMENT_ISACTIVE = false; _obj_smhr_Department.CREATEDBY = Convert.ToInt32(Session["USER_ID"]); _obj_smhr_Department.CREATEDDATE = DateTime.Now; _obj_smhr_Department.LASTMDFBY = Convert.ToInt32(Session["USER_ID"]); _obj_smhr_Department.LASTMDFDATE = DateTime.Now; switch (((Button)sender).ID.ToUpper()) { case "BTN_SAVE": _obj_smhr_Department.DEPARTMENT_NAME = Convert.ToString(rtxt_DName.Text.Replace("'", "''")); _obj_smhr_Department.BUID = Convert.ToInt32(rcmb_BusinessUnit.SelectedValue); _obj_smhr_Department.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString()); _obj_smhr_Department.MODE = 3; DataTable dt = BLL.get_Department(_obj_smhr_Department); if (dt.Rows.Count != 0) { BLL.ShowMessage(this, "This Department is already created for this Business Unit"); rtxt_DName.Text = string.Empty; rtxt_Desc.Text = string.Empty; return; } _obj_smhr_Department.MODE = 1; if (BLL.set_Department(_obj_smhr_Department)) { BLL.ShowMessage(this, "Information Saved Successfully"); } else { BLL.ShowMessage(this, "Information Not Saved"); } break; case "BTN_EDIT": int Exist = 0; _obj_smhr_Department.DEPARTMENT_ID = Convert.ToInt32(lbl_depID.Text); _obj_smhr_Department.DEPARTMENT_NAME = Convert.ToString(rtxt_DName.Text.Replace("'", "''")); if (_obj_smhr_Department.DEPARTMENT_ISACTIVE == false) { _obj_smhr_Department.MODE = 12; Exist = Convert.ToInt32(BLL.get_Department(_obj_smhr_Department).Rows[0]["COUNT"]); if (Exist == 1) { //BLL.ShowMessage(this, "There Are Employee With The Department Name " + rtxt_DName.Text + " So You cannot Make this as Inactive!"); BLL.ShowMessage(this, " You cannot Inactive Department, As it is already assigned to employee"); rcmb_Status.SelectedIndex = 0; // LoadMainGrid(); // Rg_Department.DataBind(); return; } } _obj_smhr_Department.MODE = 2; if (BLL.set_Department(_obj_smhr_Department)) { BLL.ShowMessage(this, "Information Updated Successfully"); } else { BLL.ShowMessage(this, "Information Not Saved"); } break; } Rm_HDPT_page.SelectedIndex = 0; LoadMainGrid(); Rg_Department.DataBind(); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Department", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }