private CustomerRechargeListViewModel Data_Bind(CustomerRechargeListFilterModel filter) { var model = new CustomerRechargeListViewModel { FilterModel = filter, PagedList = _customerService.GetCustomerCreditPagedList(new CustomerCreditParam() { CustomerCode = filter.CustomerCode, Page = filter.Page, PageSize = filter.PageSize, Status = filter.Status }).ToModelAsPageCollection <CustomerCreditInfo, CustomerCreditModel>() }; //状态 model.StatusModels.Add(new SelectListItem() { Text = "请选择", Value = "", Selected = !model.FilterModel.Status.HasValue }); CustomerCreditInfo.GetStatusList().ForEach(i => { model.StatusModels.Add(new SelectListItem() { Text = i.TextField, Value = i.ValueField, Selected = model.FilterModel.Status.HasValue && model.FilterModel.Status.Value.ToString() == i.ValueField }); }); return(model); }
public CustomerRechargeListViewModel() { PagedList = new PagedList <CustomerCreditModel>(); FilterModel = new CustomerRechargeListFilterModel(); StatusModels = new List <SelectListItem>(); }
public ActionResult CustomerRechargeList(CustomerRechargeListFilterModel param) { return(View(Data_Bind(param))); }