This commit is contained in:
Userok 2024-10-30 10:34:52 +03:00
parent d8c07ebb08
commit bbb179fc02
3 changed files with 7 additions and 7 deletions

View File

@ -10,8 +10,8 @@ class Conver
{ {
var attendanceData = new Dictionary<string, Dictionary<DateTime, bool>> var attendanceData = new Dictionary<string, Dictionary<DateTime, bool>>
{ {
{ "Ãðóïïà 1", new Dictionary<DateTime, bool> { { new DateTime(2023, 10, 1), true }, { new DateTime(2023, 10, 2), false } } }, { "Студент 1", new Dictionary<DateTime, bool> { { new DateTime(2023, 10, 1), true }, { new DateTime(2023, 10, 2), false } } },
{ "Ãðóïïà 2", new Dictionary<DateTime, bool> { { new DateTime(2023, 10, 1), true }, { new DateTime(2023, 10, 2), true } } } { "Студент 2", new Dictionary<DateTime, bool> { { new DateTime(2023, 10, 1), true }, { new DateTime(2023, 10, 2), true } } }
}; };
using (ExcelPackage excel = new ExcelPackage()) using (ExcelPackage excel = new ExcelPackage())
@ -19,7 +19,7 @@ class Conver
foreach (var group in attendanceData) foreach (var group in attendanceData)
{ {
var worksheet = excel.Workbook.Worksheets.Add(group.Key); var worksheet = excel.Workbook.Worksheets.Add(group.Key);
worksheet.Cells[1, 1].Value = "ÔÈÎ"; worksheet.Cells[1, 1].Value = "Студент";
int column = 2; int column = 2;
foreach (var date in group.Value.Keys) foreach (var date in group.Value.Keys)
@ -36,14 +36,14 @@ class Conver
foreach (var date in group.Value.Keys) foreach (var date in group.Value.Keys)
{ {
worksheet.Cells[row, column].Value = group.Value[date] ? "Ïðèñóòñòâóåò" : "Îòñóòñòâóåò"; worksheet.Cells[row, column].Value = group.Value[date] ? "Присутствует" : "Отсутствует";
column++; column++;
} }
row++; row++;
} }
} }
FileInfo excelFile = new FileInfo(@"C:\Users\profi\source\Musor\Xcel"); FileInfo excelFile = new FileInfo(@"C:\Users\profi\source\Musor\Xcel\Pametka.xlsx");
excel.SaveAs(excelFile); excel.SaveAs(excelFile);
} }
} }

View File

@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Zurnal")] [assembly: System.Reflection.AssemblyCompanyAttribute("Zurnal")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3eca2dd8f1df208f96109526c9875abc4489d29a")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d8c07ebb08166eee30eac561a7fa77aefe53881a")]
[assembly: System.Reflection.AssemblyProductAttribute("Zurnal")] [assembly: System.Reflection.AssemblyProductAttribute("Zurnal")]
[assembly: System.Reflection.AssemblyTitleAttribute("Zurnal")] [assembly: System.Reflection.AssemblyTitleAttribute("Zurnal")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
9c3e3ee686f577fa9c55e66a2d48d2d7111068749ef9b45e0429435fd7bbbb78 2754838fa838fa1622a1d28241e8741e2e14cd8f1431a3835aa8fe78997d910b