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 static PayrollMonthDescriptionDTO ConvertRespondentInfoToDTO(PayrollMonthDescription PayrollMonthDescription) { AutoMapper.Mapper.CreateMap <PayrollMonthDescription, PayrollMonthDescriptionDTO>().ConvertUsing( m => { return(new PayrollMonthDescriptionDTO { Id = m.Id, FyId = m.FyId, MonthIndex = m.MonthIndex, MonthNameEnglish = m.MonthNameEnglish, MonthNameNepali = m.MonthNameNepali, StartDate = m.StartDate, EndDate = m.EndDate, WorkingDays = m.WorkingDays }); }); return(AutoMapper.Mapper.Map <PayrollMonthDescription, PayrollMonthDescriptionDTO>(PayrollMonthDescription)); }
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); }