Used queries to get data from scrape database instead of FabTime to use a single data source.

This commit is contained in:
Daniel Wathen
2023-01-11 09:46:03 -07:00
parent cb14e93ad5
commit 43e5ec3e28
22 changed files with 1350 additions and 118 deletions

View File

@ -0,0 +1,137 @@
namespace ReportingServices.Desktop
{
partial class DailyReport
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.btnPrevious = new System.Windows.Forms.Button();
this.btnNext = new System.Windows.Forms.Button();
this.dgvCurrentWeek = new System.Windows.Forms.DataGridView();
this.rtbManualEntries = new System.Windows.Forms.RichTextBox();
this.dgvPreviousWeek = new System.Windows.Forms.DataGridView();
((System.ComponentModel.ISupportInitialize)(this.dgvCurrentWeek)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgvPreviousWeek)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Segoe UI", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.label1.Location = new System.Drawing.Point(786, 5);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(271, 37);
this.label1.TabIndex = 0;
this.label1.Text = "Production Passdown";
//
// btnPrevious
//
this.btnPrevious.Location = new System.Drawing.Point(64, 37);
this.btnPrevious.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnPrevious.Name = "btnPrevious";
this.btnPrevious.Size = new System.Drawing.Size(179, 56);
this.btnPrevious.TabIndex = 1;
this.btnPrevious.Text = "Previous Button";
this.btnPrevious.UseVisualStyleBackColor = true;
this.btnPrevious.Click += new System.EventHandler(this.btnPrevious_Click);
//
// btnNext
//
this.btnNext.Location = new System.Drawing.Point(1651, 37);
this.btnNext.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnNext.Name = "btnNext";
this.btnNext.Size = new System.Drawing.Size(179, 56);
this.btnNext.TabIndex = 2;
this.btnNext.Text = "Next Button";
this.btnNext.UseVisualStyleBackColor = true;
this.btnNext.Visible = false;
this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
//
// dgvCurrentWeek
//
this.dgvCurrentWeek.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvCurrentWeek.Location = new System.Drawing.Point(64, 119);
this.dgvCurrentWeek.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.dgvCurrentWeek.Name = "dgvCurrentWeek";
this.dgvCurrentWeek.RowHeadersWidth = 62;
this.dgvCurrentWeek.RowTemplate.Height = 33;
this.dgvCurrentWeek.Size = new System.Drawing.Size(1765, 378);
this.dgvCurrentWeek.TabIndex = 3;
//
// rtbManualEntries
//
this.rtbManualEntries.Location = new System.Drawing.Point(64, 527);
this.rtbManualEntries.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.rtbManualEntries.Name = "rtbManualEntries";
this.rtbManualEntries.Size = new System.Drawing.Size(576, 395);
this.rtbManualEntries.TabIndex = 4;
this.rtbManualEntries.Text = "";
//
// dgvPreviousWeek
//
this.dgvPreviousWeek.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvPreviousWeek.Location = new System.Drawing.Point(64, 119);
this.dgvPreviousWeek.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.dgvPreviousWeek.Name = "dgvPreviousWeek";
this.dgvPreviousWeek.RowHeadersWidth = 62;
this.dgvPreviousWeek.RowTemplate.Height = 33;
this.dgvPreviousWeek.Size = new System.Drawing.Size(1765, 378);
this.dgvPreviousWeek.TabIndex = 5;
this.dgvPreviousWeek.Visible = false;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1925, 853);
this.Controls.Add(this.dgvPreviousWeek);
this.Controls.Add(this.rtbManualEntries);
this.Controls.Add(this.dgvCurrentWeek);
this.Controls.Add(this.btnNext);
this.Controls.Add(this.btnPrevious);
this.Controls.Add(this.label1);
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.Name = "Form1";
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)(this.dgvCurrentWeek)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgvPreviousWeek)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private Label label1;
private Button btnPrevious;
private Button btnNext;
private DataGridView dgvCurrentWeek;
private RichTextBox rtbManualEntries;
private DataGridView dgvPreviousWeek;
}
}

View File

