public ActionResult DeleteAuthor(string id, string version) { var request = new AuthorViewModel { Id = id.ToGuidOrDefault(), Version = version.ToIntOrDefault() }; var success = GetCommand<DeleteAuthorCommand>().ExecuteCommand(request); if (success) { if (!request.Id.HasDefaultValue()) { Messages.AddSuccess(BlogGlobalization.DeleteAuthor_DeletedSuccessfully_Message); } } return WireJson(success); }
public ActionResult SaveAuthor(AuthorViewModel model) { var success = false; AuthorViewModel response = null; if (ModelState.IsValid) { response = GetCommand<SaveAuthorCommand>().ExecuteCommand(model); if (response != null) { if (model.Id.HasDefaultValue()) { Messages.AddSuccess(BlogGlobalization.CreateAuthor_CreatedSuccessfully_Message); } success = true; } } return WireJson(success, response); }