public PayrollArrearsDTO GetArrearById(int Id) { PayrollArrear item = _unitOfWork.PayrollArrear.GetById(Id); PayrollArrearsDTO viewItem = PayrollArrearsRequestFormatter.ConvertRespondentInfoToDTO(item); return(viewItem); }
public static PayrollArrear ConvertRespondentInfoFromDTO(PayrollArrearsDTO PayrollArrearsDTO) { Mapper.CreateMap <PayrollArrearsDTO, PayrollArrear>().ConvertUsing( m => { return(new PayrollArrear { Id = m.Id, EmployeeCode = m.EmployeeCode, EarningDeduction = m.EarningDeduction, FyId = m.FyId, NoOfDays = m.NoOfDays, AdjustMonth = m.AdjustMonth, ArrearMonth = m.ArrearMonth }); }); return(Mapper.Map <PayrollArrearsDTO, PayrollArrear>(PayrollArrearsDTO)); }
public ActionResult PayrollArrearsCreate(PayrollArrearsDTO item) { try { if (ModelState.IsValid) { _PayrollArrearService.InsertIntoArrears(item); } else { ViewBag.Error = "Form validation error."; return(View()); } } catch (Exception Exception) { ViewBag.Error = Exception.Message; return(View()); } ViewBag.Success = "Arrear created successfully."; IEnumerable <PayrollArrearsDTO> items = _PayrollArrearService.GetPayrollArrears(); return(View("PayrollArrears", items)); }
public void InsertIntoArrears(PayrollArrearsDTO Record) { PayrollArrear modelItem = PayrollArrearsRequestFormatter.ConvertRespondentInfoFromDTO(Record); _unitOfWork.PayrollArrear.Create(modelItem); }
public PayrollArrearsDTO GetCreateForm() { PayrollArrearsDTO item = new PayrollArrearsDTO(); IEnumerable <Employee> EmployeeList = _unitOfWork.EmployeeRepository.All().ToList(); List <SelectListItem> EmpList = new List <SelectListItem>(); foreach (Employee Employee in EmployeeList) { EmpList.Add(new SelectListItem { Text = Employee.EmpName, Value = Employee.EmpCode.ToString() }); } item.EmployeeList = EmpList; List <SelectListItem> ArrearMonthList = new List <SelectListItem>(); List <PayrollMonthDescription> ArrearMnthList = _unitOfWork.PayrollMonthDescriptipnRepository.All().ToList(); foreach (PayrollMonthDescription Mnt in ArrearMnthList) { ArrearMonthList.Add(new SelectListItem { Text = Mnt.MonthNameNepali, Value = Mnt.Id.ToString() }); } item.ArrearMonthList = ArrearMonthList; List <SelectListItem> AdjustMonthList = new List <SelectListItem>(); List <PayrollMonthDescription> AdjustMnthList = _unitOfWork.PayrollMonthDescriptipnRepository.All().ToList(); foreach (PayrollMonthDescription Mnt in AdjustMnthList) { AdjustMonthList.Add(new SelectListItem { Text = Mnt.MonthNameNepali, Value = Mnt.Id.ToString() }); } item.AdjustMonthList = AdjustMonthList; List <SelectListItem> FiscalYearList = new List <SelectListItem>(); List <Fiscal> fsclList = _unitOfWork.FiscalRepository.All().ToList(); foreach (Fiscal yr in fsclList) { FiscalYearList.Add(new SelectListItem { Text = yr.FyName, Value = yr.FyId.ToString() }); } item.FiscalYearList = FiscalYearList; List <SelectListItem> ErngsDductionList = new List <SelectListItem>(); ErngsDductionList.Add(new SelectListItem { Text = "Earning", Value = "E" }); ErngsDductionList.Add(new SelectListItem { Text = "Deduction", Value = "D" }); item.EarningDeductionList = ErngsDductionList; return(item); }
public ActionResult PayrollArrearsCreate() { PayrollArrearsDTO item = _PayrollArrearService.GetCreateForm(); return(View(item)); }