unnötiges try catch
This commit is contained in:
@@ -10,117 +10,110 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Dakota.Logic
|
||||
{
|
||||
public class DakotaManager
|
||||
{
|
||||
public int Month { get; set; }
|
||||
public int Version { get; set; }
|
||||
public class DakotaManager
|
||||
{
|
||||
public int Month { get; set; }
|
||||
public int Version { get; set; }
|
||||
|
||||
public DakotaInfoCreator DakotaInfoCreator { get; set; }
|
||||
public bool IsSammelrechnung { get; set; }
|
||||
public DakotaInfoCreator DakotaInfoCreator { get; set; }
|
||||
public bool IsSammelrechnung { get; set; }
|
||||
|
||||
public Dictionary<string, DakotaFile> DakotaFileDict { get; set; }
|
||||
public Dictionary<string, DakotaFile> DakotaFileDict { get; set; }
|
||||
|
||||
public Dictionary<string, InfoDateiNutzdaten> DakotaInfoNutzDict { get; set; }
|
||||
public Dictionary<string, InfoDateiAuftrags> DakotaInfoAufDict { get; set; }
|
||||
public Dictionary<string, InfoDateiNutzdaten> DakotaInfoNutzDict { get; set; }
|
||||
public Dictionary<string, InfoDateiAuftrags> DakotaInfoAufDict { get; set; }
|
||||
|
||||
public DakotaManager() : this(DateTime.Now.Month, DateTime.Now)
|
||||
{
|
||||
public DakotaManager() : this(DateTime.Now.Month, DateTime.Now)
|
||||
{
|
||||
|
||||
}
|
||||
public DakotaManager(int month, DateTime dateTime, bool isSammelrechnung = false)
|
||||
{
|
||||
Month = month;
|
||||
Version = GetVersion(dateTime);
|
||||
}
|
||||
public DakotaManager(int month, DateTime dateTime, bool isSammelrechnung = false)
|
||||
{
|
||||
Month = month;
|
||||
Version = GetVersion(dateTime);
|
||||
|
||||
DakotaFileDict = new Dictionary<string, DakotaFile>();
|
||||
DakotaFileDict = new Dictionary<string, DakotaFile>();
|
||||
|
||||
DakotaInfoNutzDict = new Dictionary<string, InfoDateiNutzdaten>();
|
||||
DakotaInfoAufDict = new Dictionary<string, InfoDateiAuftrags>();
|
||||
DakotaInfoNutzDict = new Dictionary<string, InfoDateiNutzdaten>();
|
||||
DakotaInfoAufDict = new Dictionary<string, InfoDateiAuftrags>();
|
||||
|
||||
DakotaInfoCreator = new DakotaInfoCreator(isSammelrechnung);
|
||||
IsSammelrechnung = isSammelrechnung;
|
||||
}
|
||||
DakotaInfoCreator = new DakotaInfoCreator(isSammelrechnung);
|
||||
IsSammelrechnung = isSammelrechnung;
|
||||
}
|
||||
|
||||
public void Add(ServiceInvoiceDC serviceInvoice, OrganisationDC organisation, CustomerDC customer, AddressInformation address, int datenaustauschreferenz, int transfernummer)
|
||||
{
|
||||
try
|
||||
{
|
||||
var ik_datenannahmestelle = organisation.IKDatenannahmestelle;
|
||||
var success = DakotaInfoNutzDict.TryGetValue(ik_datenannahmestelle, out InfoDateiNutzdaten nutzdaten);
|
||||
public void Add(ServiceInvoiceDC serviceInvoice, OrganisationDC organisation, CustomerDC customer, AddressInformation address, int datenaustauschreferenz, int transfernummer)
|
||||
{
|
||||
var ik_datenannahmestelle = organisation.IKDatenannahmestelle;
|
||||
var success = DakotaInfoNutzDict.TryGetValue(ik_datenannahmestelle, out InfoDateiNutzdaten nutzdaten);
|
||||
|
||||
if (!success)
|
||||
{
|
||||
var verfahrensstufe = organisation.Verfahrensstufe;
|
||||
if (!success)
|
||||
{
|
||||
var verfahrensstufe = organisation.Verfahrensstufe;
|
||||
|
||||
// Verfahrenkennung
|
||||
// Erste Stelle:
|
||||
// "E" - Echtdaten
|
||||
// "T" - Testdaten
|
||||
// Annahme: "E" auch für Erprobungsverfahrenstufe
|
||||
// Zusatz: "T" bei Erprobungsverfahrenstufe
|
||||
// Verfahrenkennung
|
||||
// Erste Stelle:
|
||||
// "E" - Echtdaten
|
||||
// "T" - Testdaten
|
||||
// Annahme: "E" auch für Erprobungsverfahrenstufe
|
||||
// Zusatz: "T" bei Erprobungsverfahrenstufe
|
||||
|
||||
var isTest = verfahrensstufe == BS.Shared.GkvVerfahrensstufe.Test || verfahrensstufe == BS.Shared.GkvVerfahrensstufe.Erprobung;
|
||||
var verfahrenkennung = isTest ? "TSOL0" : "ESOL0";
|
||||
var logischer_dateiname = DakotaConfig.GetLogischerDateiname(Month).Trim();
|
||||
var isTest = verfahrensstufe == BS.Shared.GkvVerfahrensstufe.Test || verfahrensstufe == BS.Shared.GkvVerfahrensstufe.Erprobung;
|
||||
var verfahrenkennung = isTest ? "TSOL0" : "ESOL0";
|
||||
var logischer_dateiname = DakotaConfig.GetLogischerDateiname(Month).Trim();
|
||||
|
||||
var info_nutz_add = DakotaInfoCreator.GetEmptyInfoNutzdatendatei(DakotaConfig.IKAbsender, organisation.IKDatenannahmestelle, (int)verfahrensstufe, logischer_dateiname, datenaustauschreferenz);
|
||||
var info_auf_add = DakotaInfoCreator.GetEmptyInfoAuftragsdatei(organisation.IKDatenannahmestelle, logischer_dateiname, verfahrenkennung, transfernummer);
|
||||
var info_nutz_add = DakotaInfoCreator.GetEmptyInfoNutzdatendatei(DakotaConfig.IKAbsender, organisation.IKDatenannahmestelle, (int)verfahrensstufe, logischer_dateiname, datenaustauschreferenz);
|
||||
var info_auf_add = DakotaInfoCreator.GetEmptyInfoAuftragsdatei(organisation.IKDatenannahmestelle, logischer_dateiname, verfahrenkennung, transfernummer);
|
||||
|
||||
DakotaInfoNutzDict.Add(ik_datenannahmestelle, info_nutz_add);
|
||||
DakotaInfoAufDict.Add(ik_datenannahmestelle, info_auf_add);
|
||||
DakotaInfoNutzDict.Add(ik_datenannahmestelle, info_nutz_add);
|
||||
DakotaInfoAufDict.Add(ik_datenannahmestelle, info_auf_add);
|
||||
|
||||
nutzdaten = info_nutz_add;
|
||||
}
|
||||
nutzdaten = info_nutz_add;
|
||||
}
|
||||
|
||||
foreach (var peroid in serviceInvoice.ServiceInvoicePeriods)
|
||||
{
|
||||
foreach (var invoice in peroid.InvoiceItems)
|
||||
{
|
||||
var info_nutz_item = new InfoParameterInvoiceItem(serviceInvoice, invoice, organisation, customer, address);
|
||||
foreach (var peroid in serviceInvoice.ServiceInvoicePeriods)
|
||||
{
|
||||
foreach (var invoice in peroid.InvoiceItems)
|
||||
{
|
||||
var info_nutz_item = new InfoParameterInvoiceItem(serviceInvoice, invoice, organisation, customer, address);
|
||||
|
||||
DakotaInfoCreator.AddInfoParameter(nutzdaten, info_nutz_item, Version);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
DakotaInfoCreator.AddInfoParameter(nutzdaten, info_nutz_item, Version);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Apply()
|
||||
{
|
||||
foreach (var ik_datenannahmestelle in DakotaInfoNutzDict.Keys)
|
||||
{
|
||||
var file = new DakotaFile(DateTime.Now);
|
||||
public void Apply()
|
||||
{
|
||||
foreach (var ik_datenannahmestelle in DakotaInfoNutzDict.Keys)
|
||||
{
|
||||
var file = new DakotaFile(DateTime.Now);
|
||||
|
||||
var info_nutz = DakotaInfoNutzDict[ik_datenannahmestelle];
|
||||
var info_auf = DakotaInfoAufDict[ik_datenannahmestelle];
|
||||
var info_nutz = DakotaInfoNutzDict[ik_datenannahmestelle];
|
||||
var info_auf = DakotaInfoAufDict[ik_datenannahmestelle];
|
||||
|
||||
file.Nutzdatendatei.Apply(info_nutz, DakotaInfoCreator.IsSammelrechnung);
|
||||
file.Auftragsdatei.Apply(info_auf);
|
||||
file.Nutzdatendatei.Apply(info_nutz, DakotaInfoCreator.IsSammelrechnung);
|
||||
file.Auftragsdatei.Apply(info_auf);
|
||||
|
||||
DakotaFileDict.Add(ik_datenannahmestelle, file);
|
||||
}
|
||||
}
|
||||
DakotaFileDict.Add(ik_datenannahmestelle, file);
|
||||
}
|
||||
}
|
||||
|
||||
private int GetVersion(DateTime create4month)
|
||||
{
|
||||
if (create4month < new DateTime(2023, 7, 1))
|
||||
throw new NotImplementedException("Keine Unterstützung von Version 17 oder niedriger");
|
||||
private int GetVersion(DateTime create4month)
|
||||
{
|
||||
if (create4month < new DateTime(2023, 7, 1))
|
||||
throw new NotImplementedException("Keine Unterstützung von Version 17 oder niedriger");
|
||||
|
||||
if (create4month < new DateTime(2024, 1, 1))
|
||||
return 18;
|
||||
if (create4month < new DateTime(2024, 1, 1))
|
||||
return 18;
|
||||
|
||||
if (create4month < new DateTime(2024, 7, 1))
|
||||
return 19;
|
||||
if (create4month < new DateTime(2024, 7, 1))
|
||||
return 19;
|
||||
|
||||
return 20;
|
||||
return 20;
|
||||
|
||||
//if (create4month < new DateTime(2025, 1, 1))
|
||||
// return 20;
|
||||
//if (create4month < new DateTime(2025, 1, 1))
|
||||
// return 20;
|
||||
|
||||
//throw new NotImplementedException("Keine Unterstützung von Version 21 oder aufwärts");
|
||||
}
|
||||
}
|
||||
//throw new NotImplementedException("Keine Unterstützung von Version 21 oder aufwärts");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user