Example #1
0
        /// <summary>
        /// 获取表的列头数据(输出EasyUI的列头格式)
        /// </summary>
        public virtual void GetHeader()
        {
            MDataTable dt = GridConfig.GetList(ObjName, GridConfig.SelectType.All);

            if (dt == null || dt.Rows.Count == 0)
            {
                dt = GridConfig.Create(ObjName, ObjCode, dt.GetSchema(false));
                if (p.UrlMenuID != string.Empty && dt.Rows.Count > 0)//仅处理配置了菜单的数据。
                {
                    //顺带处理视图语句与菜单名称的绑定
                    KeyValueConfig.SetTableDescription(ObjName, p.MenuName);
                }
            }
            if (Query <string>("reflesh") == "1")//刷新表结构
            {
                string msg;
                bool   result = GridConfig.Flesh(ObjName, ObjCode, dt, out msg);
                jsonResult = JsonHelper.OutResult(result, msg);
            }
            else if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    dt.Rows[i][Config_Grid.Field].Value = dt.Rows[i].Get <string>(Config_Grid.Field).ToLower();
                }
                jsonResult = dt.ToJson(false, false, RowOp.None, true);
            }
            else
            {
                string err = dt.DynamicData != null?dt.DynamicData.ToString() : "Init Column Header Fail!";

                jsonResult = JsonHelper.OutResult(false, err);
            }
        }
Example #2
0
        /// <summary>
        /// 获取表的列头数据(输出EasyUI的列头格式)
        /// </summary>
        public void GetHeader()
        {
            MDataTable dt = GridConfig.GetList(ObjName, GridConfig.SelectType.All);

            if (dt == null || dt.Rows.Count == 0)
            {
                dt = GridConfig.Create(ObjName, ObjCode, dt.GetSchema(false));
                if (p.UrlMenuID != string.Empty)//仅处理配置了菜单的数据。
                {
                    //顺带处理视图语句与菜单名称的绑定
                    KeyValueConfig.SetTableDescription(ObjName, p.MenuName);
                }
            }
            else
            {
                //dt = GridConfig.Check(ObjName,ObjCode, dt);
            }
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    dt.Rows[i][Config_Grid.Field].Value = dt.Rows[i].Get <string>(Config_Grid.Field).ToLower();
                }
                jsonResult = dt.ToJson(false, false, true);
            }
            else
            {
                jsonResult = JsonHelper.OutResult(false, "Init Column Header Fail!");
            }
        }
Example #3
0
        /// <summary>
        /// 获取表的列头数据(输出EasyUI的列头格式)
        /// </summary>
        public void GetHeader()
        {
            MDataTable dt = GridConfig.GetList(ObjName, GridConfig.SelectType.All);

            if (dt == null || dt.Rows.Count == 0)
            {
                dt = GridConfig.Create(ObjCode, dt.GetSchema(false));
            }
            else
            {
                //dt = GridConfig.Check(ObjCode, dt);
            }
            //顺带处理视图语句与菜单名称的绑定
            KeyValueConfig.SetTableDescription(ObjName, p.MenuName);
            jsonResult = dt.ToJson(false, false, true);
        }