public virtual IActionResult List(ContractPaymentAdvanceSearchModel searchModel) { //if (!_permissionService.Authorize(StandardPermissionProvider.ManageConstruction)) // return AccessDeniedKendoGridJson(); //prepare model var model = _paymentAdvanceFactory.PrepareContractPaymentAdvanceListModel(searchModel); return(Json(model)); }
public virtual IActionResult List() { var model = new ContractPaymentAdvanceSearchModel(); var treeTam = ""; var units = _unitService.GetAllUnits(); model.AvailableUnit = units.Select(c => new SelectListItem { Text = treeTam.PadLeft((int)c.TreeLevel - 1, '-') + c.Name, Value = c.Id.ToString(), Selected = c.Id == model.UnitId }).ToList(); model.AvailableUnit.Insert(0, new SelectListItem { Value = "0", Text = "--Chọn đơn vị--" }); return(View(model)); }
public virtual IActionResult List() { if (!_permissionService.Authorize(StandardPermissionProvider.ManageAdvanceList)) { return(AccessDeniedView()); } var model = new ContractPaymentAdvanceSearchModel(); var treeTam = ""; var units = _unitService.GetAllUnits(); model.AvailableUnit = units.Select(c => new SelectListItem { Text = treeTam.PadLeft((int)c.TreeLevel - 1, '-') + c.Name, Value = c.Id.ToString(), Selected = c.Id == model.UnitId }).ToList(); model.AvailableUnit.Insert(0, new SelectListItem { Value = "0", Text = "--Chọn đơn vị--" }); return(View(model)); }
public ContractPaymentAdvanceSearchModel PrepareContractPaymentAdvanceSearchModel(ContractPaymentAdvanceSearchModel searchModel) { throw new NotImplementedException(); }
public ContractPaymentAdvanceListModel PrepareContractPaymentAdvanceListModel(ContractPaymentAdvanceSearchModel searchModel) { if (searchModel == null) { throw new ArgumentNullException(nameof(searchModel)); } //get items var items = _paymentAdvanceService.getAllPaymentAdvance(Keysearch: searchModel.Keysearch, UnitId: (int)searchModel.UnitId, pageSize: searchModel.PageSize, pageIndex: searchModel.Page - 1, FromDate: searchModel.FromDate, ToDate: searchModel.ToDate); //prepare list model var model = new ContractPaymentAdvanceListModel { //fill in model values from the entity Data = items.Select(store => store.ToModel <ContractPaymentAdvanceModel>()), Total = items.TotalCount }; return(model); }