private void FormateGrid() { int i = 1; decimal dclNewBasic = 0; decimal dclHR = 0; decimal dclPF = 0; DataTable dtBfPlc = objPayOptMgr.SelectPayrollBenefitsPolicyData("0"); DataRow[] foundPlcRow; foundPlcRow = null; foreach (GridViewRow gRow in grEmpList.Rows) { gRow.Cells[0].Text = i.ToString(); dclNewBasic = Convert.ToDecimal(gRow.Cells[3].Text) + (Convert.ToDecimal(gRow.Cells[3].Text) * Convert.ToDecimal(txtCOLAPercent.Text.Trim())) / 100; gRow.Cells[4].Text = Convert.ToString(Common.RoundDecimal(dclNewBasic.ToString(), 0)); //House Rent foundPlcRow = dtBfPlc.Select("SHEADID=2"); if (foundPlcRow.Length > 0) { dclHR = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(gRow.Cells[5].Text, 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 0)); } dclHR = (dclNewBasic * Convert.ToDecimal(dtBfPlc.Rows[0]["VALUE"]) / 100); gRow.Cells[5].Text = Convert.ToString(Common.RoundDecimal(dclHR.ToString(), 0)); //PF Allowance if (string.IsNullOrEmpty(grEmpList.DataKeys[gRow.DataItemIndex].Values[1].ToString().Trim()) == false) { foundPlcRow = null; foundPlcRow = dtBfPlc.Select("SHEADID=13"); if (foundPlcRow.Length > 0) { dclPF = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(gRow.Cells[4].Text, 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 0)); } gRow.Cells[6].Text = Convert.ToString(Common.RoundDecimal(dclPF.ToString(), 0)); } else { gRow.Cells[6].Text = "0"; } gRow.Cells[7].Text = txtCOLAPercent.Text.Trim(); i++; } }
private void CalculateBasicSalary() { Payroll_PaySlipOptionMgr objOptMgr = new Payroll_PaySlipOptionMgr(); DataTable dtBfPlc = objOptMgr.SelectPayrollBenefitsPolicyData("1", ddlEmpType.SelectedValue.ToString()); if (dtBfPlc.Rows.Count > 0) { decimal dclBasicAmt = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(txtGrossSalary.Text, 0), Common.RoundDecimal(dtBfPlc.Rows[0]["Value"].ToString(), 2)); txtBasicSalary.Text = dclBasicAmt.ToString(); } }
private void FormateGrid() { int i = 1; decimal dclNewBasic = 0; decimal dclAllowance = 0; decimal dclPF = 0; DataTable dtBfPlc = objOptMgr.SelectPayrollBenefitsPolicyData("0", "0"); DataRow[] foundPlcRow; foundPlcRow = null; foreach (GridViewRow gRow in grPayroll.Rows) { dclNewBasic = Convert.ToDecimal(gRow.Cells[1].Text); gRow.Cells[1].Text = Convert.ToString(Common.RoundDecimal(dclNewBasic.ToString(), 0)); //Allowance foundPlcRow = dtBfPlc.Select("SHEADID=2"); if (foundPlcRow.Length > 0) { dclAllowance = objEmpMgr.GetHeadAmount(Common.RoundDecimal(gRow.Cells[1].Text, 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 0)); } dclAllowance = (dclNewBasic * Convert.ToDecimal(dtBfPlc.Rows[0]["VALUE"]) / 100); gRow.Cells[2].Text = Convert.ToString(Common.RoundDecimal(dclAllowance.ToString(), 0)); //PF Allowance foundPlcRow = null; foundPlcRow = dtBfPlc.Select("SHEADID=13"); if (foundPlcRow.Length > 0) { dclPF = objEmpMgr.GetHeadAmount(Common.RoundDecimal(gRow.Cells[1].Text, 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 0)); } gRow.Cells[3].Text = Convert.ToString(Common.RoundDecimal(dclPF.ToString(), 0)); i++; } }
private void SaveData() { dsPayroll_SalaryPackage objDs = new dsPayroll_SalaryPackage(); Payroll_PaySlipOptionMgr objOptMgr = new Payroll_PaySlipOptionMgr(); string strTranType = ""; if (hfIsUpdate.Value == "Y") { hfId.Value = hfId.Value; } else { hfId.Value = Common.getMaxId("EmpTransitionLog", "TransId"); } string strEntryDate = ""; string strEffDate = ""; string strNextIncDate = ""; string strGradeChDate = ""; string strRetirementDate = ""; if (string.IsNullOrEmpty(txtEntryDate.Text.Trim()) == false) { strEntryDate = Common.ReturnDate(txtEntryDate.Text.Trim()); } if (string.IsNullOrEmpty(txtEffDate.Text.Trim()) == false) { strEffDate = Common.ReturnDate(txtEffDate.Text.Trim()); } if (string.IsNullOrEmpty(txtNextIncDate.Text.Trim()) == false) { strNextIncDate = Common.ReturnDate(txtNextIncDate.Text.Trim()); } if (string.IsNullOrEmpty(txtGradeChangeDate.Text.Trim()) == false) { strGradeChDate = Common.ReturnDate(txtGradeChangeDate.Text.Trim()); } char[] splitter = { '/' }; string[] arinfo = Common.str_split(lblName.ToolTip.ToString(), splitter); int iBirthYear = 0; if (arinfo.Length == 3) { iBirthYear = Convert.ToInt16(arinfo[2]); iBirthYear = iBirthYear + 60; strRetirementDate = iBirthYear + "/" + arinfo[1] + "/" + arinfo[0]; arinfo = null; } if (radPromotion.Checked == true) { strTranType = "P"; } else if (radTrans.Checked == true) { strTranType = "T"; } else if (radStatus.Checked == true) { strTranType = "C"; } DataTable dtBfPlc = objOptMgr.SelectPayrollBenefitsPolicyData("0", ddlEmpType.SelectedValue.ToString()); DataRow[] foundPlcRow; foundPlcRow = null; decimal dclNewBasicSal = 0; //Basic foundPlcRow = dtBfPlc.Select("SHEADID=1"); if (foundPlcRow.Length > 0) { DataRow nRow1 = objDs.dtSalPackUpdate.NewRow(); nRow1["SHEADID"] = 1; nRow1["PAYAMT"] = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(txtNewGrossSalary.Text, 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 2)); dclNewBasicSal = Convert.ToDecimal(nRow1["PAYAMT"].ToString()); objDs.dtSalPackUpdate.Rows.Add(nRow1); } //House Rent foundPlcRow = dtBfPlc.Select("SHEADID=2"); if (foundPlcRow.Length > 0) { DataRow nRow2 = objDs.dtSalPackUpdate.NewRow(); nRow2["SHEADID"] = 2; nRow2["PAYAMT"] = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(txtNewGrossSalary.Text, 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 2)); objDs.dtSalPackUpdate.Rows.Add(nRow2); } //Medical foundPlcRow = dtBfPlc.Select("SHEADID=3"); if (foundPlcRow.Length > 0) { DataRow nRow3 = objDs.dtSalPackUpdate.NewRow(); nRow3["SHEADID"] = 3; nRow3["PAYAMT"] = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(txtNewGrossSalary.Text, 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 2)); objDs.dtSalPackUpdate.Rows.Add(nRow3); } if (ddlEmpType.SelectedValue.ToString() == "1") { //PF Allowance foundPlcRow = dtBfPlc.Select("SHEADID=8"); if (dtBfPlc.Rows.Count > 0) { DataRow nRow4 = objDs.dtSalPackUpdate.NewRow(); nRow4["SHEADID"] = 8; nRow4["PAYAMT"] = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(dclNewBasicSal.ToString(), 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 2)); objDs.dtSalPackUpdate.Rows.Add(nRow4); } objDs.dtSalPackUpdate.AcceptChanges(); } clsEmpTransition objEmpTrans = new clsEmpTransition(hfId.Value.ToString(), txtEmpID.Text.Trim(), strEntryDate, strTranType, ddlAction.SelectedValue.ToString(), ddlCompany.SelectedValue.ToString(), ddlClinic.SelectedValue.ToString(), ddlProject.SelectedValue.ToString(), ddlDepartment.SelectedValue.ToString(), ddlSubDept.SelectedValue.ToString(), ddlDesignation.SelectedValue.ToString(), ddlGrade.SelectedValue.ToString(), ddlSalaryLoc.SelectedValue.ToString(), ddlEmpType.SelectedValue.ToString(), txtNewGrossSalary.Text.Trim(), strEffDate, strNextIncDate, strGradeChDate, txtRemarks.Text.Trim(), (chkIsTAApplicable.Checked == true ? "Y" : "N"), Session["USERID"].ToString(), Common.SetDateTime(DateTime.Now.ToString())); objEmpInfoMgr.InsertEmpTransitionLog(objEmpTrans, hfDivision.Value.ToString(), hfClinic.Value.ToString(), hfProject.Value.ToString(), hfDept.Value.ToString(), hfSubDept.Value.ToString(), hfDesig.Value.ToString(), hfGrade.Value.ToString(), hfSalLoc.Value.ToString(), hfEmpType.Value.ToString(), txtNewGrossSalary.Text.Trim(), strEffDate, strNextIncDate, strGradeChDate, strRetirementDate, txtRemarks.Text.Trim(), hfIsUpdate.Value, txtNewGrossSalary.ToolTip.ToString(), hfGrossSalary.Value.ToString(), objDs.dtSalPackUpdate); lblMsg.Text = "Record Saved Successfully"; this.EntryText(); this.EntryMode(false); this.ClearControls(); }
protected void SaveData() { dsPayroll_SalaryPackage objDs = new dsPayroll_SalaryPackage(); Payroll_PaySlipOptionMgr objOptMgr = new Payroll_PaySlipOptionMgr(); string strEntryDate = ""; string strConfirmDueDate = ""; string strExtensionDate = ""; string strConfirmDate = ""; decimal dclNewBasicSal = 0; if (string.IsNullOrEmpty(txtEntryDate.Text.Trim()) == false) { strEntryDate = Common.ReturnDate(txtEntryDate.Text.Trim()); } if (string.IsNullOrEmpty(txtConfirmDueDate.Text.Trim()) == false) { strConfirmDueDate = Common.ReturnDate(txtConfirmDueDate.Text.Trim()); } if (string.IsNullOrEmpty(txtExtensionDate.Text.Trim()) == false) { strExtensionDate = Common.ReturnDate(txtExtensionDate.Text.Trim()); } if (string.IsNullOrEmpty(txtConfirmDate.Text.Trim()) == false) { strConfirmDate = Common.ReturnDate(txtConfirmDate.Text.Trim()); } DataTable dtBfPlc = objOptMgr.SelectPayrollBenefitsPolicyData("0", "1"); DataRow[] foundPlcRow; foundPlcRow = null; //Basic foundPlcRow = dtBfPlc.Select("SHEADID=1"); if (foundPlcRow.Length > 0) { DataRow nRow1 = objDs.dtSalPackUpdate.NewRow(); nRow1["SHEADID"] = 1; nRow1["PAYAMT"] = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(txtNewGrossSalary.Text, 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 2)); dclNewBasicSal = Convert.ToDecimal(nRow1["PAYAMT"].ToString()); objDs.dtSalPackUpdate.Rows.Add(nRow1); } //House Rent foundPlcRow = dtBfPlc.Select("SHEADID=2"); if (foundPlcRow.Length > 0) { DataRow nRow2 = objDs.dtSalPackUpdate.NewRow(); nRow2["SHEADID"] = 2; nRow2["PAYAMT"] = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(txtNewGrossSalary.Text, 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 2)); objDs.dtSalPackUpdate.Rows.Add(nRow2); } //Medical foundPlcRow = dtBfPlc.Select("SHEADID=3"); if (foundPlcRow.Length > 0) { DataRow nRow3 = objDs.dtSalPackUpdate.NewRow(); nRow3["SHEADID"] = 3; nRow3["PAYAMT"] = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(txtNewGrossSalary.Text, 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 2)); objDs.dtSalPackUpdate.Rows.Add(nRow3); } if (ddlEmpType.SelectedValue.ToString() == "1") { //PF Allowance foundPlcRow = dtBfPlc.Select("SHEADID=8"); if (dtBfPlc.Rows.Count > 0) { DataRow nRow4 = objDs.dtSalPackUpdate.NewRow(); nRow4["SHEADID"] = 8; nRow4["PAYAMT"] = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(dclNewBasicSal.ToString(), 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 2)); objDs.dtSalPackUpdate.Rows.Add(nRow4); } objDs.dtSalPackUpdate.AcceptChanges(); } if (hfIsUpdate.Value == "Y") { hfId.Value = hfId.Value; } else { hfId.Value = Common.getMaxId("EmpConfirmationLog", "ConfirmId"); } objEmpInfoMgr.InsertConfirmation(hfId.Value.ToString(), txtEmpID.Text.Trim(), ddlAction.SelectedValue.ToString(), strEntryDate, txtProbationPeriod.Text.Trim(), strConfirmDueDate, strExtensionDate, strConfirmDate, txtExtensionMonth.Text.Trim(), txtRemarks.Text.Trim(), Session["USERID"].ToString(), Common.SetDateTime(DateTime.Now.ToString()), hfIsUpdate.Value.ToString(), lblBasicSalary.ToolTip.ToString(), objDs.dtSalPackUpdate, "Y", lblJoinDate.Text.Trim(), lblJoinDate.ToolTip.Trim(), ddlEmpType.SelectedValue.ToString(), txtNewGrossSalary.Text, dclNewBasicSal.ToString()); if (hfIsUpdate.Value == "N") { lblMsg.Text = "Record Saved Successfully"; } else { lblMsg.Text = "Record Updated Successfully"; } this.OpenRecord(); this.EntryMode(false); }
private void SaveData() { dsPayroll_SalaryPackage objDs = new dsPayroll_SalaryPackage(); Payroll_PaySlipOptionMgr objOptMgr = new Payroll_PaySlipOptionMgr(); string IsDelete = "N"; long lngID = 0; try { string strConfrimDate = ""; if (string.IsNullOrEmpty(txtEffDate.Text.Trim()) == false) { strConfrimDate = Common.ReturnDate(txtEffDate.Text.Trim()); } if (hfIsUpdate.Value == "N") { lngID = objDB.GerMaxIDNumber("EmpSalaryAmendment", "LogId"); } else { lngID = Convert.ToInt32(hfID.Value); } DataTable dtBfPlc = objOptMgr.SelectPayrollBenefitsPolicyData("0"); DataRow[] foundPlcRow; foundPlcRow = null; //Basic DataRow nRow1 = objDs.dtSalPackUpdate.NewRow(); nRow1["SHEADID"] = 1; nRow1["PAYAMT"] = Common.RoundDecimal(txtBasicSalary.Text, 0); objDs.dtSalPackUpdate.Rows.Add(nRow1); //House Rent foundPlcRow = dtBfPlc.Select("SHEADID=2"); if (foundPlcRow.Length > 0) { DataRow nRow2 = objDs.dtSalPackUpdate.NewRow(); nRow2["SHEADID"] = 2; nRow2["PAYAMT"] = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(txtBasicSalary.Text, 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 0)); objDs.dtSalPackUpdate.Rows.Add(nRow2); } // Medical foundPlcRow = dtBfPlc.Select("SHEADID=3"); if (foundPlcRow.Length > 0) { DataRow nRow2 = objDs.dtSalPackUpdate.NewRow(); nRow2["SHEADID"] = 3; nRow2["PAYAMT"] = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(txtBasicSalary.Text, 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 0)); objDs.dtSalPackUpdate.Rows.Add(nRow2); } // Conveyance foundPlcRow = dtBfPlc.Select("SHEADID=4"); if (foundPlcRow.Length > 0) { DataRow nRow2 = objDs.dtSalPackUpdate.NewRow(); nRow2["SHEADID"] = 4; nRow2["PAYAMT"] = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(txtBasicSalary.Text, 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 0)); objDs.dtSalPackUpdate.Rows.Add(nRow2); } // Calculate Gross, Incremented Amount, and Percent decimal decGross = Common.RoundDecimal(txtBasicSalary.Text.Trim(), 0) + Common.RoundDecimal(txtHouseRent.Text.Trim(), 0) + Common.RoundDecimal(txtMedical.Text.Trim(), 0) + Common.RoundDecimal(txtConveyance.Text.Trim(), 0); decimal decIncrAmt = decGross - Common.RoundDecimal(lblGross.Text.Trim(), 0); decimal decIncrPercnt = (decIncrAmt * 100) / Common.RoundDecimal(lblGross.Text.Trim(), 0); decIncrPercnt = Common.RoundDecimal(decIncrPercnt.ToString(), 2); objEmpInfoMgr.InsertEmpSalaryAmendment(lngID.ToString(), txtEmpID.Text.Trim(), ddlAction.SelectedValue.ToString(), ddlAction.SelectedItem.ToString(), strConfrimDate, txtBasicSalary.Text, txtHouseRent.Text.Trim(), txtMedical.Text.Trim(), txtConveyance.Text.Trim(), decGross.ToString(), txtRemarks.Text.Trim(), decIncrAmt.ToString(), decIncrPercnt.ToString(), Session["USERID"].ToString(), Common.SetDateTime(DateTime.Now.ToString()), hfIsUpdate.Value, IsDelete, lblSalPac.ToolTip.ToString(), objDs.dtSalPackUpdate); if (hfIsUpdate.Value == "N") { lblMsg.Text = "Record Saved Successfully"; } else { lblMsg.Text = "Record Updated Successfully"; } this.EntryMode(false); this.ClearControls(); //this.OpenRecord(); } catch (Exception ex) { lblMsg.Text = ""; throw (ex); } }
protected void SaveData() { dsPayroll_SalaryPackage objDs = new dsPayroll_SalaryPackage(); Payroll_PaySlipOptionMgr objOptMgr = new Payroll_PaySlipOptionMgr(); string strEntryDate = ""; string strConfirmDate = ""; string strNewConfirmDate = ""; string strExtensionDate = ""; if (string.IsNullOrEmpty(txtEntryDate.Text.Trim()) == false) { strEntryDate = Common.ReturnDate(txtEntryDate.Text.Trim()); } if (string.IsNullOrEmpty(txtConfirmDate.Text.Trim()) == false) { strConfirmDate = Common.ReturnDate(txtConfirmDate.Text.Trim()); } if (string.IsNullOrEmpty(txtNewConfirmDate.Text.Trim()) == false) { strNewConfirmDate = Common.ReturnDate(txtNewConfirmDate.Text.Trim()); } if (string.IsNullOrEmpty(txtExtensionDate.Text.Trim()) == false) { strExtensionDate = Common.ReturnDate(txtExtensionDate.Text.Trim()); } //PF Allowance DataTable dtBfPlc = objOptMgr.SelectPayrollBenefitsPolicyData("0"); DataRow[] foundPlcRow; foundPlcRow = null; foundPlcRow = dtBfPlc.Select("SHEADID=13"); if (foundPlcRow.Length > 0) { DataRow nRow3 = objDs.dtSalPackUpdate.NewRow(); nRow3["SHEADID"] = 13; nRow3["PAYAMT"] = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(lblBasicSalary.Text, 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 0)); objDs.dtSalPackUpdate.Rows.Add(nRow3); } objDs.dtSalPackUpdate.AcceptChanges(); if (hfIsUpdate.Value == "Y") { hfId.Value = hfId.Value; } else { hfId.Value = Common.getMaxId("EmpConfirmationLog", "ConfirmId"); } objEmpInfoMgr.InsertConfirmation(hfId.Value.ToString(), txtEmpID.Text.Trim(), ddlAction.SelectedValue.ToString(), strEntryDate, strConfirmDate, txtExtensionMonth.Text.Trim(), strNewConfirmDate, strExtensionDate, txtRemarks.Text.Trim(), Session["USERID"].ToString(), Common.SetDateTime(DateTime.Now.ToString()), hfIsUpdate.Value.ToString(), lblBasicSalary.ToolTip.ToString(), objDs.dtSalPackUpdate); if (hfIsUpdate.Value == "N") { lblMsg.Text = "Record Saved Successfully"; } else { lblMsg.Text = "Record Updated Successfully"; } this.OpenRecord(); this.EntryMode(false); }
private void SaveData() { dsPayroll_SalaryPackage objDs = new dsPayroll_SalaryPackage(); Payroll_PaySlipOptionMgr objOptMgr = new Payroll_PaySlipOptionMgr(); string IsDelete = "N"; long lngID = 0; try { string strConfrimDate = ""; decimal dclNewBasicSal = 0; if (string.IsNullOrEmpty(txtEffDate.Text.Trim()) == false) { strConfrimDate = Common.ReturnDate(txtEffDate.Text.Trim()); } if (hfIsUpdate.Value == "N") { lngID = objDB.GerMaxIDNumber("EmpSalaryIncrementLog", "LogId"); } else { lngID = Convert.ToInt32(hfID.Value); } DataTable dtBfPlc = objOptMgr.SelectPayrollBenefitsPolicyData("0", lblName.ToolTip.ToString()); DataRow[] foundPlcRow; foundPlcRow = null; //Basic foundPlcRow = dtBfPlc.Select("SHEADID=1"); if (foundPlcRow.Length > 0) { DataRow nRow1 = objDs.dtSalPackUpdate.NewRow(); nRow1["SHEADID"] = 1; nRow1["PAYAMT"] = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(txtNewGrossSalary.Text, 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 2)); dclNewBasicSal = Convert.ToDecimal(nRow1["PAYAMT"].ToString()); objDs.dtSalPackUpdate.Rows.Add(nRow1); } //House Rent foundPlcRow = dtBfPlc.Select("SHEADID=2"); if (foundPlcRow.Length > 0) { DataRow nRow2 = objDs.dtSalPackUpdate.NewRow(); nRow2["SHEADID"] = 2; nRow2["PAYAMT"] = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(txtNewGrossSalary.Text, 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 2)); objDs.dtSalPackUpdate.Rows.Add(nRow2); } //Medical foundPlcRow = dtBfPlc.Select("SHEADID=3"); if (foundPlcRow.Length > 0) { DataRow nRow3 = objDs.dtSalPackUpdate.NewRow(); nRow3["SHEADID"] = 3; nRow3["PAYAMT"] = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(txtNewGrossSalary.Text, 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 2)); objDs.dtSalPackUpdate.Rows.Add(nRow3); } //PF Allowance foundPlcRow = dtBfPlc.Select("SHEADID=8"); if (foundPlcRow.Length > 0) { DataRow nRow4 = objDs.dtSalPackUpdate.NewRow(); nRow4["SHEADID"] = 8; nRow4["PAYAMT"] = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(dclNewBasicSal.ToString(), 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 2)); objDs.dtSalPackUpdate.Rows.Add(nRow4); } objDs.dtSalPackUpdate.AcceptChanges(); objEmpInfoMgr.InsertEmpSalaryIncrement(lngID.ToString(), txtEmpID.Text.Trim(), ddlAction.SelectedValue.ToString(), ddlAction.SelectedItem.ToString(), strConfrimDate, Common.ReturnZeroForNull(txtCOLA.Text.Trim()), Common.ReturnZeroForNull(txtGpPer.Text.Trim()), Common.ReturnZeroForNull(txtInvPer.Text.Trim()), txtNewGrossSalary.Text.Trim(), dclNewBasicSal.ToString(), txtRemarks.Text.Trim(), txtIncrement.Text, txtNewGrossSalary.ToolTip.ToString(), Session["USERID"].ToString(), Common.SetDateTime(DateTime.Now.ToString()), hfIsUpdate.Value, IsDelete, lblSalPac.ToolTip.ToString(), objDs.dtSalPackUpdate); if (hfIsUpdate.Value == "N") { lblMsg.Text = "Record Saved Successfully"; } else { lblMsg.Text = "Record Updated Successfully"; } this.EntryMode(false); this.ClearControls(); //this.OpenRecord(); } catch (Exception ex) { lblMsg.Text = ""; throw (ex); } }
private void GenerateIncrementList(DataTable dtEmpList) { DateTime dtCurrDate = DateTime.Now; decimal dclTotalScore = 0; decimal dclCOLA = 0, dclGpPer = 0, dclInvPer = 0; foreach (DataRow dRow in dtEmpList.Rows) { DataRow nRow = objDS.dtIncrement.NewRow(); //if (string.IsNullOrEmpty(dRow["EmpTypeId"].ToString())) //{ // dRow["EmpTypeId"] = "-1"; //} string strIncDate = ""; char[] splitter = { '/' }; if (string.IsNullOrEmpty(dRow["IncrementDate"].ToString().Trim()) == false) { strIncDate = dRow["IncrementDate"].ToString(); } else { strIncDate = dRow["JoiningDate"].ToString(); } string[] arinfo = Common.str_split(Common.DisplayDate(strIncDate), splitter); if (arinfo.Length == 3) { strIncDate = arinfo[2] + "/" + arinfo[1] + "/" + arinfo[0]; //arinfo = null; } //Those Inc has already done on this yr if (arinfo[2].ToString() == dtCurrDate.Year.ToString()) { arinfo = null; goto AddNextEmpId; } if (Convert.ToInt16(arinfo[2]) < Convert.ToInt16(dtCurrDate.Year)) { switch (arinfo[1]) { case "10": case "11": case "12": dclCOLA = 0; dclGpPer = 0; dclInvPer = 0; break; case "07": case "08": case "09": dclCOLA = (Convert.ToDecimal(txtCOLA.Text) * 50) / 100; dclGpPer = (Convert.ToDecimal(txtGrpPer.Text) * 50) / 100; dclInvPer = (Convert.ToDecimal(txtInvPer.Text) * 50) / 100; break; case "04": case "05": case "06": dclCOLA = (Convert.ToDecimal(txtCOLA.Text) * 75) / 100; dclGpPer = (Convert.ToDecimal(txtGrpPer.Text) * 75) / 100; dclInvPer = (Convert.ToDecimal(txtInvPer.Text) * 75) / 100; break; case "01": case "02": case "03": dclCOLA = Convert.ToDecimal(txtCOLA.Text); dclGpPer = Convert.ToDecimal(txtGrpPer.Text); dclInvPer = Convert.ToDecimal(txtInvPer.Text); break; } } if (string.IsNullOrEmpty(dRow["EmpTypeId"].ToString()) == false) { if (dRow["EmpTypeId"].ToString() == "1") { } else//For Contractual Staff { DateTime CurrYear = Convert.ToDateTime(txtActionDate.Text); DateTime JoinYear = Convert.ToDateTime(dRow["JoiningDate"].ToString().Trim()); if (JoinYear.AddYears(1) > CurrYear) { TimeSpan DateDiff = JoinYear - CurrYear; string strTotDay = Common.ReturnTotalDay(DateDiff.ToString()); if (Convert.ToInt16(strTotDay) < 365) { goto AddNextEmpId; } } } DataTable dtBfPlc = objOptMgr.SelectPayrollBenefitsPolicyData("0", dRow["EmpTypeId"].ToString().Trim()); DataRow[] foundPlcRow; foundPlcRow = null; nRow["EmpId"] = dRow["EmpId"].ToString().Trim(); nRow["FullName"] = dRow["FullName"].ToString().Trim(); nRow["TypeName"] = dRow["TypeName"].ToString().Trim(); nRow["JoiningDate"] = dRow["JoiningDate"].ToString().Trim(); nRow["DesigName"] = dRow["DesigName"].ToString().Trim(); nRow["ClinicName"] = dRow["ClinicName"].ToString().Trim(); if (string.IsNullOrEmpty(dRow["IncrementDate"].ToString().Trim()) == false) { nRow["IncrementDate"] = dRow["IncrementDate"].ToString().Trim(); } else { nRow["IncrementDate"] = ""; } nRow["BasicSalary"] = dRow["BasicSalary"].ToString().Trim(); nRow["GrossSalary"] = dRow["GrossSalary"].ToString().Trim(); nRow["COLA"] = dclCOLA; nRow["GrpPer"] = dclGpPer; nRow["InvPer"] = dclInvPer; dclTotalScore = Convert.ToDecimal(nRow["COLA"]) + Convert.ToDecimal(nRow["GrpPer"]) + Convert.ToDecimal(nRow["InvPer"]); nRow["NewBasicSalary"] = Math.Round(Convert.ToDecimal(nRow["BasicSalary"]) + ((Convert.ToDecimal(nRow["BasicSalary"]) * dclTotalScore) / 100), 0); nRow["NewGrossSalary"] = Math.Round(Convert.ToDecimal(nRow["GrossSalary"]) + ((Convert.ToDecimal(nRow["GrossSalary"]) * dclTotalScore) / 100), 0); if (dtBfPlc.Rows.Count > 0) { foundPlcRow = dtBfPlc.Select("SHEADID=2"); //House Rent nRow["Housing"] = objEmpMgr.GetHeadAmount(Common.RoundDecimal(nRow["NewGrossSalary"].ToString(), 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 2)); //Convert.ToDecimal(foundRows[0]["Housing"].ToString()) + Convert.ToDecimal(foundRows[0]["Housing"].ToString()) * dclTotalScore; foundPlcRow = null; foundPlcRow = dtBfPlc.Select("SHEADID=3");//Medical nRow["Medical"] = objEmpMgr.GetHeadAmount(Common.RoundDecimal(nRow["NewGrossSalary"].ToString(), 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 2)); foundPlcRow = null; foundPlcRow = dtBfPlc.Select("SHEADID=8");//PF if (foundPlcRow.Length > 0) { nRow["PF"] = objEmpMgr.GetHeadAmount(Common.RoundDecimal(nRow["NewGrossSalary"].ToString(), 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 2)); } } objDS.dtIncrement.Rows.Add(nRow); } AddNextEmpId: { } } objDS.dtIncrement.AcceptChanges(); grIncrementList.DataSource = objDS.Tables["dtIncrement"]; grIncrementList.DataBind(); lblExistRecordCount.Text = grIncrementList.Rows.Count.ToString(); if (grIncrementList.Rows.Count > 0) { foreach (GridViewRow gRow in grIncrementList.Rows) { gRow.Cells[4].Text = gRow.Cells[4].Text != "" ? Common.DisplayDate(gRow.Cells[4].Text) : gRow.Cells[4].Text; gRow.Cells[7].Text = gRow.Cells[7].Text != "" ? Common.DisplayDate(gRow.Cells[7].Text) : gRow.Cells[7].Text; } } else { lblMsg.Text = "Selected Cost centers Increment process for this year has already done or no staff is available."; } }
private void SaveData() { dsPayroll_SalaryPackage objDs = new dsPayroll_SalaryPackage(); Payroll_PaySlipOptionMgr objOptMgr = new Payroll_PaySlipOptionMgr(); //string strSalPackId; string strTranType = ""; if (hfIsUpdate.Value == "Y") { hfId.Value = hfId.Value; } else { hfId.Value = Common.getMaxId("EmpTransitionLog", "TransId"); } string strEntryDate = ""; string strEffDate = ""; string strNextIncDate = ""; string strGradeChDate = ""; string strRetirementDate = ""; if (string.IsNullOrEmpty(txtEntryDate.Text.Trim()) == false) { strEntryDate = Common.ReturnDate(txtEntryDate.Text.Trim()); } if (string.IsNullOrEmpty(txtEffDate.Text.Trim()) == false) { strEffDate = Common.ReturnDate(txtEffDate.Text.Trim()); } if (string.IsNullOrEmpty(txtNextIncDate.Text.Trim()) == false) { strNextIncDate = Common.ReturnDate(txtNextIncDate.Text.Trim()); } if (string.IsNullOrEmpty(txtGradeChangeDate.Text.Trim()) == false) { strGradeChDate = Common.ReturnDate(txtGradeChangeDate.Text.Trim()); } if (radPromotion.Checked == true) { strTranType = "P"; } else if (radTrans.Checked == true) { strTranType = "T"; } else if (radStatus.Checked == true) { strTranType = "C"; } else if (radEquity.Checked == true) { strTranType = "E"; } else if (radReDesig.Checked == true) { strTranType = "R"; } else if (radDeputation.Checked == true) { strTranType = "D"; } else if (radIncrement.Checked == true) { strTranType = "I"; } DataTable dtBfPlc = objOptMgr.SelectPayrollBenefitsPolicyData("0"); DataRow[] foundPlcRow; foundPlcRow = null; //Basic DataRow nRow1 = objDs.dtSalPackUpdate.NewRow(); nRow1["SHEADID"] = 1; nRow1["PAYAMT"] = Common.RoundDecimal(txtBasicSal.Text, 0); objDs.dtSalPackUpdate.Rows.Add(nRow1); //House Rent foundPlcRow = dtBfPlc.Select("SHEADID=2"); if (foundPlcRow.Length > 0) { DataRow nRow2 = objDs.dtSalPackUpdate.NewRow(); nRow2["SHEADID"] = 2; nRow2["PAYAMT"] = Common.RoundDecimal(hfHousing.Value, 0); objDs.dtSalPackUpdate.Rows.Add(nRow2); } //PF Allowance //dtBfPlc = objOptMgr.SelectPayrollBenefitsPolicyData("13"); foundPlcRow = null; foundPlcRow = dtBfPlc.Select("SHEADID=8"); if (foundPlcRow.Length > 0) { DataRow nRow3 = objDs.dtSalPackUpdate.NewRow(); nRow3["SHEADID"] = 8; nRow3["PAYAMT"] = objEmpInfoMgr.GetHeadAmount(Common.RoundDecimal(txtBasicSal.Text, 0), Common.RoundDecimal(foundPlcRow[0]["Value"].ToString(), 0)); objDs.dtSalPackUpdate.Rows.Add(nRow3); } objDs.dtSalPackUpdate.AcceptChanges(); clsEmpTransition objEmpTrans = new clsEmpTransition(hfId.Value.ToString(), txtEmpID.Text.Trim(), strEntryDate, strTranType, ddlAction.SelectedValue.ToString(), ddlDivision.SelectedValue.ToString(), ddlOffice.SelectedValue.ToString(), ddlDesignation.SelectedValue.ToString(), ddlJobTitle.SelectedValue.ToString(), ddlSector.SelectedValue.ToString(), ddlDepartment.SelectedValue.ToString(), ddlUnit.SelectedValue.ToString(), ddlGrade.SelectedValue.ToString(), ddlGradeLevel.SelectedValue.ToString(), ddlDivision.SelectedValue.ToString(), ddlDistrict.SelectedValue.ToString(), ddlSalaryLoc.SelectedValue.ToString(), "", ddlPostingPlace.SelectedValue.ToString(), txtBasicSal.Text.Trim(), txtGrossSalary.Text.Trim(), strEffDate, strNextIncDate, (chkIsNew.Checked == true ? "Y" : "N"), txtRemarks.Text.Trim(), Session["USERID"].ToString(), Common.SetDateTime(DateTime.Now.ToString()), ddlPosByFunction.SelectedValue.ToString(), strGradeChDate, ddlProject.SelectedValue.ToString(), ddlSupervisor.SelectedValue.ToString(), txtBankAccNo.Text.Trim()); // lblJoinDate.ToolTip contains salpakid objEmpInfoMgr.InsertEmpTransitionLog(objEmpTrans, "", hfDiv.Value.ToString(), hfOffice.Value.ToString(), hfDesig.Value.ToString(), hfJobTitle.Value.ToString(), hfSector.Value.ToString(), hfDept.Value.ToString(), hfUnit.Value.ToString(), hfGrade.Value.ToString(), hfGradeLevel.Value.ToString(), hfPostingDiv.Value.ToString(), hfPostingDist.Value.ToString(), hfSalLoc.Value.ToString(), "", hfPostingPlace.Value.ToString(), hfPosByFunction.Value.ToString(), txtBasicSal.ToolTip, txtGrossSalary.ToolTip, strEffDate, strNextIncDate, strGradeChDate, strRetirementDate, txtRemarks.Text.Trim(), hfIsUpdate.Value, lblJoinDate.ToolTip.ToString(), objDs.dtSalPackUpdate, hfProject.Value.ToString(), hfSuperId.Value.ToString(), hfBankAccNo.Value.ToString()); lblMsg.Text = "Record Saved Successfully"; this.EntryText(); this.EntryMode(false); this.ClearControls(); }