@ -0,0 +1,344 @@
using Microsoft.Extensions.Logging;
using ReportingServices.Shared.HelperClasses;
using ReportingServices.Shared.ViewModels.ProductionReport;
using System.Data;
using System.Reflection;
namespace ReportingServices.Desktop
{
public partial class DailyReport : Form
{
private DataTable currentWeek = new();
private DataTable previousWeek = new();
private readonly ILogger<Form1> _logger;
private readonly string _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json";
private readonly string _toolStateOwnerFilePath = "wwwroot/Assets/ToolStates.json";
private readonly string _baseFTUrl;
private readonly string _baseDBUrl;
public DailyReport(ILogger<Form1> logger)
{
_logger = logger;
_baseFTUrl = "http://mestsa008:50201/api/";
_baseDBUrl = "https://localhost:7196/api/";
_logger.LogInformation("Base FabTime Address: {baseUrl}", _baseFTUrl);
_logger.LogInformation("Base Database Address: {baseUrl}", _baseDBUrl);
InitializeComponent();
string baseFabTimeUrl = _baseFTUrl + "FabTime/";
string baseScrapeDbUrl = _baseDBUrl + "ScrapeDB/";
try
{
Shared.ViewModels.ProductionReport.DailyReport dailyReport = DailyReportHelper.SetUpDailyReport(_logger, baseFabTimeUrl, baseScrapeDbUrl);
Dictionary<string, List<string>> toolStateOwners = JsonFileHandler.LoadJSONFile<Dictionary<string, List<string>>>(_toolStateOwnerFilePath);
dailyReport.ToolStatesByOwner = toolStateOwners;
SetupWeekView(dailyReport.CurrentWeek, currentWeek);
SetupWeekView(dailyReport.PreviousWeek, previousWeek);
dgvCurrentWeek.DataSource = currentWeek;
dgvPreviousWeek.DataSource = previousWeek;
}
catch (Exception ex)
{
_logger.LogCritical(ex, "Failed to load report");
}
}
public void SetupWeekView(YieldStatistics rpt, DataTable dt)
{
dt.Columns.Add("SIOperations");
dt.Columns.Add("Monday");
dt.Columns.Add("Tuesday");
dt.Columns.Add("Wednesday");
dt.Columns.Add("Thursday");
dt.Columns.Add("Friday");
dt.Columns.Add("Saturday");
dt.Columns.Add("Sunday");
dt.Columns.Add("Weekly Total");
dt.Columns.Add("Comment");
AddDates(rpt, dt);
AddTargets(rpt, dt);
AddOuts(rpt, dt);
AddYieldedWafers(rpt, dt);
AddCustomerScrap(rpt, dt);
AddManufacturingScrap(rpt, dt);
AddProductionScrap(rpt, dt);
AddYield(rpt, dt);
AddDeltaToCommit(rpt, dt);
AddDeltaToTarget(rpt, dt);
AddNeededTarget(rpt, dt);
}
public void AddDates(YieldStatistics rpt, DataTable dt)
{
DataRow dr = dt.NewRow();
for (int i = 0; i < 7; i++)
{
dr[1 + i] = rpt.StartDate.AddDays(i).ToString("MM/dd/yyyy");
}
dt.Rows.Add(dr);
}
public void AddTargets(YieldStatistics rpt, DataTable dt)
{
DataRow dr = dt.NewRow();
dr["SIOperations"] = "Commited Target to meet Shipment Requirements";
for (int i = 0; i < 7; i++)
{
dr[1 + i] = string.Format("{0:#,###}", rpt.DailyPlanWafers);
}
dr["WeeklyTotal"] = string.Format("{0:##,###}", rpt.DailyPlanWafers * 7);
dr["Comment"] = "Number updated quarterly";
dt.Rows.Add(dr);
}
public void AddOuts(YieldStatistics rpt, DataTable dt)
{
int counter = 0;
DataRow dr = dt.NewRow();
dr["SIOperations"] = "Actual Reactor Out";
for (int i = 0; i < 7; i++)
{
if (i < rpt.OutsByDay.Count)
{
dr[1 + i] = string.Format("{0:#,###}", rpt.OutsByDay[i].TotalWafers);
counter += rpt.OutsByDay[i].TotalWafers;
}
}
dr["WeeklyTotal"] = string.Format("{0:##,###}", counter);
dr["Comment"] = "Before Scrap";
dt.Rows.Add(dr);
}
public void AddYieldedWafers(YieldStatistics rpt, DataTable dt)
{
int counter = 0;
DataRow dr = dt.NewRow();
dr["SIOperations"] = "Actual Yielded Wafers Out";
for (int i = 0; i < 7; i++)
{
if (i < rpt.OutsByDay.Count)
{
dr[1 + i] = string.Format("{0:#,###}", rpt.OutsByDay[i].TotalWafers - rpt.ScrapByDay[i].TOT_REJ_WFRS - rpt.ScrapByDay[i].TW_PROD);
counter += rpt.OutsByDay[i].TotalWafers - rpt.ScrapByDay[i].TOT_REJ_WFRS - rpt.ScrapByDay[i].TW_PROD;
}
}
dr["WeeklyTotal"] = string.Format("{0:##,###}", counter);
dr["Comment"] = "After Scrap";
dt.Rows.Add(dr);
}
public void AddCustomerScrap(YieldStatistics rpt, DataTable dt)
{
int counter = 0;
DataRow dr = dt.NewRow();
dr["SIOperations"] = "Customer Scrap";
for (int i = 0; i < 7; i++)
{
if (i < rpt.OutsByDay.Count)
{
dr[1 + i] = string.Format("{0:#,###}", rpt.ScrapByDay[i].TOT_REJ_CUST);
counter += rpt.ScrapByDay[i].TOT_REJ_CUST;
}
}
dr["WeeklyTotal"] = string.Format("{0:##,###}", counter);
dt.Rows.Add(dr);
}
public void AddManufacturingScrap(YieldStatistics rpt, DataTable dt)
{
int counter = 0;
DataRow dr = dt.NewRow();
dr["SIOperations"] = "Manufacturing Scrap";
for (int i = 0; i < 7; i++)
{
if (i < rpt.OutsByDay.Count)
{
dr[1 + i] = string.Format("{0:#,###}", rpt.ScrapByDay[i].TOT_REJ_MANU);
counter += rpt.ScrapByDay[i].TOT_REJ_MANU;
}
}
dr["WeeklyTotal"] = string.Format("{0:##,###}", counter);
dt.Rows.Add(dr);
}
public void AddProductionScrap(YieldStatistics rpt, DataTable dt)
{
int counter = 0;
DataRow dr = dt.NewRow();
dr["SIOperations"] = "Production Scrap";
for (int i = 0; i < 7; i++)
{
if (i < rpt.OutsByDay.Count)
{
dr[1 + i] = string.Format("{0:#,###}", rpt.ScrapByDay[i].TW_PROD);
counter += rpt.ScrapByDay[i].TW_PROD;
}
}
dr["WeeklyTotal"] = string.Format("{0:##,###}", counter);
dt.Rows.Add(dr);
}
public void AddYield(YieldStatistics rpt, DataTable dt)
{
int totalOuts = 0;
int totalScrap = 0;
DataRow dr = dt.NewRow();
dr["SIOperations"] = "Yield";
for (int i = 0; i < 7; i++)
{
if (i < rpt.OutsByDay.Count)
{
float yield = ((float)rpt.OutsByDay[i].TotalWafers - (float)rpt.ScrapByDay[i].TOT_REJ_WFRS) / (float)rpt.OutsByDay[i].TotalWafers;
dr[1 + i] = string.Format("{0:P2}", rpt.ScrapByDay[i].TW_PROD);
totalOuts += rpt.OutsByDay[i].TotalWafers;
totalScrap += rpt.ScrapByDay[i].TOT_REJ_CUST + rpt.ScrapByDay[i].TOT_REJ_MANU;
}
}
dr["WeeklyTotal"] = string.Format("{0:P2}", (float)(totalOuts - totalScrap) / (float)totalOuts);
dr["Comment"] = "After Scrap";
dt.Rows.Add(dr);
}
public void AddDeltaToCommit(YieldStatistics rpt, DataTable dt)
{
int counter = 0;
DataRow dr = dt.NewRow();
dr["SIOperations"] = "Delta to commit";
for (int i = 0; i < 7; i++)
{
if (i < rpt.OutsByDay.Count)
{
int delta = rpt.OutsByDay[i].TotalWafers - rpt.ScrapByDay[i].TOT_REJ_WFRS - rpt.DailyPlanWafers;
dr[1 + i] = string.Format("{0:#,###}", delta);
counter += delta;
}
}
dr["WeeklyTotal"] = string.Format("{0:##,###}", counter);
dr["Comment"] = "Difference to commitment";
dt.Rows.Add(dr);
}
public void AddDeltaToTarget(YieldStatistics rpt, DataTable dt)
{
int counter = 0;
DataRow dr = dt.NewRow();
dr["SIOperations"] = "Delta to the Plan";
for (int i = 0; i < 7; i++)
{
if (i < rpt.OutsByDay.Count)
{
int delta = rpt.OutsByDay[i].TotalWafers - rpt.ScrapByDay[i].TOT_REJ_WFRS - rpt.DailyPlanWafers;
dr[1 + i] = string.Format("{0:#,###}", delta);
counter += delta;
}
}
dr["WeeklyTotal"] = string.Format("{0:##,###}", counter);
dr["Comment"] = "Difference to Target";
dt.Rows.Add(dr);
}
public void AddNeededTarget(YieldStatistics rpt, DataTable dt)
{
DataRow dr = dt.NewRow();
dr["SIOperations"] = "Wafers Needed to make QTR";
for (int i = 0; i < 7; i++)
{
if (i < rpt.OutsByDay.Count)
{
dr[1 + i] = string.Format("{0:#,###}", rpt.DailyPlanWafers);
}
}
dr["WeeklyTotal"] = string.Format("{0:##,###}", rpt.DailyPlanWafers * 7);
dr["Comment"] = "Number updated Weekly";
dt.Rows.Add(dr);
}
private void btnPrevious_Click(object sender, EventArgs e)
{
btnNext.Visible = true;
btnPrevious.Visible = false;
dgvCurrentWeek.Visible = false;
dgvPreviousWeek.Visible = true;
}
private void btnNext_Click(object sender, EventArgs e)
{
btnNext.Visible = false;
btnPrevious.Visible = true;
dgvCurrentWeek.Visible = true;
dgvPreviousWeek.Visible = false;
}
}
}

