public ActionResult Delete(int index, int id)
        {
            var model = new BrandCategorySalesPersonListModel();

            model.GridIndex = index;

            try {
                CustomerService.DeleteBrandCategorySalesPerson(id);
            } catch (Exception e1) {
                model.Error.SetError(e1);
            }
            return(Json(model, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        public BrandCategorySalesPersonListModel FindBrandCategorySalesPersonsListModel(int customerId, int index, int pageNo, int pageSize, string search)
        {
            var model = new BrandCategorySalesPersonListModel();

            model.GridIndex = index;
            var allItems = db.FindBrandCategorySalesPersons(customerId);

            model.TotalRecords = allItems.Count();
            foreach (var item in allItems.Skip((pageNo - 1) * pageSize)
                     .Take(pageSize))
            {
                var newItem = MapToModel(item);
                model.Items.Add(newItem);
            }
            return(model);
        }