Ejemplo n.º 1
0
        public CustomerListViewModel CustomerListDataBind(CustomerListFilterModel filterModel)
        {
            var model = new CustomerListViewModel()
            {
                FilterModel = filterModel,
                PagedList   = _customerService.GetCustomerList(new SearchCustomerParam
                {
                    Page         = filterModel.Page,
                    PageSize     = filterModel.PageSize,
                    CustomerCode = filterModel.CustomerCode,
                    Status       = filterModel.Status
                })
            };

            model.CustomerStatus.Add(new SelectListItem()
            {
                Text = "请选择", Value = "", Selected = !model.FilterModel.Status.HasValue
            });
            GetCustomerStatusList().ForEach(i =>
            {
                model.CustomerStatus.Add(new SelectListItem()
                {
                    Text = i.Text, Value = i.Value, Selected = model.FilterModel.Status.HasValue && model.FilterModel.Status.Value.ToString() == i.Value
                });
            });

            model.PagedList.InnerList.ForEach(a => a.CurrentStatus = Customer.GetStatusDescription(a.Status));

            return(model);
        }
Ejemplo n.º 2
0
 public CustomerListViewModel()
 {
     PagedList      = new PagedList <CustomerExt>();
     FilterModel    = new CustomerListFilterModel();
     CustomerStatus = new List <SelectListItem>();
 }
Ejemplo n.º 3
0
 public ActionResult List(CustomerListFilterModel filterModel)
 {
     return(View(CustomerListDataBind(filterModel)));
 }