Мегадоделал

This commit is contained in:
Artyom_Yashin 2024-04-14 11:30:58 +04:00
parent 8d4745944e
commit 77bf1370bd
5 changed files with 50 additions and 48 deletions

View File

@ -30,7 +30,7 @@
{
dataGridView = new DataGridView();
ShopColumn = new DataGridViewTextBoxColumn();
IceCreamColumn = new DataGridViewTextBoxColumn();
ComputerColumn = new DataGridViewTextBoxColumn();
CountColumn = new DataGridViewTextBoxColumn();
SaveButton = new Button();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
@ -39,7 +39,7 @@
// dataGridView
//
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView.Columns.AddRange(new DataGridViewColumn[] { ShopColumn, IceCreamColumn, CountColumn });
dataGridView.Columns.AddRange(new DataGridViewColumn[] { ShopColumn, ComputerColumn, CountColumn });
dataGridView.Location = new Point(12, 64);
dataGridView.Name = "dataGridView";
dataGridView.RowHeadersWidth = 51;
@ -54,12 +54,12 @@
ShopColumn.Name = "ShopColumn";
ShopColumn.Width = 250;
//
// IceCreamColumn
// ComputerColumn
//
IceCreamColumn.HeaderText = "Компьютер";
IceCreamColumn.MinimumWidth = 6;
IceCreamColumn.Name = "ComputerColumn";
IceCreamColumn.Width = 250;
ComputerColumn.HeaderText = "Компьютер";
ComputerColumn.MinimumWidth = 6;
ComputerColumn.Name = "ComputerColumn";
ComputerColumn.Width = 250;
//
// CountColumn
//
@ -97,7 +97,7 @@
private DataGridView dataGridView;
private Button SaveButton;
private DataGridViewTextBoxColumn ShopColumn;
private DataGridViewTextBoxColumn IceCreamColumn;
private DataGridViewTextBoxColumn ComputerColumn;
private DataGridViewTextBoxColumn CountColumn;
}
}

View File

@ -361,7 +361,7 @@
</Page>
<AutoRefresh>0</AutoRefresh>
<DataSources>
<DataSource Name="IceCreamShopContractsViewModels">
<DataSource Name="ComputersShopContractsViewModels">
<ConnectionProperties>
<DataProvider>System.Data.DataSet</DataProvider>
<ConnectString>/* Local Connection */</ConnectString>
@ -371,7 +371,7 @@
<DataSets>
<DataSet Name="DataSetOrders">
<Query>
<DataSourceName>IceCreamShopContractsViewModels</DataSourceName>
<DataSourceName>ComputersShopContractsViewModels</DataSourceName>
<CommandText>/* Local Query */</CommandText>
</Query>
<Fields>
@ -389,9 +389,9 @@
</Field>
</Fields>
<rd:DataSetInfo>
<rd:DataSetName>IceCreamShopContracts.ViewModels</rd:DataSetName>
<rd:DataSetName>ComputersShopContracts.ViewModels</rd:DataSetName>
<rd:TableName>ReportDateOrdersViewModel</rd:TableName>
<rd:ObjectDataSourceType>IceCreamShopContracts.ViewModels.ReportDateOrdersViewModel, IceCreamShopContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</rd:ObjectDataSourceType>
<rd:ObjectDataSourceType>ComputersShopContracts.ViewModels.ReportDateOrdersViewModel, ComputersShopContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</rd:ObjectDataSourceType>
</rd:DataSetInfo>
</DataSet>
</DataSets>

View File

@ -98,12 +98,12 @@ namespace ComputersShopBusinessLogic.BusinessLogics
Computers = new List<Tuple<string, int>>(),
TotalCount = 0
};
foreach (var iceCream in shop.ShopComputers)
foreach (var computer in shop.ShopComputers)
{
record.Computers.Add(new Tuple<string,
int>(iceCream.Value.Item1.ComputerName, iceCream.Value.Item2));
int>(computer.Value.Item1.ComputerName, computer.Value.Item2));
record.TotalCount +=
iceCream.Value.Item2;
computer.Value.Item2;
}
list.Add(record);
}

View File

@ -105,13 +105,13 @@ namespace ComputersShopBusinessLogic.OfficePackage
StyleInfo = ExcelStyleInfoType.Text
});
rowIndex++;
foreach (var iceCream in pc.Computers)
foreach (var computer in pc.Computers)
{
InsertCellInWorksheet(new ExcelCellParameters
{
ColumnName = "B",
RowIndex = rowIndex,
Text = iceCream.Item1,
Text = computer.Item1,
StyleInfo =
ExcelStyleInfoType.TextWithBroder
});
@ -119,7 +119,7 @@ namespace ComputersShopBusinessLogic.OfficePackage
{
ColumnName = "C",
RowIndex = rowIndex,
Text = iceCream.Item2.ToString(),
Text = computer.Item2.ToString(),
StyleInfo =
ExcelStyleInfoType.TextWithBroder
});

View File

@ -132,36 +132,38 @@ namespace ComputersShopBusinessLogic.OfficePackage.Implements
}
Table docTable = new Table();
TableProperties tableProps = new TableProperties(
new TopBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 12
},
new BottomBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 12
},
new LeftBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 12
},
new RightBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 12
},
new InsideHorizontalBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 12
},
new InsideVerticalBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 12
});
new TableBorders(
new TopBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 12
},
new BottomBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 12
},
new LeftBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 12
},
new RightBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 12
},
new InsideHorizontalBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 12
},
new InsideVerticalBorder
{
Val = new EnumValue<BorderValues>(BorderValues.Single),
Size = 12
}
));
docTable.AppendChild(tableProps);
TableGrid tableGrid = new TableGrid();
for (int i = 0; i < table.Columns; i++)