/// <summary>
    /// link to remote dialog
    /// </summary>
    /// <param name="linkText"></param>
    /// <param name="option"></param>
    /// <returns></returns>
    public static String LinkToRemote(String linkText, DialogOpenOption option)
    {
      // Create tag builder  
      var builder = getTagBuilderForRemoteDialog("a", linkText, option);

      builder.MergeAttribute("href", "javascript:void(0)");

      return builder.ToString();
    }
        /// <summary>
        /// link to remote dialog
        /// </summary>
        /// <param name="linkText"></param>
        /// <param name="option"></param>
        /// <returns></returns>
        public static String LinkToRemote(String linkText, DialogOpenOption option)
        {
            // Create tag builder
            var builder = getTagBuilderForRemoteDialog("a", linkText, option);

            builder.MergeAttribute("href", "javascript:void(0)");

            return(builder.ToString());
        }
        /// <summary>
        /// javascript to open dialog
        /// </summary>
        /// <param name="option"></param>
        /// <returns></returns>
        public static String OpenDialogScript(DialogOpenOption option)
        {
            string a = String.Format("Core.openDialog({0}, this)", option.ToJSon());

            if (option.RemoteOptions != null && !String.IsNullOrEmpty(option.RemoteOptions.CallBefore))
            {
                a = string.Format("if ({0}){{{1}}}", option.RemoteOptions.CallBefore, a);
            }
            return(a);
        }
Exemple #4
0
 public static String EditButtonForList(this HtmlHelper html, DialogOpenOption option)
 {
     System.Text.StringBuilder sb = new System.Text.StringBuilder();
     sb.Append("<div style='width: 50px;float:right; margin:5px'>");
     sb.Append("<div style='margin-right: 1px;' onclick='{0}' class='iedit ibutton'>");
     sb.Append("<span></span>");
     sb.Append("</div>");
     sb.Append("<div style='margin-top: 6px;'>EDIT</div>");
     sb.Append("</div>");
     return(String.Format(sb.ToString(), DialogHelper.OpenDialogScript(option)));
 }
    public static String LinkToRemote(String linkText, DialogOpenOption option, Object attributes)
    {
      // Create tag builder  
      var builder = getTagBuilderForRemoteDialog("a", linkText, option);

      builder.MergeAttribute("href", "javascript:void(0)");

      var attr = new RouteValueDictionary(attributes);
      builder.MergeAttributes(attr);

      return builder.ToString();
    }
        public static String LinkToRemote(String linkText, DialogOpenOption option, Object attributes)
        {
            // Create tag builder
            var builder = getTagBuilderForRemoteDialog("a", linkText, option);

            builder.MergeAttribute("href", "javascript:void(0)");

            var attr = new RouteValueDictionary(attributes);

            builder.MergeAttributes(attr);

            return(builder.ToString());
        }
    /// <summary>
    /// button to remote dialog
    /// </summary>
    /// <param name="linkText"></param>
    /// <param name="option"></param>
    /// <returns></returns>
    public static String ButtonToRemote(String linkText, DialogOpenOption option, Object htmlAttributes)
    {
      // Create tag builder  
      var builder = getTagBuilderForRemoteDialog("button", linkText, option);

      if (htmlAttributes == null)
        builder.MergeAttribute("class", "form-button ui-corner-all next");

      builder.MergeAttribute("type", "button");

      if (htmlAttributes != null)
        builder.MergeAttributes(new RouteValueDictionary(htmlAttributes));

      return builder.ToString();
    }
        /// <summary>
        /// button to remote dialog
        /// </summary>
        /// <param name="linkText"></param>
        /// <param name="option"></param>
        /// <returns></returns>
        public static String ButtonToRemote(String linkText, DialogOpenOption option, Object htmlAttributes)
        {
            // Create tag builder
            var builder = getTagBuilderForRemoteDialog("button", linkText, option);

            if (htmlAttributes == null)
            {
                builder.MergeAttribute("class", "form-button ui-corner-all next");
            }

            builder.MergeAttribute("type", "button");

            if (htmlAttributes != null)
            {
                builder.MergeAttributes(new RouteValueDictionary(htmlAttributes));
            }

            return(builder.ToString());
        }
Exemple #9
0
 public static String EditLinkForList(this HtmlHelper html, DialogOpenOption option)
 {
     return(LinkToRemoteDialog(html, "", option, "ui-icon ui-icon-pencil"));
 }
