Пример #1
0
 public ActionResult addproduct(FormCollection Form)
 {
     product product = new product();
     product.name = Form["Name"];
     product.price = Form["Price"];
     return View(product);
 }
Пример #2
0
        public ActionResult saveupdate(product product, FormCollection Form)
        {
            product.name = Form["Name"];
            product.price = Form["Price"];
            db.product.Add(product);
            db.SaveChanges();

            return View(product);
        }
Пример #3
0
        public ActionResult updateproduct(int id)
        {
            product product = new product();
            product.id = id;

            db.product.Remove(db.product.Find(id));
            db.SaveChanges();

            return View(product);
        }
Пример #4
0
 public ActionResult saveproduct(product product)
 {
     db.product.Add(product);
     db.SaveChanges();
     return View(product);
 }