Beispiel #1
0
        public EasyUiGridData drillTableToGrid(List <string> parentMembers)
        {
            DatabaseAdmin  dba   = DatabaseAdmin.getInstance(table.connection);
            TableDef       tbf   = dba.getTableDef(table.name);
            string         title = string.IsNullOrEmpty(tbf.Title) ? table.name : tbf.Title;
            EasyUiGridData ret   = EUGridUtils.getGrid(table.connection, title, tbf.FieldDefs);

            return(ret);
        }
Beispiel #2
0
        public EasyUiGridData grid()
        {
            openFile();
            List <FieldDef> fields = new List <FieldDef>();

            foreach (ColumnDef field in ColumnMaps)
            {
                fields.Add(field);
            }
            EasyUiGridData ret = EUGridUtils.getGrid(_connName, fileName, fields);

            ret.url          = "ExcelTransfer." + name + ".data.wbo";
            ret.filterInputs = null;
            return(ret);
        }
 /// <summary>
 ///     数据准备返回的处理
 /// </summary>
 /// <param name="result">当前的查询结果</param>
 /// <param name="condition">当前的查询条件</param>
 /// <param name="args">当前的查询参数</param>
 protected override bool CheckListResult(EasyUiGridData <OrganizationData> result, string condition, params MySqlParameter[] args)
 {
     SetCustomJsonResult(result.Data);
     return(base.CheckListResult(result, condition, args));
 }
Beispiel #4
0
        public ListData drillTable(string table, string fk, List <string> parentMembers)
        {
            if (string.IsNullOrEmpty(table))
            {
                table = this.table.name;
            }
            if (string.IsNullOrEmpty(fk))
            {
                fk = this.primaryKey;
            }

            EasyUiGridData grid = new EasyUiGridData();
            StringBuilder  sql  = new StringBuilder();

            //纬度表
            sql.Append("Select ");
            sql.Append(this.primaryKey);
            sql.Append(" Into #t ");
            sql.Append(" From  ");
            sql.Append(this.table.name);
            int           memberPathCount;
            StringBuilder sbWhere = getDrillWhere(parentMembers, out memberPathCount);

            if (sbWhere.Length > 0)
            {
                sql.Append(" Where ");
                sql.Append(sbWhere);
            }
            sql.Append(" Group By ");
            sql.Append(primaryKey);
            sql.Append(";");

            //事实表
            sql.Append(" Select ");
            sql.Append(table);
            sql.Append(".* From ");
            sql.Append(table);
            sql.Append(",");
            sql.Append("#t");
            sql.Append(" Where ");
            sql.Append(table);
            sql.Append(".");
            sql.Append(fk);
            sql.Append("=#t.");
            sql.Append(primaryKey);


            ListData ret = new ListData();

            DatabaseAdmin dba = DatabaseAdmin.getInstance(this.table.connection);
            DataTable     tb  = dba.executeTable(sql.ToString());

            ret.total = tb.Rows.Count;
            ret.rows  = new List <ListDataRow>();
            foreach (DataRow dRow in tb.Rows)
            {
                ListDataRow row = new ListDataRow();
                foreach (DataColumn col in tb.Columns)
                {
                    row.Add(col.ColumnName, dRow[col].ToString());
                }
                ret.rows.Add(row);
            }
            return(ret);
        }