예제 #1
0
        /// <summary>
        /// 设置右键菜单
        /// </summary>
        /// <param name="gridId">表格Id</param>
        /// <param name="menuId">菜单Id</param>
        public T Menu(string gridId = "", string menuId = "")
        {
            var builder = new ParamBuilder();

            builder.Add(gridId, "''", true);
            builder.Add(menuId, true);
            return(OnContextMenu(string.Format("{0}({1})", GetMenuFunction(), builder.GetResult())));
        }
예제 #2
0
        /// <summary>
        /// 设置右键菜单
        /// </summary>
        /// <param name="treeId">树Id</param>
        /// <param name="menuId">菜单Id</param>
        public void Menu(string treeId = "", string menuId = "")
        {
            var builder = new ParamBuilder();

            builder.Add(treeId, "''", true);
            builder.Add(menuId, true);
            OnContextMenu(string.Format("$.easyui.showTreeMenu_onContextMenu({0})", builder.GetResult()));
        }
예제 #3
0
        /// <summary>
        /// 获取参数
        /// </summary>
        private string GetParams(string formId, string gridId)
        {
            var builder = new ParamBuilder();

            builder.Add(formId, "''", true);
            builder.Add(gridId, "''", true);
            return(builder.GetResult());
        }
예제 #4
0
        /// <summary>
        /// 获取添加参数
        /// </summary>
        private string GetAddParams(object row, string gridId)
        {
            var builder = new ParamBuilder();

            builder.Add(Json.ToJson(row, true));
            builder.Add(gridId, "''", true);
            return(builder.GetResult());
        }
예제 #5
0
        /// <summary>
        /// 获取联动子控件参数
        /// </summary>
        private string GetChildParams(string childId, string requestParam, string url)
        {
            var builder = new ParamBuilder();

            builder.Add(childId, "''", true);
            builder.Add(requestParam, true);
            builder.Add(url, true);
            return(builder.GetResult());
        }
예제 #6
0
        /// <summary>
        /// 获取参数
        /// </summary>
        private string GetParams(string url, string handler, string id, string message = "")
        {
            var builder = new ParamBuilder();

            builder.Add(url, "''", true);
            builder.Add(handler, "null");
            builder.Add(id, "''", true);
            builder.Add(message, "''", true);
            return(builder.GetResult());
        }
예제 #7
0
        /// <summary>
        /// 获取表单参数
        /// </summary>
        private string GetSubmitParams(string beforeHandler, string successHandler, string formId, string treeId = "")
        {
            var builder = new ParamBuilder();

            builder.Add(beforeHandler, "null");
            builder.Add(successHandler, "null");
            builder.Add(formId, "''", true);
            builder.Add(treeId, "''", true);
            return(builder.GetResult());
        }
예제 #8
0
        /// <summary>
        /// 单击刷新面板
        /// </summary>
        /// <param name="panelId">面板编号</param>
        /// <param name="url">服务端Url</param>
        /// <param name="paramName">参数</param>
        /// <param name="fnCreateUrl">用于创建Url的回调函数</param>
        public void RefreshPanel(string panelId, string url, string paramName, string fnCreateUrl = "")
        {
            var builder = new ParamBuilder();

            builder.Add(panelId, "''", true);
            builder.Add(url, "''", true);
            builder.Add(paramName, "''", true);
            builder.Add(fnCreateUrl, "null");
            OnClick(string.Format("$.easyui.clickTreeNodeRefreshPanel_onClick({0})", builder.GetResult()));
        }
예제 #9
0
        /// <summary>
        /// 获取行展开详细内容参数
        /// </summary>
        private string GetDetailParams(string url, bool isShowBorder, string fnCreateUrl, string paramName, string btnDivId)
        {
            var builder = new ParamBuilder();

            builder.Add(url, true);
            builder.Add(isShowBorder.ToStr().ToLower());
            builder.Add(fnCreateUrl, "null");
            builder.Add(paramName, true);
            builder.Add(btnDivId, true);
            return(builder.GetResult());
        }
예제 #10
0
        /// <summary>
        /// 获取添加参数
        /// </summary>
        private string GetAddParams(object row, string gridId, string beforeHandler = "")
        {
            var builder = new ParamBuilder();

            builder.Add(Json.ToJson(row, true));
            builder.Add(gridId, "''", true);
            if (!beforeHandler.IsEmpty())
            {
                builder.Add(beforeHandler);
            }
            return(builder.GetResult());
        }
예제 #11
0
파일: TreeOption.cs 프로젝트: NetUtil/Util
 /// <summary>
 /// 设置右键菜单
 /// </summary>
 /// <param name="treeId">树Id</param>
 /// <param name="menuId">菜单Id</param>
 public void Menu( string treeId = "", string menuId = "" ) {
     var builder = new ParamBuilder();
     builder.Add( treeId, "''", true );
     builder.Add( menuId, true );
     OnContextMenu( string.Format( "$.easyui.showTreeMenu_onContextMenu({0})", builder.GetResult() ) );
 }
예제 #12
0
파일: TreeOption.cs 프로젝트: NetUtil/Util
 /// <summary>
 /// 单击刷新面板
 /// </summary>
 /// <param name="panelId">面板编号</param>
 /// <param name="url">服务端Url</param>
 /// <param name="paramName">参数</param>
 /// <param name="fnCreateUrl">用于创建Url的回调函数</param>
 public void RefreshPanel( string panelId, string url, string paramName, string fnCreateUrl = "" ) {
     var builder = new ParamBuilder();
     builder.Add( panelId, "''", true );
     builder.Add( url, "''", true );
     builder.Add( paramName, "''", true );
     builder.Add( fnCreateUrl, "null" );
     OnClick( string.Format( "$.easyui.clickTreeNodeRefreshPanel_onClick({0})", builder.GetResult() ) );
 }
예제 #13
0
 public void TestSeparator() {
     _builder = new ParamBuilder( "'", ";" );
     _builder.Add( "a" );
     _builder.Add( "b" );
     Assert.AreEqual( "a;b", _builder.GetResult() );
 }
예제 #14
0
 public void TestQuotes() {
     _builder = new ParamBuilder( "\"" );
     _builder.Add( "a",true );
     _builder.Add( "b" );
     Assert.AreEqual( "\"a\",b", _builder.GetResult() );
 }
 public static ParamBuilder ViewAsPdf(this ParamBuilder builder, int value)
 {
     return(builder.Add(ParamNames.ViewAsPdf, value));
 }
 public static ParamBuilder UserGroup(this ParamBuilder builder, string key)
 {
     return(builder.Add(ParamNames.UserGroup, key));
 }
 public static ParamBuilder User(this ParamBuilder builder, Guid id)
 {
     return(builder.Add(ParamNames.User, id));
 }
예제 #18
0
 public void TestAdd_Empty()
 {
     _builder.Add("");
     Assert.AreEqual("", _builder.GetResult());
 }