WAS, WAS_RCPT wip
This commit is contained in:
parent
5b5fd61638
commit
329d9f8a8b
@ -127,16 +127,95 @@ namespace ENI2.Excel
|
||||
return result;
|
||||
}
|
||||
|
||||
private static bool ScanWAS_RCPT(Message message, ExcelReader reader)
|
||||
#region WAS_RCPT
|
||||
|
||||
private static bool ScanWAS_RCPT(Message was_rcptMessage, ExcelReader reader)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
bool result = false;
|
||||
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
string idNumber = reader.ReadCellAsText("waste delivery receipt", string.Format("B{0}", i + 9));
|
||||
if (idNumber.IsNullOrEmpty()) continue;
|
||||
if (!(was_rcptMessage.GetSublistElementWithIdentifier(i.ToString()) is WAS_RCPT wasr))
|
||||
{
|
||||
wasr = new WAS_RCPT();
|
||||
wasr.Identifier = i.ToString();
|
||||
wasr.MessageHeader = was_rcptMessage;
|
||||
was_rcptMessage.Elements.Add(wasr);
|
||||
}
|
||||
wasr.IdentificationNumber = idNumber;
|
||||
wasr.PortReceptionFacilityName = reader.ReadCellAsText("waste delivery receipt", string.Format("C{0}", i + 9));
|
||||
wasr.PortReceptionFacilityProviderName = reader.ReadCellAsText("waste delivery receipt", string.Format("D{0}", i + 9));
|
||||
wasr.WasteDeliveryDateFrom = reader.ReadCellAsDateTime("waste delivery receipt", string.Format("E{0}", i + 9));
|
||||
wasr.WasteDeliveryDateTo = reader.ReadCellAsDateTime("waste delivery receipt", string.Format("F{0}", i + 9));
|
||||
|
||||
|
||||
result = true;
|
||||
}
|
||||
|
||||
private static bool ScanWAS(Message message, ExcelReader reader)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region WAS
|
||||
|
||||
private static bool ScanWAS(Message wasMessage, ExcelReader reader)
|
||||
{
|
||||
|
||||
if (wasMessage.Elements.Count == 0)
|
||||
{
|
||||
WAS newWAS = new WAS();
|
||||
newWAS.MessageHeader = wasMessage;
|
||||
wasMessage.Elements.Add(newWAS);
|
||||
}
|
||||
WAS was = wasMessage.Elements[0] as WAS;
|
||||
was.WasteDisposalValidExemption = reader.ReadCellAsBool("waste", "C8");
|
||||
if(!(was.WasteDisposalValidExemption ?? false))
|
||||
{
|
||||
was.LastWasteDisposalPort = reader.ReadCellAsText("waste", "C10");
|
||||
was.LastWasteDisposalDate = reader.ReadCellAsDateTime("waste", "C11");
|
||||
was.NextWasteDisposalPort = reader.ReadCellAsText("waste", "C12");
|
||||
|
||||
|
||||
for (int i = 1; i <= 25; i++)
|
||||
{
|
||||
if (!(was.GetSublistElementWithIdentifier(i.ToString()) is Waste waste))
|
||||
{
|
||||
waste = new Waste();
|
||||
waste.Identifier = i.ToString();
|
||||
waste.WAS = was;
|
||||
was.Waste.Add(waste);
|
||||
}
|
||||
waste.WasteType = (int?)reader.ReadCellAsDecimal("waste", string.Format("C{0}", i + 18));
|
||||
waste.WasteDescription = reader.ReadCellAsText("waste", string.Format("D{0}", i + 18));
|
||||
waste.WasteDisposalAmount_MTQ = reader.ReadCellAsDecimal("waste", string.Format("E{0}", i + 18));
|
||||
waste.WasteCapacity_MTQ = reader.ReadCellAsDecimal("waste", string.Format("F{0}", i + 18));
|
||||
waste.WasteAmountRetained_MTQ = reader.ReadCellAsDecimal("waste", string.Format("G{0}", i + 18));
|
||||
waste.WasteDisposalPort = reader.ReadCellAsText("waste", string.Format("H{0}", i + 18));
|
||||
waste.WasteAmountGeneratedTillNextPort_MTQ = reader.ReadCellAsDecimal("waste", string.Format("I{0}", i + 18));
|
||||
}
|
||||
|
||||
was.WasteDisposalServiceProvider.Clear();
|
||||
for (int i = 1; i < 1000; i++)
|
||||
{
|
||||
string wsdpName = reader.ReadCellAsText("waste", string.Format("B{0}", i + 45));
|
||||
if (wsdpName.IsNullOrEmpty()) break;
|
||||
WasteDisposalServiceProvider wdsp = new WasteDisposalServiceProvider();
|
||||
wdsp.Identifier = i.ToString();
|
||||
wdsp.WAS = was;
|
||||
was.WasteDisposalServiceProvider.Add(wdsp);
|
||||
wdsp.WasteDisposalServiceProviderName = wsdpName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private static bool ScanTOWD(Message message, ExcelReader reader)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user