Compare commits

..

No commits in common. "8a31283d9e8f8b0e5cbaa9465456146997d5cb34" and "8e1c9fddf31307ee18768c37a3a5c19a5a1a26bc" have entirely different histories.

10 changed files with 44 additions and 92 deletions

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows7.0</TargetFramework> <TargetFramework>net6.0-windows7.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
@ -19,11 +19,12 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" /> <PackageReference Include="DocumentFormat.OpenXml" Version="3.1.1" /> <PackageReference Include="NotVisualComponent2" Version="1.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="NotVisualComponent" Version="1.0.0" />
<PackageReference Include="WinFormsLibrary" Version="1.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Contracts\Contracts.csproj" />
<ProjectReference Include="..\Controls\Controls.csproj" /> <ProjectReference Include="..\Controls\Controls.csproj" />
<ProjectReference Include="..\DatabaseImplement\DatabaseImplement.csproj" /> <ProjectReference Include="..\DatabaseImplement\DatabaseImplement.csproj" />
</ItemGroup> </ItemGroup>

View File

@ -1,16 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0-windows7.0</TargetFramework> <TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="NotVisualComponent2" Version="1.0.0" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Contracts\Contracts.csproj" /> <ProjectReference Include="..\Contracts\Contracts.csproj" />
</ItemGroup> </ItemGroup>

View File

@ -1,16 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0-windows7.0</TargetFramework> <TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="NotVisualComponent2" Version="1.0.0" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Models\Models.csproj" /> <ProjectReference Include="..\Models\Models.csproj" />
</ItemGroup> </ItemGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0-windows7.0</TargetFramework> <TargetFramework>net6.0-windows7.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
@ -12,7 +12,7 @@
<PackageReference Include="CreateVisualComponent" Version="1.0.0" /> <PackageReference Include="CreateVisualComponent" Version="1.0.0" />
<PackageReference Include="CustomComponentsTest" Version="1.0.0" /> <PackageReference Include="CustomComponentsTest" Version="1.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.35" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.35" />
<PackageReference Include="NotVisualComponent2" Version="1.0.0" /> <PackageReference Include="NotVisualComponent" Version="1.0.0" />
<PackageReference Include="PDFsharp-MigraDoc-GDI" Version="6.1.1" /> <PackageReference Include="PDFsharp-MigraDoc-GDI" Version="6.1.1" />
</ItemGroup> </ItemGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0-windows7.0</TargetFramework> <TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
@ -14,7 +14,6 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="NotVisualComponent2" Version="1.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.29" /> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.29" />
</ItemGroup> </ItemGroup>

View File

@ -41,9 +41,7 @@
редактироватьtoolStripMenuItem = new ToolStripMenuItem(); редактироватьtoolStripMenuItem = new ToolStripMenuItem();
controlDataTreeTable = new ControlsLibraryNet60.Data.ControlDataTreeTable(); controlDataTreeTable = new ControlsLibraryNet60.Data.ControlDataTreeTable();
largeTextComponent = new Controls.LargeTextComponent(components); largeTextComponent = new Controls.LargeTextComponent(components);
pieChartWord1 = new CustomComponents.NonViewComponents.PieChartWord(components); componentDocumentWithChartPieWord = new ComponentsLibraryNet60.DocumentWithChart.ComponentDocumentWithChartPieWord(components);
componentDocumentWithTableMultiHeaderExcel1 = new ComponentsLibraryNet60.DocumentWithTable.ComponentDocumentWithTableMultiHeaderExcel(components);
excelHardTable1 = new NotVisualComponent.ExcelHardTable(components);
menuStrip1.SuspendLayout(); menuStrip1.SuspendLayout();
SuspendLayout(); SuspendLayout();
// //
@ -104,7 +102,6 @@
excelОтчётToolStripMenuItem.Name = "excelОтчётToolStripMenuItem"; excelОтчётToolStripMenuItem.Name = "excelОтчётToolStripMenuItem";
excelОтчётToolStripMenuItem.Size = new Size(98, 24); excelОтчётToolStripMenuItem.Size = new Size(98, 24);
excelОтчётToolStripMenuItem.Text = "Excel отчёт"; excelОтчётToolStripMenuItem.Text = "Excel отчёт";
excelОтчётToolStripMenuItem.Click += excelОтчётToolStripMenuItem_Click;
// //
// wordДиаграммаToolStripMenuItem // wordДиаграммаToolStripMenuItem
// //
@ -158,8 +155,6 @@
private ToolStripMenuItem редактироватьtoolStripMenuItem; private ToolStripMenuItem редактироватьtoolStripMenuItem;
private ControlsLibraryNet60.Data.ControlDataTreeTable controlDataTreeTable; private ControlsLibraryNet60.Data.ControlDataTreeTable controlDataTreeTable;
private Controls.LargeTextComponent largeTextComponent; private Controls.LargeTextComponent largeTextComponent;
private CustomComponents.NonViewComponents.PieChartWord pieChartWord1; private ComponentsLibraryNet60.DocumentWithChart.ComponentDocumentWithChartPieWord componentDocumentWithChartPieWord;
private ComponentsLibraryNet60.DocumentWithTable.ComponentDocumentWithTableMultiHeaderExcel componentDocumentWithTableMultiHeaderExcel1;
private NotVisualComponent.ExcelHardTable excelHardTable1;
} }
} }

View File

