// Get: Admin/LangManager/Create public ActionResult Create() { var model = new Models.LangBooksEditViewModel(); this.StatusList(1); return(View(model)); }
public ActionResult Create(Models.LangBooksEditViewModel model) { if (ModelState.IsValid) { try { m_langWorker.InsertManagerLangBook(model); return(RedirectToAction("Index")); } catch (Exception ex) { ModelState.AddModelError("", ex.Message); } } this.StatusList(model.Status); return(View(model)); }
public ActionResult Edit(Models.LangBooksEditViewModel model) { if (ModelState.IsValid) { try { if (string.IsNullOrEmpty(model.Code)) { model.Code = ""; } m_langWorker.UpdateManagerLangBook(model); return(RedirectToAction("Index")); } catch (Exception ex) { ModelState.AddModelError("", ex.Message); } } this.StatusList(model.Status); return(View(model)); }