public ProcuringAgencyListModel PrepareProcuringAgencyListModel(ProcuringAgencySearchModel searchModel) { if (searchModel == null) { throw new ArgumentNullException(nameof(searchModel)); } //get items var items = _procuringAgencyService.GetProcuringAgencys(searchModel.TypeId, searchModel.Name, searchModel.IsInEVN, searchModel.Page - 1, searchModel.PageSize); //prepare list model var model = new ProcuringAgencyListModel { //fill in model values from the entity Data = items.Select(c => { var m = c.ToModel <ProcuringAgencyModel>(); m.TypeText = _localizationService.GetLocalizedEnum(c.procuringAgencyType); return(m); } ), Total = items.TotalCount }; return(model); }
public virtual IActionResult List(ProcuringAgencySearchModel searchModel) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageProcuringAgency)) { return(AccessDeniedKendoGridJson()); } //prepare model var model = _procuringAgencyModelFactory.PrepareProcuringAgencyListModel(searchModel); return(Json(model)); }
public ProcuringAgencySearchModel PrepareProcuringAgencySearchModel(ProcuringAgencySearchModel searchModel) { if (searchModel == null) { throw new ArgumentNullException(nameof(searchModel)); } //prepare page parameters searchModel.SetGridPageSize(); searchModel.lsType = ((ProcuringAgencyType)searchModel.TypeId).ToSelectList(); searchModel.IsInEVN = true; return(searchModel); }