コード例 #1
0
        public ActionResult Create([Bind(Include = "ProductsModelId,Nume,CodProdus,DescriereProdus,GreutateProdus,Pret,Producator,Categorie,IsActiv,MetaTitle,MetaKeywords,MetaDescription,Url")] ProductsModel productsModel)
        {
            if (ModelState.IsValid)
            {
                db.ProductsT.Add(productsModel);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(productsModel));
        }
コード例 #2
0
        public ActionResult Create([Bind(Include = "CategoriesModelId,Nume,Titlu,Descriere,ParentId,Order,MetaTitle,MetaKeywords,MetaDescription,Url")] CategoriesModel categoriesModel)
        {
            if (ModelState.IsValid)
            {
                db.CategoriesT.Add(categoriesModel);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(categoriesModel));
        }