protected void rcmb_Period_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { if (Convert.ToInt32(rcmb_Period.SelectedIndex) > 0) { rcmb_PeriodElements.Items.Clear(); _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_Period.SelectedValue); _obj_smhr_payroll.MODE = 11; DataTable dt_Details = new DataTable(); dt_Details = BLL.get_payrolltrans(_obj_smhr_payroll); rcmb_PeriodElements.DataSource = dt_Details; rcmb_PeriodElements.DataValueField = "PRDDTL_ID"; rcmb_PeriodElements.DataTextField = "PRDDTL_NAME"; rcmb_PeriodElements.DataBind(); rcmb_PeriodElements.Items.Insert(0, new RadComboBoxItem("Select")); } else { rcmb_PeriodElements.Items.Clear(); rcmb_PeriodElements.Items.Insert(0, new RadComboBoxItem("Select")); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Payrollemail", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rcbFinancialPeriod_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { // LOADS PERIOD WHICH ARE UNDER THAT FINANCIAL PERIODS try { if ((rcbBusinessUnit.SelectedIndex > 0) && (rcbFinancialPeriod.SelectedIndex > 0)) { _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcbFinancialPeriod.SelectedItem.Value); _obj_smhr_payroll.MODE = 11; dt_Result = BLL.get_payrolltrans(_obj_smhr_payroll); rcbPeriodID.DataSource = dt_Result; rcbPeriodID.DataValueField = "PRDDTL_ID"; rcbPeriodID.DataTextField = "PRDDTL_NAME"; rcbPeriodID.DataBind(); rcbPeriodID.Items.Insert(0, new RadComboBoxItem("Select", "0")); RG_Vpay.Visible = false; } else { BLL.ShowMessage(this, "Select Proper Financial Period For Proper Businesunit"); rcbBusinessUnit.ClearSelection(); rcbFinancialPeriod.ClearSelection(); rcbPeriodID.Items.Clear(); rcbPeriodID.Items.Insert(0, new RadComboBoxItem("", "")); RG_Vpay.Visible = false; } } catch (Exception ex) { BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_vpms_trans", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rcmb_PeriodElements_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { if ((rcmb_BusinessUnit.SelectedIndex > 0) && (rcmb_Period.SelectedIndex > 0) && (rcmb_PeriodElements.SelectedIndex > 0)) { rcmb_PayTran.Items.Clear(); _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.MODE = 30; _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_PeriodElements.SelectedItem.Value); _obj_smhr_payroll.BUID = Convert.ToInt32(rcmb_BusinessUnit.SelectedItem.Value); DataTable dt = BLL.get_PayDetails(_obj_smhr_payroll); if (dt.Rows.Count != 0) { rcmb_PayTran.Items.Clear(); rcmb_PayTran.DataSource = dt; rcmb_PayTran.DataTextField = "PAYTRAN_NAME"; rcmb_PayTran.DataValueField = "PAYTRAN_ID"; rcmb_PayTran.DataBind(); rcmb_PayTran.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("'", "''"), "PayRegisterRow", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private bool chkAuthority() { try { _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.TRANID = Convert.ToInt32(rcb_Paytran.SelectedItem.Value); _obj_smhr_payroll.MODE = 9; DataTable dt = BLL.get_PayApproval(_obj_smhr_payroll); if (dt.Rows.Count != 0) { if (Convert.ToString(dt.Rows[0]["TEMP_PAYTRAN_APPROVERS"]).IndexOf(Convert.ToString(Session["USER_ID"])) == -1) { return(false); } else { return(true); } } else { return(false); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PayrollApproval", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); return(false); } }
protected void rcmb_businessunit_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { if (rcmb_businessunit.SelectedIndex != 0) { rcb_Paytran.Items.Clear(); _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.OPERATION = operation.Empty; _obj_smhr_payroll.MODE = 3; _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcb_PeriodElements.SelectedItem.Value); _obj_smhr_payroll.BUID = Convert.ToInt32(rcmb_businessunit.SelectedItem.Value); dt_Details = new DataTable(); dt_Details = BLL.get_Payroll(_obj_smhr_payroll); if (dt_Details.Rows.Count != 0) { rcb_Paytran.DataSource = dt_Details; rcb_Paytran.DataTextField = "TEMP_PAYTRAN_NAME"; rcb_Paytran.DataValueField = "TEMP_PAYTRAN_ID"; rcb_Paytran.DataBind(); rcb_Paytran.Items.Insert(0, new RadComboBoxItem("Select")); } else { rcb_Paytran.Items.Insert(0, new RadComboBoxItem("Select")); } RG_PayTran.Visible = false; chk_CheckAll.Visible = false; chk_CheckAll.Checked = false; lnk.Visible = false; btn_Approve.Enabled = false; btn_Reject.Enabled = false; //if ((rcb_Period.SelectedIndex > 0) && (rcb_PeriodElements.SelectedIndex > 0)) //{ // lnk.Visible = true; //} } else { rcb_Paytran.Items.Clear(); rcb_Paytran.Text = String.Empty; RG_PayTran.Visible = false; chk_CheckAll.Visible = false; chk_CheckAll.Checked = false; lnk.Visible = false; RG_PayTran.Visible = false; btn_Approve.Enabled = false; btn_Reject.Enabled = false; //lnk.Visible = false; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PayrollApproval", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rcb_PeriodElements_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { if ((rcb_PeriodElements.SelectedIndex != 0) && (rcmb_businessunit.SelectedIndex > 0)) { rcb_Transaction.Items.Clear(); _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.OPERATION = operation.Empty; _obj_smhr_payroll.MODE = 3; _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcb_PeriodElements.SelectedItem.Value); _obj_smhr_payroll.BUID = Convert.ToInt32(rcmb_businessunit.SelectedItem.Value); DataTable dt_Details = BLL.get_Payroll(_obj_smhr_payroll); _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.MODE = 22; _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcb_PeriodElements.SelectedItem.Value); _obj_smhr_payroll.BUID = Convert.ToInt32(rcmb_businessunit.SelectedItem.Value); DataTable dt = BLL.get_PayDetails(_obj_smhr_payroll); if (dt.Rows.Count != 0) { //_obj_smhr_payroll = new SMHR_PAYROLL(); //_obj_smhr_payroll.MODE = 22; //_obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcb_PeriodElements.SelectedItem.Value); //_obj_smhr_payroll.BUID = Convert.ToInt32(rcmb_businessunit.SelectedItem.Value); //DataTable dt = BLL.get_PayDetails(_obj_smhr_payroll); rcb_Transaction.Items.Clear(); rcb_Transaction.DataSource = dt; rcb_Transaction.DataTextField = "TEMP_PAYTRAN_NAME"; rcb_Transaction.DataValueField = "TEMP_PAYTRAN_ID"; rcb_Transaction.DataBind(); rcb_Transaction.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select")); RG_Transaction.Visible = false; btn_Rollback.Visible = false; } else { RG_Transaction.Visible = false; btn_Rollback.Visible = false; } } else { rcb_Transaction.Items.Clear(); rcb_Transaction.Items.Insert(0, new RadComboBoxItem("", "")); RG_Transaction.Visible = false; btn_Rollback.Visible = false; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Rollback", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadGrid() { try { _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.OPERATION = operation.Check; _obj_smhr_payroll.MODE = 2; _obj_smhr_payroll.TRANID = Convert.ToInt32(rcb_Paytran.SelectedItem.Value); dt_Details = new DataTable(); dt_Details = BLL.get_Payroll(_obj_smhr_payroll); RG_PayTran.DataSource = dt_Details; RG_PayTran.DataBind(); int i = 0; int j = 0; Label lbl_Amt = new Label(); for (i = 0; i < RG_PayTran.Items.Count; i++) { lbl_Amt = RG_PayTran.Items[i].FindControl("lblAmount") as Label; if (lbl_Amt.Text.StartsWith("-")) { lbl_Amt.BackColor = System.Drawing.Color.Red; lbl_Amt.ToolTip = "Negative Balance for this Employee"; j = j + 1; } } if (j > 0) { btn_Approve.Enabled = true; btn_Reject.Enabled = true; BLL.ShowMessage(this, "There are employee(s) with negative balance"); } else { //code for security if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2) { btn_Approve.Enabled = false; btn_Reject.Enabled = false; } else { btn_Approve.Enabled = true; btn_Reject.Enabled = true; } } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PayrollApproval", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); return; } }
protected void rcb_Period_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) { try { if (rcb_Period.SelectedIndex != 0) { _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.MODE = 29; _obj_smhr_payroll.PERODID = Convert.ToInt32(rcb_Period.SelectedValue); dt_Details = BLL.get_Payroll(_obj_smhr_payroll); rcb_PeriodElements.DataSource = dt_Details; rcb_PeriodElements.DataValueField = "EMPSALDTLS_PRDDTL_ID"; rcb_PeriodElements.DataTextField = "PRDDTL_NAME"; rcb_PeriodElements.DataBind(); rcb_PeriodElements.Items.Insert(0, new RadComboBoxItem("Select")); RG_PayTran.Visible = false; chk_CheckAll.Visible = false; chk_CheckAll.Checked = false; lnk.Visible = false; btn_Approve.Enabled = false; btn_Reject.Enabled = false; rcb_Paytran.Items.Clear(); rcb_Paytran.Text = String.Empty; rcmb_businessunit.Items.Clear(); rcmb_businessunit.Text = String.Empty; if ((rcb_PeriodElements.SelectedIndex > 0) && (rcmb_businessunit.SelectedIndex > 0)) { lnk.Visible = true; } } else { rcb_PeriodElements.Items.Clear(); rcb_PeriodElements.Text = String.Empty; rcb_Paytran.Items.Clear(); rcb_Paytran.Text = string.Empty; rcmb_businessunit.Items.Clear(); rcmb_businessunit.Text = string.Empty; RG_PayTran.Visible = false; chk_CheckAll.Visible = false; chk_CheckAll.Checked = false; lnk.Visible = false; btn_Approve.Enabled = false; btn_Reject.Enabled = false; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PayrollApproval", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); return; } }
protected void rcmb_Financialperiod_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { // checking whether selection is made or not for business unit combo box if (rcmb_Busniessunit.SelectedIndex > 0) { // checking for financial period if (rcmb_Financialperiod.SelectedIndex > 0) { SMHR_PAYROLL _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_Financialperiod.SelectedValue); _obj_smhr_payroll.MODE = 11; dt_Information = BLL.get_payrolltrans(_obj_smhr_payroll); if (dt_Information.Rows.Count != 0) { rcmb_Perioddtls.DataSource = dt_Information; rcmb_Perioddtls.DataValueField = "PRDDTL_ID"; rcmb_Perioddtls.DataTextField = "PRDDTL_NAME"; rcmb_Perioddtls.DataBind(); rcmb_Perioddtls.Items.Insert(0, new RadComboBoxItem("Select")); } else { rcmb_Perioddtls.DataSource = dt_null; rcmb_Perioddtls.DataBind(); rcmb_Perioddtls.Items.Insert(0, new RadComboBoxItem("Select")); } } else { BLL.ShowMessage(this, "Select Financial Period"); rcmb_Perioddtls.Items.Clear(); } } else { BLL.ShowMessage(this, "Select Businessunit"); rcmb_Financialperiod.ClearSelection(); rcmb_Perioddtls.Items.Clear(); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Esiexport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void lnk_Download_Command(object sender, CommandEventArgs e) { try { LoadCombos(); _obj_SMHR_ESIIMPORT.Mode = 2; _obj_SMHR_ESIIMPORT.ESIIMPORT_PERIDEMLEMENTID = Convert.ToInt32(Convert.ToString(e.CommandArgument)); dt_Information = BLL.get_ESIimport(_obj_SMHR_ESIIMPORT); if (dt_Information.Rows.Count != 0) { rcmb_Busniessunit.SelectedIndex = rcmb_Busniessunit.Items.FindItemIndexByValue(Convert.ToString(dt_Information.Rows[0]["ESIIMPORT_BUID"])); rcmb_Financialperiod.SelectedIndex = rcmb_Financialperiod.Items.FindItemIndexByValue(Convert.ToString(dt_Information.Rows[0]["ESIIMPORT_FINANCIAL_PERIOD"])); // loading the period elements under that period SMHR_PAYROLL _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_Financialperiod.SelectedValue); _obj_smhr_payroll.MODE = 11; DataTable dt_Details = new DataTable(); dt_Details = BLL.get_payrolltrans(_obj_smhr_payroll); if (dt_Details.Rows.Count != 0) { rcmb_Perioddtls.DataSource = dt_Details; rcmb_Perioddtls.DataValueField = "PRDDTL_ID"; rcmb_Perioddtls.DataTextField = "PRDDTL_NAME"; rcmb_Perioddtls.DataBind(); rcmb_Perioddtls.Items.Insert(0, new RadComboBoxItem("Select")); } rcmb_Perioddtls.SelectedIndex = rcmb_Perioddtls.Items.FindItemIndexByValue(Convert.ToString(dt_Information.Rows[0]["ESIIMPORT_PERIDEMLEMENTID"])); if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2) { BLL.ShowMessage(this, "this User Type is Not Allowed to View and Download the Esi Information"); return; } Session["ESIInfo"] = dt_Information; ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "ShowESIInfo('" + Convert.ToString(rcmb_Busniessunit.SelectedItem.Text) + "','" + Convert.ToString(rcmb_Financialperiod.SelectedItem.Value) + "','" + Convert.ToString(rcmb_Perioddtls.SelectedItem.Text) + "');", true); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Esiexport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rcmbPeriod_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { if (rcmbBusinessUnit.SelectedIndex > 0) { if (rcmbPeriod.SelectedIndex > 0) { _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmbPeriod.SelectedValue); _obj_smhr_payroll.MODE = 28; dt_Details = BLL.get_payrolltrans(_obj_smhr_payroll); if (dt_Details.Rows.Count != 0) { rcmbPeriodElement.DataSource = dt_Details; rcmbPeriodElement.DataValueField = "PRDDTL_ID"; rcmbPeriodElement.DataTextField = "PRDDTL_NAME"; rcmbPeriodElement.DataBind(); rcmbPeriodElement.Items.Insert(0, new RadComboBoxItem("Select")); //chkList.Items.Clear(); //trStruct.Visible = false; } } else { rcmbPeriodElement.Items.Clear(); rcmbPeriodElement.Items.Insert(0, new RadComboBoxItem("", "")); //trStruct.Visible = false; } } else { rcmbPeriodElement.Items.Clear(); rcmbPeriodElement.Items.Insert(0, new RadComboBoxItem("", "")); rcmbPeriod.ClearSelection(); //chkList.Items.Clear(); //trStruct.Visible = false; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frmHoldPayrollProcess", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadGrid() { try { _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.OPERATION = operation.Check; _obj_smhr_payroll.MODE = 2; _obj_smhr_payroll.TRANID = Convert.ToInt32(Convert.ToString(Request.QueryString["ID"])); DataTable dt_Details = BLL.get_Payroll(_obj_smhr_payroll); RG_PayTran.DataSource = dt_Details; RG_PayTran.DataBind(); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_tranDetails", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rcb_Transaction_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) { try { if (rcb_Transaction.SelectedIndex > 0) { // To Close The Previously Opened window. ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "Close()", true); _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.MODE = 23; _obj_smhr_payroll.TRANID = Convert.ToInt32(rcb_Transaction.SelectedValue); DataTable dt = BLL.get_PayDetails(_obj_smhr_payroll); if (dt.Rows.Count != 0) { RG_Transaction.Visible = true; if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2) { btn_Rollback.Visible = false; } else { btn_Rollback.Visible = true; } RG_Transaction.DataSource = dt; RG_Transaction.DataBind(); } else { RG_Transaction.Visible = false; btn_Rollback.Visible = false; } } else { RG_Transaction.Visible = false; btn_Rollback.Visible = false; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Rollback", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
// ---------------------------------------------------------------------------------------- // Author: Dhanush InfoTech Pvt Ltd // Company: Dhanush InfoTech Pvt Ltd // Date: 7/22/2010 // Time: 16:34 // Procedure Name: ddl_Period_SelectedIndexChanged // Procedure Kind Description: Method // Purpose: Filling up Period Elements Drop down // ---------------------------------------------------------------------------------------- protected void ddl_Period_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { if ((ddl_BusinessUnit.SelectedIndex > 0) && (ddl_Period.SelectedIndex > 0)) { _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(ddl_Period.SelectedValue); _obj_smhr_payroll.MODE = 28; dt_Details = new DataTable(); dt_Details = BLL.get_payrolltrans(_obj_smhr_payroll); if (dt_Details.Rows.Count != 0) { ddl_PeriodElements.DataSource = dt_Details; ddl_PeriodElements.DataValueField = "PRDDTL_ID"; ddl_PeriodElements.DataTextField = "PRDDTL_NAME"; ddl_PeriodElements.DataBind(); ddl_PeriodElements.Items.Insert(0, new RadComboBoxItem("Select")); } } else { if (ddl_BusinessUnit.SelectedIndex <= 0) { ddl_Period.ClearSelection(); } if (ddl_Period.SelectedIndex <= 0) { ddl_PeriodElements.Items.Clear(); lbl_SalaryStruct.Visible = false; chkSalary_List.Visible = false; } } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PayrollTrans", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); BLL.ShowMessage(this, ex.ToString()); } }
protected void rcmb_AttPeriod_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { if (rcmb_AttPeriod.SelectedIndex > 0) { rcmb_AttPeriodElement.Items.Clear(); SMHR_PAYROLL _obj_smhr_payroll; _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_AttPeriod.SelectedValue); _obj_smhr_payroll.MODE = 28; DataTable dt_Details = BLL.get_payrolltrans(_obj_smhr_payroll); if (dt_Details.Rows.Count != 0) { rcmb_AttPeriodElement.DataSource = dt_Details; rcmb_AttPeriodElement.DataValueField = "PRDDTL_ID"; rcmb_AttPeriodElement.DataTextField = "PRDDTL_NAME"; rcmb_AttPeriodElement.DataBind(); rcmb_AttPeriodElement.Items.Insert(0, new RadComboBoxItem("Select")); tblr_AttPeriodElement.Visible = true; } else { } } else { BLL.ShowMessage(this, "Select Period!"); rcmb_AttPeriodElement.Items.Clear(); rcmb_AttPeriodElement.Items.Insert(0, new RadComboBoxItem("", "")); rg_Attendence.DataSource = null; rg_Attendence.DataBind(); rg_Attendence.Visible = false; return; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "EmpTransDetails", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); return; } }
protected void ddl_PeriodElements_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.MODE = 19; _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(ddl_PeriodElements.SelectedValue); DataTable dt_Details = BLL.get_Payroll(_obj_smhr_payroll); ddl_BusinessUnit.DataSource = dt_Details; ddl_BusinessUnit.DataValueField = "BUSINESSUNIT_ID"; ddl_BusinessUnit.DataTextField = "BUSINESSUNIT_CODE"; ddl_BusinessUnit.DataBind(); ddl_BusinessUnit.Items.Insert(0, new RadComboBoxItem("Select")); lbl_SalaryStruct.Visible = false; chkSalary_List.Visible = false; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Retropay", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadDetails() { try { _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.MODE = 15; _obj_smhr_payroll.EMP_ID = Convert.ToInt32(Convert.ToString(Request.QueryString["ID"])); DataTable dt = BLL.get_SalDetails(_obj_smhr_payroll); if (dt.Rows.Count != 0) { lbl_Code.Text = Convert.ToString(dt.Rows[0]["EMP_EMPCODE"]); lbl_Name.Text = Convert.ToString(dt.Rows[0]["EMPNAME"]); lbl_DOJ.Text = Convert.ToString(dt.Rows[0]["EMPDOJ"]); lbl_Position.Text = Convert.ToString(dt.Rows[0]["POSITIONS_CODE"]); lbl_BusUnit.Text = Convert.ToString(dt.Rows[0]["BUSINESSUNIT_CODE"]); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_SalDetails", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
public void loadPeriodElement() { try { SMHR_PAYROLL _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmbPeriod.SelectedValue); _obj_smhr_payroll.MODE = 28; DataTable dt_Details = BLL.get_payrolltrans(_obj_smhr_payroll); if (dt_Details.Rows.Count > 0) { rcmbPeriodElement.DataSource = dt_Details; rcmbPeriodElement.DataTextField = "PRDDTL_NAME"; rcmbPeriodElement.DataValueField = "PRDDTL_ID"; rcmbPeriodElement.DataBind(); rcmbPeriodElement.Items.Insert(0, new RadComboBoxItem("Select")); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_LeaveChart", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rdtp_OTDt_SelectedDateChanged(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e) { try { //if (rcmb_PeriodElement.SelectedIndex > 0) if (rdtp_OTDt.SelectedDate != null) { Rg_OTDetails.Enabled = true; Rg_OTDetails.Visible = true; SMHR_PAYROLL _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.BUID = Convert.ToInt32(rcmb_BUI.SelectedItem.Value); _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_PeriodElement.SelectedItem.Value); _obj_smhr_payroll.MODE = 10; DataTable dt = BLL.get_PayDetails(_obj_smhr_payroll); if (dt.Rows.Count == 0) { LoadGrid(); if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2) { btn_Process.Visible = false; } else { btn_Process.Visible = true; } Rg_OTDetails.Visible = true; //Rg_OTDetails.Visible = true; btn_Cancle.Visible = true; } else { Rg_OTDetails.Visible = true; btn_Process.Visible = false; Rg_OTDetails.Enabled = false; btn_Cancle.Visible = true; LoadGrid(); } ////TO CHECK WHETHER PAYROLL IS APPROVED OR NOT //_obj_smhr_payroll.BUID = Convert.ToInt32(rcmb_BUI.SelectedItem.Value); //_obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_PeriodElement.SelectedItem.Value); //_obj_smhr_payroll.PERODID = Convert.ToInt32(rcmb_PeriodMaster.SelectedItem.Value); //_obj_smhr_payroll.MODE = 32; //DataTable dt1 = BLL.get_PayDetails(_obj_smhr_payroll); //if (dt1.Rows.Count > 0) //{ // if (Convert.ToString(dt1.Rows[0]["COUNT"]) != "0") // { // btn_Process.Visible = false; // Rg_OTDetails.Enabled = false; // BLL.ShowMessage(this, "Payroll is Approved for this month."); // return; // } //} } else { Rg_OTDetails.Visible = false; btn_Process.Visible = false; btn_Cancle.Visible = false; //BLL.ShowMessage(this, "Select A Period"); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_overtimecalc", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Paytran_Click(object sender, EventArgs e) { try { StringBuilder strPayroll = new StringBuilder(); string str; for (int index = 0; index <= chkSalary_List.Items.Count - 1; index++) { if (chkSalary_List.Items[index].Selected) { if (Convert.ToString(strPayroll) != string.Empty) { str = ",''" + chkSalary_List.Items[index].Value + "''"; strPayroll.Append(str); } else { str = "''" + chkSalary_List.Items[index].Value + "''"; strPayroll.Append(str); } } } if (Convert.ToString(strPayroll) == string.Empty) { BLL.ShowMessage(this, "Please Choose Salary Structure"); return; } _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(ddl_PeriodElements.SelectedValue); _obj_smhr_payroll.MODE = 6; _obj_smhr_payroll.EMP_SALSTRUCT = Convert.ToString(strPayroll); DataTable dt_Details = BLL.get_payrolltrans(_obj_smhr_payroll); if (dt_Details.Rows.Count != 0) { BLL.ShowMessage(this, "Payroll Already done for this Period"); return; } else { _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(ddl_PeriodElements.SelectedValue); _obj_smhr_payroll.MODE = 7; _obj_smhr_payroll.EMP_SALSTRUCT = Convert.ToString(strPayroll); dt_Details = BLL.get_payrolltrans(_obj_smhr_payroll); if (dt_Details.Rows.Count != 0) { BLL.ShowMessage(this, "Payroll Already done for this Period"); return; } } bool status = false; int procstatus = 0; try { StringBuilder strPay = new StringBuilder(); string str1 = null; _obj_smhr_payroll.MODE = 8; DataTable dt = BLL.get_payrolltrans(_obj_smhr_payroll); if (dt.Rows.Count != 0) { for (int i = 0; i <= dt.Rows.Count - 1; i++) { if (string.IsNullOrEmpty(Convert.ToString(strPay)) && string.IsNullOrEmpty(str1)) { str1 = Convert.ToString(dt.Rows[0][3]); strPay.Append(str1); } else { str1 = "," + Convert.ToString(dt.Rows[0][3]); strPay.Append(str1); } } } else { BLL.ShowMessage(this, "Approval Process Not set Properly."); return; } _obj_smhr_employee = new SMHR_EMPLOYEE(); _obj_smhr_employee.EMPSALDTLS_PERIOD_ID = Convert.ToInt32(ddl_Period.SelectedValue); _obj_smhr_employee.EMPSALDTLS_PRDDTL_ID = Convert.ToInt32(ddl_PeriodElements.SelectedValue); _obj_smhr_employee.EMPSALDTLS_STR = Convert.ToString(strPay); if (Convert.ToString(strPayroll) != string.Empty) { _obj_smhr_employee.EMPSALDTLS_STRUCT = Convert.ToString(strPayroll); } else { _obj_smhr_employee.EMPSALDTLS_STRUCT = string.Empty; } _obj_smhr_employee.EMPSALDTLS_ID = Convert.ToInt32(Session["USER_ID"]); _obj_smhr_employee.EMPSALDTLS_DATE = DateTime.Now; status = BLL.set_payrolltrans(_obj_smhr_employee, "KENYA"); if (status == true) { procstatus = 2; } } catch (Exception ex) { if (ex.Message == "NO EMPLOYEES TO RUN PAYROLL") { procstatus = 1; } //status = false; } if (procstatus == 2) { BLL.ShowMessage(this, "Payroll Process sent for Approval"); clearFields(); return; } else { if (procstatus == 1) { BLL.ShowMessage(this, "No employees to process"); return; } else { BLL.ShowMessage(this, "Error occured while performing the process"); return; } } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Retropay", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> ///IN THIS BASED ON Project_ID(COMMANDARGUMENT) ALL DATA WILL BE TAKEN TO DATATABLE THEN WE CAN BIND TO INDIVIDUAL FIELDS /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void lnk_DOWNLOAD_Command(object sender, CommandEventArgs e) { try { LoadCombos(); SMHR_ESIIMPORT _obj_SMHR_ESIIMPORT = new SMHR_ESIIMPORT(); _obj_SMHR_ESIIMPORT.Mode = 2; _obj_SMHR_ESIIMPORT.ESIIMPORT_ID = Convert.ToInt32(Convert.ToString(e.CommandArgument)); DataTable DT = BLL.get_ESIimport(_obj_SMHR_ESIIMPORT); if (DT.Rows.Count != 0) { rcmb_BUI.SelectedIndex = rcmb_BUI.Items.FindItemIndexByValue(Convert.ToString(DT.Rows[0]["ESIIMPORT_BUID"])); RCM_FINANCIALPERIOD.SelectedIndex = RCM_FINANCIALPERIOD.Items.FindItemIndexByValue(Convert.ToString(DT.Rows[0]["ESIIMPORT_FINANCIAL_PERIOD"])); SMHR_PAYROLL _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(RCM_FINANCIALPERIOD.SelectedValue); _obj_smhr_payroll.MODE = 11; DataTable dt_Details = new DataTable(); dt_Details = BLL.get_payrolltrans(_obj_smhr_payroll); if (dt_Details.Rows.Count != 0) { rcm_fin_elem.DataSource = dt_Details; rcm_fin_elem.DataValueField = "PRDDTL_ID"; rcm_fin_elem.DataTextField = "PRDDTL_NAME"; rcm_fin_elem.DataBind(); rcm_fin_elem.Items.Insert(0, new RadComboBoxItem("Select")); } rcm_fin_elem.SelectedIndex = rcm_fin_elem.Items.FindItemIndexByValue(Convert.ToString(DT.Rows[0]["ESIIMPORT_PERIDEMLEMENTID"])); rg_importchild.DataSource = DT; rg_importchild.DataBind(); for (int i = 0; i < rg_importchild.Items.Count; i++) { Label LBLAMOUNT; LBLAMOUNT = rg_importchild.Items[i].FindControl("lbl_IMPORTCHILD_TOTALAMOUNT") as Label; Label LBLREASONCODE; LBLREASONCODE = rg_importchild.Items[i].FindControl("lbl_IMPORTCHILD_reasoncode") as Label; if (LBLAMOUNT.Text == "0") { LBLREASONCODE.Text = "1"; } else { LBLREASONCODE.Text = "0"; } } rcm_fin_elem.Enabled = false; RCM_FINANCIALPERIOD.Enabled = false; btn_Save.Visible = false; lbl_esiimport.Visible = false; lbl_det.Visible = true; rcmb_BUI.Enabled = false; Rm_ESIIMPORT_PAGE.SelectedIndex = 1; if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2) { BTN_DOWNLOAD.Visible = false; } else { BTN_DOWNLOAD.Visible = true; } } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_esiimport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rcmb_PeriodStatus_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { Rg_PayReults.Visible = false; rcb_Transaction.Items.Clear(); rcb_Transaction.Text = string.Empty; rcb_Transaction.Items.Insert(0, new RadComboBoxItem("", "")); lnk.Visible = false; lnk_Approved.Visible = false; //added for link to Payroll Reports. By Anirudh //if (rcmb_PeriodStatus.SelectedIndex > 0) //{ // if ((rcmb_PeriodStatus.SelectedItem.Text).ToUpper() == "PENDING") // { // if ((rcmb_BUI.SelectedIndex > 0) && (rcmb_PeriodMaster.SelectedIndex > 0) && (rcmb_PeriodElement.SelectedIndex > 0)) // { // lnk.Visible = true; // lnk_Approved.Visible = false; // } // else // { // lnk.Visible = false; // lnk_Approved.Visible = false; // } // } // else if ((rcmb_PeriodStatus.SelectedItem.Text).ToUpper() == "APPROVED") // { // if ((rcmb_BUI.SelectedIndex > 0) && (rcmb_PeriodMaster.SelectedIndex > 0) && (rcmb_PeriodElement.SelectedIndex > 0)) // { // lnk.Visible = false; // lnk_Approved.Visible = true; // } // else // { // lnk.Visible = false; // lnk_Approved.Visible = false; // } // } // else // { // lnk.Visible = false; // lnk_Approved.Visible = false; // } //} //if(rcmb_PeriodStatus.SelectedIndex==0) //{ // lnk.Visible=false; // lnk_Approved.Visible=false; //} ///////////////////////// if (rcmb_PeriodStatus.SelectedIndex != 0) { if ((rcmb_BUI.SelectedIndex > 0) && (rcmb_PeriodMaster.SelectedIndex > 0) && (rcmb_PeriodElement.SelectedIndex > 0)) { if (rcmb_PeriodStatus.SelectedItem.Value == Convert.ToString(1)) //Approved { rcb_Transaction.Items.Clear(); _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.MODE = 30; _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_PeriodElement.SelectedItem.Value); _obj_smhr_payroll.BUID = Convert.ToInt32(rcmb_BUI.SelectedItem.Value); DataTable dt = BLL.get_PayDetails(_obj_smhr_payroll); if (dt.Rows.Count != 0) { rcb_Transaction.Items.Clear(); rcb_Transaction.DataSource = dt; rcb_Transaction.DataTextField = "PAYTRAN_NAME"; rcb_Transaction.DataValueField = "PAYTRAN_ID"; rcb_Transaction.DataBind(); rcb_Transaction.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select")); } } else if ((rcmb_PeriodStatus.SelectedItem.Value == Convert.ToString(2))) //Rejected { rcb_Transaction.Items.Clear(); _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.MODE = 31; _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_PeriodElement.SelectedItem.Value); _obj_smhr_payroll.BUID = Convert.ToInt32(rcmb_BUI.SelectedItem.Value); DataTable dt = BLL.get_PayDetails(_obj_smhr_payroll); if (dt.Rows.Count != 0) { rcb_Transaction.Items.Clear(); rcb_Transaction.DataSource = dt; rcb_Transaction.DataTextField = "PAYTRAN_NAME"; rcb_Transaction.DataValueField = "PAYTRAN_ID"; rcb_Transaction.DataBind(); rcb_Transaction.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select")); } } else //Pending { rcb_Transaction.Items.Clear(); _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.MODE = 22; _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_PeriodElement.SelectedItem.Value); _obj_smhr_payroll.BUID = Convert.ToInt32(rcmb_BUI.SelectedItem.Value); DataTable dt = BLL.get_PayDetails(_obj_smhr_payroll); if (dt.Rows.Count != 0) { //_obj_smhr_payroll = new SMHR_PAYROLL(); //_obj_smhr_payroll.MODE = 22; //_obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_PeriodElement.SelectedItem.Value); //_obj_smhr_payroll.BUID = Convert.ToInt32(rcmb_businessunit.SelectedItem.Value); //DataTable dt = BLL.get_PayDetails(_obj_smhr_payroll); rcb_Transaction.Items.Clear(); rcb_Transaction.DataSource = dt; rcb_Transaction.DataTextField = "TEMP_PAYTRAN_NAME"; rcb_Transaction.DataValueField = "TEMP_PAYTRAN_ID"; rcb_Transaction.DataBind(); rcb_Transaction.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select")); //RG_Transaction.Visible = false; //btn_Rollback.Visible = false; } else { //RG_Transaction.Visible = false; //btn_Rollback.Visible = false; } } } else { BLL.ShowMessage(this, "Select All Paramaters."); return; } } else { rcb_Transaction.Items.Clear(); rcb_Transaction.Items.Insert(0, new RadComboBoxItem("", "")); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Payresults", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void RCM_FINANCIALPERIOD_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { if (rcmb_BUI.SelectedItem.Text != "Select") { if (RCM_FINANCIALPERIOD.SelectedItem.Text != "Select") { SMHR_PAYROLL _obj_smhr_payroll = new SMHR_PAYROLL(); if (RCM_FINANCIALPERIOD.SelectedItem.Value != "") { _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(RCM_FINANCIALPERIOD.SelectedValue); } else { _obj_smhr_payroll.PERIODDTLID = 0; } _obj_smhr_payroll.MODE = 11; DataTable dt_Details = new DataTable(); dt_Details = BLL.get_payrolltrans(_obj_smhr_payroll); if (dt_Details.Rows.Count != 0) { rcm_fin_elem.DataSource = dt_Details; rcm_fin_elem.DataValueField = "PRDDTL_ID"; rcm_fin_elem.DataTextField = "PRDDTL_NAME"; rcm_fin_elem.DataBind(); rcm_fin_elem.Items.Insert(0, new RadComboBoxItem("Select")); } else { DataTable dt_Details2 = new DataTable(); rcm_fin_elem.DataSource = dt_Details2; rcm_fin_elem.DataBind(); rcm_fin_elem.Items.Insert(0, new RadComboBoxItem("Select")); } finelem_id.Visible = true; rg_importchild.Visible = false; BTN_DOWNLOAD.Visible = false; } else { BLL.ShowMessage(this, "Select Financial Period"); finelem_id.Visible = false; rg_importchild.Visible = false; BTN_DOWNLOAD.Visible = false; return; } } else { BLL.ShowMessage(this, "Select Business Unit"); RCM_FINANCIALPERIOD.SelectedIndex = 0; return; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_esiimport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Reject_Click1(object sender, EventArgs e) { try { bool status1 = false; // changed by sridevi on (24/02/2011) //status1 = chkAuthority(); status1 = true; if (status1 == true) { int i = 0; CheckBox chkBox = new CheckBox(); string str = null; Label lblID = new Label(); for (int index = 0; index <= RG_PayTran.Items.Count - 1; index++) { chkBox = RG_PayTran.Items[index].FindControl("chk_Choose") as CheckBox; lblID = RG_PayTran.Items[index].FindControl("lblID") as Label; if (chkBox.Checked) { if (str == null) { str = "''" + lblID.Text + "''"; } else { str = str + ",''" + lblID.Text + "''"; } } } if (str != null && str != "") { bool status = false; _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.TRANID = Convert.ToInt32(rcb_Paytran.SelectedItem.Value); _obj_smhr_payroll.EMPDATA = Convert.ToString(str); _obj_smhr_payroll.MODE = 1; _obj_smhr_payroll.LASTMDFBY = Convert.ToInt32(Session["USER_ID"]); _obj_smhr_payroll.LASTMDFDATE = DateTime.Now; _obj_smhr_payroll.PERODID = Convert.ToInt32(rcb_PeriodElements.SelectedValue); status = BLL.set_PayrollReject(_obj_smhr_payroll); if (status == true) { if (RG_PayTran.Items.Count != 0) { BLL.ShowMessage(this, "Payroll rejection Process Successfully done for the selected employee(s)"); LoadGrid(); return; } else { BLL.ShowMessage(this, "Payroll rejection Process successfully done"); btn_Approve.Visible = false; btn_Reject.Visible = false; chk_CheckAll.Visible = false; chk_CheckAll.Checked = false; LoadGrid(); rcb_Paytran.Items.Clear(); rcb_PeriodElements.Items.Clear(); rcb_Period.SelectedIndex = -1; return; } } } else { BLL.ShowMessage(this, "Please Select the Employees for Rejection"); return; } } else { BLL.ShowMessage(this, "You are not authorized for rejection"); btn_Approve.Enabled = false; btn_Reject.Enabled = false; RG_PayTran.Visible = false; return; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PayrollApproval", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); return; } }
private void LoadSaldtlsold() { try { DataTable dt = new DataTable(); if (rcmb_PeriodStatus.SelectedIndex != 0) { _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.BUID = Convert.ToInt32(rcmb_BUI.SelectedItem.Value); _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_PeriodElement.SelectedItem.Value); if (rcmb_PeriodStatus.SelectedItem.Value == Convert.ToString(1)) //Approved { _obj_smhr_payroll.MODE = 10; dt = BLL.get_PayDetails(_obj_smhr_payroll); if (dt.Rows.Count != 0) { Rg_PayReults.DataSource = dt; Rg_PayReults.DataBind(); } else { _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.BUID = Convert.ToInt32(rcmb_BUI.SelectedItem.Value); _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_PeriodElement.SelectedItem.Value); _obj_smhr_payroll.MODE = 25; DataTable dt_1 = BLL.get_PayDetails(_obj_smhr_payroll); if (dt_1.Rows.Count != 0) { Rg_PayReults.DataSource = dt_1; Rg_PayReults.DataBind(); } else { dt.Rows.Clear(); Rg_PayReults.DataSource = dt; Rg_PayReults.DataBind(); } } } else if ((rcmb_PeriodStatus.SelectedItem.Value == Convert.ToString(2))) //Rejected { _obj_smhr_payroll.MODE = 12; dt = BLL.get_PayDetails(_obj_smhr_payroll); if (dt.Rows.Count != 0) { Rg_PayReults.DataSource = dt; Rg_PayReults.DataBind(); } else { dt.Rows.Clear(); Rg_PayReults.DataSource = dt; Rg_PayReults.DataBind(); } } else //Pending { _obj_smhr_payroll.MODE = 13; dt = BLL.get_PayDetails(_obj_smhr_payroll); if (dt.Rows.Count != 0) { Rg_PayReults.DataSource = dt; Rg_PayReults.DataBind(); } else { dt.Rows.Clear(); Rg_PayReults.DataSource = dt; Rg_PayReults.DataBind(); } } Rg_PayReults.Visible = true; } else { dt.Rows.Clear(); Rg_PayReults.DataSource = dt; Rg_PayReults.DataBind(); } foreach (GridDataItem dataItem in Rg_PayReults.MasterTableView.Items) { if (dataItem["SALARY"].Text.StartsWith("-")) { dataItem.BackColor = System.Drawing.Color.Red; dataItem.ForeColor = System.Drawing.Color.White; dataItem.ToolTip = "Note: Negative salary for this Employee"; } } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Payresults", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadData() { try { _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(Convert.ToString(Request.QueryString["PDID"])); if (Convert.ToString(Request.QueryString["Status"]).ToUpper() == "APPROVED") { _obj_smhr_payroll.MODE = 14; _obj_smhr_payroll.STATUS = 1; _obj_smhr_payroll.EMP_ID = Convert.ToInt32(Convert.ToString(Request.QueryString["ID"])); _obj_smhr_payroll.TRANID = Convert.ToInt32(Convert.ToString(Request.QueryString["Trid"])); DataTable dt = BLL.get_SalDetails(_obj_smhr_payroll); //COMMENTED ON 09.12.2013 ////if (dt.Rows.Count > 0) ////{ //// if (Convert.ToInt32(dt.Rows[0]["LOCALISATION"]) == 1) //// { //// if (Convert.ToString(dt.Rows[0]["FLAG"]) == "Y") //// { //// double netpay_bu = 0.0; //// for (int index = 0; index < dt.Rows.Count; index++) //// { //// if (Convert.ToBoolean(dt.Rows[index]["PAYITEM_ISBENEFITABLE"]) == false) //// netpay_bu += Convert.ToDouble(dt.Rows[index]["NETAMT"]); //// } //// lbl_BU_Amount.Text = "Net Salary in " + Convert.ToString(dt.Rows[0]["BU_CURRCODE"]) + " : " + netpay_bu; //// lbl_BU_Amount.Visible = true; //// } //// else //// lbl_BU_Amount.Visible = false; //// } //// else //// { //// lbl_Amount.Text = "Net Salary : " + Convert.ToString(Request.QueryString["sal"]); //// lbl_BU_Amount.Visible = false; //// } //// lbl_Amount.Text = "Net Salary in " + Convert.ToString(dt.Rows[0]["EMP_CURRCODE"]) + " : " + Convert.ToString(Request.QueryString["sal"]); ////} ////else //// lbl_Amount.Text = "Net Salary : " + Convert.ToString(Request.QueryString["sal"]); dt_income = dt.Clone(); dt_deductions = dt.Clone(); if (dt.Rows.Count != 0) { dv_Income = dt.DefaultView; dv_Income.RowFilter = "HR_MASTER_CODE='Income' AND PAYITEM_ISBENEFITABLE='False'"; //dv_Income.RowFilter = "HR_MASTER_CODE IN ('Income','Employer') AND PAYITEM_ISBENEFITABLE='False'"; dt_income = dv_Income.ToTable(); dv_Deductions = dt.DefaultView; dv_Deductions.RowFilter = "HR_MASTER_CODE='Deductions' AND PAYITEM_ISBENEFITABLE='False'"; dt_deductions = dv_Deductions.ToTable(); dv_Benefitable = dt.DefaultView; dv_Benefitable.RowFilter = "PAYITEM_ISBENEFITABLE='True'"; dt_Benefitable = dv_Benefitable.ToTable(); if (dt_income.Rows.Count > 0) { RG_SalDetails.DataSource = dt_income; RG_SalDetails.DataBind(); } else { Income.Visible = false; Incomegrid.Visible = false; } if (dt_deductions.Rows.Count > 0) { Rg_Deductions.DataSource = dt_deductions; Rg_Deductions.DataBind(); } else { Deductions.Visible = false; Deductionsgrid.Visible = false; } if (dt_Benefitable.Rows.Count > 0) { Rg_Benefitable.DataSource = dt_Benefitable; Rg_Benefitable.DataBind(); } else { Benefitable.Visible = false; Benefitable.Visible = false; } } else { _obj_smhr_payroll.MODE = 21; _obj_smhr_payroll.STATUS = 1; _obj_smhr_payroll.EMP_ID = Convert.ToInt32(Convert.ToString(Request.QueryString["ID"])); _obj_smhr_payroll.TRANID = Convert.ToInt32(Convert.ToString(Request.QueryString["Trid"])); DataTable dt1 = BLL.get_SalDetails(_obj_smhr_payroll); if (dt1.Rows.Count != 0) { dv_Income = dt1.DefaultView; dv_Income.RowFilter = "HR_MASTER_CODE='Income' AND PAYITEM_ISBENEFITABLE='False'"; dt_income = dv_Income.ToTable(); dv_Deductions = dt1.DefaultView; dv_Deductions.RowFilter = "HR_MASTER_CODE='Deductions' AND PAYITEM_ISBENEFITABLE='False'"; dt_deductions = dv_Deductions.ToTable(); dv_Benefitable = dt1.DefaultView; dv_Benefitable.RowFilter = "PAYITEM_ISBENEFITABLE='True'"; dt_Benefitable = dv_Benefitable.ToTable(); if (dt_income.Rows.Count > 0) { RG_SalDetails.DataSource = dt_income; RG_SalDetails.DataBind(); } else { Income.Visible = false; Incomegrid.Visible = false; } if (dt_deductions.Rows.Count > 0) { Rg_Deductions.DataSource = dt_deductions; Rg_Deductions.DataBind(); } else { Deductions.Visible = false; Deductionsgrid.Visible = false; } if (dt_Benefitable.Rows.Count > 0) { Rg_Benefitable.DataSource = dt_Benefitable; Rg_Benefitable.DataBind(); } else { Benefitable.Visible = false; Benefitable.Visible = false; } } } } else if (Convert.ToString(Request.QueryString["Status"]).ToUpper() == "PENDING") { _obj_smhr_payroll.MODE = 14; _obj_smhr_payroll.STATUS = 0; _obj_smhr_payroll.EMP_ID = Convert.ToInt32(Convert.ToString(Request.QueryString["ID"])); _obj_smhr_payroll.TRANID = Convert.ToInt32(Convert.ToString(Request.QueryString["Trid"])); DataTable dt = BLL.get_SalDetails(_obj_smhr_payroll); ////if (dt.Rows.Count > 0) ////{ //// if (Convert.ToInt32(dt.Rows[0]["LOCALISATION"]) == 1) //// { //// if (Convert.ToString(dt.Rows[0]["FLAG"]) == "Y") //// { //// double netpay_bu = 0.0; //// for (int index = 0; index < dt.Rows.Count; index++) //// { //// if (Convert.ToBoolean(dt.Rows[index]["PAYITEM_ISBENEFITABLE"]) == false) //// netpay_bu += Convert.ToDouble(dt.Rows[index]["NETAMT"]); //// } //// lbl_BU_Amount.Text = "Net Salary in " + Convert.ToString(dt.Rows[0]["BU_CURRCODE"]) + " : " + netpay_bu; //// lbl_BU_Amount.Visible = true; //// } //// else //// lbl_BU_Amount.Visible = false; //// } //// else //// { //// lbl_Amount.Text = "Net Salary : " + Convert.ToString(Request.QueryString["sal"]); //// lbl_BU_Amount.Visible = false; //// } //// lbl_Amount.Text = "Net Salary in " + Convert.ToString(dt.Rows[0]["EMP_CURRCODE"]) + " : " + Convert.ToString(Request.QueryString["sal"]); ////} ////else //// lbl_Amount.Text = "Net Salary : " + Convert.ToString(Request.QueryString["sal"]); dt_income = dt.Clone(); dt_deductions = dt.Clone(); if (dt.Rows.Count != 0) { dv_Income = dt.DefaultView; dv_Income.RowFilter = "HR_MASTER_CODE='Income' AND PAYITEM_ISBENEFITABLE='False'"; //dv_Income.RowFilter = "HR_MASTER_CODE IN ('Income','Employer') AND PAYITEM_ISBENEFITABLE='False'"; //dv_Income. = "PAYITEM_ISBENEFITABLE='False'"; dt_income = dv_Income.ToTable(); dv_Deductions = dt.DefaultView; dv_Deductions.RowFilter = "HR_MASTER_CODE='Deductions' AND PAYITEM_ISBENEFITABLE='False'"; dt_deductions = dv_Deductions.ToTable(); dv_Benefitable = dt.DefaultView; dv_Benefitable.RowFilter = "PAYITEM_ISBENEFITABLE='True' "; dt_Benefitable = dv_Benefitable.ToTable(); if (dt_income.Rows.Count > 0) { RG_SalDetails.DataSource = dt_income; RG_SalDetails.DataBind(); } else { Income.Visible = false; Incomegrid.Visible = false; } if (dt_deductions.Rows.Count > 0) { Rg_Deductions.DataSource = dt_deductions; Rg_Deductions.DataBind(); } else { Deductions.Visible = false; Deductionsgrid.Visible = false; } if (dt_Benefitable.Rows.Count > 0) { Rg_Benefitable.DataSource = dt_Benefitable; Rg_Benefitable.DataBind(); } else { Benefitable.Visible = false; Benefitable.Visible = false; } } } else { _obj_smhr_payroll.MODE = 24; _obj_smhr_payroll.STATUS = 2; _obj_smhr_payroll.EMP_ID = Convert.ToInt32(Convert.ToString(Request.QueryString["ID"])); _obj_smhr_payroll.TRANID = Convert.ToInt32(Convert.ToString(Request.QueryString["Trid"])); DataTable dt = BLL.get_SalDetails(_obj_smhr_payroll); ////if (dt.Rows.Count > 0) ////{ //// if (Convert.ToInt32(dt.Rows[0]["LOCALISATION"]) == 1) //// { //// if (Convert.ToString(dt.Rows[0]["FLAG"]) == "Y") //// { //// double netpay_bu = 0.0; //// for (int index = 0; index < dt.Rows.Count; index++) //// { //// if (Convert.ToBoolean(dt.Rows[index]["PAYITEM_ISBENEFITABLE"]) == false) //// netpay_bu += Convert.ToDouble(dt.Rows[index]["NETAMT"]); //// } //// lbl_BU_Amount.Text = "Net Salary in " + Convert.ToString(dt.Rows[0]["BU_CURRCODE"]) + " : " + netpay_bu; //// lbl_BU_Amount.Visible = true; //// } //// else //// lbl_BU_Amount.Visible = false; //// } //// else //// { //// lbl_Amount.Text = "Net Salary : " + Convert.ToString(Request.QueryString["sal"]); //// lbl_BU_Amount.Visible = false; //// } //// lbl_Amount.Text = "Net Salary in " + Convert.ToString(dt.Rows[0]["EMP_CURRCODE"]) + " : " + Convert.ToString(Request.QueryString["sal"]); ////} ////else //// lbl_Amount.Text = "Net Salary : " + Convert.ToString(Request.QueryString["sal"]); dt_income = dt.Clone(); dt_deductions = dt.Clone(); if (dt.Rows.Count != 0) { dv_Income = dt.DefaultView; dv_Income.RowFilter = "HR_MASTER_CODE='Income' AND PAYITEM_ISBENEFITABLE='False'"; //dv_Income. = "PAYITEM_ISBENEFITABLE='False'"; dt_income = dv_Income.ToTable(); dv_Deductions = dt.DefaultView; dv_Deductions.RowFilter = "HR_MASTER_CODE='Deductions' AND PAYITEM_ISBENEFITABLE='False'"; dt_deductions = dv_Deductions.ToTable(); dv_Benefitable = dt.DefaultView; dv_Benefitable.RowFilter = "PAYITEM_ISBENEFITABLE='True' "; dt_Benefitable = dv_Benefitable.ToTable(); if (dt_income.Rows.Count > 0) { RG_SalDetails.DataSource = dt_income; RG_SalDetails.DataBind(); } else { Income.Visible = false; Incomegrid.Visible = false; } if (dt_deductions.Rows.Count > 0) { Rg_Deductions.DataSource = dt_deductions; Rg_Deductions.DataBind(); } else { Deductions.Visible = false; Deductionsgrid.Visible = false; } if (dt_Benefitable.Rows.Count > 0) { Rg_Benefitable.DataSource = dt_Benefitable; Rg_Benefitable.DataBind(); } else { Benefitable.Visible = false; Benefitable.Visible = false; } } } if (Request.QueryString["sal"] != null) { lbl_Amount.Text = "Net Salary : " + Convert.ToString(Request.QueryString["sal"]); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_SalDetails", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
/// <summary> /// This Region will consists of methods which will perform some action when ever a button clicked /// </summary> protected void btn_Runpayroll_Click(object sender, EventArgs e) { try { if ((rcmb_Financialperiod.SelectedIndex > 0) && (rcmb_Businessunit.SelectedIndex > 0) && (rcmb_Period.SelectedIndex > 0)) { StringBuilder strPayroll = new StringBuilder(); string strchecksalstructs; for (int index = 0; index <= chklst_Salarystruct.Items.Count - 1; index++) { if (chklst_Salarystruct.Items[index].Selected) { if (Convert.ToString(strPayroll) != string.Empty) { strchecksalstructs = ",''" + chklst_Salarystruct.Items[index].Value + "''"; strPayroll.Append(strchecksalstructs); } else { strchecksalstructs = "''" + chklst_Salarystruct.Items[index].Value + "''"; strPayroll.Append(strchecksalstructs); } } } if (Convert.ToString(strPayroll) == string.Empty) { BLL.ShowMessage(this, "Please Choose Salary Structure"); return; } _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_Period.SelectedValue); _obj_smhr_payroll.MODE = 7; _obj_smhr_payroll.EMP_SALSTRUCT = Convert.ToString(strPayroll); _obj_smhr_payroll.BUID = Convert.ToInt32(rcmb_Businessunit.SelectedValue); dt_Details = BLL.get_payrolltrans(_obj_smhr_payroll); if (dt_Details.Rows.Count != 0) { _obj_smhr_employee.OPERATION = operation.CHKPAYAPP; _obj_smhr_employee.EMPSALDTLS_STR = Convert.ToString(strPayroll); _obj_smhr_employee.EMP_BUSINESSUNIT_ID = Convert.ToInt32(rcmb_Businessunit.SelectedValue); _obj_smhr_employee.EMPSALDTLS_PRDDTL_ID = Convert.ToInt32(rcmb_Period.SelectedValue); DataTable dtChkPayApp = BLL.get_Employee(_obj_smhr_employee); if (dtChkPayApp.Rows.Count > 0) { _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_Period.SelectedValue); _obj_smhr_payroll.MODE = 6; _obj_smhr_payroll.EMP_SALSTRUCT = Convert.ToString(strPayroll); _obj_smhr_payroll.BUID = Convert.ToInt32(rcmb_Businessunit.SelectedValue); dt_Details = BLL.get_payrolltrans(_obj_smhr_payroll); if (dt_Details.Rows.Count != 0) { _obj_smhr_employee = new SMHR_EMPLOYEE(); _obj_smhr_employee.OPERATION = operation.CHKPAY2; _obj_smhr_employee.EMPSALDTLS_STR = Convert.ToString(strPayroll); _obj_smhr_employee.EMP_BUSINESSUNIT_ID = Convert.ToInt32(rcmb_Businessunit.SelectedValue); _obj_smhr_employee.EMPSALDTLS_PRDDTL_ID = Convert.ToInt32(rcmb_Period.SelectedValue); DataTable dtChkPay = BLL.get_Employee(_obj_smhr_employee); if (dtChkPay.Rows.Count > 0) { } else { BLL.ShowMessage(this, "Payroll Already done for this Period"); return; } } else { } } else { BLL.ShowMessage(this, "Payroll Already done for this Period"); return; } } else { _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_Period.SelectedValue); _obj_smhr_payroll.MODE = 6; _obj_smhr_payroll.EMP_SALSTRUCT = Convert.ToString(strPayroll); _obj_smhr_payroll.BUID = Convert.ToInt32(rcmb_Businessunit.SelectedValue); dt_Details = BLL.get_payrolltrans(_obj_smhr_payroll); if (dt_Details.Rows.Count != 0) { _obj_smhr_employee = new SMHR_EMPLOYEE(); _obj_smhr_employee.OPERATION = operation.CHKPAY; _obj_smhr_employee.EMPSALDTLS_STR = Convert.ToString(strPayroll); _obj_smhr_employee.EMP_BUSINESSUNIT_ID = Convert.ToInt32(rcmb_Businessunit.SelectedValue); _obj_smhr_employee.EMPSALDTLS_PRDDTL_ID = Convert.ToInt32(rcmb_Period.SelectedValue); DataTable dtChkPay = BLL.get_Employee(_obj_smhr_employee); if (dtChkPay.Rows.Count > 0) { } else { BLL.ShowMessage(this, "Payroll Already done for this Period"); return; } } else { } } bool status = false; int procstatus = 0; try { StringBuilder strPay = new StringBuilder(); string str1 = null; _obj_smhr_payroll.MODE = 8; _obj_smhr_payroll.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt = BLL.get_payrolltrans(_obj_smhr_payroll); if (dt.Rows.Count != 0) { for (int i = 0; i <= dt.Rows.Count - 1; i++) { if (string.IsNullOrEmpty(Convert.ToString(strPay)) && string.IsNullOrEmpty(str1)) { str1 = Convert.ToString(dt.Rows[i][0]); strPay.Append(str1); } else { str1 = "," + Convert.ToString(dt.Rows[i][0]); strPay.Append(str1); } } } else { //BLL.ShowMessage(this, "Approval Process Not set Properly."); //return; } _obj_smhr_employee = new SMHR_EMPLOYEE(); _obj_smhr_employee.EMPSALDTLS_PERIOD_ID = Convert.ToInt32(rcmb_Financialperiod.SelectedValue); _obj_smhr_employee.EMPSALDTLS_PRDDTL_ID = Convert.ToInt32(rcmb_Period.SelectedValue); _obj_smhr_employee.EMPSALDTLS_STR = Convert.ToString(strPay); if (Convert.ToString(strPayroll) != string.Empty) { _obj_smhr_employee.EMPSALDTLS_STRUCT = Convert.ToString(strPayroll); } else { _obj_smhr_employee.EMPSALDTLS_STRUCT = string.Empty; } _obj_smhr_employee.EMPSALDTLS_ID = Convert.ToInt32(Session["USER_ID"]); _obj_smhr_employee.EMPSALDTLS_DATE = DateTime.Now; _obj_smhr_employee.EMP_BUSINESSUNIT_ID = Convert.ToInt32(rcmb_Businessunit.SelectedValue); _obj_smhr_employee.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt_Local = BLL.ExecuteQuery("SELECT BUSINESSUNIT_LOCALISATION,HR_MASTER_CODE FROM SMHR_BUSINESSUNIT " + " JOIN SMHR_HR_MASTER ON " + " BUSINESSUNIT_LOCALISATION = HR_MASTER_ID WHERE BUSINESSUNIT_ID = '" + Convert.ToInt32(rcmb_Businessunit.SelectedValue) + "'"); _obj_smhr_employee.CREATEDBY = Convert.ToInt32(Session["USER_ID"]); if (dt_Local.Rows.Count > 0) { status = BLL.set_payrolltrans(_obj_smhr_employee, Convert.ToString(dt_Local.Rows[0]["HR_MASTER_CODE"])); } else { BLL.ShowMessage(this, "Localisation is Not Defined for Selected business Unit"); return; } if (status == true) { procstatus = 2; } } catch (Exception ex) { if (ex.Message == "NO EMPLOYEES TO RUN PAYROLL") { procstatus = 1; } else if (ex.Message == "NOATTENDS") { procstatus = 3; } else if (ex.Message == "NOMAPPING") { procstatus = 4; } else if (ex.Message == "ALREADYEXIST") { procstatus = 5; } //status = false; } if (procstatus == 2) { BLL.ShowMessage(this, "Payroll Process sent for Approval"); DisableControls(); LoadGrid(); //EnableControls(); //ClearingControls(); return; } else { if (procstatus == 1) { BLL.ShowMessage(this, "No employees to process"); return; } else if (procstatus == 3) { BLL.ShowMessage(this, "Attendance is not defined for this period."); return; } else if (procstatus == 4) { BLL.ShowMessage(this, "Payitems Mapping is not defined for this Organisation."); return; } else if (procstatus == 5) { BLL.ShowMessage(this, "Payroll Already done for this Period."); return; } else { BLL.ShowMessage(this, "Error occured while performing the process"); return; } } } else { BLL.ShowMessage(this, "Select Proper Information to Run the Payroll Process"); return; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Payrolldetails", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rcmb_PeriodElement_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { tr_OTDt.Visible = false; rdtp_OTDt.Visible = false; Rg_OTDetails.Visible = false; btn_Process.Visible = false; btn_Cancle.Visible = false; if (rcmb_PeriodMaster.SelectedIndex <= 0) { BLL.ShowMessage(this, "Please Select Period"); return; } if (rcmb_PeriodElement.SelectedIndex > 0) { Rg_OTDetails.Enabled = true; Rg_OTDetails.Visible = true; SMHR_PAYROLL _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.BUID = Convert.ToInt32(rcmb_BUI.SelectedItem.Value); _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_PeriodElement.SelectedItem.Value); _obj_smhr_payroll.PERODID = Convert.ToInt32(rcmb_PeriodMaster.SelectedItem.Value); //_obj_smhr_payroll.MODE = 10; _obj_smhr_payroll.MODE = 35; DataTable dt = BLL.get_PayDetails(_obj_smhr_payroll); Rg_OTDetails.DataSource = dt; Rg_OTDetails.DataBind(); Rg_OTDetails.Visible = true; if (dt.Rows.Count == 0) { // LoadGrid(); if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2) { btn_Process.Visible = false; } else { btn_Process.Visible = false; } Rg_OTDetails.Visible = true; //Rg_OTDetails.Visible = true; btn_Cancle.Visible = true; } else { Rg_OTDetails.Visible = true; btn_Process.Visible = false; Rg_OTDetails.Enabled = false; btn_Cancle.Visible = true; // LoadGrid(); } } //{ // rdtp_OTDt.SelectedDate = null; // SMHR_PERIODDTL _obj_smhr_prddtl = new SMHR_PERIODDTL(); // DataTable dt_Details = new DataTable(); // _obj_smhr_prddtl.OPERATION = operation.Select; // _obj_smhr_prddtl.PRDDTL_ID = Convert.ToInt32(rcmb_PeriodElement.SelectedValue); // dt_Details = BLL.get_PeriodDetails(_obj_smhr_prddtl); // if (dt_Details.Rows.Count > 0) // { // if (Convert.ToDateTime(dt_Details.Rows[0][3].ToString()) <= DateTime.Now) // //if (Convert.ToDateTime(dt_Details.Rows[0][3].ToString()).Month <= DateTime.Now.Month) // { // rdtp_OTDt.MinDate = Convert.ToDateTime(dt_Details.Rows[0]["PRDDTL_STARTDATE"].ToString()); // if (Convert.ToDateTime(dt_Details.Rows[0]["PRDDTL_ENDDATE"].ToString()) > DateTime.Now) // //if (Convert.ToDateTime(dt_Details.Rows[0]["PRDDTL_ENDDATE"].ToString()).Month > DateTime.Now.Month) // { // //DateTime start = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); // //DateTime end = start.AddMonths(1).AddDays(-1); // //rdtp_OTDt.MaxDate = end; // rdtp_OTDt.MaxDate = DateTime.Now; // } // else // { // rdtp_OTDt.MaxDate = Convert.ToDateTime(dt_Details.Rows[0]["PRDDTL_ENDDATE"].ToString()); // } // //tr_OTDt.Visible = true; // //rdtp_OTDt.Visible = true; // } // } //} //if (rcmb_BUI.SelectedIndex > 0) //{ // tr_OTDt.Visible = true; //To display datepicker // rdtp_OTDt.MaxDate = DateTime.Today.AddDays(-1); //} else { Rg_OTDetails.Visible = false; btn_Process.Visible = false; btn_Cancle.Visible = false; // Rg_OTDetails.Visible = false; BLL.ShowMessage(this, "Please Select Period Element"); return; } if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2) { btn_Finalise.Visible = false; btn_Process.Visible = false; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_overtimecalc", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rg_importchild_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) { try { SMHR_PAYROLL _obj_smhr_payroll = new SMHR_PAYROLL(); if (RCM_FINANCIALPERIOD.SelectedItem.Value != "") { _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(RCM_FINANCIALPERIOD.SelectedItem.Value); } else { _obj_smhr_payroll.PERIODDTLID = 0; } _obj_smhr_payroll.MODE = 11; DataTable dt_Details = new DataTable(); dt_Details = BLL.get_payrolltrans(_obj_smhr_payroll); if (dt_Details.Rows.Count != 0) { //rcm_fin_elem.DataSource = dt_Details; //rcm_fin_elem.DataValueField = "PRDDTL_ID"; //rcm_fin_elem.DataTextField = "PRDDTL_NAME"; //rcm_fin_elem.DataBind(); //rcm_fin_elem.Items.Insert(0, new RadComboBoxItem("Select")); } else { DataTable dt_Details2 = new DataTable(); rcm_fin_elem.DataSource = dt_Details2; rcm_fin_elem.DataBind(); rcm_fin_elem.Items.Insert(0, new RadComboBoxItem("Select")); } SMHR_ESIMASTER _obj_Smhr_ESIMASTER = new SMHR_ESIMASTER(); _obj_Smhr_ESIMASTER.Mode = 7; if (rcmb_BUI.SelectedItem.Value != "") { _obj_Smhr_ESIMASTER.SMHR_ESI_MASTER_BUID = Convert.ToInt32(rcmb_BUI.SelectedItem.Value); } else { _obj_Smhr_ESIMASTER.SMHR_ESI_MASTER_BUID = 0; } _obj_Smhr_ESIMASTER.SMHR_ESI_MASTER_ORGID = Convert.ToInt32(Session["ORG_ID"]); if (rcm_fin_elem.SelectedItem.Value != "") { _obj_Smhr_ESIMASTER.SMHR_ESI_MASTER_CREATEDBY = Convert.ToInt32(rcm_fin_elem.SelectedItem.Value); } else { _obj_Smhr_ESIMASTER.SMHR_ESI_MASTER_CREATEDBY = 0; } DataTable dt = BLL.get_ESIMASTER(_obj_Smhr_ESIMASTER); if (dt.Rows.Count != 0) { //btn_Save.Visible = true; rg_importchild.DataSource = dt; for (int i = 0; i < rg_importchild.Items.Count; i++) { Label LBLAMOUNT; LBLAMOUNT = rg_importchild.Items[i].FindControl("lbl_IMPORTCHILD_TOTALAMOUNT") as Label; Label LBLREASONCODE; LBLREASONCODE = rg_importchild.Items[i].FindControl("lbl_IMPORTCHILD_reasoncode") as Label; if (LBLAMOUNT.Text == "0") { LBLREASONCODE.Text = "1"; } else { LBLREASONCODE.Text = "0"; } } return; //BTN_DOWNLOAD.Visible = true; } else { DataTable dt1 = new DataTable(); btn_Save.Visible = false; BTN_DOWNLOAD.Visible = false; rg_importchild.DataSource = dt1; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_esiimport", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Paytran_Click(object sender, EventArgs e) { StringBuilder strPayroll = new StringBuilder(); string str; for (int index = 0; index <= chkSalary_List.Items.Count - 1; index++) { if (chkSalary_List.Items[index].Selected) { if (Convert.ToString(strPayroll) != string.Empty) { str = ",''" + chkSalary_List.Items[index].Value + "''"; strPayroll.Append(str); } else { str = "''" + chkSalary_List.Items[index].Value + "''"; strPayroll.Append(str); } } } if (Convert.ToString(strPayroll) == string.Empty) { BLL.ShowMessage(this, "Please Choose Salary Structure"); return; } _obj_smhr_payroll = new SMHR_PAYROLL(); _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(ddl_PeriodElements.SelectedValue); _obj_smhr_payroll.MODE = 6; _obj_smhr_payroll.EMP_SALSTRUCT = Convert.ToString(strPayroll); _obj_smhr_payroll.BUID = Convert.ToInt32(ddl_BusinessUnit.SelectedValue); dt_Details = BLL.get_payrolltrans(_obj_smhr_payroll); if (dt_Details.Rows.Count != 0) { //BLL.ShowMessage(this, "Payroll Already done for this Period"); //return; } else { _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(ddl_PeriodElements.SelectedValue); _obj_smhr_payroll.MODE = 7; _obj_smhr_payroll.EMP_SALSTRUCT = Convert.ToString(strPayroll); _obj_smhr_payroll.BUID = Convert.ToInt32(ddl_BusinessUnit.SelectedValue); dt_Details = BLL.get_payrolltrans(_obj_smhr_payroll); if (dt_Details.Rows.Count != 0) { //BLL.ShowMessage(this, "Payroll Already done for this Period"); //return; } } bool status = false; int procstatus = 0; try { StringBuilder strPay = new StringBuilder(); string str1 = null; _obj_smhr_payroll.MODE = 8; _obj_smhr_payroll.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt = BLL.get_payrolltrans(_obj_smhr_payroll); if (dt.Rows.Count != 0) { for (int i = 0; i <= dt.Rows.Count - 1; i++) { if (string.IsNullOrEmpty(Convert.ToString(strPay)) && string.IsNullOrEmpty(str1)) { str1 = Convert.ToString(dt.Rows[i][0]); strPay.Append(str1); } else { str1 = "," + Convert.ToString(dt.Rows[i][0]); strPay.Append(str1); } } } else { //BLL.ShowMessage(this, "Approval Process Not set Properly."); //return; } _obj_smhr_employee = new SMHR_EMPLOYEE(); _obj_smhr_employee.EMPSALDTLS_PERIOD_ID = Convert.ToInt32(ddl_Period.SelectedValue); _obj_smhr_employee.EMPSALDTLS_PRDDTL_ID = Convert.ToInt32(ddl_PeriodElements.SelectedValue); _obj_smhr_employee.EMPSALDTLS_STR = Convert.ToString(strPay); if (Convert.ToString(strPayroll) != string.Empty) { _obj_smhr_employee.EMPSALDTLS_STRUCT = Convert.ToString(strPayroll); } else { _obj_smhr_employee.EMPSALDTLS_STRUCT = string.Empty; } _obj_smhr_employee.EMPSALDTLS_ID = Convert.ToInt32(Session["USER_ID"]); _obj_smhr_employee.EMPSALDTLS_DATE = DateTime.Now; _obj_smhr_employee.EMP_BUSINESSUNIT_ID = Convert.ToInt32(ddl_BusinessUnit.SelectedValue); _obj_smhr_employee.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt_Local = BLL.ExecuteQuery("SELECT BUSINESSUNIT_LOCALISATION,HR_MASTER_CODE FROM SMHR_BUSINESSUNIT " + " JOIN SMHR_HR_MASTER ON " + " BUSINESSUNIT_LOCALISATION = HR_MASTER_ID WHERE BUSINESSUNIT_ID = '" + Convert.ToInt32(ddl_BusinessUnit.SelectedValue) + "'"); if (dt_Local.Rows.Count > 0) { status = BLL.set_payrolltrans(_obj_smhr_employee, Convert.ToString(dt_Local.Rows[0]["HR_MASTER_CODE"])); } else { BLL.ShowMessage(this, "Localisation is Not Defined for Selected business Unit"); return; } if (status == true) { procstatus = 2; } } catch (Exception ex) { if (ex.Message == "NO EMPLOYEES TO RUN PAYROLL") { procstatus = 1; } else if (ex.Message == "NOATTENDS") { procstatus = 3; } else if (ex.Message == "NOMAPPING") { procstatus = 4; } else if (ex.Message == "ALREADYEXIST") { procstatus = 5; } //status = false; } if (procstatus == 2) { BLL.ShowMessage(this, "Payroll Process sent for Approval"); clearFields(); return; } else { if (procstatus == 1) { BLL.ShowMessage(this, "No employees to process"); return; } else if (procstatus == 3) { BLL.ShowMessage(this, "Attendance is not defined for this period."); return; } else if (procstatus == 4) { BLL.ShowMessage(this, "Payitems Mapping is not defined for this Organisation."); return; } else if (procstatus == 5) { BLL.ShowMessage(this, "Payroll Already done for this Period."); return; } else { BLL.ShowMessage(this, "Error occured while performing the process"); return; } } }