예제 #1
0
 public static DataTbl GetTblQuery1()
 {
     var dt = new DataTbl
     {
         fields = new List<tspField>(),
         data = new List<object[]>(),
     };
     int iColumns = 10;
     for (int i = 0; i < iColumns; i++)
     {
         var dc = new tspField
         {
             name = "Column " + i,
         };
         dt.fields.Add(dc);
     }
     int iRows = 50;
     for (int i = iRows; i < iRows * 2; i++)
     {
         var dataRow = new object[iColumns];
         for (int j = 0; j < iColumns; j++)
         {
             dataRow[j] = "Row " + i + ", Column " + j;
         }
         dt.data.Add(dataRow);
     }
     return dt;
 }
예제 #2
0
        public static DataTbl GetTreeGrid()
        {
            var dt = new DataTbl
            {
                fields = new List<tspField>(),
                data = new List<object[]>(),
            };
            int iColumns = 2;
            dt.fields.Add(new tspField
            {
                isTreeNodeInfo = true,
                name = "TreeInfo",
            });

            for (int i = 0; i < iColumns; i++)
            {

                var dc = new tspField
                {
                    name = "Column " + i,
                };
                dt.fields.Add(dc);
            }
            var totalColumns = dt.fields.Count;

            var stack = new Stack<int>();
            for (int i = 1; i < 5; i++)
            {
                stack.Push(15);
            }
            //    stack.Push(20);
            //stack.Push(20);
            //stack.Push(20);
            //stack.Push(30);
            CreateNode(dt.data, totalColumns, string.Empty, string.Empty, stack, 0);

            // = 300;// 10;
            //int iLint iLevel1Rowsevel2Rows = 20; // 5;
            //int iLevel3Rows = 20;// 5;
            ////int iLevel4Rows = 20;

            //for (int i = 0; i < iLevel1Rows; i++)
            //{
            //    var dataRow = new object[totalColumns];
            //    object[] treeInfo = {"Tree Label " + i, "itm_" + i, string.Empty, 0, iLevel2Rows };
            //    dataRow[0] = treeInfo;
            //    for (int j = 1; j < totalColumns; j++)
            //    {
            //        dataRow[j] = "Row " + i + ", Column " + j;
            //    }
            //    dt.data.Add(dataRow);
            //    for (int j = 0; j < iLevel2Rows; j++)
            //    {
            //        var childDataRow = new object[totalColumns];
            //        object[] childTreeInfo = { "Child Node " + i + " - " + j, "itm_" + i + "_" + j, treeInfo[1], 1, iLevel3Rows };
            //        childDataRow[0] = childTreeInfo;
            //        for (int k = 1; k < totalColumns; k++)
            //        {
            //            childDataRow[k] = "Child Row " + j + ", Column " + k;
            //        }
            //        dt.data.Add(childDataRow);
            //        for (int k = 0; k < iLevel3Rows; k++)
            //        {
            //            var grandChildDataRow = new object[totalColumns];
            //            object[] grandChildTreeInfo = {"Grand child node " + i + " - " + j + " - " + k, "itm_" + i + "_" + j + "_" + k, childTreeInfo[1], 2, 0};
            //            grandChildDataRow[0] = grandChildTreeInfo;
            //            for (int l = 1; l < totalColumns; l++)
            //            {
            //                grandChildDataRow[l] = "Grand Child Row " + k + ", Column " + l;
            //            }
            //            dt.data.Add(grandChildDataRow);
            //        }
            //    }
            //}
            return dt;
        }