public virtual ActionResult _Customer(int UnitId) { var model = new CustomerUnitSearchModel(); model.UnitId = UnitId; return(PartialView(model)); }
public CustomerUnitSearchModel PrepareCustomerSearchListModel(CustomerUnitSearchModel searchModel) { if (searchModel == null) { throw new ArgumentNullException(nameof(searchModel)); } var param = _unitService.GetAllCustomerByUnitId(searchModel.UnitId).Select(c => c.Id).ToArray(); //get items var items = _customerService.GetSearchAllCustomer(Keyword: searchModel.srKeywordCustomer, ExcludeCustomerIds: param); //prepare list model CustomerUnitSearchModel model = new CustomerUnitSearchModel(); model.ListCustomer = items.Select(c => { var m = new CustomerUnitModel(); m.CustomerId = c.Id; m.Username = c.Username; m.FullName = _customerService.GetCustomerFullName(c); m.Email = c.Email; return(m); }).ToList(); return(model); }
public CustomerUnitListModel PrepareCustomerUnitListModel(CustomerUnitSearchModel searchModel) { if (searchModel == null) { throw new ArgumentNullException(nameof(searchModel)); } //get items var items = _unitService.GetAllCustomerByUnitId(searchModel.UnitId); //prepare list model var model = new CustomerUnitListModel { //fill in model values from the entity Data = items.Select(c => { var m = new CustomerUnitModel(); m.CustomerId = c.Id; m.Username = c.Username; m.FullName = _customerService.GetCustomerFullName(c); return(m); }).ToList(), Total = items.Count }; return(model); }
public virtual IActionResult _SelectListCustomer(CustomerUnitSearchModel searchModel) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageUnit)) { return(AccessDeniedView()); } var model = _unitModelFactory.PrepareCustomerCheckListModel(searchModel); return(PartialView("_SelectCustomerList", model)); }
public virtual IActionResult CustomerUnit(CustomerUnitSearchModel searchModel) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageUnit)) { return(AccessDeniedView()); } var model = _unitModelFactory.PrepareCustomerUnitListModel(searchModel); return(Json(model)); }
public CustomerUnitSearchModel PrepareCustomerUnitSearchModel(CustomerUnitSearchModel searchModel) { if (searchModel == null) { throw new ArgumentNullException(nameof(searchModel)); } //prepare page parameters searchModel.SetGridPageSize(); return(searchModel); }
public CustomerUnitSearchModel PrepareCustomerCheckListModel(CustomerUnitSearchModel searchModel) { if (searchModel == null) { throw new ArgumentNullException(nameof(searchModel)); } //get items var items = _unitService.GetAllCustomerByUnitId(searchModel.UnitId); CustomerUnitSearchModel model = new CustomerUnitSearchModel(); //prepare list model model.ListCustomer = items.Select(c => { var m = new CustomerUnitModel(); m.CustomerId = c.Id; m.Username = c.Username; m.FullName = _customerService.GetCustomerFullName(c); m.Email = c.Email; return(m); }).ToList(); return(model); }
public virtual ActionResult _AddCustomer(CustomerUnitSearchModel model) { return(PartialView(model)); }