예제 #1
0
        public ActionResult _SelectAutoGenerateColumns()
        {
            var customers = SessionCustomerRepository.All();

            return(View(new GridModel
            {
                Data = customers,
                Total = customers.Count
            }));
        }
예제 #2
0
        public ActionResult _SaveAutoColumnsEditing(string id)
        {
            EditableCustomer customer = SessionCustomerRepository.One(p => p.CustomerID == id);

            TryUpdateModel(customer);

            SessionCustomerRepository.Update(customer);

            return(View(new GridModel(SessionCustomerRepository.All())));
        }
예제 #3
0
        public ActionResult ClientRowTemplate_Delete(string id)
        {
            var customer = SessionCustomerRepository.One(c => c.CustomerID == id);

            if (customer != null)
            {
                SessionCustomerRepository.Delete(customer);
            }

            return(View(new GridModel(SessionCustomerRepository.All())));
        }
예제 #4
0
        public ActionResult _DeleteAutoColumnsEditing(string id)
        {
            EditableCustomer customer = SessionCustomerRepository.One(p => p.CustomerID == id);

            if (customer != null)
            {
                //Delete the record
                SessionCustomerRepository.Delete(customer);
            }

            //Rebind the grid
            return(View(new GridModel(SessionCustomerRepository.All())));
        }
        public ActionResult ServerRowTemplate_Update(string id)
        {
            var customer = SessionCustomerRepository.One(c => c.CustomerID == id);

            if (customer != null)
            {
                if (TryUpdateModel(customer))
                {
                    SessionCustomerRepository.Update(customer);
                    return(RedirectToAction("ServerRowTemplate", this.GridRouteValues()));
                }
            }

            return(View("ServerRowTemplate", SessionCustomerRepository.All()));
        }
예제 #6
0
        public ActionResult ClientRowTemplate_Select()
        {
            var customers = SessionCustomerRepository.All();

            return(View(new GridModel(customers)));
        }
예제 #7
0
 public ActionResult AutoGenerateColumns()
 {
     return(View(SessionCustomerRepository.All()));
 }
        public ActionResult ServerRowTemplate()
        {
            var customers = SessionCustomerRepository.All();

            return(View(customers));
        }