public ActionResult Create(CatalogModel catalogmodel) { if (ModelState.IsValid) { db.Catalogs.Add(catalogmodel); catalogmodel.CreateTime = DateTime.Now; db.SaveChanges(); return RedirectToAction("Index"); } return View(catalogmodel); }
public ActionResult Edit(CatalogModel catalogmodel) { if (ModelState.IsValid) { db.Entry(catalogmodel).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(catalogmodel); }