public ActionResult Save(EditModel model) { if (ModelState.IsValid) { model.Save(api); IsSaved = true; return RedirectToAction("Edit", new { id = model.Id }); } if (model.Id.HasValue) ViewBag.Title = Piranha.Manager.Resources.Post.EditTitle; else ViewBag.Title = String.Format(Piranha.Manager.Resources.Post.AddTitle, model.TypeName); return View("Edit", model); }
public ActionResult Add(string type) { var model = new EditModel(api, type); ViewBag.Title = String.Format(Piranha.Manager.Resources.Post.AddTitle, model.TypeName); return View("Edit", model); }