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);
        }
        /// <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));
        }
Example #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);
        }
Example #5
0
 public void Success(string title, string message)
 {
     _toastr.AddToastMessage(title, message, ToastType.Success);
     TempData["Toastr"] = _toastr;
 }