init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,83 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using Kreta.BusinessLogic.Classes;
|
||||
using Kreta.Core.ConnectionType;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
using Kreta.Framework.Util;
|
||||
using OfficeOpenXml;
|
||||
|
||||
namespace Kreta.BusinessLogic.Helpers.Nyomtatvanyok.Excel
|
||||
{
|
||||
public class OsztalyTanuloinakHaviMulasztasiOsszesitoje : BaseNyomtatvanyExcel
|
||||
{
|
||||
public OsztalyTanuloinakHaviMulasztasiOsszesitoje(IConnectionType connectionType, string templateFilename = null) : base(connectionType)
|
||||
{
|
||||
StoredProcedure = "sp_GetOsztalyTanuloinakHaviMulasztasaiOsszesitoje";
|
||||
FileInfo exFile = null;
|
||||
if (templateFilename != null)
|
||||
{
|
||||
exFile = new FileInfo(templateFilename);
|
||||
}
|
||||
ExcelPackage = (exFile == null) ? new ExcelPackage() : new ExcelPackage(exFile);
|
||||
|
||||
//Munkalap tulajdonságok beállítása
|
||||
SetWorkbookProperties();
|
||||
}
|
||||
|
||||
public override void CreateSheet(Dictionary<string, string> dbParameters, int sheetIndex = 1)
|
||||
{
|
||||
DbParameters = dbParameters;
|
||||
|
||||
dbParameters.TryGetValue("pElmeletgyakorlat", out string elmeletGyakorlat);
|
||||
if (string.IsNullOrWhiteSpace(elmeletGyakorlat))
|
||||
elmeletGyakorlat = "0";
|
||||
|
||||
dbParameters.TryGetValue("pMulasztandoOrakszamaTeljesNaposMulasztashoz", out string pMulasztandoOrakszamaTeljesNaposMulasztashoz);
|
||||
if (string.IsNullOrWhiteSpace(pMulasztandoOrakszamaTeljesNaposMulasztashoz))
|
||||
pMulasztandoOrakszamaTeljesNaposMulasztashoz = "4";
|
||||
|
||||
// Adatforrás összeállítása
|
||||
SetExcelDataSet();
|
||||
DataAccessManual.Util.DataAccessBase.SetBoolFields(DataSet.Tables[13], "OJCSJKeresztfeleves,OJTechnikaiOsztaly,OJNemzetisegi,OJKettannyelvu,OJNyelviElokeszito,OJIsGyogypedagogiaiLogopediai,OJSportOsztaly,OJAranyJanosProgram");
|
||||
|
||||
DataSet.Tables[DataSet.Tables.Count - 1].TableName = "TanulokIktatasiAdatok";
|
||||
DataSet.Tables[DataSet.Tables.Count - 2].TableName = "OsztalyIktatasiAdatok";
|
||||
|
||||
DataTable honapokDt = DataSet.Tables[0];
|
||||
int index = 1;
|
||||
foreach (DataRow honap in honapokDt.Rows)
|
||||
{
|
||||
//Munkalap összeállítása
|
||||
ExcelWorksheet worksheet = CreateSheet(SDAConvert.ToString(honap["honapnev"]), index, eOrientation.Landscape, true, 2);
|
||||
worksheet.Row(1).Height = elmeletGyakorlat.Equals("0") ? 30 : 45;
|
||||
worksheet.Column(1).Width = 25;
|
||||
worksheet.Column(2).Width = 13;
|
||||
|
||||
int dcol = 3;
|
||||
for (; dcol <= (elmeletGyakorlat.Equals("0") ? 31 + 1 : 62 + 1); dcol++)
|
||||
worksheet.Column(dcol).Width = 6;
|
||||
|
||||
int[] dim = AddDataTable(
|
||||
worksheet, 1, 1, DataSet.Tables[index], null, IntegerStyleBottomBordered, HeaderStyleBottomBorderedBGGray,
|
||||
new[] { HeaderStyleBottomBordered, NormalStyleBottomBordered }, new[] { HeaderStyleBottomBordered },
|
||||
null, null, null,
|
||||
2, new[] { "COUNT", "SUM" }, new[] { Resources.ExcelNyomtatvanyResource.OsztalyTanuloinakHaviMulasztasiOsszesitojeNapiHianyzoTanulok, Resources.ExcelNyomtatvanyResource.OsztalyTanuloinakHaviMulasztasiOsszesitojeNapiOsszesito }, new[] { IntegerBoldStyle, IntegerStyle }, HeaderStyle);
|
||||
|
||||
for (; dcol <= dim[1]; dcol++)
|
||||
worksheet.Column(dcol).Width = 11;
|
||||
|
||||
if (dim[1] > 0)
|
||||
{
|
||||
worksheet.Column(dim[1]).Width = 15;
|
||||
AddComment(worksheet, 1, dim[1], ">= " + FrameworkEnumExtensions.EnumToListManual<TeljesNaposMulasztasSzamitashozMiminalisanMulasztottOrakszamaModEnum>()[pMulasztandoOrakszamaTeljesNaposMulasztashoz]);
|
||||
}
|
||||
|
||||
//Hiányzó fejlécek beállítása
|
||||
AddTanuloAdatokFejlec(worksheet, 1);
|
||||
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue