protected override ActionResult RedirectToActionAfterSuccessCreate(AfterSuccessSaveParam afterSuccessSaveParam) { switch (afterSuccessSaveParam.NextStep) { case 0: case 1: return(Json(JsonWizardResult.CreateSuccess(afterSuccessSaveParam.Id, afterSuccessSaveParam.TargetHtmlId, GetNextStep(afterSuccessSaveParam.NextStep), afterSuccessSaveParam.GetAction()))); } return(View(afterSuccessSaveParam.Action, afterSuccessSaveParam.Dto)); }
protected override ActionResult RedirectToActionAfterSuccessCreate(AfterSuccessSaveParam afterSuccessSaveParam) { Guid?parentId = GetService().GetParentId(afterSuccessSaveParam.Id); if (parentId.HasValue) { return(Json(JsonTreeResult.CreateTreeSuccess(parentId.Value, afterSuccessSaveParam.TargetHtmlId, null, afterSuccessSaveParam.Action))); //return base.RedirectToActionAfterSuccessCreate(id, actionName, controllerName, routeValues, parentId.Value.ToString(), JsonRefreshMode.REFRESH_TREE_AFTER_DIALOG_CLOSE); } return(base.RedirectToActionAfterSuccessCreate(afterSuccessSaveParam)); }
protected override ActionResult DoNext(ExhibitionDto exhibitionDto, int currentStep) { switch (currentStep) { case 0: return(RedirectToActionAfterSuccessCreate(AfterSuccessSaveParam.Create(exhibitionDto.Id, null, null, null, null, null, currentStep))); case 1: return(DoCreate(exhibitionDto, AfterSuccessSaveParam.Create(exhibitionDto.Id, null, WebConstants.VIEW_PAGED_LIST, WebConstants.CONTROLLER_EXHIBITION, null, HtmlConstants.PAGED_LIST_EXHIBITION, currentStep))); //null, null, null, currentStep.ToString())); } return(null); }
/// <summary> /// Calls the appropriate service and persists the DTO to the database. /// </summary> /// <param name="dto">The DTO to persist</param> /// <param name="message">The message to display to user after the operation is finished</param> /// <param name="actionName">The name of the action</param> /// <param name="controllerName">The name of the controller</param> /// <param name="routeValues">The route values for redirect</param> /// <returns>The apropriate View</returns> public virtual ActionResult DoCreate(T dto, AfterSuccessSaveParam afterSuccessSaveParam) { if (!ModelState.IsValid) { return(RedirectToActionAfterClientFailCreate(dto, null)); } try { GetUnitOfWork().StartTransaction(); dto = GetService().Persist(dto); GetUnitOfWork().EndTransaction(); afterSuccessSaveParam.Id = dto.Id; GetTempDataManager().SetTempData(TempDataConstants.MESSAGE, afterSuccessSaveParam.Message); GetTempDataManager().SetTempData(TempDataConstants.DTO, dto); } catch (ValidationException ex) { return(RedirectToActionAfterServerFailCreate(dto, AfterFailSaveParam.Create(ex.GetValidationResults()))); } return(RedirectToActionAfterSuccessCreate(afterSuccessSaveParam)); }
public override ActionResult Create(MenuItemDto menuItemDto) { return(DoCreate(menuItemDto, AfterSuccessSaveParam.Create(menuItemDto.Id, Message.CreateSuccessMessage(MessageKeyConstants.INFO_OBJECT_SAVE_SUCCESS_MESSAGE), WebConstants.VIEW_LIST, WebConstants.CONTROLLER_MENU, null, HtmlConstants.TREE_MENU_ITEM))); }
public ActionResult Details(ExhibitionDto exhibitionDto) { return(base.DoCreate(exhibitionDto, AfterSuccessSaveParam.Create(exhibitionDto, Message.CreateSuccessMessage(MessageKeyConstants.INFO_OBJECT_SAVE_SUCCESS_MESSAGE), WebConstants.VIEW_DETAILS, WebConstants.CONTROLLER_EXHIBITION, new { id = exhibitionDto.Id }))); }
public ActionResult Details(PaintingDto paintingDto) { return(base.DoCreate(paintingDto, AfterSuccessSaveParam.Create(paintingDto, Message.CreateSuccessMessage(MessageKeyConstants.INFO_OBJECT_SAVE_SUCCESS_MESSAGE), WebConstants.VIEW_DETAILS, WebConstants.CONTROLLER_PAINTING, new { id = paintingDto.Id }))); }
public override ActionResult Create(CollectionDto collectionDto) { return(DoCreate(collectionDto, AfterSuccessSaveParam.Create(collectionDto.Id, Message.CreateSuccessMessage(MessageKeyConstants.INFO_OBJECT_SAVE_SUCCESS_MESSAGE), WebConstants.VIEW_PAGED_LIST, WebConstants.CONTROLLER_COLLECTION, null, HtmlConstants.PAGED_LIST_COLLECTION))); }
protected override ActionResult RedirectToActionAfterSuccessCreate(AfterSuccessSaveParam afterSuccessSaveParam) { return(Json(JsonDialogResult.CreateSuccess(afterSuccessSaveParam.TargetHtmlId, null, afterSuccessSaveParam.GetAction()))); }
protected virtual ActionResult RedirectToActionAfterSuccessCreate(AfterSuccessSaveParam afterSuccessSaveParam) { return(RedirectToAction(afterSuccessSaveParam.Action, afterSuccessSaveParam.Controller, afterSuccessSaveParam.RouteValues)); }
public ActionResult Details(UserDto userDto) { return(base.DoCreate(userDto, AfterSuccessSaveParam.Create(userDto, Message.CreateSuccessMessage(MessageKeyConstants.INFO_OBJECT_SAVE_SUCCESS_MESSAGE), WebConstants.VIEW_PROFILE, WebConstants.CONTROLLER_USER, new { id = userDto.Id }))); }
public ActionResult TreeNodeChangePosition(Guid sourceId, Guid targetId) { GetService().TreeNodeChangePosition(sourceId, targetId); return(RedirectToActionAfterSuccessCreate(AfterSuccessSaveParam.Create(sourceId, null, WebConstants.VIEW_LIST, null, null, HtmlConstants.TREE_MENU_ITEM))); //return RedirectToActionAfterSuccessCreate(sourceId, WebConstants.VIEW_LIST, null, null, HtmlConstants.TREE_MENU_ITEM); }