//using System; //using System.Collections.Generic; //using System.Linq; //using System.Text; //using Payroll.BO; //using Ease.CoreV35; //using Ease.CoreV35.Model; //using Ease.CoreV35.Caching; //using System.Data; //namespace Payroll.Report //{ // public class rptArrear // { // ObjectsTemplate _Departments = new ObjectsTemplate(); // ObjectsTemplate _Designations = new ObjectsTemplate(); // ObjectsTemplate _Banks = new ObjectsTemplate(); // ObjectsTemplate _Branches = new ObjectsTemplate(); // ObjectsTemplate _Locations = new ObjectsTemplate(); // ObjectsTemplate _employees = new ObjectsTemplate(); // private double TotalGross = 0; // private double TotalArrear = 0; // private double TotalDeduc = 0; // private double TotalUn = 0; // string sempNo = string.Empty; // DateTime _fiscalyearStart; // DateTime arrearMonth; // public rptArrear() // { // _Designations = Designation.Get(EnumStatus.Active); // _Branches = Branch.Get(EnumStatus.Active); // _Banks = Bank.Get(); // _Locations = Location.Get(); // _Departments = Department.Get(); // } // public void ShowBankAdvice(ArrearProcess oProcess, int bankID, int BranchID, string sEmpID, string type) // { // fReportViewer form = new fReportViewer(); // //arrearMonth = GlobalFunctions.FirstDateOfMonth(Payroll.BO.SystemInformation.CurrentSysInfo.NextPayProcessDate); // arrearMonth = GlobalFunctions.FirstDateOfMonth(oProcess.ProcessMonth); // int count = 1; // DataRow oDR = null; // string itemType = string.Empty; // if (type == "Salary") // { // itemType = "12"; // } // else if (type == "OPI") // { // itemType = "13"; // } // //DataSet oEmpArrearBankAdvice = MiscellaneousDataset.GetEmpArrearBankAdvice(GlobalFunctions.LastDateOfMonth(arrearMonth), sEmpID, itemType, oProcess.ID.Integer, BranchID); // DataSet oEmpArrearBankAdvice = MiscellaneousDataset.GetEmpArrearBankAdvice(sEmpID, itemType, oProcess.ID.Integer, BranchID); // PayrollDataSet.PayrollDataSet.BankAdviceDataTable bankAdvice = new Payroll.Report.PayrollDataSet.PayrollDataSet.BankAdviceDataTable(); // PayrollDataSet.PayrollDataSet.BankAdviceLetterDataTable bankAdviceLetter = new Payroll.Report.PayrollDataSet.PayrollDataSet.BankAdviceLetterDataTable(); // double nTotal = 0.0; // foreach (DataRow oDRow in oEmpArrearBankAdvice.Tables[0].Rows) // { // oDR = bankAdvice.NewRow(); // oDR["EmpNo"] = oDRow["EMPLOYEENO"]; // oDR["EmpName"] = oDRow["NAME"]; // oDR["AccountNo"] = oDRow["ACCOUNTNO"]; // oDR["Amount"] = GlobalFunctions.Round(Convert.ToDouble(oDRow["CHANGEDAMOUNT"])); // oDR["Email"] = oDRow["EMAILADDRESS"]; // oDR["SalaryMonth"] = arrearMonth; // oDR["SLNo"] = count; // bankAdvice.Rows.Add(oDR); // nTotal += GlobalFunctions.Round(Convert.ToDouble(oDR["Amount"])); // count++; // } // string sRefNo = "";//"IDLC/TF/" + DateTime.Today.ToString("yyyy/0") + arrearMonth.Month; // string[] sTempTaka = Payroll.BO.GlobalFunctions.TakaFormat(nTotal).ToString().Split('.'); // string sDateTaka = "" + sTempTaka[0] + " /- (" + Ease.CoreV35.Utility.Global.NumericFunctions.MillionFormat(nTotal) + ")"; // Bank oBank = _Banks.Find(delegate(Bank ob) { return ob.ID.Integer == bankID; }); // string sAccount = oBank.Accountingformat; // string sCheckTk = Payroll.BO.GlobalFunctions.MillionToInWords(Convert.ToInt32(nTotal)); // string totalTaka = sCheckTk; // string sTaka = "BDT " + sTempTaka[0] + " (" + sCheckTk + " taka only)"; // //bankAdviceLetter.Rows.Add(sRefNo, sTaka, sAccount, "", DateTime.Today.ToString("MMMM dd, yyyy"), oBank.Name, Payroll.BO.SystemInformation.CurrentSysInfo.NextPayProcessDate.ToString("MMMM dd, yyyy"), sTaka, oBank.Branchs[0].Address); // bankAdviceLetter.Rows.Add(sRefNo, sTaka, sAccount, "", DateTime.Today.ToString("MMMM dd, yyyy"), oBank.Name, Payroll.BO.SystemInformation.CurrentSysInfo.NextPayProcessDate.ToString("MMMM dd, yyyy")); // form.ShowArrearBankAdvice(bankAdvice, bankAdviceLetter, sCheckTk); // } // public void ShowArrear(ArrearProcess arrearProcess, string sEmpID) // { // throw new NotImplementedException(); // } // public void ShowArrearSlip(ArrearProcess arrearProcess, string sEmpID, string _type) // { // fReportViewer form = new fReportViewer(); // //arrearMonth = GlobalFunctions.FirstDateOfMonth(Payroll.BO.SystemInformation.CurrentSysInfo.NextPayProcessDate); // arrearMonth = GlobalFunctions.FirstDateOfMonth(arrearProcess.ProcessMonth); // int count = 1; // DataRow oDR = null; // string itemType = string.Empty; // if (_type == "Salary") // { // itemType = "1,2,4,5"; // DataSet oSalaryMonthlys = MiscellaneousDataset.GetEmpArrerSlipGross(sEmpID, itemType, arrearProcess.ID.Integer); // PayrollDataSet.PayrollDataSet.PayslipDataTable PayslipData = new Payroll.Report.PayrollDataSet.PayrollDataSet.PayslipDataTable(); // _employees = Employee.GetWithDiscontinue(); // DataRow oRowGr = null; // TotalGross = 0; // TotalArrear = 0; // TotalDeduc = 0; // TotalUn = 0; // foreach (DataRow odRow in oSalaryMonthlys.Tables[0].Rows) // { // //DataRow oRow = this.GetItem(PayslipData, Convert.ToString(odRow["EMPLOYEENO"]), (EnumArearProcessItemType)Convert.ToInt32(odRow["ItemType"]), Convert.ToInt32(odRow["ItemID"])); // //if (oRow == null) // //{ // oRowGr = PayslipData.NewRow(); // oRowGr = this.GrossMergeForArrearSlip(oRowGr, odRow); // PayslipData.Rows.Add(oRowGr); // //} // SalaryMonthly item = new SalaryMonthly(); // Employee oEmp = _employees.Find(delegate(Employee emp) { return emp.EmployeeNo == Convert.ToString(odRow["EMPLOYEENO"]); }); // IncomeTax otax = null; // double dTaxPrvAmount = 0.0; // if ((Convert.ToInt32(odRow["ItemType"]) == (int)enumPayrollComponentType.Ordinary_Hour) || (Convert.ToInt32(odRow["ItemType"]) == (int)enumPayrollComponentType.Allowance) || (Convert.ToInt32(odRow["ItemType"]) == (int)enumPayrollComponentType.Over_Time) || (Convert.ToInt32(odRow["ItemType"]) == (int)enumPayrollComponentType.Bonus)) // { // oRowGr["Earning"] = GlobalFunctions.Round(Convert.ToDouble(odRow["CHANGEDAMOUNT"])); // sempNo = odRow["EmployeeNo"].ToString(); // if (sempNo == odRow["EmployeeNo"].ToString()) // { // TotalGross = TotalGross + Convert.ToDouble(oRowGr["Earning"]); // oRowGr["TotalGross"] = TotalGross; // } // else // { // TotalGross = 0.0; // TotalGross = TotalGross + Convert.ToDouble(oRowGr["Earning"]); // oRowGr["TotalGross"] = TotalGross; // } // } // } // int nCount = 0; // //oSalaryMonthlys = MiscellaneousDataset.GetArrearSlipDeduct(GlobalFunctions.LastDateOfMonth(arrearMonth), sEmpID, "6,7,13", arrearProcess.ID.Integer); // oSalaryMonthlys = MiscellaneousDataset.GetArrearSlipDeduct(sEmpID, "6,7, 8, 11, 13", arrearProcess.ID.Integer); // string employeeNo = ""; // DataRow[] odros = null; // if (oSalaryMonthlys.Tables[0].Rows.Count > 0) // { // employeeNo = oSalaryMonthlys.Tables[0].Rows[0]["EMPLOYEENO"].ToString(); // odros = PayslipData.Select(" EmployeeNo='" + oSalaryMonthlys.Tables[0].Rows[0]["EMPLOYEENO"].ToString() + "'"); // } // foreach (DataRow odRow in oSalaryMonthlys.Tables[0].Rows) // { // double damount = Convert.ToDouble(odRow["CHANGEDAMOUNT"].ToString()); // if (damount != 0.00) // { // DataRow oRow = null; // if (employeeNo != odRow["EMPLOYEENO"].ToString()) // { // odros = PayslipData.Select(" EmployeeNo='" + odRow["EMPLOYEENO"].ToString() + "'"); // nCount = 0; // } // if (odros.Length <= nCount) // { // oRow = PayslipData.NewRow(); // oRow = this.GrossMerge(oRow, odRow); // PayslipData.Rows.Add(oRow); // } // else oRow = odros[nCount]; // if (Convert.ToInt32(odRow["ItemType"]) == (int)enumPayrollComponentType.Loan || Convert.ToInt32(odRow["ItemType"]) == (int)enumPayrollComponentType.LoanInterest || Convert.ToInt32(odRow["ItemType"]) == (int)enumPayrollComponentType.PF || Convert.ToInt32(odRow["ItemType"]) == (int)enumPayrollComponentType.IncomeTax || Convert.ToInt32(odRow["ItemType"]) == (int)enumPayrollComponentType.OPI) // { // oRow["DeducDescription"] = odRow["Description"];//odRow["Description"]; // } // if (Convert.ToInt32(odRow["ItemType"]) == (int)enumPayrollComponentType.Loan || Convert.ToInt32(odRow["ItemType"]) == (int)enumPayrollComponentType.LoanInterest || Convert.ToInt32(odRow["ItemType"]) == (int)enumPayrollComponentType.PF || Convert.ToInt32(odRow["ItemType"]) == (int)enumPayrollComponentType.IncomeTax || Convert.ToInt32(odRow["ItemType"]) == (int)enumPayrollComponentType.OPI) // { // oRow["DeducAmount"] = odRow["CHANGEDAMOUNT"]; // } // TotalDeduc = TotalDeduc + Convert.ToDouble(oRow["DeducAmount"]); // nCount = nCount + 1; // employeeNo = odRow["EMPLOYEENO"].ToString(); // } // } // string empNo = string.Empty; // double nAmount = 0.00; // double nDeAmount = 0.00; // double total = 0.00; // Double dd = -1; // foreach (DataRow oDR1 in PayslipData) // { // if (empNo != oDR1["EMPLOYEENO"].ToString()) // { // nAmount = 0; nDeAmount = 0; // total = 0.00; // nAmount = PayslipData // .AsEnumerable() // .Where(r => (String)r["EMPLOYEENO"] == oDR1["EMPLOYEENO"].ToString()) // .Sum(r => (Double)r["Earning"]); // nDeAmount = PayslipData // .AsEnumerable() // .Where(r => (String)r["EMPLOYEENO"] == oDR1["EMPLOYEENO"].ToString() )//&& ((Double)r["DeducAmount"]) != dd // .Sum(r => (String.IsNullOrEmpty(Convert.ToString(r["DeducAmount"])) ? 0d : ((double)r["DeducAmount"]))); // total = Convert.ToDouble(nAmount - nDeAmount); // oDR1["STaka"] = Payroll.BO.GlobalFunctions.MillionToInWords(Convert.ToInt32(total)); // empNo = oDR1["EMPLOYEENO"].ToString(); // } // else if (empNo == oDR1["EMPLOYEENO"].ToString()) // { // oDR1["STaka"] = Payroll.BO.GlobalFunctions.MillionToInWords(Convert.ToInt32(total)); // empNo = oDR1["EMPLOYEENO"].ToString(); // } // } // string salaryMonth = arrearMonth.ToString("MMMM yyyy"); // string sTaka = Payroll.BO.GlobalFunctions.MillionToInWords(Convert.ToInt32(TotalGross - TotalDeduc)); // form.ShowArrearSlip(PayslipData, salaryMonth, sTaka); // } // else if (_type == "OPI") // { // itemType = "13"; // DataRow oRow = null; // // arrearMonth = GlobalFunctions.FirstDateOfMonth(Payroll.BO.SystemInformation.CurrentSysInfo.NextPayProcessDate); // arrearMonth = GlobalFunctions.FirstDateOfMonth(arrearProcess.ProcessMonth); // DataSet oSalaryMonthlys = MiscellaneousDataset.GetEmpArrerSlipGross(sEmpID, itemType, arrearProcess.ID.Integer); // PayrollDataSet.PayrollDataSet.PayslipDataTable PayslipData = new Payroll.Report.PayrollDataSet.PayrollDataSet.PayslipDataTable(); // _employees = Employee.GetWithDiscontinue(); // TotalGross = 0; // TotalArrear = 0; // foreach (DataRow odRow in oSalaryMonthlys.Tables[0].Rows) // { // oRow = PayslipData.NewRow(); // oRow = this.GrossMergeArrearOPI(oRow, odRow); // PayslipData.Rows.Add(oRow); // } // string salaryMonth = arrearMonth.ToString("MMMM yyyy"); // form.ShowDlgArrearOPISlip(PayslipData, salaryMonth); // } // } // private DataRow GrossMergeArrearOPI(DataRow destination, DataRow source) // { // Department oDepartment = null; // if (_Departments.Count > 0) // oDepartment = _Departments.Find(delegate(Department dd) { return dd.ID == Ease.CoreV35.Model.ID.FromInteger(Convert.ToInt32(source["DEPARTMENTID"])); }); // destination["Name"] = source["Name"]; // destination["EMPLOYEENO"] = source["EmployeeNo"]; // destination["Designation"] = source["Designation"]; // DateTime dt = Convert.ToDateTime(source["JOININGDATE"]); // string sdt = dt.ToString("MMM dd, yyyy"); // destination["DateOfJoining"] = sdt; // destination["LName"] = source["LName"]; // destination["Category"] = source["Category"]; // if (oDepartment.Tier == 1) // { // destination["Division"] = ""; // destination["Department"] = ""; // destination["Unit"] = ""; // } // else if (oDepartment.Tier == 2) // { // destination["Division"] = oDepartment.Name; // } // else if (oDepartment.Tier == 3) // { // destination["Division"] = oDepartment.Parent.Name; // destination["Department"] = oDepartment.Name; // } // else if (oDepartment.Tier == 4) // { // destination["Division"] = oDepartment.Parent.Parent.Name; // destination["Department"] = oDepartment.Parent.Name; // destination["Unit"] = oDepartment.Name; // } // else // { // destination["Division"] = ""; // destination["Department"] = ""; // destination["Unit"] = ""; // } // if (source["PAYMENTMODE"].Equals(2)) // { // destination["PAYMENTMODE"] = "Bank Transfer"; // } // else // { // destination["PAYMENTMODE"] = "Cheque"; // } // destination["BName"] = source["Bank"]; // destination["ACCOUNTNO"] = source["ACCOUNTNO"]; // destination["SalaryMonth"] = Convert.ToDateTime(source["ProcessMonth"]).ToString("dd MMM yyyy"); // destination["Description"] = source["Description"]; // //destination["Arrear"] = Convert.ToDouble(0.00); // destination["Earning"] = GlobalFunctions.Round(Convert.ToDouble(source["CHANGEDAMOUNT"])); // return destination; // } // private DataRow GrossMerge(DataRow destination, DataRow source) // { // if (Convert.ToInt32(source["ItemType"]) == (int)EnumArearProcessItemType.IncomeTax || Convert.ToInt32(source["ItemType"]) == (int)EnumArearProcessItemType.PF) // { // destination["Name"] = source["Name"]; // destination["EMPLOYEENO"] = source["EMPLOYEENO"]; // destination["Grade"] = source["Grade"]; // destination["Designation"] = source["Designation"]; // destination["Department"] = source["Department"]; // destination["LName"] = source["LName"]; // destination["ActualBasic"] = source["BASICSALARY"]; // if (source["PAYMENTMODE"].Equals(1)) // { // destination["PAYMENTMODE"] = "CashPayment"; // } // else if (source["PAYMENTMODE"].Equals(2)) // { // destination["PAYMENTMODE"] = "BankTransfer"; // } // else if (source["PAYMENTMODE"].Equals(3)) // { // destination["PAYMENTMODE"] = "Provision"; // } // destination["BName"] = source["Bank"]; // destination["ACCOUNTNO"] = source["ACCOUNTNO"]; // destination["SalaryMonth"] = Convert.ToDateTime(source["ProcessMonth"]).ToString("dd MMM yyyy"); // destination["Description"] = source["Description"]; // destination["ItemGroup"] = source["ItemType"]; // destination["ItemID"] = source["ITEMID"]; // return destination; // } // else // { // destination["Name"] = source["Name"]; // destination["EMPLOYEENO"] = source["EMPLOYEENO"]; // destination["Grade"] = source["Grade"]; // destination["Designation"] = source["Designation"]; // destination["Department"] = source["Department"]; // destination["LName"] = source["LName"]; // destination["ActualBasic"] = source["BASICSALARY"]; // if (source["PAYMENTMODE"].Equals(1)) // { // destination["PAYMENTMODE"] = "CashPayment"; // } // else if (source["PAYMENTMODE"].Equals(2)) // { // destination["PAYMENTMODE"] = "BankTransfer"; // } // else if (source["PAYMENTMODE"].Equals(3)) // { // destination["PAYMENTMODE"] = "Provision"; // } // destination["BName"] = source["Bank"]; // destination["ACCOUNTNO"] = source["ACCOUNTNO"]; // destination["SalaryMonth"] = Convert.ToDateTime(source["ProcessMonth"]).ToString("dd MMM yyyy"); // destination["Description"] = source["Description"]; // destination["ItemGroup"] = source["ItemType"]; // destination["ItemID"] = source["ITEMID"]; // return destination; // } // } // private DataRow GrossMergeForArrearSlip(DataRow destination, DataRow source) // { // Department oDepartment = null; // if (_Departments.Count > 0) // oDepartment = _Departments.Find(delegate(Department dd) { return dd.ID == Ease.CoreV35.Model.ID.FromInteger(Convert.ToInt32(source["DEPARTMENTID"])); }); // if (Convert.ToInt32(source["ItemType"]) == (int)EnumArearProcessItemType.IncomeTax || Convert.ToInt32(source["ItemType"]) == (int)EnumArearProcessItemType.PF) // { // destination["Name"] = source["Name"]; // destination["EMPLOYEENO"] = source["EMPLOYEENO"]; // destination["Grade"] = source["Grade"]; // destination["Designation"] = source["Designation"]; // DateTime dt = Convert.ToDateTime(source["JOININGDATE"]); // string sdt = dt.ToString("MMM dd, yyyy"); // destination["JoiningDate"] = sdt; // destination["LName"] = source["LName"]; // // destination["Category"] = source["Category"]; // if (oDepartment.Tier == 1) // { // //destination["Division"] = ""; // destination["Department"] = ""; // // destination["Unit"] = ""; // } // else if (oDepartment.Tier == 2) // { // destination["Division"] = oDepartment.Name; // } // else if (oDepartment.Tier == 3) // { // //destination["Division"] = oDepartment.Parent.Name; // destination["Department"] = oDepartment.Name; // } // else if (oDepartment.Tier == 4) // { // // destination["Division"] = oDepartment.Parent.Parent.Name; // destination["Department"] = oDepartment.Parent.Name; // //destination["Unit"] = oDepartment.Name; // } // else // { // //destination["Division"] = ""; // destination["Department"] = ""; // // destination["Unit"] = ""; // } // destination["ActualBasic"] = source["BASICSALARY"]; // if (source["PAYMENTMODE"].Equals(2)) // { // destination["PAYMENTMODE"] = "Bank Transfer"; // } // else // { // destination["PAYMENTMODE"] = "Cheque"; // } // destination["BName"] = source["Bank"]; // destination["ACCOUNTNO"] = source["ACCOUNTNO"]; // destination["SalaryMonth"] = Convert.ToDateTime(source["ProcessMonth"]).ToString("dd MMM yyyy"); // destination["Description"] = ""; // destination["ItemGroup"] = source["ItemType"]; // destination["ItemID"] = source["ITEMID"]; // if (arrearMonth.Month >= 1 && arrearMonth.Month < 7) // { // _fiscalyearStart = new DateTime(arrearMonth.Year - 1, 7, 1); // destination["TaxMonth"] = _fiscalyearStart.ToString("MMM yyyy"); // } // else // { // _fiscalyearStart = new DateTime(arrearMonth.Year, 7, 1); // destination["TaxMonth"] = _fiscalyearStart.ToString("MMM yyyy"); // } // return destination; // } // else if (Convert.ToInt32(source["ItemType"]) == (int)EnumArearProcessItemType.Allowance || Convert.ToInt32(source["ItemType"]) == (int)EnumArearProcessItemType.Basic || Convert.ToInt32(source["ItemType"]) == (int)EnumArearProcessItemType.Bonus || Convert.ToInt32(source["ItemType"]) == (int)EnumArearProcessItemType.OT) // { // destination["Name"] = source["Name"]; // destination["EMPLOYEENO"] = source["EMPLOYEENO"]; // destination["Grade"] = source["Grade"]; // destination["Designation"] = source["Designation"]; // DateTime dt = Convert.ToDateTime(source["JOININGDATE"]); // string sdt = dt.ToString("MMM dd, yyyy"); // destination["JoiningDate"] = sdt; // destination["LName"] = source["LName"]; // //destination["Category"] = source["Category"]; // if (oDepartment.Tier == 1) // { // //destination["Division"] = ""; // destination["Department"] = ""; // //destination["Unit"] = ""; // } // else if (oDepartment.Tier == 2) // { // //destination["Division"] = oDepartment.Name; // } // else if (oDepartment.Tier == 3) // { // // destination["Division"] = oDepartment.Parent.Name; // destination["Department"] = oDepartment.Name; // } // else if (oDepartment.Tier == 4) // { // //destination["Division"] = oDepartment.Parent.Parent.Name; // destination["Department"] = oDepartment.Parent.Name; // //destination["Unit"] = oDepartment.Name; // } // else // { // //destination["Division"] = ""; // destination["Department"] = ""; // // destination["Unit"] = ""; // } // destination["ActualBasic"] = source["BASICSALARY"]; // if (source["PAYMENTMODE"].Equals(2)) // { // destination["PAYMENTMODE"] = "Bank Transfer"; // } // else // { // destination["PAYMENTMODE"] = "Cheque"; // } // destination["BName"] = source["Bank"]; // destination["ACCOUNTNO"] = source["ACCOUNTNO"]; // destination["SalaryMonth"] = Convert.ToDateTime(source["ProcessMonth"]).ToString("dd MMM yyyy"); // destination["Description"] = source["Description"]; // destination["ItemGroup"] = source["ItemType"]; // destination["ItemID"] = source["ITEMID"]; // if (arrearMonth.Month >= 1 && arrearMonth.Month < 7) // { // _fiscalyearStart = new DateTime(arrearMonth.Year - 1, 7, 1); // destination["TaxMonth"] = _fiscalyearStart.ToString("MMM yyyy"); // } // else // { // _fiscalyearStart = new DateTime(arrearMonth.Year, 7, 1); // destination["TaxMonth"] = _fiscalyearStart.ToString("MMM yyyy"); // } // return destination; // } // else // { // return destination; // } // } // private DataRow GetItem(Payroll.Report.PayrollDataSet.PayrollDataSet.PayslipDataTable Source, string sEmpNo, EnumArearProcessItemType enumArearProcessItemType, int ITemID) // { // foreach (DataRow odRow in Source.Rows) // { // if (Convert.ToString(odRow["EMPLOYEENO"]) == sEmpNo && // Convert.ToInt32(odRow["ItemID"]) == ITemID) // { // return odRow; // } // } // return null; // } // public void ShowArrearSheet(ArrearProcess arrearProcess, string sEmpID, string _type) // { // fReportViewer form = new fReportViewer(); // PayrollDataSet.PayrollDataSet.ArrSheetDataTable arrDataTable = new Payroll.Report.PayrollDataSet.PayrollDataSet.ArrSheetDataTable(); // PayrollDataSet.PayrollDataSet.ArrSheetDataTable arrDataTableTemp = new Payroll.Report.PayrollDataSet.PayrollDataSet.ArrSheetDataTable(); // PayrollDataSet.PayrollDataSet.ArrSheetDataTable arrDataTableSorted = new Payroll.Report.PayrollDataSet.PayrollDataSet.ArrSheetDataTable(); // //arrearMonth = GlobalFunctions.LastDateOfMonth(Payroll.BO.SystemInformation.CurrentSysInfo.NextPayProcessDate); // arrearMonth = GlobalFunctions.FirstDateOfMonth(arrearProcess.ProcessMonth); // double Total = 0; // int serialNo = 0; // string sEmpNo = string.Empty; // DataRow oDR = null; // DataRow or = null; // string itemType = string.Empty; // string sReportName = string.Empty; // string tempEmpNo = string.Empty; // string sl = string.Empty; // if (_type == "Salary") // { // sReportName = "Arrear Sheet of Salary"; // itemType = "1,2,3,4,5,6,7,8,11,12,9,13,21"; // DataSet oSalarySheets = MiscellaneousDataset.GetEmpArrerSheet(sEmpID, itemType,arrearProcess.ID.Integer); // foreach (DataRow row in oSalarySheets.Tables[0].Rows) // { // if (sEmpNo.Trim() != row["EMPLOYEENO"].ToString()) // { // serialNo++; // sEmpNo = row["EMPLOYEENO"].ToString().Trim(); // } // if (sl != row["SLGroup"].ToString()) // { // Total = 0; // } // sl = row["SLGroup"].ToString(); // oDR = arrDataTable.NewRow(); // oDR["EMPLOYEENO"] = sEmpNo; // oDR["NAME"] = row["NAME"]; // oDR["GName"] = row["GName"]; // oDR["DName"] = row["DName"]; // oDR["GCode"] = row["GCode"]; // oDR["SL"] = row["SL"]; // oDR["SLGroup"] = row["SLGroup"]; // oDR["EmployeeID"] = row["EmployeeID"]; // oDR["ProcessMonth"] = Convert.ToDateTime(row["ProcessMonth"]).ToString("dd MMM yyyy"); // if ((row["ItemType"]).ToString() !="8") // { // Total += GlobalFunctions.Round(Convert.ToDouble(row["ChangedAmount"])); // oDR["NetPay"] = Total; // } // else // { // Total -= GlobalFunctions.Round(Convert.ToDouble(row["ChangedAmount"])); // oDR["NetPay"] = Total; // } // oDR["Description"] = row["Description"]; // oDR["SerialNo"] = Convert.ToDouble(row["SerialNo"]); // oDR["ChangedAmount"] = GlobalFunctions.Round(Convert.ToDouble(row["ChangedAmount"])); // oDR["ItemSerialNo"] = Convert.ToDouble(serialNo); // oDR["DegCode"] = row["dcode"]; // arrDataTable.Rows.Add(oDR); // } // DataSet tempDataSet = new DataSet(); // tempDataSet.Tables.Add(arrDataTable); // for (int i = tempDataSet.Tables[0].Rows.Count-1; i > 0; i--) // { // DataRow dr = tempDataSet.Tables[0].Rows[i]; // if (tempEmpNo == dr["EMPLOYEENO"].ToString()) // { // continue; // } // tempEmpNo = dr["EMPLOYEENO"].ToString(); // or = arrDataTableTemp.NewRow(); // or["EMPLOYEENO"] = dr["EMPLOYEENO"]; // or["NAME"] = dr["NAME"]; // or["GName"] = dr["GName"]; // or["DName"] = dr["DName"]; // or["GCode"] = dr["GCode"]; // or["EmployeeID"] = dr["EmployeeID"]; // or["ProcessMonth"] = Convert.ToDateTime(dr["ProcessMonth"]).ToString("dd MMM yyyy"); // or["Description"] = "Net Pay"; // or["SerialNo"] = Convert.ToDouble(dr["SerialNo"]); // or["ChangedAmount"] = dr["NetPay"]; // or["ItemSerialNo"] = Convert.ToDouble(serialNo); // //or["DegCode"] = row["dcode"]; // arrDataTableTemp.Rows.Add(or); // } // serialNo = 0; // arrDataTable.Merge(arrDataTableTemp); // sEmpNo = string.Empty; // var sortedData = from DataRow dr in arrDataTable.Rows orderby dr["EMPLOYEENO"] select dr; // foreach (DataRow dr in sortedData) // { // if (sEmpNo.Trim() != dr["EMPLOYEENO"].ToString()) // { // serialNo++; // sEmpNo = dr["EMPLOYEENO"].ToString().Trim(); // } // DataRow nDr = arrDataTableSorted.NewRow(); // nDr.ItemArray = dr.ItemArray; // nDr["ItemSerialNo"] = Convert.ToDouble(serialNo); // arrDataTableSorted.Rows.Add(nDr); // } // } // else if (_type == "OPI") // { // sReportName = "Arrear Sheet of OPI"; // itemType = "8,10"; // DataSet oSalarySheets = MiscellaneousDataset.GetEmpArrerSheet(sEmpID, itemType, arrearProcess.ID.Integer); // foreach (DataRow row in oSalarySheets.Tables[0].Rows) // { // if (sEmpNo.Trim() != row["EMPLOYEENO"].ToString()) // { // serialNo++; // sEmpNo = row["EMPLOYEENO"].ToString().Trim(); // } // oDR = arrDataTable.NewRow(); // oDR["EMPLOYEENO"] = sEmpNo; // oDR["NAME"] = row["NAME"]; // oDR["GName"] = row["GName"]; // oDR["DName"] = row["DName"]; // oDR["GCode"] = row["GCode"]; // oDR["EmployeeID"] = row["EmployeeID"]; // oDR["ProcessMonth"] = Convert.ToDateTime(row["ProcessMonth"]).ToString("dd MMM yyyy"); // oDR["Description"] = row["Description"]; // oDR["SerialNo"] = Convert.ToDouble(row["SerialNo"]); // oDR["ChangedAmount"] = GlobalFunctions.Round(Convert.ToDouble(row["ChangedAmount"])); // oDR["ItemSerialNo"] = Convert.ToDouble(serialNo); // oDR["DegCode"] = row["dcode"]; // arrDataTable.Rows.Add(oDR); // } // serialNo = 0; // sEmpNo = string.Empty; // var sortedData = from DataRow dr in arrDataTable.Rows orderby dr["DegCode"] select dr; // foreach (DataRow dr in sortedData) // { // if (sEmpNo.Trim() != dr["EMPLOYEENO"].ToString()) // { // serialNo++; // sEmpNo = dr["EMPLOYEENO"].ToString().Trim(); // } // DataRow nDr = arrDataTableSorted.NewRow(); // nDr.ItemArray = dr.ItemArray; // nDr["ItemSerialNo"] = Convert.ToDouble(serialNo); // arrDataTableSorted.Rows.Add(nDr); // } // } // //DataView dv = arrDataTable.DefaultView; // //dv.Sort("DName", "ASC"); // form.ShowArrearSalarySheet(arrDataTableSorted, arrearMonth, sReportName); // } // } //}