Beispiel #1
0
        public void AlertMsgStay(Notification notification, string Message, string Message2 = null)
        {
            AlertMsgData alert = new AlertMsgData()
            {
                Message      = Message,
                Message2     = Message2,
                notification = notification,
            };

            if (_temp != null)
            {
                _temp["AlertMsgStay"] = alert;
            }
        }
Beispiel #2
0
        public string GetAlertMsgHtml(HtmlHelper helper)
        {
            try
            {
                AlertMsgData alert = null;
                if (_temp != null)
                {
                    alert = _temp["AlertMsgStay"] as AlertMsgData;
                }

                if (alert == null)
                {
                    return("");
                }

                _temp["AlertMsgStay"] = null;

                String retour = null;

                if (alert.notification == Notification.success)
                {
                    retour  = "<div class='alert alert-success'>";
                    retour += " <div class='notification-text'>";
                    retour += "<p>" + alert.Message + "<span>" + alert.Message2 + " </span>" + "</p>";
                    retour += "</div>";
                    retour += "<div class='close'>";
                    retour += "</div>";
                    retour += "</div>";
                }
                else if (alert.notification == Notification.warning)
                {
                    retour += "<div class='alert alert-warning'>";
                    retour += " <div class='notification-text'>";
                    retour += "<p>" + alert.Message + "<span>" + alert.Message2 + " </span>" + "</p>";
                    retour += "</div>";
                    retour += "<div class='close'>";
                    retour += "</div>";
                    retour += "</div>";
                }
                else if (alert.notification == Notification.disable)
                {
                    retour += "<div class='alert alert-disable'>";
                    retour += " <div class='notification-text'>";
                    retour += "<p>" + alert.Message + "<span>" + alert.Message2 + " </span>" + "</p>";
                    retour += "</div>";
                    retour += "<div class='close'>";
                    retour += "</div>";
                    retour += "</div>";
                }
                else if (alert.notification == Notification.error)
                {
                    retour += "<div class='alert alert-error'>";
                    retour += " <div class='notification-text'>";
                    retour += "<p>" + alert.Message + "<span>" + alert.Message2 + " </span>" + "</p>";
                    retour += "</div>";
                    retour += "<div class='close'>";
                    retour += "</div>";
                    retour += "</div>";
                }

                return(retour.ToString());
            }
            catch (Exception ex)
            {
            }
            return("<div class='alert alert-warning'><b>" + "Ooops" + "</b>" + "incident on the display of notifications" + "</div>");
        }