Exemplo n.º 1
0
 public static JsonResult Show(MessageType type, MessageAlignment alignment = MessageAlignment.Center)
 {
     return(new JsonResult(new
     {
         message = DbRes.T(type.ToString() == "NotValid"?"Error":type.ToString(), "MessageBox"),
         type = type.ToString().ToLower(),
         alignment = alignment.ToString().ToLower()
     }));
 }
Exemplo n.º 2
0
        public static JavaScriptResult Show(string message, MessageType type = MessageType.Alert, bool modal              = false,
                                            MessageAlignment layout          = MessageAlignment.Center, bool dismissQueue = false)
        {
            string txt = "$.noty.closeAll(); noty({ text: \"" + message + "\", type: \"" + type.ToString().ToLower() +
                         "\", layout: \"" + layout.ToString().ToLowerFirst() + "\", dismissQueue: " +
                         dismissQueue.ToString().ToLower() + ", modal: " + modal.ToString().ToLower() + " });";

            return(new JavaScriptResult()
            {
                Script = txt
            });
        }
Exemplo n.º 3
0
 public static JsonResult Custom(string title,
                                 string message,
                                 MessageType type           = MessageType.Success,
                                 MessageAlignment alignment = MessageAlignment.Center
                                 )
 {
     return(new JsonResult(new
     {
         title = title,
         text = message,
         type = type.ToString().ToLower(),
         alignment = alignment.ToString().ToLower()
     }));
 }
Exemplo n.º 4
0
 public Noty Layout(MessageAlignment value)
 {
     Attributes["layout"] = string.Format("'{0}'", value.ToString().ToLowerFirst());
     SetScript();
     return(this);
 }