public IEnumerable <PayrollMonthDescriptionDTO> GetAllPayrollMonths(int fyId) { List <PayrollMonthDescriptionDTO> Records = new List <PayrollMonthDescriptionDTO>(); IEnumerable <PayrollMonthDescription> modelDatas = _unitOfWork.PayrollMonthDescriptipnRepository.All().Where(x => x.FyId == Convert.ToInt32(fyId)).ToList(); foreach (var str in modelDatas) { PayrollMonthDescriptionDTO Singles = new PayrollMonthDescriptionDTO(); Singles = PayrollMonthDescriptionRequestFormatter.ConvertRespondentInfoToDTO(str); Singles.Fiscal = FiscalRequestFormatter.ConvertRespondentInfoToDTO(str.Fiscal); Records.Add(Singles); } return(Records); }
public PayrollMonthDescriptionDTO GetPayrollMonthById(int Id) { PayrollMonthDescription DbRecords = _unitOfWork.PayrollMonthDescriptipnRepository.GetById(Id); IEnumerable <SelectListItem> Record = GetFiscalDropDown(); foreach (var str in Record) { if (Convert.ToInt32(str.Value) == DbRecords.FyId) { str.Selected = true; } } PayrollMonthDescriptionDTO ViewRecord = PayrollMonthDescriptionRequestFormatter.ConvertRespondentInfoToDTO(DbRecords); ViewRecord.Fiscals = Record; return(ViewRecord); }
public void UpdatePayrollMonth(PayrollMonthDescriptionDTO Data) { PayrollMonthDescription UpdateData = PayrollMonthDescriptionRequestFormatter.ConvertRespondentInfoFromDTO(Data); _unitOfWork.PayrollMonthDescriptipnRepository.Update(UpdateData); }
public void InsertIntoMonthDescription(PayrollMonthDescriptionDTO Record) { PayrollMonthDescription Insert = PayrollMonthDescriptionRequestFormatter.ConvertRespondentInfoFromDTO(Record); _unitOfWork.PayrollMonthDescriptipnRepository.Create(Insert); }