예제 #1
0
		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);
		}
예제 #2
0
		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);
		}