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

            return(View(new GridModel
            {
                Data = customers,
                Total = customers.Count
            }));
        }
Beispiel #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())));
        }
Beispiel #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())));
        }
        public ActionResult ServerRowTemplate_Delete(string id)
        {
            var customer = SessionCustomerRepository.One(c => c.CustomerID == id);

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

            return(RedirectToAction("ServerRowTemplate", this.GridRouteValues()));
        }
Beispiel #5
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()));
        }
Beispiel #7
0
        public ActionResult ClientRowTemplate_Select()
        {
            var customers = SessionCustomerRepository.All();

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

            return(View(customers));
        }