@ -1,13 +1,12 @@
using Contracts.BindlingModels; using ComponentsLibraryNet60.DocumentWithChart;
using ComponentsLibraryNet60.Models;
using Contracts.BindlingModels;
using Contracts.BusinessLogicContracts; using Contracts.BusinessLogicContracts;
using Contracts.ViewModels; using Contracts.ViewModels;
using Controls; using Controls;
using ControlsLibraryNet60.Data; using ControlsLibraryNet60.Data;
using ControlsLibraryNet60.Models; using ControlsLibraryNet60.Models;
using CustomComponents; using CustomComponents;
using CustomComponents.NonViewComponents.Enums;
using CustomComponents.NonViewComponents.SupportClasses;
using CustomComponents.NonViewComponents;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
@ -17,11 +16,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using DatabaseImplement.Models;
using ComponentsLibraryNet60.DocumentWithTable;
using ComponentsLibraryNet60.Models;
using NotVisualComponent.Models;
using NotVisualComponent;
namespace Forms namespace Forms
{ {
public partial class FormMain : Form public partial class FormMain : Form
@ -144,59 +139,35 @@ namespace Forms
saveFileDialog.ShowDialog(); saveFileDialog.ShowDialog();
string path = saveFileDialog.FileName + ".docx"; string path = saveFileDialog.FileName + ".docx";
var list = _dlogic.ReadList(null); var list = _dlogic.ReadList(null);
var data = list var data = new List<(int Date, double Value)> { };
.Where(x => x.DeliveryDate != "Даты доставки нет") string header = "График доставок известной даты\n";
.GroupBy(x => x.DeliveryType) var chart = new Dictionary<string, List<(int Date, double Value)>> { };
.Select(g => (type: g.Key, Value: g.Count())) int index = 1;
.ToList(); foreach (var type in _dtlogic.ReadList(null)!)
var categoriesX = data.Select(d => d.type).ToList();
var valuesY = data.Select(d => (double)d.Value).ToList();
var series = new List<SeriesData>
{ {
new() int sum = 0;
foreach (var item in list)
{ {
SeriesName = "Количество доставок", if (item.DeliveryType == type.Name)
ValuesY = valuesY, {
Color = Color.FromArgb(100, 150, 200) sum++;
} }
};
pieChartWord1.CreateDiagramDocument(new PieChartData()
{
FileName = path,
DocumentTitle = "Диаграмма",
DiagramTitle = "Количество доставок по типам",
LegendLayout = PieChartLegendAlign.Bottom,
CategoriesX = categoriesX,
SeriesData = series
});
MessageBox.Show("Отчет готов");
} }
header += $"{index} - {type.Name}\n";
private void excelОтчётToolStripMenuItem_Click(object sender, EventArgs e) if (sum != 0) data.Add((index, sum));
{ index++;
SaveFileDialog saveFileDialog = new SaveFileDialog(); }
saveFileDialog.ShowDialog(); chart.Add("ИП", data);
string path = saveFileDialog.FileName + ".xlsx"; var conf = new ComponentDocumentWithChartConfig
var list = _dlogic.ReadList(null);
excelHardTable1.CreateDoc(new TableWithHeaderConfig<DeliveryViewModel>
{ {
FilePath = path, FilePath = path,
Header = "Deliveryies", Header = header,
ColumnsRowsWidth = new List<(int Column, int Row)> { (5, 5), (20, 5), (10, 0), (15, 0), }, ChartTitle = "Диаграмма по типам доставок",
Headers = new List<(int ColumnIndex, int RowIndex, string Header, string PropertyName)> LegendLocation = ComponentsLibraryNet60.Models.Location.Bottom,
{ Data = chart,
(0, 0, "Id", "Id"), };
(1, 0, "FCs", "FCs"), componentDocumentWithChartPieWord.CreateDoc(conf);
(2, 0, "DeliveryType", "DeliveryType"),
(3, 0, "DeliveryDate", "DeliveryDate"),
},
Data = list
});
MessageBox.Show("Отчет готов"); MessageBox.Show("Отчет готов");
} }
} }
} }

View File

@ -123,13 +123,7 @@
<metadata name="largeTextComponent.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="largeTextComponent.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>153, 17</value> <value>153, 17</value>
</metadata> </metadata>
<metadata name="pieChartWord1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="componentDocumentWithChartPieWord.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>348, 17</value> <value>348, 17</value>
</metadata> </metadata>
<metadata name="componentDocumentWithTableMultiHeaderExcel1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>504, 17</value>
</metadata>
<metadata name="excelHardTable1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 58</value>
</metadata>
</root> </root>

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows7.0</TargetFramework> <TargetFramework>net6.0-windows7.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
@ -19,11 +19,12 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" /> <PackageReference Include="DocumentFormat.OpenXml" Version="3.1.1" /> <PackageReference Include="NotVisualComponent2" Version="1.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="NotVisualComponent" Version="1.0.0" />
<PackageReference Include="WinFormsLibrary" Version="1.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Contracts\Contracts.csproj" />
<ProjectReference Include="..\Controls\Controls.csproj" /> <ProjectReference Include="..\Controls\Controls.csproj" />
<ProjectReference Include="..\DatabaseImplement\DatabaseImplement.csproj" /> <ProjectReference Include="..\DatabaseImplement\DatabaseImplement.csproj" />
</ItemGroup> </ItemGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0-windows7.0</TargetFramework> <TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
@ -9,7 +9,6 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.35" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.35" />
<PackageReference Include="NotVisualComponent2" Version="1.0.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>