Ejemplo n.º 1
0
        public ActionResult Create( Customer customer)
        {
            if (ModelState.IsValid)
            {
                db.Customer.Add(customer);
                db.SaveChanges();
               return  RedirectToAction("Index", "Customers");
            }

            return View(customer);// PartialView("_CreateCustomerPartial", customer);
        }
Ejemplo n.º 2
0
        public ActionResult Edit(Customer customer)
        {
            customer.CustomerID = (int)Session["CustomerID"]; // To handle concurrencyException
            if (ModelState.IsValid)
            {
                db.Entry(customer).State = EntityState.Modified;
                db.SaveChanges();

                return RedirectToAction("Index");
            }
               // return PartialView("_EditCustomerPartial", customer);
            return PartialView(customer);
        }