public virtual ReportBalanceSearchModel PrepareReportBalanceSearchModel(ReportBalanceSearchModel model = null) { if (null == model) { model = new ReportBalanceSearchModel(); } baseAdminModelFactory.PrepareStatisticsFrequency(model.AvailableStatisticsFrequencies, false); baseAdminModelFactory.PrepareFeeCategories(model.AvailableFeeCategories, false); return(model); }
public virtual TripModel PrepareModel(TripModel model, Trip entity, bool excludeProperties = false) { if (null != entity) { model = model ?? entity.ToModel <TripModel>(); PrepareConsignmentOrderSearchModel(model.ConsignmentOrderSearchModel, entity); } if (null == model) { model = new TripModel { SerialNum = CommonHelper.GenerateSerialNumber() } } ; PrepareModel(ref model); baseAdminModelFactory.PrepareCars(model.AvailableCars, defaultItemText: localizationService.GetResource("Admin.Common.Select")); baseAdminModelFactory.PrepareDrivers(model.AvailableDrivers, defaultItemText: localizationService.GetResource("Admin.Common.Select")); baseAdminModelFactory.PrepareFeeCategories(model.AvaliableFeeCategories, withSpecialDefaultItem: false); if (model.Fees.Count != model.AvaliableFeeCategories.Count) { model.Fees.Clear(); foreach (var item in model.AvaliableFeeCategories) { model.Fees.Add(new FeeModel { CategoryId = int.Parse(item.Value) }); } } return(model); }