Пример #1
0
        public ActionResult Create([Bind(Include = "id,product_name,product_price,product_description,product_image,product_category")] Product product)
        {
            if (ModelState.IsValid)
            {
                db.Products.Add(product);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(product));
        }
Пример #2
0
        public ActionResult Create([Bind(Include = "cus_id,cus_fn,cus_lf,cus_mail,cus_phone")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                db.Customers.Add(customer);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(customer));
        }