Beispiel #1
0
        public ActionResult EditEmployeePayrollMaster(int id)
        {
            SetupEmployeeMasterModel     model  = new SetupEmployeeMasterModel();
            SetupEmployeeMasterProviders SEMPro = new SetupEmployeeMasterProviders();

            if (GetPayrollCount(id) == true)
            {
                return(RedirectToAction("Index", new { string.Empty, message = "Employee Payroll Not Created. Please Create Payroll First!!" }));
            }
            model = SEMPro.GetEmployeePayrollMaster().Where(x => x.EmployeeMasterId == id).FirstOrDefault();
            model.EmployeeAllowanceSetupModelList = SEMPro.GetEmployeeAllowanceInfo().Where(x => x.EmployeeMasterId == id).ToList();
            model.EmployeeDeductionSetupModelList = SEMPro.GetEmployeeDeductionInfo().Where(x => x.EmployeeMasterId == id).ToList();
            model.EmployeeMasterId = id;
            return(View(model));
        }
Beispiel #2
0
        public ActionResult GenerateSalarySheet(SetupEmployeeMasterModel model)
        {
            SetupEmployeeMasterProviders SProv = new SetupEmployeeMasterProviders();

            if (model.EmployeeMasterId == 0)
            {
                model.SetupEmployeeMasterModelList    = SProv.GetEmployeePayrollMaster().ToList();
                model.EmployeeAllowanceSetupModelList = SProv.GetEmployeeAllowanceInfo().ToList();
                model.EmployeeDeductionSetupModelList = SProv.GetEmployeeDeductionInfo().ToList();
            }
            else
            {
                model.SetupEmployeeMasterModelList    = SProv.GetEmployeePayrollMaster().Where(x => x.EmployeeMasterId == model.EmployeeMasterId).ToList();
                model.EmployeeAllowanceSetupModelList = SProv.GetEmployeeAllowanceInfo().Where(x => x.EmployeeMasterId == model.EmployeeMasterId).ToList();
                model.EmployeeDeductionSetupModelList = SProv.GetEmployeeDeductionInfo().Where(x => x.EmployeeMasterId == model.EmployeeMasterId).ToList();
            }
            int i = SProv.GeneratePayroll(model);

            if (i != 0)
            {
                return(PartialView("_ViewSalarySheet", model));
            }
            return(View(model));
        }