Exemple #10
0
 /// <summary>
 /// Button to open a dialog
 /// </summary>
 /// <param name="html"></param>
 /// <param name="name"></param>
 /// <param name="url"></param>
 /// <param name="cssClass"></param>
 /// <returns></returns>
 public static String ButtonToRemoteDialog(this HtmlHelper html, string name, DialogOpenOption option, string cssClass)
 {
     return(String.Format(@"<input 
 type='button' value='{0}' onclick='{1}' class={2}/>", name, DialogHelper.OpenDialogScript(option), cssClass));
 }
Exemple #11
0
 public static String NewRecordButton(this HtmlHelper html, DialogOpenOption option)
 {
     return(String.Format(@"<input 
 type='button' value='{0}' onclick='{1}' class='{2}'/>", "NEW RECORD", DialogHelper.OpenDialogScript(option), "toolbar-button toolbar-icon-task-add"));
 }
 public static String EditButtonForList(this HtmlHelper html, DialogOpenOption option)
 {
   System.Text.StringBuilder sb = new System.Text.StringBuilder();
   sb.Append("<div style='width: 50px;float:right; margin:5px'>");
   sb.Append("<div style='margin-right: 1px;' onclick='{0}' class='iedit ibutton'>");
   sb.Append("<span></span>");
   sb.Append("</div>");
   sb.Append("<div style='margin-top: 6px;'>EDIT</div>");
   sb.Append("</div>");
   return String.Format(sb.ToString(), DialogHelper.OpenDialogScript(option));
 }
 public static String EditLinkForList(this HtmlHelper html, DialogOpenOption option)
 {
   return LinkToRemoteDialog(html, "", option, "ui-icon ui-icon-pencil");
 }
 /// <summary>
 /// javascript to open dialog
 /// </summary>
 /// <param name="html"></param>
 /// <param name="option"></param>
 /// <returns></returns>
 public static String OpenDialogScript(this HtmlHelper html, DialogOpenOption option)
 {
   return OpenDialogScript(option);
 }
 /// <summary>
 /// link to open remote dialog
 /// </summary>
 /// <param name="html"></param>
 /// <param name="linkText"></param>
 /// <param name="option"></param>
 /// <returns></returns>
 public static String LinkToRemoteDialog(this HtmlHelper html, String linkText, DialogOpenOption option, string css)
 {
   return DialogHelper.LinkToRemote(linkText, option, css);
 }
    /// <summary>
    /// get tag builder for remote dialog
    /// </summary>
    /// <param name="tagName"></param>
    /// <param name="linkText"></param>
    /// <param name="option"></param>
    /// <returns></returns>
    private static TagBuilder getTagBuilderForRemoteDialog(String tagName, String linkText, DialogOpenOption option)
    {
      // Create tag builder  
      var builder = new TagBuilder(tagName);

      builder.MergeAttribute("onClick", OpenDialogScript(option));

      builder.SetInnerText(linkText);

      return builder;
    }
 /// <summary>
 /// javascript to open dialog
 /// </summary>
 /// <param name="option"></param>
 /// <returns></returns>
 public static String OpenDialogScript(DialogOpenOption option)
 {
   string a = String.Format("Core.openDialog({0}, this)", option.ToJSon());
   if (option.RemoteOptions != null && !String.IsNullOrEmpty(option.RemoteOptions.CallBefore))
   {
     a = string.Format("if ({0}){{{1}}}", option.RemoteOptions.CallBefore, a);
   }
   return a;
 }
Exemple #18
0
 /// <summary>
 /// button to open remote dialog
 /// </summary>
 /// <param name="html"></param>
 /// <param name="linkText"></param>
 /// <param name="option"></param>
 /// <returns></returns>
 public static String ButtonToRemoteDialog(this HtmlHelper html, String linkText, DialogOpenOption option)
 {
     return(DialogHelper.ButtonToRemote(linkText, option));
 }
 public static String NewRecordButton(this HtmlHelper html, DialogOpenOption option)
 {
   return String.Format(@"<input 
     type='button' value='{0}' onclick='{1}' class='{2}'/>", "NEW RECORD", DialogHelper.OpenDialogScript(option), "toolbar-button toolbar-icon-task-add");
 }
 /// <summary>
 /// button to open remote dialog
 /// </summary>
 /// <param name="html"></param>
 /// <param name="linkText"></param>
 /// <param name="option"></param>
 /// <returns></returns>
 public static String ButtonToRemoteDialog(this HtmlHelper html, String linkText, DialogOpenOption option)
 {
   return DialogHelper.ButtonToRemote(linkText, option);
 }
 public static String ButtonToRemoteDialog(this HtmlHelper html, String linkText, DialogOpenOption option, Object htmlAttributes)
 {
   return DialogHelper.ButtonToRemote(linkText, option, htmlAttributes);
 }
 /// <summary>
 /// javascript to open dialog
 /// </summary>
 /// <param name="html"></param>
 /// <param name="option"></param>
 /// <returns></returns>
 public static String OpenDialogScript(this HtmlHelper html, DialogOpenOption option)
 {
     return(OpenDialogScript(option));
 }
 public static String ButtonToRemote(String linkText, DialogOpenOption option)
 {
     return(ButtonToRemote(linkText, option, null));
 }
        /// <summary>
        /// get tag builder for remote dialog
        /// </summary>
        /// <param name="tagName"></param>
        /// <param name="linkText"></param>
        /// <param name="option"></param>
        /// <returns></returns>
        private static TagBuilder getTagBuilderForRemoteDialog(String tagName, String linkText, DialogOpenOption option)
        {
            // Create tag builder
            var builder = new TagBuilder(tagName);

            builder.MergeAttribute("onClick", OpenDialogScript(option));

            builder.SetInnerText(linkText);

            return(builder);
        }
Exemple #25
0
 /// <summary>
 /// link to open remote dialog
 /// </summary>
 /// <param name="html"></param>
 /// <param name="linkText"></param>
 /// <param name="option"></param>
 /// <returns></returns>
 public static String LinkToRemoteDialog(this HtmlHelper html, String linkText, DialogOpenOption option, string css)
 {
     return(DialogHelper.LinkToRemote(linkText, option, css));
 }
 public static String ButtonToRemote(String linkText, DialogOpenOption option)
 {
   return ButtonToRemote(linkText, option, null);
 }
Exemple #27
0
 public static String ButtonToRemoteDialog(this HtmlHelper html, String linkText, DialogOpenOption option, Object htmlAttributes)
 {
     return(DialogHelper.ButtonToRemote(linkText, option, htmlAttributes));
 }
 /// <summary>
 /// Button to open a dialog
 /// </summary>
 /// <param name="html"></param>
 /// <param name="name"></param>
 /// <param name="url"></param>
 /// <param name="cssClass"></param>
 /// <returns></returns>
 public static String ButtonToRemoteDialog(this HtmlHelper html, string name, DialogOpenOption option, string cssClass)
 {
   return String.Format(@"<input 
     type='button' value='{0}' onclick='{1}' class={2}/>", name, DialogHelper.OpenDialogScript(option), cssClass);
 }