Example #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();
        }
Example #2
0
 partial void Updatecustomer(customer instance);
Example #3
0
 partial void Deletecustomer(customer instance);
Example #4
0
 partial void Insertcustomer(customer instance);