View File

@ -0,0 +1,60 @@
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,60 @@
namespace ReportingServices.Desktop
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnDailyReport = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// btnDailyReport
//
this.btnDailyReport.Location = new System.Drawing.Point(98, 12);
this.btnDailyReport.Name = "btnDailyReport";
this.btnDailyReport.Size = new System.Drawing.Size(140, 65);
this.btnDailyReport.TabIndex = 0;
this.btnDailyReport.Text = "Daily Report";
this.btnDailyReport.UseVisualStyleBackColor = true;
this.btnDailyReport.Click += new System.EventHandler(this.btnDailyReport_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.btnDailyReport);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
private Button btnDailyReport;
}
}

View File

@ -0,0 +1,31 @@
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ReportingServices.Desktop
{
public partial class Form1 : Form
{
ILogger<Form1> _logger;
public Form1(ILogger<Form1> logger)
{
_logger = logger;
InitializeComponent();
}
private void btnDailyReport_Click(object sender, EventArgs e)
{
DailyReport report = new DailyReport(_logger);
this.Hide();
report.Show();
}
}
}

View File

@ -0,0 +1,60 @@
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,32 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace ReportingServices.Desktop
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var services = new ServiceCollection();
ConfigureServices(services);
using (ServiceProvider serviceProvider = services.BuildServiceProvider())
{
var form1 = serviceProvider.GetRequiredService<Form1>();
Application.Run(form1);
}
}
private static void ConfigureServices(ServiceCollection services)
{
services.AddSingleton<Form1>()
.AddLogging(configure => configure.AddConsole());
}
}
}

View File

@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\ReportingServices.Shared\ReportingServices.Shared.csproj" />
</ItemGroup>
</Project>