Ejemplo n.º 1
0
 public void ShowPopupMessage(string Message, WarningType type)
 {
     labelMessage.Text       = "<strong>" + type.ToString().Replace("Danger", "Error") + "! </strong> <span>" + Message + "</span><hr><span>Press Esc Button To Close</span>";
     MessagePanelID.CssClass = string.Format("alert fade in alert-{0} alert-dismissable fade show", type.ToString().ToLower());
     MessagePanelID.Attributes.Add("role", "alert");
     MessagePanelID.Visible = true;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Displays a warning
        /// </summary>
        /// <param name="type">Type.</param>
        /// <param name="message">Message.</param>
        public void Warn(WarningType type, string message)
        {
            WarningType filter = type & WarningFilter;

            if (filter != WarningType.None)
            {
                Console.Error.WriteLine("*** WARNING {0}: {1}", type.ToString(), message);
            }
        }
Ejemplo n.º 3
0
        public void ShowMessage(string mensaje, WarningType type)
        {
            //gets the controls from the page
            //Panel PanelMessage = Master.FindControl("Message") as Panel;
            //Label labelMessage = PanelMessage.FindControl("labelMessage") as Label;

            //sets the message and the type of alert, than displays the message
            labelMessage.Text = mensaje;
            Message.CssClass  = string.Format("alert alert-{0} alert-dismissable", type.ToString().ToLower());
            Message.Attributes.Add("role", "alert");
            Message.Visible = true;
        }
Ejemplo n.º 4
0
 private string GetWarningLocale(WarningType warningType)
 {
     switch (warningType)
     {
         case WarningType.INVALID_TARGET:
             return "Invalid target";
         case WarningType.INVALID_PARAMETER:
             return "Invalid parameter";
         case WarningType.INVALID_VALUE:
             return "Invalid parameter value";
     }
     return "Other error "+warningType.ToString();
 }
        internal static string GetWarningText(WarningType warningType, params object[] warningParameters)
        {
            switch (warningType)
            {
                #region Business Rule Warnings

                #endregion

            case WarningType.SessionNotFound:
            {
                if (warningParameters.Length > 0)
                {
                    return(string.Format("The session could not be found. ({0})", warningParameters[0]));
                }
                else
                {
                    return(string.Format("The session could not be found."));
                }
            }

            case WarningType.Unknown:
            {
                if (warningParameters.Length > 0)
                {
                    return(string.Format("{1} ({0})", warningType.ToString(), warningParameters[0]));
                }
                else
                {
                    return(string.Format("A warning has occurred ({0}).", warningType.ToString()));
                }
            }

            case WarningType.InvalidEmailAddress:
            {
                if (warningParameters.Length > 0)
                {
                    return(string.Format("{1} ({0})", warningType.ToString(), warningParameters[0]));
                }
                else
                {
                    return(string.Format("Invalid email address ({0}).", warningType.ToString()));
                }
            }

            default:
            {
                if (warningParameters.Length > 0)
                {
                    return(string.Format("{1} ({0})", warningType.ToString(), warningParameters[0]));
                }
                else
                {
                    return(string.Format("A warning has occurred ({0}).", warningType.ToString()));
                }
            }
            }
        }
Ejemplo n.º 6
0
        private string GetWarningLocale(WarningType warningType)
        {
            switch (warningType)
            {
            case WarningType.INVALID_TARGET:
                return("Invalid target");

            case WarningType.INVALID_PARAMETER:
                return("Invalid parameter");

            case WarningType.INVALID_VALUE:
                return("Invalid parameter value");
            }
            return("Other error " + warningType.ToString());
        }
 public void Mensaje(string vMensaje, WarningType type)
 {
     ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "text", "infatlan.showNotification('top','center','" + vMensaje + "','" + type.ToString().ToLower() + "')", true);
 }
Ejemplo n.º 8
0
        public void ShowNotification(string message, WarningType type)
        {
            var   mainContentHolder = Master.FindControl("ContentPlaceHolderMain") as ContentPlaceHolder;
            Panel notificationPanel = new Panel();

            {
                LiteralControl closeButton = new LiteralControl();
                closeButton.Text = "<a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">&times;</a>";

                Label notificationMessage = new Label()
                {
                    Text = message
                };

                notificationPanel.Controls.Add(closeButton);
                notificationPanel.Controls.Add(notificationMessage);
            }

            notificationPanel.CssClass = string.Format("alert alert-{0} alert-dismissable", type.ToString().ToLower());
            notificationPanel.Attributes.Add("role", "alert");

            mainContentHolder.Controls.AddAt(0, notificationPanel);
        }
Ejemplo n.º 9
0
        public void ShowMessage(string message, WarningType type, bool visibility)
        {
            Panel PanelMessage = FindControl("Message") as Panel;
            Label labelMessage = PanelMessage.FindControl("labelMessage") as Label;

            labelMessage.Text     = message;
            PanelMessage.CssClass = string.Format("alert alert-{0} alert-dismissable", type.ToString().ToLower());
            PanelMessage.Attributes.Add("role", "alert");
            PanelMessage.Visible = visibility;
        }
 public void MensajeLoad(string vMensaje, WarningType type)
 {
     ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "text", " document.addEventListener(\"DOMContentLoaded\", function (event) { infatlan.showNotification('top','center','" + vMensaje + "','" + type.ToString().ToLower() + "'); });", true);
 }
        // = new SqlConnection("test");
        /// <summary>
        /// Shows a message based of type and message
        /// </summary>
        /// <param name="message">Message to display</param>
        /// <param name="type">ENUM type of the message</param>

        public static void showMessage(string message, WarningType type, MasterPage master)
        {
            //gets the controls from the page
            Panel panelMessage      = master.FindControl("alertMessage") as Panel;
            Label labelAlertMessage = panelMessage.FindControl("labelAlertMessage") as Label;

            //sets the message and the type of alert, than displays the message
            labelAlertMessage.Text = message;
            panelMessage.CssClass  = string.Format("alert alert-{0} alert-dismissable", type.ToString().ToLower());
            panelMessage.Attributes.Add("role", "alert");
            panelMessage.Visible = true;
        }
        internal static void InvokeWarning(WarningType warningType, params object[] arguments)
        {
            string message = Resources.GetMessage(warningType.ToString());

            Warning?.Invoke(null, new WarningEventArgs(string.Format(message, arguments)));
        }
        internal static void InvokeWarning(WarningType warningType)
        {
            string message = Resources.GetMessage(warningType.ToString());

            Warning?.Invoke(null, new WarningEventArgs(message));
        }
Ejemplo n.º 14
0
 /// <summary>
 /// класс предупреждения к кадру
 /// </summary>
 /// <param name="_type">тип предупреждения</param>
 /// <param name="_text">текст предупреждения</param>
 public StepMarkModel(WarningType _type,string _text )
 {
     Type = _type.ToString("G");
     Text = _text;
 }
Ejemplo n.º 15
0
 /// <summary>
 /// класс предупреждения к кадру
 /// </summary>
 /// <param name="_type">тип предупреждения</param>
 /// <param name="_text">текст предупреждения</param>
 public StepMarkModel(WarningType _type, string _text)
 {
     Type = _type.ToString("G");
     Text = _text;
 }