Esempio n. 1
0
 public ActionResult Edit(Customer customer)
 {
     try
     {
         // TODO: Add update logic here
         var customerEntities = new CustomerDB();
         customerEntities.Update(customer);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
Esempio n. 2
0
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                var customerEntities = new CustomerDB();
                customerEntities.Delete(id);
                return RedirectToAction("Index");

            }
            catch
            {
                return View();
            }
        }
Esempio n. 3
0
        public ActionResult Create(Customer customer)
        {
            try
            {
                //TODO: add insert logic here
                var customEntities = new CustomerDB();
                customEntities.Create(customer);
                return RedirectToAction("Index");

            }
            catch (Exception)
            {
                return View();
            }
        }
Esempio n. 4
0
 //
 // GET: /Customer/
 public ActionResult Index()
 {
     var customEntities = new CustomerDB();
     return View(customEntities.GetCustomers());
 }
Esempio n. 5
0
 public ActionResult Edit(int id)
 {
     var customerEntities = new CustomerDB();
     return View(customerEntities.GetCustomerById(id));
 }