Beispiel #1
0
        public ActionResult AddSupplier()
        {
            if (Request.Form["name"] != null)
            {
                supplier sup = new supplier
                {
                    name = Request.Form["name"].ToString(),
                };

                db.suppliers.InsertOnSubmit(sup);

                try
                {
                    db.SubmitChanges();
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                    // Make some adjustments.
                    // ...
                    // Try again.
                    db.SubmitChanges();
                }
                return RedirectToAction("Index", "Suppliers");
            }
            return View();
        }
Beispiel #2
0
 partial void Updatesupplier(supplier instance);
Beispiel #3
0
 partial void Deletesupplier(supplier instance);
Beispiel #4
0
 partial void Insertsupplier(supplier instance);