Exemplo 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();
     }
 }
Exemplo n.º 2
0
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                var customerEntities = new CustomerDB();
                customerEntities.Delete(id);
                return RedirectToAction("Index");

            }
            catch
            {
                return View();
            }
        }
Exemplo 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();
            }
        }
Exemplo n.º 4
0
 //
 // GET: /Customer/
 public ActionResult Index()
 {
     var customEntities = new CustomerDB();
     return View(customEntities.GetCustomers());
 }
Exemplo n.º 5
0
 public ActionResult Edit(int id)
 {
     var customerEntities = new CustomerDB();
     return View(customerEntities.GetCustomerById(id));
 }