예제 #1
0
        protected ActionResult RedirectWithRoute(string action, string message = null, bool error = true, object routeValues = null)
        {
            if (!message.IsNullOrEmpty())
            {
                ViewData.SetNotification(error ? UiNotification.Error(message) : UiNotification.Confirmation(message));
            }

            return(routeValues == null?RedirectToAction(action) : RedirectToAction(action, routeValues));
        }
예제 #2
0
        protected ActionResult RedirectWithViewModel <TPostModel, TViewModel>(TPostModel postModel, string action, string message = null, bool error = true, object routeValues = null) where TViewModel : class, new()
        {
            var viewModel = new TViewModel();

            PropertyMapper <TPostModel, TViewModel> .Map(postModel, viewModel);

            ViewData.Model = viewModel;

            if (!message.IsNullOrEmpty())
            {
                ViewData.SetNotification(error ? UiNotification.Error(message) : UiNotification.Confirmation(message));
            }

            return(routeValues == null?RedirectToAction(action) : RedirectToAction(action, routeValues));
        }
예제 #3
0
 protected void ConfirmationNotification(string unencodedMessage)
 {
     ViewData.SetNotification(UiNotification.Confirmation(unencodedMessage));
 }
예제 #4
0
 protected void ConfirmationNotification(MvcHtmlString message)
 {
     ViewData.SetNotification(UiNotification.Confirmation(message));
 }