Пример #1
0
        public ActionResult Create(FormCollection collection,string Name)
        {
            try
            {
                // TODO: Add insert logic here

                CategoryModel cm = new CategoryModel();
                cm.Name = Name;
                CategoryDB.InsertCategory(cm);
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Пример #2
0
        public ActionResult Index(FormCollection collection)
        {
            CategoryModel cm = new CategoryModel();
            cm.Name = collection["Category"];
            CategoryDB.InsertCategory(cm);

            return RedirectToAction("Index");
        }