public void GroupByMultipleProperties()
        {
            GroupBy groupBy = new GroupBy();

            Assert.IsEmpty(groupBy.Expression);

            groupBy.Add("Activity");
            groupBy.Add("Country");

            Assert.AreEqual("Activity, Country", groupBy.Expression);
        }
예제 #2
0
        public Part AddGroupBy(string value, string name)
        {
            var part = new Part(value, name);

            GroupBy.Add(part);
            return(part);
        }
예제 #3
0
 public void AddGroupBy(SqlFragment f)
 {
     if (GroupBy == null)
     {
         GroupBy = new List <SqlFragment>();
     }
     GroupBy.Add(f);
 }
예제 #4
0
        private static void AutoCompress(int size, bool delete)
        {
            string current = Environment.CurrentDirectory;

            string[] paths =
            {
                current
            };

            Console.WriteLine("execute AutoCompressMode;");
            Console.WriteLine($" -   size: {size}");
            Console.WriteLine($" - delete: {delete}");
            Console.WriteLine($" -   path: {current}");
            Console.WriteLine();


#warning EndsWithは後でsurfixオプションに変更するとして、取り敢えず今はべた書き。
            var infos = Utility
                        .EachFile(paths, Utility.FolderOption.SearchFilesShallow)
                        .Where(x => x.Name.EndsWith(".url.txt"));


            GroupBy <string, FileInfo> group = new  GroupBy <string, FileInfo>();
            foreach (FileInfo file in infos)
            {
                string name = file.Name;

                string key = name.split(".")[0];

                group.Add(key, file);
            }


            var keys = group.Keys;
            foreach (var key in keys)
            {
                var files = group[key];

                if (size < files.Count)
                {
                    Compress(files, key);
                    Zip(files, key, delete);
                }
            }
        }
예제 #5
0
        public static void ConstructTableObjectFromPostRequest(JSONTable jt, ref BaseTable bt, ref SqlFilter whereFilter, ref BaseFilter join, ref OrderBy orderBy, ref GroupBy groupBy)
        {
            bt = (BaseTable)DatabaseObjects.GetTableObject(jt.TableName);

            ColumnList selCols = new ColumnList();

            if ((jt.JSelectColumns != null))
            {
                foreach (JTableSelectColumn col in jt.JSelectColumns)
                {
                    selCols.Add(col.ColumnName, true);
                }

                bt.SelectedColumns.Clear();
                bt.SelectedColumns.AddRange(selCols);
            }

            if (jt.JWhereClause != null && jt.JWhereClause.Trim() != "")
            {
                whereFilter = new SqlFilter(jt.JWhereClause);
            }

            if ((jt.JOrderByList != null))
            {
                foreach (JOrderBy jOrderBy in jt.JOrderByList)
                {
                    orderBy = new OrderBy(true, false);
                    orderBy.Add(bt.TableDefinition.ColumnList.GetByCodeName(jOrderBy.ColumnName), OrderByItem.ToOrderDir(jOrderBy.OrderDirection));
                }
            }

            if ((jt.JGroupByList != null))
            {
                foreach (JTableGroupBy jGroupBy in jt.JGroupByList)
                {
                    groupBy = new GroupBy(true, false);
                    groupBy.Add(bt.TableDefinition.ColumnList.GetByCodeName(jGroupBy.ColumnName));
                }
            }
        }