コード例 #1
0
        public virtual ActionResult _Customer(int UnitId)
        {
            var model = new CustomerUnitSearchModel();

            model.UnitId = UnitId;
            return(PartialView(model));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        public virtual IActionResult _SelectListCustomer(CustomerUnitSearchModel searchModel)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageUnit))
            {
                return(AccessDeniedView());
            }
            var model = _unitModelFactory.PrepareCustomerCheckListModel(searchModel);

            return(PartialView("_SelectCustomerList", model));
        }
コード例 #5
0
        public virtual IActionResult CustomerUnit(CustomerUnitSearchModel searchModel)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageUnit))
            {
                return(AccessDeniedView());
            }
            var model = _unitModelFactory.PrepareCustomerUnitListModel(searchModel);

            return(Json(model));
        }
コード例 #6
0
        public CustomerUnitSearchModel PrepareCustomerUnitSearchModel(CustomerUnitSearchModel searchModel)
        {
            if (searchModel == null)
            {
                throw new ArgumentNullException(nameof(searchModel));
            }

            //prepare page parameters
            searchModel.SetGridPageSize();
            return(searchModel);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
 public virtual ActionResult _AddCustomer(CustomerUnitSearchModel model)
 {
     return(PartialView(model));
 }