public JsonResult GetPayrollMonth() { MTSHRDataLayer.Payroll data_pay = new MTSHRDataLayer.Payroll(); var payrollData = data_pay.GetPayrollMonth(); return(Json(new { result = payrollData }, JsonRequestBehavior.AllowGet)); }
public ActionResult GetMonthlyVarianceData(string EmpId, string type, string description) { MTSHRDataLayer.Payroll data = new MTSHRDataLayer.Payroll(); var MonthlyVarianceData = data.GetMonthlyVarianceData(Convert.ToInt64(EmpId), Convert.ToInt64(type), description); return(Json(new { success = true, result1 = JsonConvert.SerializeObject(MonthlyVarianceData.Tables[0]), result2 = JsonConvert.SerializeObject(MonthlyVarianceData.Tables[1]) }, JsonRequestBehavior.AllowGet)); }
public JsonResult GetPayrollFromDate(string Payroll_Month) { var year = ""; int month = 0; if (!string.IsNullOrEmpty(Payroll_Month)) { string[] date = new string[2]; date = Payroll_Month.Split('-'); var MonthName = date[0]; year = date[1].Trim().ToString(); month = this.getMonth(MonthName); } else { return(Json(new { result = "0" }, JsonRequestBehavior.AllowGet)); } MTSHRDataLayer.Payroll data_pay = new MTSHRDataLayer.Payroll(); var payrollDataFrom = data_pay.GetPayrollFromDate(month.ToString(), year); var payrollDataTo = data_pay.GetPayrollToDate(month.ToString(), year); var prevBonus = data_pay.GetPayrollPreviousBonus(month.ToString(), year); return(Json(new { result = payrollDataFrom, result2 = payrollDataTo, result1 = prevBonus }, JsonRequestBehavior.AllowGet)); }
public ActionResult GetEmployeePayrollDetails(string EmpId) { MTSHRDataLayer.Payroll data = new MTSHRDataLayer.Payroll(); var MonthlyVarianceData = data.GetEmployeePayrollDetails(Convert.ToInt64(EmpId)); return(Json(new { success = true, result1 = JsonConvert.SerializeObject(MonthlyVarianceData.Tables[0]), result2 = JsonConvert.SerializeObject(MonthlyVarianceData.Tables[1]) }, JsonRequestBehavior.AllowGet)); }
public ActionResult GetDeductionCalculationDetails() { MTSHRDataLayer.Payroll data = new MTSHRDataLayer.Payroll(); var MonthlyVarianceData = data.GetDeductionCalculationDetails(); return(Json(new { success = true, result1 = JsonConvert.SerializeObject(MonthlyVarianceData.Tables[0]), result2 = JsonConvert.SerializeObject(MonthlyVarianceData.Tables[1]), result3 = JsonConvert.SerializeObject(MonthlyVarianceData.Tables[2]) }, JsonRequestBehavior.AllowGet)); }
public ActionResult UpdateMonthlyVarianceData(Int64 ID, string EmpId, string type, string description, string Amount, string month) { MTSHRDataLayer.Payroll data = new MTSHRDataLayer.Payroll(); var result = JsonConvert.SerializeObject(data.UpdateMonthlyVarianceData(ID, Convert.ToInt64(EmpId), Convert.ToInt64(type), description, Amount == "" ? (Decimal)0 : Convert.ToDecimal(Amount), month == "" ? (DateTime?)null : Convert.ToDateTime(month))); return(Json(new { success = result })); }
public ActionResult UpdatePrevBounsDate(DateTime PrevBounsDate) { MTSHRDataLayer.Payroll PrevBouns = new MTSHRDataLayer.Payroll(); Int64 result = PrevBouns.UpdatePrevBounsDate(PrevBounsDate, Convert.ToInt64(Session["UserID"].ToString())); return(Json(new { success = true, result = result })); }
public ActionResult SubmitPayrollDetails(Payroll roll, Int64 payrollID) { MTSHRDataLayer.Payroll data = new MTSHRDataLayer.Payroll(); var result = JsonConvert.SerializeObject(data.SubmitPayrollDetails(roll.EmpId, roll.Basic_Pay, roll.HouseRentAllwn, roll.SpecialAllwn, roll.MedicalAllwn , roll.ConveyanceAllwn, roll.FoodAllwn, roll.GrossSalary, roll.PF, roll.ProffesionalTax, roll.ESI, roll.SodexoPass, roll.Others, roll.TotalDeduction, roll.NetSalary, roll.EffectiveSince, roll.PF_Restriction, payrollID)); return(Json(new { success = result })); }
public JsonResult GetEmployeesList() { DataTable dt = new DataTable(); MTSHRDataLayer.Payroll activeEmployee = new MTSHRDataLayer.Payroll(); dt = activeEmployee.Read(); return(Json(JsonConvert.SerializeObject(dt), JsonRequestBehavior.AllowGet)); }
public ActionResult RevisePayrollDetails(Int64 Empid) { MTSHRDataLayer.Payroll revisePayroll = new MTSHRDataLayer.Payroll(); Int64 result = revisePayroll.RevisePayrollDetails(Empid); if (result == 2) { return(Content("1")); } return(Content("0")); }
public ActionResult GetEmployeeLossOfPayDetails(Int64 EmployeeId, string Month, string Year) { DataTable dt = new DataTable(); try { Month = getMonth(Month).ToString(); MTSHRDataLayer.Payroll payroll = new MTSHRDataLayer.Payroll(); dt = payroll.GetEmployeeLossOfPayDetails(EmployeeId, Month, Year); } catch (Exception ex) { BaseExceptionHandler.HandleException(ref ex); dt = new DataTable(); } return(Json(JsonConvert.SerializeObject(dt))); }
public ActionResult AddOrRemoveLop(Int64 EmployeeId, string Month, string Year, DateTime LeaveFrom, DateTime LeaveTo, decimal Numberofdays, string Reason, bool AutoLop, Int64 AddOrRemoveFlag) { Int64 result = 0; try { Month = getMonth(Month).ToString(); Month = Month.Length == 1 ? ("0" + Month) : Month; MTSHRDataLayer.Payroll payroll = new MTSHRDataLayer.Payroll(); result = payroll.AddOrRemoveLop(EmployeeId, Month, Year, LeaveFrom, LeaveTo, Numberofdays, Reason, AutoLop, AddOrRemoveFlag, Convert.ToInt64(Session["UserID"].ToString())); } catch (Exception ex) { BaseExceptionHandler.HandleException(ref ex); result = -999; } return(Content(result.ToString())); }
public ActionResult UpdatePayrollDetails(Int64 ID, Int64 EmployeeId, float BasicPay, float HouseAllowance, float SpecialAllowance, float Medical_allowance, float FoodAllowance, float Conveyance, float Others, float TotalEarnings, float SudexoPass, float IncomeTax, float Professional_Tax, float EmployeeEsi, float Employee_PF, float OthersDeductions, float TotalDeductions, float Incentives, float NetSalary, float TotalDays, float LopDays, float PaidDays) { Int64 result = 0; try { MTSHRDataLayer.Payroll payroll = new MTSHRDataLayer.Payroll(); result = payroll.UpdatePayrollDetails(ID, EmployeeId, BasicPay, HouseAllowance, SpecialAllowance, Medical_allowance, FoodAllowance, Conveyance, Others, TotalEarnings, SudexoPass, IncomeTax, Professional_Tax, EmployeeEsi, Employee_PF, OthersDeductions, TotalDeductions, Incentives, NetSalary, TotalDays, LopDays, PaidDays, Convert.ToInt64(Session["UserID"].ToString())); } catch (Exception ex) { BaseExceptionHandler.HandleException(ref ex); result = -999; } return(Content(result.ToString())); }
public JsonResult GetPayrollReport(string FromDate, String Option) { string fromyear = ""; int frommonth = 0; if (!string.IsNullOrEmpty(FromDate)) { string[] date = new string[2]; date = FromDate.Split('-'); var MonthName = date[0]; fromyear = date[1].Trim().ToString(); frommonth = this.getMonth(MonthName); } MTSHRDataLayer.Payroll data_pay = new MTSHRDataLayer.Payroll(); DataTable payrollReport = new DataTable(); payrollReport = data_pay.GetpayrollReport(frommonth.ToString(), fromyear, Option); return(Json(new { result = JsonConvert.SerializeObject(payrollReport) }, JsonRequestBehavior.AllowGet)); }
public void GetDownloadPayroll(string Month) { if (!string.IsNullOrEmpty(Month)) { string[] date = new string[2]; date = Month.Split('-'); var MonthName = date[0]; var year = date[1].Trim().ToString(); int month = this.getMonth(MonthName); DataTable dt = new DataTable(); MTSHRDataLayer.Payroll data_pay = new MTSHRDataLayer.Payroll(); dt = data_pay.GetDownloadPayroll(month.ToString(), year); string attachment = "attachment; filename=payroll_employee_bank_sheet_" + Month + ".xls"; Response.ClearContent(); Response.AddHeader("content-disposition", attachment); Response.ContentType = "application/vnd.ms-excel"; string tab = ""; foreach (DataColumn dc in dt.Columns) { Response.Write(tab + dc.ColumnName); tab = "\t"; } Response.Write("\n"); int i; foreach (DataRow dr in dt.Rows) { tab = ""; for (i = 0; i < dt.Columns.Count; i++) { Response.Write(tab + dr[i].ToString()); tab = "\t"; } Response.Write("\n"); } Response.End(); } }
public JsonResult Read_Lop(string Payroll_Month, string AttandanceFrom, string AttandanceTo) { var year = ""; int month = 0; if (!string.IsNullOrEmpty(Payroll_Month)) { string[] date = new string[2]; date = Payroll_Month.Split('-'); var MonthName = date[0]; year = date[1].Trim().ToString(); month = this.getMonth(MonthName); } else { return(Json(new { result = "" }, JsonRequestBehavior.AllowGet)); } MTSHRDataLayer.Payroll data_pay = new MTSHRDataLayer.Payroll(); var payrollData = Json(JsonConvert.SerializeObject(data_pay.Get_Lop_Days(month.ToString(), year, AttandanceFrom, AttandanceTo).Tables[0])); return(Json(new { result = payrollData }, JsonRequestBehavior.AllowGet)); }
public JsonResult CheckPayrollDetails(string Payroll_Month, Int64 Flag) { var year = ""; int month = 0; if (!string.IsNullOrEmpty(Payroll_Month)) { string[] date = new string[2]; date = Payroll_Month.Split('-'); var MonthName = date[0]; year = date[1].Trim().ToString(); month = this.getMonth(MonthName); } else { return(Json(new { result = "0" }, JsonRequestBehavior.AllowGet)); } MTSHRDataLayer.Payroll data_pay = new MTSHRDataLayer.Payroll(); var payrollData = Json(JsonConvert.SerializeObject(data_pay.CheckPayrollData(month.ToString(), year, Flag))); return(Json(new { result = payrollData }, JsonRequestBehavior.AllowGet)); }