Exemplo n.º 1
0
        public ActionResult AddCustomer()
        {
            if (Request.Form["name"] != null)
            {
                customer pro = new customer
                {
                    name = Request.Form["name"].ToString(),
                };

                db.customers.InsertOnSubmit(pro);

                try
                {
                    db.SubmitChanges();
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                    // Make some adjustments.
                    // ...
                    // Try again.
                    db.SubmitChanges();
                }
                return RedirectToAction("Index", "Customers");
            }
            return View();
        }
Exemplo n.º 2
0
 partial void Updatecustomer(customer instance);
Exemplo n.º 3
0
 partial void Deletecustomer(customer instance);
Exemplo n.º 4
0
 partial void Insertcustomer(customer instance);