/// <summary> /// データベース作成用SQL文を生成する /// </summary> /// <param name="designFileName"></param> /// <param name="layoutType"></param> private void DoCreateSqlScript(string designFileName, LayoutType layoutType) { try { ScriptOptions opts; if (layoutType == LayoutType.Live) { Logging.OutputFileName = "LiveDBCreater.sql"; opts = ScriptOptions.DropTables | ScriptOptions.CreateTables | ScriptOptions.CreateDropDescriptions | ScriptOptions.DropDropDescriptions; } else { Logging.OutputFileName = "SeedDBCreater.sql"; opts = ScriptOptions.CreateTables | ScriptOptions.DropTables | ScriptOptions.CreateDropDescriptions | ScriptOptions.DropDropDescriptions; } TableCreator creator = new TableCreator(reportHandler); creator.CreateDBScript(layoutType, designFileName, opts); } finally { Logging.OutputFileName = ""; } }
private bool ValidateCustomerReportedIssues(ReportExecutionContext context, RepositoryConfiguration repositoryConfig, HtmlPageCreator emailBody) { TableCreator tc = new TableCreator("Customer reported issues"); tc.DefineTableColumn("Title", TableCreator.Templates.Title); tc.DefineTableColumn("Labels", TableCreator.Templates.Labels); tc.DefineTableColumn("Author", TableCreator.Templates.Author); tc.DefineTableColumn("Assigned", TableCreator.Templates.Assigned); tc.DefineTableColumn("Issues Found", i => i.Note); List <ReportIssue> issuesWithNotes = new List <ReportIssue>(); foreach (Issue issue in context.GitHubClient.SearchForGitHubIssues(CreateQuery(repositoryConfig))) { if (!ValidateIssue(issue, out string issuesFound)) { issuesWithNotes.Add(new ReportIssue() { Issue = issue, Note = issuesFound }); Logger.LogWarning($"{issue.Number}: {issuesFound}"); } } // order the issues by the list of issues they have. issuesWithNotes = issuesWithNotes.OrderBy(i => i.Note).ToList(); emailBody.AddContent(tc.GetContent(issuesWithNotes)); return(issuesWithNotes.Any()); }
private bool RetrieveItemsFromGitHub(SearchIssuesRequest requestOptions, DateTime from, HtmlPageCreator emailBody, string header) { TableCreator tc = new TableCreator(header); tc.DefineTableColumn("Title", TableCreator.Templates.Title); tc.DefineTableColumn("Labels", TableCreator.Templates.Labels); tc.DefineTableColumn("Author", TableCreator.Templates.Author); tc.DefineTableColumn("Assigned", TableCreator.Templates.Assigned); Colorizer.WriteLine("Retrieving issues"); List <ReportIssue> issues = new List <ReportIssue>(); foreach (var issue in _gitHub.SearchForGitHubIssues(requestOptions)) { if (issue.CreatedAt.ToUniversalTime() >= from.ToUniversalTime()) { issues.Add(new ReportIssue() { Issue = issue, Note = string.Empty, Milestone = null }); } } emailBody.AddContent(tc.GetContent(issues)); return(issues.Any()); }
public GuidTypeMapperTests(DatabaseFixture fixture) { Fixture = fixture; OracleTypeMapper.AddTypeHandler <Guid>(new GuidRaw16TypeHandler()); var columns = new[] { new TableColumn { Name = "CustomerId", DataType = OracleMappingType.Raw, Size = 16, PrimaryKey = true }, new TableColumn { Name = "Name", DataType = OracleMappingType.Varchar2, Size = 40 }, new TableColumn { Name = "City", DataType = OracleMappingType.Varchar2, Size = 40 }, new TableColumn { Name = "OtherGuid", DataType = OracleMappingType.Raw, Size = 16, Nullable = true }, }; TableCreator.Create(Fixture.Connection, "GuidCustomerTest", columns); InsertCustomer(new Customer { CustomerId = customerId, Name = "DIPS AS", City = "Oslo" }); }
static void Main(string[] args) { string path = @"C:\Users\Brendlu16\source\repos\Znamky\" + "test.db"; DatabaseManager dbManager = new DatabaseManager(path); TableCreator tableCreator = new TableCreator(path); //PridaniProTest(); /*var znamky = dbManager.NacistZnamky(); * var predmety1 = dbManager.NacistPredmety().ToArray(); * foreach (var item in znamky) * { * Console.WriteLine(predmety1[item.Predmet].Nazev+", "+item.Hodnota+", "+item.Vaha+", "+item.ID); * }*/ var predmety = tableCreator.NacistListPredmetu(); var radky = tableCreator.VytvoritTabulku(); for (int i = 0; i < predmety.Count; i++) { Console.Write(predmety[i].Nazev + ": "); foreach (var item in radky[i]) { Console.Write(item.Hodnota + "(vaha " + item.Vaha + "), "); } Console.WriteLine(" "); } Console.ReadKey(); }
private bool FindIssuesWithLabel(ReportExecutionContext context, RepositoryConfiguration repositoryConfig, HtmlPageCreator emailBody) { List <ReportIssue> testIssues = new List <ReportIssue>(); foreach (string label in _labels) { Logger.LogInformation($"Retrieve issues for label {label}"); foreach (Issue issue in context.GitHubClient.SearchForGitHubIssues(CreateQuery(repositoryConfig, label))) { testIssues.Add(new ReportIssue() { Issue = issue, Note = $"Label: {label}" }); } } IEnumerable <IGrouping <string, ReportIssue> > groups = testIssues.GroupBy(g => g.Note); foreach (IGrouping <string, ReportIssue> group in groups.OrderBy(g => g.Key)) { TableCreator tc = new TableCreator(group.Key); tc.DefineTableColumn("Milestone", TableCreator.Templates.Milestone); tc.DefineTableColumn("Title", TableCreator.Templates.Title); tc.DefineTableColumn("Labels", TableCreator.Templates.Labels); tc.DefineTableColumn("Author", TableCreator.Templates.Author); tc.DefineTableColumn("Assigned", TableCreator.Templates.Assigned); emailBody.AddContent(tc.GetContent(group)); } return(testIssues.Any()); }
private bool RetrieveNewItems(ReportExecutionContext context, SearchIssuesRequest requestOptions, DateTime from, HtmlPageCreator emailBody, string header) { TableCreator tc = new TableCreator(header); tc.DefineTableColumn("Title", TableCreator.Templates.Title); tc.DefineTableColumn("State", i => i.Issue.State.ToString()); tc.DefineTableColumn("Labels", TableCreator.Templates.Labels); tc.DefineTableColumn("Author", TableCreator.Templates.Author); tc.DefineTableColumn("Assigned", TableCreator.Templates.Assigned); List <ReportIssue> issues = new List <ReportIssue>(); foreach (Issue issue in context.GitHubClient.SearchForGitHubIssues(requestOptions)) { if (issue.CreatedAt.ToUniversalTime() >= from.ToUniversalTime()) { issues.Add(new ReportIssue() { Issue = issue, Note = string.Empty, Milestone = null }); } } //sort the issues by state, descending becasue Open should show up before Closed emailBody.AddContent(tc.GetContent(issues.OrderByDescending(i => i.Issue.State.ToString()))); return(issues.Any()); }
public ActionResult <GameState> CreateTable(TableCreator tableCreator) { GameState.Game = tableCreator.game; GameState.PlayerName = tableCreator.PlayerName; GameState.Notify(); return(CreatedAtAction(nameof(GetState), GameState)); }
public void VypsatZnamky(string path) { TableZnamky.Clear(); DatabaseManager dbManager = new DatabaseManager(path); TableCreator tableCreator = new TableCreator(path); var predmety = tableCreator.NacistListPredmetu(); var radky = tableCreator.VytvoritTabulku(); for (int i = 0; i < predmety.Count; i++) { /*StackLayout radek = new StackLayout { Orientation = StackOrientation.Horizontal }; * Label label = new Label { Text = predmety[i].Nazev, WidthRequest = 100 }; * radek.Children.Add(label); * foreach (var item in radky[i]) * { * Label label2 = new Label { Text = item.Hodnota.ToString(), WidthRequest = 20 }; * radek.Children.Add(label2); * } * ViewCell cell = new ViewCell { View = radek };*/ TextCell cell = new TextCell { Text = predmety[i].Nazev, StyleId = i.ToString() }; cell.Tapped += ViewCellTapped; TableZnamky.Add(cell); } }
public static bool CreateTable(LookupModel lookupmodel) { bool result = true; var dbman = new DBManager(DataProvider.Firebird); dbman.ConnectionString = Entrence.ConnectionString; try { dbman.Open(); dbman.BeginTransaction(); dbman.CreateParameters(3); dbman.AddOutputParameters(2, "@Id", lookupmodel.LookUpMetaData.Id); dbman.AddParameters(0, "@Name", lookupmodel.LookUpMetaData.Name); dbman.AddParameters(1, "@Description", lookupmodel.LookUpMetaData.Description); dbman.ExecuteNonQuery(CommandType.StoredProcedure, Commands.InsertLookup); lookupmodel.LookUpMetaData.Id = (int)dbman.Parameters[2].Value; int sortorder = 0; foreach (var field in lookupmodel.Fields) { string commands = string.Format( "INSERT INTO \"lookupsdetails\" (\"IdLookUp\", \"IdLookField\",\"SORTORDER\",ISUNIQUE,ISREQUARED,TN) VALUES ({0},{1},{2},{3},{4},'{5}')", lookupmodel.LookUpMetaData.Id, field.Id, sortorder, field.IsUnique?1:0, field.IsRequared?1:0, field.Tn ?? ""); dbman.ExecuteNonQuery(CommandType.Text, commands); sortorder++; } string test = new TableCreator("nom_" + lookupmodel.LookUpMetaData.Id, lookupmodel.Fields).ToString(); dbman.ExecuteNonQuery(CommandType.Text, test); StringBuilder triger = new StringBuilder(); string tablename = "nom_" + lookupmodel.LookUpMetaData.Id; string trigername = "trigernom_" + lookupmodel.LookUpMetaData.Id; string generatorname = "generatornom_" + lookupmodel.LookUpMetaData.Id; triger.AppendFormat("CREATE GENERATOR {0}", generatorname); dbman.ExecuteNonQuery(CommandType.Text, triger.ToString()); triger.Clear(); triger.AppendFormat( "CREATE TRIGGER \"{1}\" FOR \"{2}\" ACTIVE BEFORE INSERT AS BEGIN new.\"Id\" = gen_id({0}, 1);END", generatorname, trigername, tablename); //triger.Append("END $$ SET TERM ; $$ SET TERM $$ ;"); dbman.ExecuteNonQuery(CommandType.Text, triger.ToString()); //string maptablename = string.Format("CREATE TABLE \"{0}tofirm\"(\"FirmId\" Integer NOT NULL,\"NomID\" Integer NOT NULL)", tablename); //dbman. ExecuteNonQuery(CommandType.Text, maptablename); dbman.CommitTransaction(); } catch (Exception ex) { Logger.Instance().WriteLogError(ex.Message, "CreateTable"); dbman.RollBackTransaction(); result = false; } finally { dbman.Dispose(); } return(result); }
public void createTableTest() { var command = TableCreator.GenerateCreateTableCommand <TestType>(); string expected = "CREATE TABLE SERVERTESTS_DATABASE_TESTTYPE (ID BIGINT IDENTITY(1,1) PRIMARY KEY,NAME VARCHAR(50),HEIGHT INT,STARTED DATETIME2(3),WEIGHT BIGINT,PW VARCHAR(1000));"; Assert.AreEqual(expected, command.ToUpper()); }
/// <summary> /// Creates the table. /// </summary> /// <param name="schemaName">The name of the schema.</param> /// <param name="tableName">The name of the table.</param> /// <param name="columnsInfo">The columns information.</param> public void CreateTable(string schemaName, string tableName, IDictionary <string, ColumnWriterBase> columnsInfo) { schemaName = schemaName.Replace("\"", string.Empty); tableName = tableName.Replace("\"", string.Empty); using var connection = new NpgsqlConnection(this.connectionString); connection.Open(); TableCreator.CreateTable(connection, schemaName, tableName, ClearQuotationMarksFromColumnOptions(columnsInfo)); }
public BulkOperationTests(DatabaseFixture fixture) { Fixture = fixture; var columns = new[] { new TableColumn { Name = "CUSTOMERID", DataType = OracleMappingType.Raw, Size = 16, PrimaryKey = true }, new TableColumn { Name = "COMPANYNAME", DataType = OracleMappingType.Varchar2, Size = 40 }, new TableColumn { Name = "CITY", DataType = OracleMappingType.Varchar2, Size = 40 }, new TableColumn { Name = "CONTACTNAME", DataType = OracleMappingType.Varchar2, Size = 40 }, new TableColumn { Name = "CONTACTTITLE", DataType = OracleMappingType.Varchar2, Size = 40 }, new TableColumn { Name = "ADDRESS", DataType = OracleMappingType.Varchar2, Size = 60 }, new TableColumn { Name = "POSTALCODE", DataType = OracleMappingType.Varchar2, Size = 40, Nullable = true }, new TableColumn { Name = "COUNTRY", DataType = OracleMappingType.Varchar2, Size = 40 }, new TableColumn { Name = "PHONE", DataType = OracleMappingType.Varchar2, Size = 40 }, new TableColumn { Name = "FAX", DataType = OracleMappingType.Varchar2, Size = 40, Nullable = true }, new NumberColumn { Name = "TIDSSTEMPEL", DataType = OracleMappingType.Int64 }, new TableColumn { Name = "OPPRETTETAV", DataType = OracleMappingType.Varchar2, Size = 40 }, new TableColumn { Name = "OPPRETTETTID", DataType = OracleMappingType.Date }, new TableColumn { Name = "SISTENDRETAV", DataType = OracleMappingType.Varchar2, Size = 40 }, new TableColumn { Name = "SISTENDRETTID", DataType = OracleMappingType.Date }, new NumberColumn { Name = "DIPSID", DataType = OracleMappingType.Int64 }, }; TableCreator.Create(Fixture.Connection, "BULKCUSTOMERS", columns); }
public bool LoadDB(string dbPath) { path = dbPath; loader.Load(dbPath, ref this.xEntity, ref this.xTableList); tableList = TableList.getTableList(); tableCreator = new TableCreator(path); TableList.initializeXDocument(IO.LoadXMLTable("table_list", path), IO); ReferenceHelper.Initialize(); return(true); }
private void CreateOneTableForEntity(Entity entity) { List <EntityField> fields = RecursiveFromEntityFieldsExtractor.Extract(entity); // create table by field list TableCreator tc = new TableCreator(DataConfiguration.OutputPath, entity.Name); tc.GenerateFile(entity.Name, fields); // create indexes by field list Indexes4TableCreator ic = new Indexes4TableCreator(DataConfiguration.OutputPath, entity.Name); ic.GenerateFile(entity.Name, fields); }
public Page1() { InitializeComponent(); string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal); path = Path.Combine(path, "test.db"); TableCreator tableCreator = new TableCreator(path); var predmety = tableCreator.NacistListPredmetu(); foreach (var item in predmety) { TestPicker.Items.Add(item.Nazev); } }
private bool FindIssuesInPastDuesMilestones(ReportExecutionContext context, RepositoryConfiguration repositoryConfig, HtmlPageCreator emailBody) { TableCreator tc = new TableCreator("Issues in past-due milestones"); tc.DefineTableColumn("Milestone", TableCreator.Templates.Milestone); tc.DefineTableColumn("Title", TableCreator.Templates.Title); tc.DefineTableColumn("Labels", TableCreator.Templates.Labels); tc.DefineTableColumn("Author", TableCreator.Templates.Author); tc.DefineTableColumn("Assigned", TableCreator.Templates.Assigned); context.Log.LogInformation($"Retrieving milestone information for repo {repositoryConfig.Name}"); IEnumerable <Milestone> milestones = context.GitHubClient.ListMilestones(repositoryConfig).GetAwaiter().GetResult(); List <Milestone> pastDueMilestones = new List <Milestone>(); foreach (Milestone item in milestones) { if (item.DueOn != null && DateTimeOffset.Now > item.DueOn) { context.Log.LogWarning($"Milestone {item.Title} past due ({item.DueOn.Value}) has {item.OpenIssues} open issue(s)."); if (item.OpenIssues > 0) { pastDueMilestones.Add(item); } } } context.Log.LogInformation($"Found {pastDueMilestones.Count} past due milestones with active issues"); List <ReportIssue> issuesInPastMilestones = new List <ReportIssue>(); foreach (Milestone item in pastDueMilestones) { context.Log.LogInformation($"Retrieve issues for milestone {item.Title}"); foreach (Issue issue in context.GitHubClient.SearchForGitHubIssues(CreateQuery(repositoryConfig, item))) { issuesInPastMilestones.Add(new ReportIssue() { Issue = issue, Milestone = item, Note = string.Empty }); } } emailBody.AddContent(tc.GetContent(issuesInPastMilestones)); return(issuesInPastMilestones.Any()); }
// Update is called once per frame void Update() { Calculation(); rowText.text = x + " " + y + " " + n + " " + a + " " + b + " " + result; if (result == "True") { expCount++; if (expCount == 3) { expCount = 0; TableCreator.Start(); } } }
public TableCreatorTests() { this.clientMock = new Mock <IAmazonDynamoDB>(); this.indexFactoryMock = new Mock <IIndexFactory>(); this.attributeDefinitionFactoryMock = new Mock <IAttributeDefinitionFactory>(); this.indexConfigurationFactoryMock = new Mock <IIndexConfigurationFactory>(); this.entityConfigurationProviderMock = new Mock <IEntityConfigurationProvider>(); this.dynamoContextOptionsMock = new Mock <IDynamoContextOptions>(); this.creator = new TableCreator( this.clientMock.Object, this.indexFactoryMock.Object, this.attributeDefinitionFactoryMock.Object, this.indexConfigurationFactoryMock.Object, this.entityConfigurationProviderMock.Object); this.modelBuilder = new ModelBuilderFake(this.dynamoContextOptionsMock.Object); }
static void Main(string[] args) { DataSet shopDb = new DataSet("ShopDB"); DataTable employees = TableCreator.CreateEmployeesTable(); DataTable customers = TableCreator.CreateCustomersTable(); DataTable products = TableCreator.CreateProductsTable(); DataTable orderDetails = TableCreator.CreateOrderDetailsTable(); DataTable orders = TableCreator.CreateOrdersTable(); ForeignKeyConstraint emplyeeWithOrderDetail = new ForeignKeyConstraint(employees.Columns["Id"], orderDetails.Columns["EmployeeId"]); ForeignKeyConstraint productWithOrder = new ForeignKeyConstraint(products.Columns["Id"], orders.Columns["ProductId"]); ForeignKeyConstraint customerWithOrder = new ForeignKeyConstraint(customers.Columns["Id"], orders.Columns["CustomerId"]); ForeignKeyConstraint orderDetailWithOrder = new ForeignKeyConstraint(orderDetails.Columns["Id"], orders.Columns["OrderDetailId"]); shopDb.Tables.AddRange(new DataTable[] { employees, customers, products, orderDetails, orders }); }
public BooleanStringTypeMapperTests(DatabaseFixture fixture) { Fixture = fixture; var columns = new[] { new NumberColumn { Name = "Id", DataType = OracleMappingType.Int32, PrimaryKey = true }, new TableColumn { Name = "BooleanValue", DataType = OracleMappingType.Char, Size = 1 } }; OracleTypeMapper.AddTypeHandler(typeof(bool), new BooleanStringTypeHandler("Y", "N")); TableCreator.Create(Fixture.Connection, "BoolCharTypeMappingTest", columns); }
static void Main(string[] args) { using (var creator = new TableCreator()) { try { creator.CreateStandardTable(); } catch (SqlException exception) { Console.WriteLine(exception.Message); } catch (Exception exception) { Console.WriteLine(exception.Message); } } Console.ReadLine(); }
public Page3(int predmetID) { InitializeComponent(); string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal); path = Path.Combine(path, "test.db"); TableCreator tableCreator = new TableCreator(path); DatabaseManager dbManager = new DatabaseManager(path); var predmety = tableCreator.NacistListPredmetu(); var radky = tableCreator.VytvoritTabulku(); var radek = radky[predmetID]; double soucet = 0; double soucetVah = 0; foreach (var item in radek) { soucet += item.Hodnota * item.Vaha; soucetVah += item.Vaha; } double prumer = soucet / soucetVah; prumer = Math.Round(prumer, 2); TextCell cell = new TextCell { Text = predmety[predmetID].Nazev + " (průměr: " + prumer + ")" }; TableZnamky.Add(cell); foreach (var item in radek) { TextCell cell2 = new TextCell { Text = item.Hodnota + " (váha: " + item.Vaha + ")", StyleId = item.ID.ToString() }; cell2.Tapped += ViewCellTapped; TableZnamky.Add(cell2); } }
public void ParseSend(object o) { var data = (Filters)o; apartments.Clear(); IParser cianParser = new CianParser(); IParser avitoParser = new AvitoParser(); IParser domofondParser = new DomofondParser(); Console.WriteLine("1 парсер"); try { apartments.AddRange(cianParser.Parse(data, PAGES)); } catch (Exception) { } Console.WriteLine("2 парсер"); try { apartments.AddRange(avitoParser.Parse(data, PAGES)); } catch (Exception) { } Console.WriteLine("3 парсер"); try { apartments.AddRange(domofondParser.Parse(data, PAGES)); } catch (Exception) { } apartments.Sort((a, b) => int.Parse(a.Price) - int.Parse(b.Price)); Console.WriteLine("Создание и отправка таблицы"); EmailSender.Send(user.Email, EmailSender.MessageType.Mailing, TableCreator.CreateTable(apartments)); }
public void PridatZnamku(object sender, EventArgs e) { try { string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal); path = Path.Combine(path, "test.db"); TableCreator tableCreator = new TableCreator(path); DatabaseManager dbManager = new DatabaseManager(path); var predmety = tableCreator.NacistListPredmetu(); var selectedPredmet = predmety[TestPicker.SelectedIndex]; int znamka = int.Parse(ZnamkaEntry.Text); int vaha = int.Parse(VahaEntry.Text); Znamka novaZnamka = new Znamka { Predmet = selectedPredmet.ID, Hodnota = znamka, Vaha = vaha }; dbManager.UlozitZnamku(novaZnamka); Navigation.PushAsync(new MainPage()); } catch (Exception) { } }
private bool FindStalePRsInRepo(RepositoryConfig repositoryConfig, HtmlPageCreator emailBody) { TableCreator tc = new TableCreator($"Pull Requests older than {DateTime.Now.AddMonths(-3).ToShortDateString()}"); tc.DefineTableColumn("Title", TableCreator.Templates.Title); tc.DefineTableColumn("Labels", TableCreator.Templates.Labels); tc.DefineTableColumn("Author", TableCreator.Templates.Author); tc.DefineTableColumn("Assigned", TableCreator.Templates.Assigned); _log.LogInformation($"Retrieving PR information for repo {repositoryConfig.Name}"); List <ReportIssue> oldPrs = new List <ReportIssue>(); foreach (Issue issue in _gitHub.SearchForGitHubIssues(CreateQuery(repositoryConfig))) { _log.LogInformation($"Found stale PR {issue.Number}"); oldPrs.Add(new ReportIssue() { Issue = issue, Note = string.Empty, Milestone = null }); } emailBody.AddContent(tc.GetContent(oldPrs)); return(oldPrs.Any()); }
private bool RetrieveNeedsAttentionIssues(ReportExecutionContext context, RepositoryConfiguration repositoryConfig, HtmlPageCreator emailBody) { TableCreator tc = new TableCreator("Issues that need attention"); tc.DefineTableColumn("Title", TableCreator.Templates.Title); tc.DefineTableColumn("Labels", TableCreator.Templates.Labels); tc.DefineTableColumn("Author", TableCreator.Templates.Author); tc.DefineTableColumn("Assigned", TableCreator.Templates.Assigned); List <ReportIssue> issues = new List <ReportIssue>(); foreach (Issue issue in context.GitHubClient.SearchForGitHubIssues(CreateQueryForNeedsAttentionItems(repositoryConfig))) { issues.Add(new ReportIssue() { Issue = issue, Milestone = issue.Milestone, Note = string.Empty }); } emailBody.AddContent(tc.GetContent(issues)); return(issues.Any()); }
private bool GetIssuesInBacklogMilestones(RepositoryConfig repositoryConfig, HtmlPageCreator emailBody) { _log.LogInformation($"Retrieving milestone information for repo {repositoryConfig.Name}"); IEnumerable <Milestone> milestones = _gitHub.ListMilestones(repositoryConfig).GetAwaiter().GetResult(); List <Milestone> backlogMilestones = new List <Milestone>(); foreach (Milestone item in milestones) { if (item.DueOn == null) { _log.LogWarning($"Milestone {item.Title} has {item.OpenIssues} open issue(s)."); if (item.OpenIssues > 0) { backlogMilestones.Add(item); } } } _log.LogInformation($"Found {backlogMilestones.Count} past due milestones with active issues"); List <ReportIssue> issuesInBacklogMilestones = new List <ReportIssue>(); foreach (Milestone item in backlogMilestones) { _log.LogInformation($"Retrieve issues for milestone {item.Title}"); foreach (Issue issue in _gitHub.SearchForGitHubIssues(CreateQuery(repositoryConfig, item))) { issuesInBacklogMilestones.Add(new ReportIssue() { Issue = issue, Milestone = item, Note = string.Empty }); } } // Split the list into 3: // > 12months // > 6months // 0-6months IEnumerable <IGrouping <string, ReportIssue> > groups = issuesInBacklogMilestones.GroupBy(i => i.Issue.CreatedAt > DateTime.Now.AddMonths(-6) ? "C. Issues created in the last 6 months" : i.Issue.CreatedAt <= DateTime.Now.AddMonths(-6) && i.Issue.CreatedAt > DateTime.Now.AddMonths(-12) ? "B. Issues created between 6 and 12 months ago" : "A. Issues created more than 12 months ago"); foreach (IGrouping <string, ReportIssue> group in groups.OrderBy(g => g.Key)) { TableCreator tc = new TableCreator(group.Key); tc.DefineTableColumn("Milestone", TableCreator.Templates.Milestone); tc.DefineTableColumn("Created", i => i.Issue.CreatedAt.UtcDateTime.ToShortDateString()); tc.DefineTableColumn("Title", TableCreator.Templates.Title); tc.DefineTableColumn("Labels", TableCreator.Templates.Labels); tc.DefineTableColumn("Author", TableCreator.Templates.Author); tc.DefineTableColumn("Assigned", TableCreator.Templates.Assigned); emailBody.AddContent(tc.GetContent(group)); } return(issuesInBacklogMilestones.Any()); }
/// <summary> /// データベース作成用SQL文を生成する /// </summary> /// <param name="designFileName"></param> /// <param name="layoutType"></param> private void DoCreateSqlScript(TableCreateInfo createInfo) { TableCreator creator = new TableCreator(reportHandler); creator.CreateDBScript(createInfo); }
/// <summary> /// Wandelt eine Texteingabedatei in eine interne Repräsentation um. /// </summary> /// <param name="path">Der volle Pfad zur Datei.</param> private static void ProcessFile(string path) { // See if this is a table bool isTable = (0 == string.Compare(Path.GetExtension(path), ".xht", true)); // The huffman pair table HuffmanPairTable pairTable; // Check mode if (isTable) { // Load the table pairTable = HuffmanPairTable.Load(path); } else { // Create the huffman pair table pairTable = new HuffmanPairTable(); // Open the file for line wiese reading using (StreamReader reader = new StreamReader(path, Encoding.GetEncoding(1252))) { // Read the format string format = reader.ReadLine(); // Create the delegate ProcessLineHandler processor = (ProcessLineHandler)Delegate.CreateDelegate(typeof(ProcessLineHandler), typeof(Program), format); // Process all lines for (string line; null != (line = reader.ReadLine());) { // Process the line processor(pairTable, line); } } } // Create the binary representation TableCreator table = pairTable.CreateBinary(); // Core name string targetName = Path.GetFileNameWithoutExtension(path); // Report Console.WriteLine("{0} ({1} Bytes): Lookup={2} Linked={3} [{6} Patterns total] Dead={4} Unsupported={5}", targetName, table.GetTable().Length, table.DirectTables, table.LinkedTables, table.DeadEnds, table.CharacterNotSupported, table.LinkedItems); // Load the table uint[] encoderTable = table.CreateEncoderTable(); // See if we created the table if (!isTable) { // Overall usage double usage = 0.0; // Process all for (int i = 127 + 1; i-- > 0;) { // Attach to the table index int index = i * (1 + 127 + 1) * 2; // Overall weight long weight = 0; // Process all for (int j = 1 + 127 + 1; j-- > 0;) { // Load items uint width = encoderTable[index++]; uint pattern = encoderTable[index++]; // Check it if (width > 0) { weight += ((long)1) << (int)(32 - width); } } // Get the private usage double privUsage = weight * 1.0 / (((long)1) << 32); // Report pairTable[(0 == i) ? HuffmanItem.StartOrEnd : (char)(i - 1 + 1)].FillFactor = privUsage; // Sum up usage += privUsage; } // Correct usage /= (127 + 1); // Report usage pairTable.FillFactor = usage; // Save XML representation pairTable.Save(Path.ChangeExtension(path, ".xht")); } }