예제 #1
0
        public static ToastMessage AddToastMessage(this Controller controller, string title, string message, ToastType toastType = ToastType.Info)
        {
            Toastr toastr = controller.TempData["Toastr"] as Toastr;

            toastr = toastr ?? new Toastr();
            var toastMessage = toastr.AddToastMessage(title, message, toastType);

            controller.TempData["Toastr"] = toastr;
            return(toastMessage);
        }
        public static ToastMessage AddToastMessage(this Controller controller, string title, string message, StayHealthy.Common.Enums.SystemEnum.ToastType toastType = StayHealthy.Common.Enums.SystemEnum.ToastType.Info)
        {
            Toastr toastr = controller.TempData["Toastr"] as Toastr;

            toastr = toastr ?? new Toastr();

            var toastMessage = toastr.AddToastMessage(title, message, toastType);

            controller.TempData["Toastr"] = toastr;
            return(toastMessage);
        }
예제 #3
0
        /// <summary>Adiciona un mensaje al contenedor principal de mensajes</summary>
        /// <param name="title">Titulo</param>
        /// <param name="message">Mensaje</param>
        /// <param name="Type">Tipo</param>
        /// <param name="isSticky">Indica si el mensaje permanece visible</param>
        public ToastMessage AddToastMessage(string title, string message, BootstrapAlertType Type, bool isSticky = false)
        {
            ToastType TipoToast = ToastType.Success;

            switch (Type)
            {
            case BootstrapAlertType.info:
                TipoToast = ToastType.Info; break;

            case BootstrapAlertType.warning:
                TipoToast = ToastType.Warning; break;

            case BootstrapAlertType.danger:
                TipoToast = ToastType.Error; break;
            }

            return(Toastr.AddToastMessage(title, message, TipoToast, isSticky));
        }
예제 #4
0
        public static ToastMessage AddToastMessage(
            this Controller controller
            , string title
            , string message
            , ToastType toastType    = ToastType.Info
            , bool closeButoon       = true
            , bool progressBar       = true
            , bool promptToCloseForm = false
            )
        {
            Toastr toastr = controller.TempData["Toastr"] as Toastr;

            toastr = toastr ?? new Toastr();

            var toastMessage = toastr.AddToastMessage(title, message, toastType, closeButoon, progressBar, promptToCloseForm);

            controller.TempData["Toastr"] = toastr;

            return(toastMessage);
        }
예제 #5
0
 public void Success(string title, string message)
 {
     _toastr.AddToastMessage(title, message, ToastType.Success);
     TempData["Toastr"] = _toastr;
 }