public void ImportedBuyer_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _agreement_commercialagreement_importedbuyer = new DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement
            {
                ProductCategory = "CommercialAgreement_ProductCategory",
                PaymentTerms    = "CommercialAgreement_PaymentTerms",
            };
            var _agreement_commercialagreement_importedbuyer2 = new DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement
            {
                ProductCategory = "CommercialAgreement_ProductCategory",
                PaymentTerms    = "CommercialAgreement_PaymentTerms",
            };
            var _transaction_transactions_importedbuyer = new DSS5_SupplyChainFinancialsOptimisation.BO.Transaction
            {
                TransactionDateOccured = now,
                TransactionValue       = 2222222222.22222M,
                FundedAmount           = 2222222222.22222M,
                ToBePaidAmount         = 2222222222.22222M,
                InvoicedDate           = now,
                PaymentStatus          = "Transaction_PaymentStatus",
                PaymentDate            = now,
                RestPaymentAmount      = 2222222222.22222M,
                PaidByBuyer            = true,
            };
            var _transaction_transactions_importedbuyer2 = new DSS5_SupplyChainFinancialsOptimisation.BO.Transaction
            {
                TransactionDateOccured = now,
                TransactionValue       = 2222222222.22222M,
                FundedAmount           = 2222222222.22222M,
                ToBePaidAmount         = 2222222222.22222M,
                InvoicedDate           = now,
                PaymentStatus          = "Transaction_PaymentStatus",
                PaymentDate            = now,
                RestPaymentAmount      = 2222222222.22222M,
                PaidByBuyer            = true,
            };

            new PersistenceSpecification <DSS5_SupplyChainFinancialsOptimisation.BO.ImportedBuyer>(Session)
            .CheckProperty(p => p.Code, "ImportedBuyer_Code")
            .CheckProperty(p => p.VATNumber, "ImportedBuyer_VATNumber")
            .CheckProperty(p => p.Company, "ImportedBuyer_Company")
            .CheckProperty(p => p.AddressOne, "ImportedBuyer_AddressOne")
            .CheckProperty(p => p.AddressTwo, "ImportedBuyer_AddressTwo")
            .CheckProperty(p => p.Phone, "ImportedBuyer_Phone")
            .CheckBag(p => p.CommercialAgreement, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement>
            {
                _agreement_commercialagreement_importedbuyer,
                _agreement_commercialagreement_importedbuyer2
            }))
            .CheckBag(p => p.Transactions, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction>
            {
                _transaction_transactions_importedbuyer,
                _transaction_transactions_importedbuyer2
            }))
            .VerifyTheMappings();
        }
 public virtual void RemoveCommercialAgreements(CommercialAgreement __item)
 {
     if (__item != null)
     {
         __item.Buyer = null;
     }
 }
 public virtual void InternalRemoveCommercialAgreements(CommercialAgreement __item)
 {
     if (__item == null)
     {
         return;
     }
     commercialAgreements?.Remove(__item);
 }
 public virtual void InternalAddCommercialAgreements(CommercialAgreement __item)
 {
     if (__item == null || disableInternalAdditions)
     {
         return;
     }
     commercialAgreements?.Add(__item);
 }
        public void Buyer_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _agreement_commercialagreements_buyer = new DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement
            {
                ProductCategory = "CommercialAgreement_ProductCategory",
                PaymentTerms    = "CommercialAgreement_PaymentTerms",
            };
            var _agreement_commercialagreements_buyer2 = new DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement
            {
                ProductCategory = "CommercialAgreement_ProductCategory",
                PaymentTerms    = "CommercialAgreement_PaymentTerms",
            };

            new PersistenceSpecification <DSS5_SupplyChainFinancialsOptimisation.BO.Buyer>(Session)
            .CheckProperty(p => p.BuyerId, 1266)
            .CheckProperty(p => p.PrimaryPhone, "Buyer_PrimaryPhone")
            .CheckProperty(p => p.SecondaryPhone, "Buyer_SecondaryPhone")
            .CheckProperty(p => p.Fax, "Buyer_Fax")
            .CheckProperty(p => p.WebSite, "Buyer_WebSite")
            .CheckProperty(p => p.Company, "Buyer_Company")
            .CheckProperty(p => p.AnnualTurnOver, 2222222222.22222M)
            .CheckProperty(p => p.LegalRepresentative, "Buyer_LegalRepresentative")
            .CheckProperty(p => p.Rating, "Buyer_Rating")
            .CheckProperty(p => p.CreditInsurance, true)
            .CheckProperty(p => p.Logo, "Buyer_Logo")
            .CheckProperty(p => p.AddressOne, "Buyer_AddressOne")
            .CheckProperty(p => p.AddressTwo, "Buyer_AddressTwo")
            .CheckProperty(p => p.VatNumber, "Buyer_VatNumber")
            .CheckProperty(p => p.ContactPerson, "Buyer_ContactPerson")
            .CheckProperty(p => p.Prefix, "Buyer_Prefix")
            .CheckProperty(p => p.Temp, "Buyer_Temp")
            .CheckProperty(p => p.UserName, "1a5b4867-9da2-484f-94b6-88a4aab485dbBuyer_UserName")
            .CheckProperty(p => p.PasswordHash, "Buyer_PasswordHash")
            .CheckProperty(p => p.SecurityStamp, "Buyer_SecurityStamp")
            .CheckProperty(p => p.EmailConfirmed, true)
            .CheckProperty(p => p.LockoutEnabled, true)
            .CheckProperty(p => p.PhoneNumberConfirmed, true)
            .CheckProperty(p => p.TwoFactorEnabled, true)
            .CheckProperty(p => p.AccessFailedCount, 1647)
            .CheckProperty(p => p.Name, "Buyer_Name")
            .CheckProperty(p => p.Email, "Buyer_Email")
            .CheckProperty(p => p.PhoneNumber, "Buyer_PhoneNumber")
            .CheckProperty(p => p.LockoutEndDate, now)
            .CheckBag(p => p.CommercialAgreements, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement>
            {
                _agreement_commercialagreements_buyer,
                _agreement_commercialagreements_buyer2
            }))
            .VerifyTheMappings();
        }
 public virtual void AddCommercialAgreements(CommercialAgreement __item)
 {
     if (__item == null)
     {
         return;
     }
     if (__item.Buyer != this)
     {
         __item.Buyer = this;
     }
 }
 public virtual void SetCommercialAgreementsAt(CommercialAgreement __item, int __index)
 {
     if (__item == null)
     {
         commercialAgreements[__index].Buyer = null;
     }
     else
     {
         commercialAgreements[__index] = __item;
         if (__item.Buyer != this)
         {
             __item.Buyer = this;
         }
     }
 }
 public virtual void AddAtIndexCommercialAgreements(int index, CommercialAgreement __item)
 {
     if (__item == null)
     {
         return;
     }
     commercialAgreements?.Insert(index, __item);
     disableInternalAdditions = true;
     try
     {
         if (__item.Buyer != this)
         {
             __item.Buyer = this;
         }
     }
     finally
     {
         disableInternalAdditions = false;
     }
 }
/// <summary>
///     Returns true if self and the provided entity have the same Id values
///     and the Ids are not of the default Id value
/// </summary>
        protected bool HasSameNonDefaultIdAs(CommercialAgreement compareTo)
        {
            return(!this.IsTransient() && !compareTo.IsTransient() && this.Id.Equals(compareTo.Id));
        }
/// <summary>
/// Copies the current object to a new instance
/// </summary>
/// <param name="deep">Copy members that refer to objects external to this class (not dependent)</param>
/// <param name="copiedObjects">Objects that should be reused</param>
/// <param name="asNew">Copy the current object as a new one, ready to be persisted, along all its members.</param>
/// <param name="reuseNestedObjects">If asNew is true, this flag if set, forces the reuse of all external objects.</param>
/// <param name="copy">Optional - An existing [CommercialAgreement] instance to use as the destination.</param>
/// <returns>A copy of the object</returns>
        public virtual CommercialAgreement Copy(bool deep = false, Hashtable copiedObjects = null, bool asNew = false, bool reuseNestedObjects = false, CommercialAgreement copy = null)
        {
            if (copiedObjects == null)
            {
                copiedObjects = new Hashtable();
            }
            if (copy == null && copiedObjects.Contains(this))
            {
                return((CommercialAgreement)copiedObjects[this]);
            }
            copy = copy ?? new CommercialAgreement();
            if (!asNew)
            {
                copy.TransientId = this.TransientId;
                copy.Id          = this.Id;
            }
            copy.ProductCategory = this.ProductCategory;
            copy.PaymentTerms    = this.PaymentTerms;
            if (!copiedObjects.Contains(this))
            {
                copiedObjects.Add(this, copy);
            }
            if (deep && this.supplier != null)
            {
                if (!copiedObjects.Contains(this.supplier))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.Supplier = this.Supplier;
                    }
                    else if (asNew)
                    {
                        copy.Supplier = this.Supplier.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.supplier = this.supplier.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.Supplier = (Supplier)copiedObjects[this.Supplier];
                    }
                    else
                    {
                        copy.supplier = (Supplier)copiedObjects[this.Supplier];
                    }
                }
            }
            if (deep && this.buyer != null)
            {
                if (!copiedObjects.Contains(this.buyer))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.Buyer = this.Buyer;
                    }
                    else if (asNew)
                    {
                        copy.Buyer = this.Buyer.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.buyer = this.buyer.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.Buyer = (Buyer)copiedObjects[this.Buyer];
                    }
                    else
                    {
                        copy.buyer = (Buyer)copiedObjects[this.Buyer];
                    }
                }
            }
            copy.orders = new List <Order>();
            if (deep && this.orders != null)
            {
                foreach (var __item in this.orders)
                {
                    if (!copiedObjects.Contains(__item))
                    {
                        if (asNew && reuseNestedObjects)
                        {
                            copy.AddOrders(__item);
                        }
                        else
                        {
                            copy.AddOrders(__item.Copy(deep, copiedObjects, asNew));
                        }
                    }
                    else
                    {
                        copy.AddOrders((Order)copiedObjects[__item]);
                    }
                }
            }
            if (deep && this.importedBuyer != null)
            {
                if (!copiedObjects.Contains(this.importedBuyer))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.ImportedBuyer = this.ImportedBuyer;
                    }
                    else if (asNew)
                    {
                        copy.ImportedBuyer = this.ImportedBuyer.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.importedBuyer = this.importedBuyer.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.ImportedBuyer = (ImportedBuyer)copiedObjects[this.ImportedBuyer];
                    }
                    else
                    {
                        copy.importedBuyer = (ImportedBuyer)copiedObjects[this.ImportedBuyer];
                    }
                }
            }
            copy.transactions = new List <Transaction>();
            if (deep && this.transactions != null)
            {
                foreach (var __item in this.transactions)
                {
                    if (!copiedObjects.Contains(__item))
                    {
                        if (asNew && reuseNestedObjects)
                        {
                            copy.AddTransactions(__item);
                        }
                        else
                        {
                            copy.AddTransactions(__item.Copy(deep, copiedObjects, asNew));
                        }
                    }
                    else
                    {
                        copy.AddTransactions((Transaction)copiedObjects[__item]);
                    }
                }
            }
            if (deep && this.agreement != null)
            {
                if (!copiedObjects.Contains(this.agreement))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.Agreement = this.Agreement;
                    }
                    else if (asNew)
                    {
                        copy.Agreement = this.Agreement.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.agreement = this.agreement.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.Agreement = (Agreement)copiedObjects[this.Agreement];
                    }
                    else
                    {
                        copy.agreement = (Agreement)copiedObjects[this.Agreement];
                    }
                }
            }
            return(copy);
        }
        public void Order_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _agreement_commercialagreement_orders = new DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement
            {
                ProductCategory = "CommercialAgreement_ProductCategory",
                PaymentTerms    = "CommercialAgreement_PaymentTerms",
            };
            var _order_orderproducts_order = new DSS5_SupplyChainFinancialsOptimisation.BO.OrderProduct
            {
                Code            = "OrderProduct_Code",
                Quantity        = 222222.22M,
                Description     = "OrderProduct_Description",
                UnitValue       = "OrderProduct_UnitValue",
                MeasurementUnit = "OrderProduct_MeasurementUnit",
                Price           = 222222.22M,
                LineTotalPrice  = 222222.22M,
            };
            var _order_orderproducts_order2 = new DSS5_SupplyChainFinancialsOptimisation.BO.OrderProduct
            {
                Code            = "OrderProduct_Code",
                Quantity        = 222222.22M,
                Description     = "OrderProduct_Description",
                UnitValue       = "OrderProduct_UnitValue",
                MeasurementUnit = "OrderProduct_MeasurementUnit",
                Price           = 222222.22M,
                LineTotalPrice  = 222222.22M,
            };
            var _order_proofofdeliveries_orders = new DSS5_SupplyChainFinancialsOptimisation.BO.ProofOfDelivery
            {
                PODNumber      = "ProofOfDelivery_PODNumber",
                DateIssued     = now,
                QualityStatus  = "ProofOfDelivery_QualityStatus",
                QuantityStatus = "ProofOfDelivery_QuantityStatus",
                DeliveryStatus = "ProofOfDelivery_DeliveryStatus",
                PODAttachment  = "ProofOfDelivery_PODAttachment",
                Comments       = "ProofOfDelivery_Comments",
            };
            var _order_proofofdeliveries_orders2 = new DSS5_SupplyChainFinancialsOptimisation.BO.ProofOfDelivery
            {
                PODNumber      = "ProofOfDelivery_PODNumber",
                DateIssued     = now,
                QualityStatus  = "ProofOfDelivery_QualityStatus",
                QuantityStatus = "ProofOfDelivery_QuantityStatus",
                DeliveryStatus = "ProofOfDelivery_DeliveryStatus",
                PODAttachment  = "ProofOfDelivery_PODAttachment",
                Comments       = "ProofOfDelivery_Comments",
            };
            var _order_invoices_orders = new DSS5_SupplyChainFinancialsOptimisation.BO.Invoice
            {
                InvoiceNumber     = "Invoice_InvoiceNumber",
                Description       = "Invoice_Description",
                DateIssued        = now,
                Amount            = 2222222222222.22M,
                CustomerType      = "Invoice_CustomerType",
                CumulativeBalance = 222222.22M,
                TotalPrice        = 222222.22M,
                DescriptionTwo    = "Invoice_DescriptionTwo",
                Attribute         = "Invoice_Attribute",
                InvoiceAttachment = "Invoice_InvoiceAttachment",
            };
            var _order_invoices_orders2 = new DSS5_SupplyChainFinancialsOptimisation.BO.Invoice
            {
                InvoiceNumber     = "Invoice_InvoiceNumber",
                Description       = "Invoice_Description",
                DateIssued        = now,
                Amount            = 2222222222222.22M,
                CustomerType      = "Invoice_CustomerType",
                CumulativeBalance = 222222.22M,
                TotalPrice        = 222222.22M,
                DescriptionTwo    = "Invoice_DescriptionTwo",
                Attribute         = "Invoice_Attribute",
                InvoiceAttachment = "Invoice_InvoiceAttachment",
            };
            var _order_deliverynotes_orders = new DSS5_SupplyChainFinancialsOptimisation.BO.DeliveryNote
            {
                DeliveryNoteNumber = "DeliveryNote_DeliveryNoteNumber",
                Description        = "DeliveryNote_Description",
                DateIssued         = now,
                Amount             = 2222222222222.22M,
                TotalPrice         = 222222.22M,
                DNoteAttachment    = "DeliveryNote_DNoteAttachment",
            };
            var _order_deliverynotes_orders2 = new DSS5_SupplyChainFinancialsOptimisation.BO.DeliveryNote
            {
                DeliveryNoteNumber = "DeliveryNote_DeliveryNoteNumber",
                Description        = "DeliveryNote_Description",
                DateIssued         = now,
                Amount             = 2222222222222.22M,
                TotalPrice         = 222222.22M,
                DNoteAttachment    = "DeliveryNote_DNoteAttachment",
            };
            var _order_orderstatus_order = new DSS5_SupplyChainFinancialsOptimisation.BO.OrderStatus
            {
                OrderdDateOccured = now,
                Status            = "OrderStatus_Status",
                PaymentStatus     = true,
                InitialOrdered    = true,
                FinalOrdered      = true,
            };
            var _order_finalacceptancecertificate_order = new DSS5_SupplyChainFinancialsOptimisation.BO.FinalAcceptanceCertificate
            {
                Certificate = "FinalAcceptanceCertificate_Certificate",
            };
            var _order_creditnotes_orders = new DSS5_SupplyChainFinancialsOptimisation.BO.CreditNote
            {
                CreditNoteNumber   = "CreditNote_CreditNoteNumber",
                Description        = "CreditNote_Description",
                DateIssued         = now,
                Amount             = 2222222222.22222M,
                TotalPrice         = 2222222222.22222M,
                CreditNoteDocument = "CreditNote_CreditNoteDocument",
                CNoteAttachment    = "CreditNote_CNoteAttachment",
            };
            var _order_creditnotes_orders2 = new DSS5_SupplyChainFinancialsOptimisation.BO.CreditNote
            {
                CreditNoteNumber   = "CreditNote_CreditNoteNumber",
                Description        = "CreditNote_Description",
                DateIssued         = now,
                Amount             = 2222222222.22222M,
                TotalPrice         = 2222222222.22222M,
                CreditNoteDocument = "CreditNote_CreditNoteDocument",
                CNoteAttachment    = "CreditNote_CNoteAttachment",
            };
            var _order_orderpayment_order = new DSS5_SupplyChainFinancialsOptimisation.BO.OrderPayment
            {
                PaymentAmount = 2222222222.22222M,
                DateIssued    = now,
            };
            var _order_orderpayment_order2 = new DSS5_SupplyChainFinancialsOptimisation.BO.OrderPayment
            {
                PaymentAmount = 2222222222.22222M,
                DateIssued    = now,
            };
            var _order_letterofcredits_orders = new DSS5_SupplyChainFinancialsOptimisation.BO.LetterOfCredit
            {
                ValueOfLoC     = 222222.22M,
                IssuingBank    = "LetterOfCredit_IssuingBank",
                Detail         = "LetterOfCredit_Detail",
                UploadOfScan   = "LetterOfCredit_UploadOfScan",
                Calculated     = 222222.22M,
                DateOfValidity = now,
                DateOfExpiry   = now,
            };
            var _order_letterofcredits_orders2 = new DSS5_SupplyChainFinancialsOptimisation.BO.LetterOfCredit
            {
                ValueOfLoC     = 222222.22M,
                IssuingBank    = "LetterOfCredit_IssuingBank",
                Detail         = "LetterOfCredit_Detail",
                UploadOfScan   = "LetterOfCredit_UploadOfScan",
                Calculated     = 222222.22M,
                DateOfValidity = now,
                DateOfExpiry   = now,
            };
            var _order_billoflandings_orders = new DSS5_SupplyChainFinancialsOptimisation.BO.BillOfLanding
            {
                LandingPlace     = "BillOfLanding_LandingPlace",
                LandingDate      = now,
                DeliveryPlace    = "BillOfLanding_DeliveryPlace",
                DeliveryDate     = now,
                DOCNumber        = 5961,
                ReceivingPartyId = 7650,
                IsBuyerReceiving = true,
            };
            var _order_billoflandings_orders2 = new DSS5_SupplyChainFinancialsOptimisation.BO.BillOfLanding
            {
                LandingPlace     = "BillOfLanding_LandingPlace",
                LandingDate      = now,
                DeliveryPlace    = "BillOfLanding_DeliveryPlace",
                DeliveryDate     = now,
                DOCNumber        = 8301,
                ReceivingPartyId = 2374,
                IsBuyerReceiving = true,
            };
            var _order_intermediaries_orders = new DSS5_SupplyChainFinancialsOptimisation.BO.Intermediary
            {
                OtherDescription = "Intermediary_OtherDescription",
                Company          = "Intermediary_Company",
                EMail            = "Intermediary_EMail",
                GUID             = "Intermediary_GUID",
            };
            var _order_intermediaries_orders2 = new DSS5_SupplyChainFinancialsOptimisation.BO.Intermediary
            {
                OtherDescription = "Intermediary_OtherDescription",
                Company          = "Intermediary_Company",
                EMail            = "Intermediary_EMail",
                GUID             = "Intermediary_GUID",
            };
            var _transaction_transaction_orders = new DSS5_SupplyChainFinancialsOptimisation.BO.Transaction
            {
                TransactionDateOccured = now,
                TransactionValue       = 2222222222.22222M,
                FundedAmount           = 2222222222.22222M,
                ToBePaidAmount         = 2222222222.22222M,
                InvoicedDate           = now,
                PaymentStatus          = "Transaction_PaymentStatus",
                PaymentDate            = now,
                RestPaymentAmount      = 2222222222.22222M,
                PaidByBuyer            = true,
            };

            new PersistenceSpecification <DSS5_SupplyChainFinancialsOptimisation.BO.Order>(Session)
            .CheckProperty(p => p.OrderNumber, "Order_OrderNumber")
            .CheckProperty(p => p.EstimatedDateOfDelivery, now)
            .CheckProperty(p => p.PaymentTerms, "Order_PaymentTerms")
            .CheckProperty(p => p.IntermediateParty, true)
            .CheckProperty(p => p.IsCancelled, true)
            .CheckProperty(p => p.DateOfOrder, now)
            .CheckProperty(p => p.OrderAmount, 2222222222.22222M)
            .CheckProperty(p => p.TotalPrice, 2222222222.22222M)
            .CheckProperty(p => p.From, "Order_From")
            .CheckProperty(p => p.DeliveryTo, "Order_DeliveryTo")
            .CheckProperty(p => p.OrderAttachment, "Order_OrderAttachment")
            .CheckReference(p => p.CommercialAgreement, _agreement_commercialagreement_orders)
            .CheckBag(p => p.OrderProducts, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.OrderProduct>
            {
                _order_orderproducts_order,
                _order_orderproducts_order2
            }))
            .CheckBag(p => p.ProofOfDeliveries, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.ProofOfDelivery>
            {
                _order_proofofdeliveries_orders,
                _order_proofofdeliveries_orders2
            }))
            .CheckBag(p => p.Invoices, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.Invoice>
            {
                _order_invoices_orders,
                _order_invoices_orders2
            }))
            .CheckBag(p => p.DeliveryNotes, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.DeliveryNote>
            {
                _order_deliverynotes_orders,
                _order_deliverynotes_orders2
            }))
            .CheckReference(p => p.OrderStatus, _order_orderstatus_order)
            .CheckReference(p => p.FinalAcceptanceCertificate, _order_finalacceptancecertificate_order)
            .CheckBag(p => p.CreditNotes, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.CreditNote>
            {
                _order_creditnotes_orders,
                _order_creditnotes_orders2
            }))
            .CheckBag(p => p.OrderPayment, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.OrderPayment>
            {
                _order_orderpayment_order,
                _order_orderpayment_order2
            }))
            .CheckBag(p => p.LetterOfCredits, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.LetterOfCredit>
            {
                _order_letterofcredits_orders,
                _order_letterofcredits_orders2
            }))
            .CheckBag(p => p.BillOfLandings, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.BillOfLanding>
            {
                _order_billoflandings_orders,
                _order_billoflandings_orders2
            }))
            .CheckBag(p => p.Intermediaries, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.Intermediary>
            {
                _order_intermediaries_orders,
                _order_intermediaries_orders2
            }))
            .CheckReference(p => p.Transaction, _transaction_transaction_orders)
            .VerifyTheMappings();
        }
        public void Supplier_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _agreement_commercialagreements_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement
            {
                ProductCategory = "CommercialAgreement_ProductCategory",
                PaymentTerms    = "CommercialAgreement_PaymentTerms",
            };
            var _agreement_commercialagreements_supplier2 = new DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement
            {
                ProductCategory = "CommercialAgreement_ProductCategory",
                PaymentTerms    = "CommercialAgreement_PaymentTerms",
            };
            var _agreement_agreements_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.Agreement
            {
                StartDate              = now,
                EndDate                = now,
                FundedRate             = 222222.22M,
                FundedAmount           = 222222.22M,
                CurrentAgreementStatus = "Agreement_CurrentAgreementStatus",
                InterestRate           = 222222.22M,
            };
            var _agreement_agreements_supplier2 = new DSS5_SupplyChainFinancialsOptimisation.BO.Agreement
            {
                StartDate              = now,
                EndDate                = now,
                FundedRate             = 222222.22M,
                FundedAmount           = 222222.22M,
                CurrentAgreementStatus = "Agreement_CurrentAgreementStatus",
                InterestRate           = 222222.22M,
            };
            var _supplier_supplierbusinessstructuredata_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierBusinessStructureData
            {
                NumOfCustomersD           = 8305,
                NumOfCustomersAbroad      = 2564,
                NumOfCustomersEU          = 7939,
                NumOfCustomers            = 9311,
                ThereofActiveD            = 1730,
                ThereofActiveAbroad       = 3597,
                ThereofActiveEU           = 6691,
                ThereofActive             = 9832,
                NumOfOccasionalCustD      = 5778,
                NumOfOccasionalCustAbroad = 9576,
                NumOfOccasionalCustEU     = 8968,
                NumOfOccasionalCust       = 5981,
                NumOpenBalanceD           = 3463,
                NumOpenBalanceAboad       = 7036,
                NumOpenBalanceEU          = 7273,
                NumOpenBalance            = 4600,
                NumOfInvoicesD            = 9503,
                NumOfInvoicesAbroad       = 5853,
                NumOfInvoicesEU           = 7845,
                NumOfInvoices             = 1007,
                NumOfEmployeesD           = 7719,
                NumOfEmployeesAbroad      = 6432,
                NumTransCustD             = 7582,
                NumTransCustAbroad        = 7573,
                NumTransCustEU            = 2899,
                NumTransCust            = 6393,
                ApplicableCommercialLaw = "SupplierBusinessStructureData_ApplicableCommercialLaw",
                Jurisdiction            = "SupplierBusinessStructureData_Jurisdiction",
            };
            var _supplier_supplierreceivables_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierReceivables
            {
                DomesticCustomersPresent     = 2222222222.22222M,
                DomesticCustomersPrior       = 2222222222.22222M,
                EUCustomersPresent           = 2222222222.22222M,
                EUCustomersPrior             = 2222222222.22222M,
                ThirdCountryCustomersPresent = 2222222222.22222M,
                ThirdCountryCustomersPrior   = 2222222222.22222M,
                WillUploadFiles = true,
                TotalPrior      = 2222222222.22222M,
                TotalPresent    = 2222222222.22222M,
            };
            var _supplier_suppliercontactinformation_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierContactInformation
            {
                ContactPerson    = "SupplierContactInformation_ContactPerson",
                AddressOne       = "SupplierContactInformation_AddressOne",
                AddressTwo       = "SupplierContactInformation_AddressTwo",
                Telephone        = "SupplierContactInformation_Telephone",
                Email            = "SupplierContactInformation_Email",
                ManagingDirector = "SupplierContactInformation_ManagingDirector",
                EstablishedIn    = "SupplierContactInformation_EstablishedIn",
            };
            var _supplier_supplierturnover_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierTurnover
            {
                PlannedCurrentYear       = 2222222222.22222M,
                PlannedCurrentYearD      = 2222222222.22222M,
                PlannedCurrentYearEU     = 2222222222.22222M,
                PlannedCurrentYearAbroad = 2222222222.22222M,
                PlannedNextYear          = 2222222222.22222M,
                PlannedNextYearD         = 2222222222.22222M,
                PlannedNextYearEU        = 2222222222.22222M,
                PlannedNextYearAbroad    = 2222222222.22222M,
                ActualPreviousYear       = 2222222222.22222M,
                ActualPreviousYearAbroad = 2222222222.22222M,
                ActualPreviousYearD      = 2222222222.22222M,
                ActualPreviousYearEU     = 2222222222.22222M,
                PercentageD        = 2222222222.22222M,
                PercentageEU       = 2222222222.22222M,
                PercentageAbroad   = 2222222222.22222M,
                PercentageCND      = 2222222222.22222M,
                PercentageCNEU     = 2222222222.22222M,
                PercentageCNAbroad = 2222222222.22222M,
                PercentageSales    = 2222222222.22222M,
                PercentageCN       = 2222222222.22222M,
            };
            var _supplier_supplierextrainformation_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierExtraInformation
            {
                OccurenceBadDebts      = "SupplierExtraInformation_OccurenceBadDebts",
                ExistenceCounterClaims = "SupplierExtraInformation_ExistenceCounterClaims",
                HasCompanyAssigned     = "SupplierExtraInformation_HasCompanyAssigned",
                AreCompanyReceivables  = "SupplierExtraInformation_AreCompanyReceivables",
            };
            var _supplier_financialstatements_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_financialstatements_supplier2 = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_economicevaluations_supplier2 = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_economicevaluations_supplier22 = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_businessplans_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_businessplans_supplier2 = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_prioroutstandingbalances_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_prioroutstandingbalances_supplier2 = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_outstandingbalances_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_outstandingbalances_supplier2 = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_currentsituations_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_currentsituations_supplier2 = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_currentstatements_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_currentstatements_supplier2 = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_currentcredits_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_currentcredits_supplier2 = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_factoringagreements_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_factoringagreements_supplier2 = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_customeragreements_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_customeragreements_supplier2 = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_generalconstractuals_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_generalconstractuals_supplier2 = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_organizationalcharts_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_organizationalcharts_supplier2 = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_invoicesforms_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_invoicesforms_supplier2 = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_declarations_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_declarations_supplier2 = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads
            {
                Path = "SupplierUploads_Path",
            };
            var _supplier_supplierevaluation_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierEvaluation
            {
                Environment             = "SupplierEvaluation_Environment",
                ContractualPaymentTerms = 2222222222.22222M,
                Average             = 2222222222.22222M,
                AverageInvoiceValue = 2222222222.22222M,
                EquityRatio         = 2222222222.22222M,
            };
            var _supplier_dataquality_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.DataQuality
            {
                Orders                = true,
                DeliveryNotes         = true,
                CustomsDocuments      = true,
                IntermediaryLogistics = true,
                Invoices              = true,
                PoDs        = true,
                PaymentData = true,
            };
            var _supplier_dataavailability_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.DataAvailability
            {
                Orders                = true,
                DeliveryNotes         = true,
                CustomsDocuments      = true,
                IntermediaryLogistics = true,
                Invoices              = true,
                PoDs        = true,
                PaymentData = true,
            };
            var _supplierproduct_supplierproducts_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierProduct
            {
                Code            = "SupplierProduct_Code",
                Description     = "SupplierProduct_Description",
                UnitValue       = "SupplierProduct_UnitValue",
                MeasurementUnit = "SupplierProduct_MeasurementUnit",
                Price           = 222222.22M,
            };
            var _supplierproduct_supplierproducts_supplier2 = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierProduct
            {
                Code            = "SupplierProduct_Code",
                Description     = "SupplierProduct_Description",
                UnitValue       = "SupplierProduct_UnitValue",
                MeasurementUnit = "SupplierProduct_MeasurementUnit",
                Price           = 222222.22M,
            };
            var _transaction_transactions_supplier = new DSS5_SupplyChainFinancialsOptimisation.BO.Transaction
            {
                TransactionDateOccured = now,
                TransactionValue       = 2222222222.22222M,
                FundedAmount           = 2222222222.22222M,
                ToBePaidAmount         = 2222222222.22222M,
                InvoicedDate           = now,
                PaymentStatus          = "Transaction_PaymentStatus",
                PaymentDate            = now,
                RestPaymentAmount      = 2222222222.22222M,
                PaidByBuyer            = true,
            };
            var _transaction_transactions_supplier2 = new DSS5_SupplyChainFinancialsOptimisation.BO.Transaction
            {
                TransactionDateOccured = now,
                TransactionValue       = 2222222222.22222M,
                FundedAmount           = 2222222222.22222M,
                ToBePaidAmount         = 2222222222.22222M,
                InvoicedDate           = now,
                PaymentStatus          = "Transaction_PaymentStatus",
                PaymentDate            = now,
                RestPaymentAmount      = 2222222222.22222M,
                PaidByBuyer            = true,
            };

            new PersistenceSpecification <DSS5_SupplyChainFinancialsOptimisation.BO.Supplier>(Session)
            .CheckProperty(p => p.SupplierId, 7413)
            .CheckProperty(p => p.Company, "Supplier_Company")
            .CheckProperty(p => p.CompanyLogo, "Supplier_CompanyLogo")
            .CheckProperty(p => p.Business, "Supplier_Business")
            .CheckProperty(p => p.CurrentAmount, "Supplier_CurrentAmount")
            .CheckProperty(p => p.AverageAmount, "Supplier_AverageAmount")
            .CheckProperty(p => p.PercentageOfCreditNotes, "Supplier_PercentageOfCreditNotes")
            .CheckProperty(p => p.PrimaryPhone, "Supplier_PrimaryPhone")
            .CheckProperty(p => p.SecondaryPhone, "Supplier_SecondaryPhone")
            .CheckProperty(p => p.Fax, "Supplier_Fax")
            .CheckProperty(p => p.WebSite, "Supplier_WebSite")
            .CheckProperty(p => p.AcceptedPolicyTerms, true)
            .CheckProperty(p => p.SupplierStatus, "Supplier_SupplierStatus")
            .CheckProperty(p => p.DomainFocus, "Supplier_DomainFocus")
            .CheckProperty(p => p.EvaluationResult, "Supplier_EvaluationResult")
            .CheckProperty(p => p.EvaluationCountResult, 5378)
            .CheckProperty(p => p.AnnualTurnover, true)
            .CheckProperty(p => p.BEnvironment, true)
            .CheckProperty(p => p.PTerms, true)
            .CheckProperty(p => p.Average, true)
            .CheckProperty(p => p.InvoiceValue, true)
            .CheckProperty(p => p.EqRatio, true)
            .CheckProperty(p => p.Prefix, "Supplier_Prefix")
            .CheckProperty(p => p.VATNumber, "Supplier_VATNumber")
            .CheckProperty(p => p.MarketSegment, "Supplier_MarketSegment")
            .CheckProperty(p => p.AdditionalComments, "Supplier_AdditionalComments")
            .CheckProperty(p => p.AdditionalCommentsStep2, "Supplier_AdditionalCommentsStep2")
            .CheckProperty(p => p.AdditionalCommentsStep3, "Supplier_AdditionalCommentsStep3")
            .CheckProperty(p => p.UserName, "5751132e-819d-430c-9606-abc087f96970Supplier_UserName")
            .CheckProperty(p => p.PasswordHash, "Supplier_PasswordHash")
            .CheckProperty(p => p.SecurityStamp, "Supplier_SecurityStamp")
            .CheckProperty(p => p.EmailConfirmed, true)
            .CheckProperty(p => p.LockoutEnabled, true)
            .CheckProperty(p => p.PhoneNumberConfirmed, true)
            .CheckProperty(p => p.TwoFactorEnabled, true)
            .CheckProperty(p => p.AccessFailedCount, 7261)
            .CheckProperty(p => p.Name, "Supplier_Name")
            .CheckProperty(p => p.Email, "Supplier_Email")
            .CheckProperty(p => p.PhoneNumber, "Supplier_PhoneNumber")
            .CheckProperty(p => p.LockoutEndDate, now)
            .CheckBag(p => p.CommercialAgreements, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement>
            {
                _agreement_commercialagreements_supplier,
                _agreement_commercialagreements_supplier2
            }))
            .CheckBag(p => p.Agreements, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.Agreement>
            {
                _agreement_agreements_supplier,
                _agreement_agreements_supplier2
            }))
            .CheckReference(p => p.SupplierBusinessStructureData, _supplier_supplierbusinessstructuredata_supplier)
            .CheckReference(p => p.SupplierReceivables, _supplier_supplierreceivables_supplier)
            .CheckReference(p => p.SupplierContactInformation, _supplier_suppliercontactinformation_supplier)
            .CheckReference(p => p.SupplierTurnover, _supplier_supplierturnover_supplier)
            .CheckReference(p => p.SupplierExtraInformation, _supplier_supplierextrainformation_supplier)
            .CheckBag(p => p.FinancialStatements, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads>
            {
                _supplier_financialstatements_supplier,
                _supplier_financialstatements_supplier2
            }))
            .CheckBag(p => p.EconomicEvaluations, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads>
            {
                _supplier_economicevaluations_supplier2,
                _supplier_economicevaluations_supplier22
            }))
            .CheckBag(p => p.BusinessPlans, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads>
            {
                _supplier_businessplans_supplier,
                _supplier_businessplans_supplier2
            }))
            .CheckBag(p => p.PriorOutstandingBalances, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads>
            {
                _supplier_prioroutstandingbalances_supplier,
                _supplier_prioroutstandingbalances_supplier2
            }))
            .CheckBag(p => p.OutstandingBalances, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads>
            {
                _supplier_outstandingbalances_supplier,
                _supplier_outstandingbalances_supplier2
            }))
            .CheckBag(p => p.CurrentSituations, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads>
            {
                _supplier_currentsituations_supplier,
                _supplier_currentsituations_supplier2
            }))
            .CheckBag(p => p.CurrentStatements, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads>
            {
                _supplier_currentstatements_supplier,
                _supplier_currentstatements_supplier2
            }))
            .CheckBag(p => p.CurrentCredits, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads>
            {
                _supplier_currentcredits_supplier,
                _supplier_currentcredits_supplier2
            }))
            .CheckBag(p => p.FactoringAgreements, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads>
            {
                _supplier_factoringagreements_supplier,
                _supplier_factoringagreements_supplier2
            }))
            .CheckBag(p => p.CustomerAgreements, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads>
            {
                _supplier_customeragreements_supplier,
                _supplier_customeragreements_supplier2
            }))
            .CheckBag(p => p.GeneralConstractuals, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads>
            {
                _supplier_generalconstractuals_supplier,
                _supplier_generalconstractuals_supplier2
            }))
            .CheckBag(p => p.OrganizationalCharts, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads>
            {
                _supplier_organizationalcharts_supplier,
                _supplier_organizationalcharts_supplier2
            }))
            .CheckBag(p => p.InvoicesForms, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads>
            {
                _supplier_invoicesforms_supplier,
                _supplier_invoicesforms_supplier2
            }))
            .CheckBag(p => p.Declarations, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.SupplierUploads>
            {
                _supplier_declarations_supplier,
                _supplier_declarations_supplier2
            }))
            .CheckReference(p => p.SupplierEvaluation, _supplier_supplierevaluation_supplier)
            .CheckReference(p => p.DataQuality, _supplier_dataquality_supplier)
            .CheckReference(p => p.DataAvailability, _supplier_dataavailability_supplier)
            .CheckBag(p => p.SupplierProducts, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.SupplierProduct>
            {
                _supplierproduct_supplierproducts_supplier,
                _supplierproduct_supplierproducts_supplier2
            }))
            .CheckBag(p => p.Transactions, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction>
            {
                _transaction_transactions_supplier,
                _transaction_transactions_supplier2
            }))
            .VerifyTheMappings();
        }
示例#13
0
        public void Agreement_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _agreement_investor_agreements = new DSS5_SupplyChainFinancialsOptimisation.BO.Investor
            {
                InvestorId           = 1174,
                PrimaryPhone         = "Investor_PrimaryPhone",
                SecondaryPhone       = "Investor_SecondaryPhone",
                Fax                  = "Investor_Fax",
                WebSite              = "Investor_WebSite",
                Company              = "Investor_Company",
                ContactPerson        = "Investor_ContactPerson",
                Logo                 = "Investor_Logo",
                SupervisingAuthority = "Investor_SupervisingAuthority",
                RegistrationNo       = "Investor_RegistrationNo",
                DomainFocus          = "Investor_DomainFocus",
                TurnOver             = 2222222222.22222M,
                VatNumber            = "Investor_VatNumber",
                AddressTwo           = "Investor_AddressTwo",
                AddressOne           = "Investor_AddressOne",
                ManagingDirector     = "Investor_ManagingDirector",
                TargetMarket         = "Investor_TargetMarket",
                CustomerSizeFrom     = "Investor_CustomerSizeFrom",
                CustomerSizeTo       = "Investor_CustomerSizeTo",
                LocalJurisdiction    = "Investor_LocalJurisdiction",
                CommercialRegNo      = "Investor_CommercialRegNo",
                OtherMinRequirements = "Investor_OtherMinRequirements",
                CRR                  = true,
                UploadCompliance     = "Investor_UploadCompliance",
                OtherMemberships     = "Investor_OtherMemberships",
                OtherDomainFocus     = "Investor_OtherDomainFocus",
                InvestorStatus       = "Investor_InvestorStatus",
                IAFC                 = true,
                Prefix               = "Investor_Prefix",
                UserName             = "******",
                PasswordHash         = "Investor_PasswordHash",
                SecurityStamp        = "Investor_SecurityStamp",
                EmailConfirmed       = true,
                LockoutEnabled       = true,
                PhoneNumberConfirmed = true,
                TwoFactorEnabled     = true,
                AccessFailedCount    = 3988,
                Name                 = "Investor_Name",
                Email                = "Investor_Email",
                PhoneNumber          = "Investor_PhoneNumber",
                LockoutEndDate       = now,
            };
            var _agreement_supplier_agreements = new DSS5_SupplyChainFinancialsOptimisation.BO.Supplier
            {
                SupplierId              = 4870,
                Company                 = "Supplier_Company",
                CompanyLogo             = "Supplier_CompanyLogo",
                Business                = "Supplier_Business",
                CurrentAmount           = "Supplier_CurrentAmount",
                AverageAmount           = "Supplier_AverageAmount",
                PercentageOfCreditNotes = "Supplier_PercentageOfCreditNotes",
                PrimaryPhone            = "Supplier_PrimaryPhone",
                SecondaryPhone          = "Supplier_SecondaryPhone",
                Fax                     = "Supplier_Fax",
                WebSite                 = "Supplier_WebSite",
                AcceptedPolicyTerms     = true,
                SupplierStatus          = "Supplier_SupplierStatus",
                DomainFocus             = "Supplier_DomainFocus",
                EvaluationResult        = "Supplier_EvaluationResult",
                EvaluationCountResult   = 1087,
                AnnualTurnover          = true,
                BEnvironment            = true,
                PTerms                  = true,
                Average                 = true,
                InvoiceValue            = true,
                EqRatio                 = true,
                Prefix                  = "Supplier_Prefix",
                VATNumber               = "Supplier_VATNumber",
                MarketSegment           = "Supplier_MarketSegment",
                AdditionalComments      = "Supplier_AdditionalComments",
                AdditionalCommentsStep2 = "Supplier_AdditionalCommentsStep2",
                AdditionalCommentsStep3 = "Supplier_AdditionalCommentsStep3",
                UserName                = "******",
                PasswordHash            = "Supplier_PasswordHash",
                SecurityStamp           = "Supplier_SecurityStamp",
                EmailConfirmed          = true,
                LockoutEnabled          = true,
                PhoneNumberConfirmed    = true,
                TwoFactorEnabled        = true,
                AccessFailedCount       = 1898,
                Name                    = "Supplier_Name",
                Email                   = "Supplier_Email",
                PhoneNumber             = "Supplier_PhoneNumber",
                LockoutEndDate          = now,
            };
            var _agreement_fundedtransactions_agreement = new DSS5_SupplyChainFinancialsOptimisation.BO.FundedTransaction
            {
                FundingPercentage = "FundedTransaction_FundingPercentage",
                TransactionStatus = "FundedTransaction_TransactionStatus",
            };
            var _agreement_fundedtransactions_agreement2 = new DSS5_SupplyChainFinancialsOptimisation.BO.FundedTransaction
            {
                FundingPercentage = "FundedTransaction_FundingPercentage",
                TransactionStatus = "FundedTransaction_TransactionStatus",
            };
            var _agreement_agreementstatus_agreement = new DSS5_SupplyChainFinancialsOptimisation.BO.AgreementStatus
            {
                Status      = "AgreementStatus_Status",
                DateOccured = now,
                ProvidedBy  = "AgreementStatus_ProvidedBy",
            };
            var _agreement_agreementstatus_agreement2 = new DSS5_SupplyChainFinancialsOptimisation.BO.AgreementStatus
            {
                Status      = "AgreementStatus_Status",
                DateOccured = now,
                ProvidedBy  = "AgreementStatus_ProvidedBy",
            };
            var _agreement_documentagreement_agreement = new DSS5_SupplyChainFinancialsOptimisation.BO.DocumentAgreement
            {
                SupplierDocument = "DocumentAgreement_SupplierDocument",
                InvestorDocument = "DocumentAgreement_InvestorDocument",
                AdminDocument    = "DocumentAgreement_AdminDocument",
            };
            var _agreement_commercialagreements_agreement = new DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement
            {
                ProductCategory = "CommercialAgreement_ProductCategory",
                PaymentTerms    = "CommercialAgreement_PaymentTerms",
            };
            var _agreement_commercialagreements_agreement2 = new DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement
            {
                ProductCategory = "CommercialAgreement_ProductCategory",
                PaymentTerms    = "CommercialAgreement_PaymentTerms",
            };

            new PersistenceSpecification <DSS5_SupplyChainFinancialsOptimisation.BO.Agreement>(Session)
            .CheckProperty(p => p.StartDate, now)
            .CheckProperty(p => p.EndDate, now)
            .CheckProperty(p => p.FundedRate, 222222.22M)
            .CheckProperty(p => p.FundedAmount, 222222.22M)
            .CheckProperty(p => p.InterestRate, 222222.22M)
            .CheckReference(p => p.Investor, _agreement_investor_agreements)
            .CheckReference(p => p.Supplier, _agreement_supplier_agreements)
            .CheckBag(p => p.FundedTransactions, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.FundedTransaction>
            {
                _agreement_fundedtransactions_agreement,
                _agreement_fundedtransactions_agreement2
            }))
            .CheckBag(p => p.AgreementStatus, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.AgreementStatus>
            {
                _agreement_agreementstatus_agreement,
                _agreement_agreementstatus_agreement2
            }))
            .CheckReference(p => p.DocumentAgreement, _agreement_documentagreement_agreement)
            .CheckBag(p => p.CommercialAgreements, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement>
            {
                _agreement_commercialagreements_agreement,
                _agreement_commercialagreements_agreement2
            }))
            .VerifyTheMappings();
        }
示例#14
0
 public CommercialAgreementFormViewModel()
 {
     CommercialAgreement = new DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement();
 }
        /*<ControllerActionImplementation:ImportRAYMETRICSCSV:1/>*/
        public ActionResult ExecuteImportRAYMETRICSCSV()
        {
            ActionResult _result = null;
            string       pathCSV = zAppDev.DotNet.Framework.Utilities.Web.MapPath(System.IO.Path.Combine("~/App_Data/Uploads", @model.rayPath));

            if ((pathCSV?.Contains("raymetrics") ?? false))
            {
                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "DevTool", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "raymetrics File Import");
                int?     rowCount     = 0;
                string[] entries      = null;
                string[] orderEntries = null;
                int?     test         = 0;
                DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement commercialAgreement            = new DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement();
                DSS5_SupplyChainFinancialsOptimisation.BO.ImportedBuyer       newImportedBuyer               = new DSS5_SupplyChainFinancialsOptimisation.BO.ImportedBuyer();
                System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.Order>   orders   = new System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.Order>();
                System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.Invoice> invoices = new System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.Invoice>();
                commercialAgreement.Supplier = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Supplier>((a) => a.UserName == "Supplier15")?.FirstOrDefault();
                System.Collections.Generic.List <string> delim = new System.Collections.Generic.List <string>();
                delim.Add("\r");
                delim.Add("\n");
                foreach (var row in System.IO.File.ReadAllText(pathCSV).SplitExtended(delim.ToArray(), true) ?? Enumerable.Empty <string>())
                {
                    if (((((row == null || row == "")) == false) && (((row == null || row.Trim() == "")) == false)))
                    {
                        entries = row?.SplitExtended(';', false);
                        if ((entries.Length > 0))
                        {
                            if (zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0).StartsWith("Πελάτης"))
                            {
                                newImportedBuyer.Code = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 1);
                                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "DevTool", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Customer is " + (newImportedBuyer?.Code ?? ""));
                            }
                        }
                        else
                        {
                            zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "DevTool", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Row: " + (rowCount?.ToString() ?? "") + "does not have 2 entries.");
                        }
                    }
                    else
                    {
                        zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "DevTool", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Row " + (rowCount?.ToString() ?? "") + " did not have value.");
                    }
                    if (rowCount > 0)
                    {
                        zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "DevTool", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "order----> " + row);
                        orderEntries = row?.SplitExtended(';', false);
                        if (zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(orderEntries, 2).StartsWith("ΤΔΑ-Χ"))
                        {
                            DSS5_SupplyChainFinancialsOptimisation.BO.Invoice inv = new DSS5_SupplyChainFinancialsOptimisation.BO.Invoice();
                            inv.DateIssued    = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(orderEntries, 1), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                            inv.InvoiceNumber = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(orderEntries, 3);
                            inv.Description   = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(orderEntries, 5);
                            invoices?.Add(inv);
                            DSS5_SupplyChainFinancialsOptimisation.BO.Order order = new DSS5_SupplyChainFinancialsOptimisation.BO.Order();
                            order.DateOfOrder = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(orderEntries, 0), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                            order.OrderNumber = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(orderEntries, 4);
                            order.Invoices    = invoices.ToList();
                            orders?.Add(order);
                        }
                        else if (zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(orderEntries, 2).StartsWith("EU-INV"))
                        {
                            DSS5_SupplyChainFinancialsOptimisation.BO.Invoice inv = new DSS5_SupplyChainFinancialsOptimisation.BO.Invoice();
                            inv.DateIssued    = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(orderEntries, 1), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                            inv.InvoiceNumber = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(orderEntries, 3);
                            inv.Description   = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(orderEntries, 5);
                            inv.CustomerType  = "EU Customer";
                            invoices?.Add(inv);
                            DSS5_SupplyChainFinancialsOptimisation.BO.Order order = new DSS5_SupplyChainFinancialsOptimisation.BO.Order();
                            order.DateOfOrder = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(orderEntries, 0), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                            order.OrderNumber = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(orderEntries, 4);
                            order.Invoices    = invoices.ToList();
                            orders?.Add(order);
                        }
                        else if (zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(orderEntries, 2).StartsWith("NoE-INV"))
                        {
                            DSS5_SupplyChainFinancialsOptimisation.BO.Invoice inv = new DSS5_SupplyChainFinancialsOptimisation.BO.Invoice();
                            inv.DateIssued    = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(orderEntries, 1), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                            inv.InvoiceNumber = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(orderEntries, 3);
                            inv.Description   = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(orderEntries, 5);
                            inv.CustomerType  = "Non EU Customer";
                            invoices?.Add(inv);
                            DSS5_SupplyChainFinancialsOptimisation.BO.Order order = new DSS5_SupplyChainFinancialsOptimisation.BO.Order();
                            order.DateOfOrder = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(orderEntries, 0), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                            order.OrderNumber = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(orderEntries, 4);
                            order.Invoices    = invoices.ToList();
                            orders?.Add(order);
                        }
                    }
                    rowCount = rowCount.GetValueOrDefault(0) + 1;
                    commercialAgreement.Orders = orders.ToList();
                    new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Save <DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement>(commercialAgreement);
                }
                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "DevTool", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Rowcount " + (rowCount?.ToString() ?? ""));
            }
            return(_result);
        }
        /*<ControllerActionImplementation:ImportLekosCSV:1/>*/
        public ActionResult ExecuteImportLekosCSV()
        {
            ActionResult _result = null;
            string       pathCSV = zAppDev.DotNet.Framework.Utilities.Web.MapPath(System.IO.Path.Combine("~/App_Data/Uploads", @model.LekosPath));

            if ((pathCSV?.Contains("LEKOS") ?? false))
            {
                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "LEKOS File Import");
                int?     rowCount       = 0;
                string[] entries        = null;
                string[] productEntries = null;
                int?     test           = 0;
                DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement commercialAgreement = new DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement();
                DSS5_SupplyChainFinancialsOptimisation.BO.Order newOrder = new DSS5_SupplyChainFinancialsOptimisation.BO.Order();
                System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.OrderProduct> products = new System.Collections.Generic.List <DSS5_SupplyChainFinancialsOptimisation.BO.OrderProduct>();
                commercialAgreement.Supplier = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetAsQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Supplier>((a) => a.UserName == "Supplier25")?.FirstOrDefault();
                System.Collections.Generic.List <string> delim = new System.Collections.Generic.List <string>();
                delim.Add("\r");
                delim.Add("\n");
                foreach (var row in System.IO.File.ReadAllText(pathCSV).SplitExtended(delim.ToArray(), true) ?? Enumerable.Empty <string>())
                {
                    if (((((row == null || row == "")) == false) && (((row == null || row.Trim() == "")) == false)))
                    {
                        entries = row?.SplitExtended(';', false);
                        if ((entries.Length > 0))
                        {
                            if (zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0).StartsWith("Α-ΔΑ"))
                            {
                                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Found Delivery Note");
                                newOrder.PaymentTerms = "";
                                DSS5_SupplyChainFinancialsOptimisation.BO.DeliveryNote newDeliveryNote = new DSS5_SupplyChainFinancialsOptimisation.BO.DeliveryNote();
                                newDeliveryNote.DeliveryNoteNumber = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0);
                                newDeliveryNote.Description        = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 1);
                                newDeliveryNote.DateIssued         = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 2), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                                newDeliveryNote.Amount             = zAppDev.DotNet.Framework.Utilities.Common.ConvertToDecimal(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 14));
                                newOrder?.AddDeliveryNotes(newDeliveryNote);
                                commercialAgreement?.AddOrders(newOrder);
                            }
                            else if (zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0).StartsWith("Α-ΠΑ"))
                            {
                                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Found Order");
                                newOrder.OrderNumber  = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0);
                                newOrder.DateOfOrder  = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 2), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                                newOrder.PaymentTerms = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 10);
                                commercialAgreement?.AddOrders(newOrder);
                            }
                            else if (zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0).StartsWith("Α-ΤΔ"))
                            {
                                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Found Delivery Note & Invoice");
                                newOrder.PaymentTerms = "";
                                DSS5_SupplyChainFinancialsOptimisation.BO.DeliveryNote newDeliveryNote = new DSS5_SupplyChainFinancialsOptimisation.BO.DeliveryNote();
                                newDeliveryNote.DeliveryNoteNumber = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0);
                                newDeliveryNote.Description        = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 1);
                                newDeliveryNote.DateIssued         = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 2), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                                newDeliveryNote.Amount             = zAppDev.DotNet.Framework.Utilities.Common.ConvertToDecimal(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 14));
                                newOrder?.AddDeliveryNotes(newDeliveryNote);
                                DSS5_SupplyChainFinancialsOptimisation.BO.Invoice newInvoice = new DSS5_SupplyChainFinancialsOptimisation.BO.Invoice();
                                newInvoice.InvoiceNumber = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0);
                                newInvoice.Description   = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 1);
                                newInvoice.DateIssued    = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 2), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                                newInvoice.Amount        = zAppDev.DotNet.Framework.Utilities.Common.ConvertToDecimal(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 14));
                                newOrder?.AddInvoices(newInvoice);
                                commercialAgreement?.AddOrders(newOrder);
                            }
                            else if (zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0).StartsWith("Α-ΤΠ"))
                            {
                                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Found Invoice");
                                newOrder.PaymentTerms = "";
                                DSS5_SupplyChainFinancialsOptimisation.BO.Invoice newInvoice = new DSS5_SupplyChainFinancialsOptimisation.BO.Invoice();
                                newInvoice.InvoiceNumber = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0);
                                newInvoice.Description   = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 1);
                                newInvoice.DateIssued    = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 2), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                                newInvoice.Amount        = zAppDev.DotNet.Framework.Utilities.Common.ConvertToDecimal(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 14));
                                newOrder?.AddInvoices(newInvoice);
                                commercialAgreement?.AddOrders(newOrder);
                            }
                            else if (zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0).StartsWith("Χ-Α"))
                            {
                                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Found Cancelled Order");
                                newOrder.PaymentTerms = "";
                                DSS5_SupplyChainFinancialsOptimisation.BO.CreditNote crNote = new DSS5_SupplyChainFinancialsOptimisation.BO.CreditNote();
                                crNote.CreditNoteNumber = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0);
                                crNote.Description      = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 1);
                                crNote.DateIssued       = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 2), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                                crNote.TotalPrice       = zAppDev.DotNet.Framework.Utilities.Common.ConvertToDecimal(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 14));
                                newOrder?.AddCreditNotes(crNote);
                                commercialAgreement?.AddOrders(newOrder);
                            }
                            else if (zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0).StartsWith("Ε-ΤΠ"))
                            {
                                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Found EU Invoice");
                                newOrder.PaymentTerms = "";
                                DSS5_SupplyChainFinancialsOptimisation.BO.Invoice newInvoice = new DSS5_SupplyChainFinancialsOptimisation.BO.Invoice();
                                newInvoice.InvoiceNumber = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 0);
                                newInvoice.Description   = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 1);
                                newInvoice.DateIssued    = zAppDev.DotNet.Framework.Utilities.Common.ParseExactDate(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 2), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).GetValueOrDefault(System.Data.SqlTypes.SqlDateTime.MinValue.Value);
                                newInvoice.Amount        = zAppDev.DotNet.Framework.Utilities.Common.ConvertToDecimal(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(entries, 14));
                                newInvoice.CustomerType  = "EU Customer";
                                newOrder?.AddInvoices(newInvoice);
                                commercialAgreement?.AddOrders(newOrder);
                            }
                        }
                        else
                        {
                            zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Row: " + (rowCount?.ToString() ?? "") + "does not have 2 entries.");
                        }
                    }
                    else
                    {
                        zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Row " + (rowCount?.ToString() ?? "") + " did not have value.");
                    }
                    if (rowCount > 0)
                    {
                        zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "product----> " + row);
                        productEntries = row?.SplitExtended(';', false);
                        DSS5_SupplyChainFinancialsOptimisation.BO.OrderProduct product = new DSS5_SupplyChainFinancialsOptimisation.BO.OrderProduct();
                        product.Code            = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(productEntries, 0);
                        product.Description     = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(productEntries, 1);
                        product.MeasurementUnit = zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(productEntries, 2);
                        products?.Add(product);
                        product.Quantity = zAppDev.DotNet.Framework.Utilities.Common.ConvertToDecimal(zAppDev.DotNet.Framework.Utilities.Common.GetItemFromArray(productEntries, 3));
                    }
                    rowCount = rowCount.GetValueOrDefault(0) + 1;
                    commercialAgreement?.AddOrders(newOrder);
                    new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Save <DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement>(commercialAgreement);
                }
                zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Warning, "DeveloperTools", DSS5_SupplyChainFinancialsOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Rowcount " + (rowCount?.ToString() ?? ""));
            }
            return(_result);
        }
        public void Transaction_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _agreement_commercialagreement_transactions = new DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement
            {
                ProductCategory = "CommercialAgreement_ProductCategory",
                PaymentTerms    = "CommercialAgreement_PaymentTerms",
            };
            var _transaction_orders_transaction = new DSS5_SupplyChainFinancialsOptimisation.BO.Order
            {
                OrderNumber             = "Order_OrderNumber",
                EstimatedDateOfDelivery = now,
                PaymentTerms            = "Order_PaymentTerms",
                IntermediateParty       = true,
                IsCancelled             = true,
                DateOfOrder             = now,
                OrderAmount             = 2222222222.22222M,
                TotalPrice      = 2222222222.22222M,
                From            = "Order_From",
                DeliveryTo      = "Order_DeliveryTo",
                OrderAttachment = "Order_OrderAttachment",
            };
            var _transaction_orders_transaction2 = new DSS5_SupplyChainFinancialsOptimisation.BO.Order
            {
                OrderNumber             = "Order_OrderNumber",
                EstimatedDateOfDelivery = now,
                PaymentTerms            = "Order_PaymentTerms",
                IntermediateParty       = true,
                IsCancelled             = true,
                DateOfOrder             = now,
                OrderAmount             = 2222222222.22222M,
                TotalPrice      = 2222222222.22222M,
                From            = "Order_From",
                DeliveryTo      = "Order_DeliveryTo",
                OrderAttachment = "Order_OrderAttachment",
            };
            var _transaction_creditnotes_transaction = new DSS5_SupplyChainFinancialsOptimisation.BO.CreditNote
            {
                CreditNoteNumber   = "CreditNote_CreditNoteNumber",
                Description        = "CreditNote_Description",
                DateIssued         = now,
                Amount             = 2222222222.22222M,
                TotalPrice         = 2222222222.22222M,
                CreditNoteDocument = "CreditNote_CreditNoteDocument",
                CNoteAttachment    = "CreditNote_CNoteAttachment",
            };
            var _transaction_creditnotes_transaction2 = new DSS5_SupplyChainFinancialsOptimisation.BO.CreditNote
            {
                CreditNoteNumber   = "CreditNote_CreditNoteNumber",
                Description        = "CreditNote_Description",
                DateIssued         = now,
                Amount             = 2222222222.22222M,
                TotalPrice         = 2222222222.22222M,
                CreditNoteDocument = "CreditNote_CreditNoteDocument",
                CNoteAttachment    = "CreditNote_CNoteAttachment",
            };
            var _transaction_deliverynotes_transaction = new DSS5_SupplyChainFinancialsOptimisation.BO.DeliveryNote
            {
                DeliveryNoteNumber = "DeliveryNote_DeliveryNoteNumber",
                Description        = "DeliveryNote_Description",
                DateIssued         = now,
                Amount             = 2222222222222.22M,
                TotalPrice         = 222222.22M,
                DNoteAttachment    = "DeliveryNote_DNoteAttachment",
            };
            var _transaction_deliverynotes_transaction2 = new DSS5_SupplyChainFinancialsOptimisation.BO.DeliveryNote
            {
                DeliveryNoteNumber = "DeliveryNote_DeliveryNoteNumber",
                Description        = "DeliveryNote_Description",
                DateIssued         = now,
                Amount             = 2222222222222.22M,
                TotalPrice         = 222222.22M,
                DNoteAttachment    = "DeliveryNote_DNoteAttachment",
            };
            var _transaction_invoices_transaction = new DSS5_SupplyChainFinancialsOptimisation.BO.Invoice
            {
                InvoiceNumber     = "Invoice_InvoiceNumber",
                Description       = "Invoice_Description",
                DateIssued        = now,
                Amount            = 2222222222222.22M,
                CustomerType      = "Invoice_CustomerType",
                CumulativeBalance = 222222.22M,
                TotalPrice        = 222222.22M,
                DescriptionTwo    = "Invoice_DescriptionTwo",
                Attribute         = "Invoice_Attribute",
                InvoiceAttachment = "Invoice_InvoiceAttachment",
            };
            var _transaction_invoices_transaction2 = new DSS5_SupplyChainFinancialsOptimisation.BO.Invoice
            {
                InvoiceNumber     = "Invoice_InvoiceNumber",
                Description       = "Invoice_Description",
                DateIssued        = now,
                Amount            = 2222222222222.22M,
                CustomerType      = "Invoice_CustomerType",
                CumulativeBalance = 222222.22M,
                TotalPrice        = 222222.22M,
                DescriptionTwo    = "Invoice_DescriptionTwo",
                Attribute         = "Invoice_Attribute",
                InvoiceAttachment = "Invoice_InvoiceAttachment",
            };
            var _transaction_proofofdeliveries_transaction = new DSS5_SupplyChainFinancialsOptimisation.BO.ProofOfDelivery
            {
                PODNumber      = "ProofOfDelivery_PODNumber",
                DateIssued     = now,
                QualityStatus  = "ProofOfDelivery_QualityStatus",
                QuantityStatus = "ProofOfDelivery_QuantityStatus",
                DeliveryStatus = "ProofOfDelivery_DeliveryStatus",
                PODAttachment  = "ProofOfDelivery_PODAttachment",
                Comments       = "ProofOfDelivery_Comments",
            };
            var _transaction_proofofdeliveries_transaction2 = new DSS5_SupplyChainFinancialsOptimisation.BO.ProofOfDelivery
            {
                PODNumber      = "ProofOfDelivery_PODNumber",
                DateIssued     = now,
                QualityStatus  = "ProofOfDelivery_QualityStatus",
                QuantityStatus = "ProofOfDelivery_QuantityStatus",
                DeliveryStatus = "ProofOfDelivery_DeliveryStatus",
                PODAttachment  = "ProofOfDelivery_PODAttachment",
                Comments       = "ProofOfDelivery_Comments",
            };
            var _transaction_transactionstatus_transaction = new DSS5_SupplyChainFinancialsOptimisation.BO.TransactionStatus
            {
                TransactionDateOccured = now,
                Status              = "TransactionStatus_Status",
                Shipped             = true,
                Invoiced            = true,
                ShippedDateOccured  = now,
                InvoicedDateOccured = now,
                Cancelled           = true,
                InTransit           = true,
                Picked              = true,
                PaymentStatus       = true,
                InitialOrderDate    = now,
                FinalOrderDate      = now,
                Delivered           = true,
                Ordered             = true,
            };
            var _transaction_supplier_transactions = new DSS5_SupplyChainFinancialsOptimisation.BO.Supplier
            {
                SupplierId              = 5635,
                Company                 = "Supplier_Company",
                CompanyLogo             = "Supplier_CompanyLogo",
                Business                = "Supplier_Business",
                CurrentAmount           = "Supplier_CurrentAmount",
                AverageAmount           = "Supplier_AverageAmount",
                PercentageOfCreditNotes = "Supplier_PercentageOfCreditNotes",
                PrimaryPhone            = "Supplier_PrimaryPhone",
                SecondaryPhone          = "Supplier_SecondaryPhone",
                Fax                     = "Supplier_Fax",
                WebSite                 = "Supplier_WebSite",
                AcceptedPolicyTerms     = true,
                SupplierStatus          = "Supplier_SupplierStatus",
                DomainFocus             = "Supplier_DomainFocus",
                EvaluationResult        = "Supplier_EvaluationResult",
                EvaluationCountResult   = 7465,
                AnnualTurnover          = true,
                BEnvironment            = true,
                PTerms                  = true,
                Average                 = true,
                InvoiceValue            = true,
                EqRatio                 = true,
                Prefix                  = "Supplier_Prefix",
                VATNumber               = "Supplier_VATNumber",
                MarketSegment           = "Supplier_MarketSegment",
                AdditionalComments      = "Supplier_AdditionalComments",
                AdditionalCommentsStep2 = "Supplier_AdditionalCommentsStep2",
                AdditionalCommentsStep3 = "Supplier_AdditionalCommentsStep3",
                UserName                = "******",
                PasswordHash            = "Supplier_PasswordHash",
                SecurityStamp           = "Supplier_SecurityStamp",
                EmailConfirmed          = true,
                LockoutEnabled          = true,
                PhoneNumberConfirmed    = true,
                TwoFactorEnabled        = true,
                AccessFailedCount       = 2744,
                Name                    = "Supplier_Name",
                Email                   = "Supplier_Email",
                PhoneNumber             = "Supplier_PhoneNumber",
                LockoutEndDate          = now,
            };
            var _transaction_importedbuyer_transactions = new DSS5_SupplyChainFinancialsOptimisation.BO.ImportedBuyer
            {
                Code       = "ImportedBuyer_Code",
                VATNumber  = "ImportedBuyer_VATNumber",
                Company    = "ImportedBuyer_Company",
                AddressOne = "ImportedBuyer_AddressOne",
                AddressTwo = "ImportedBuyer_AddressTwo",
                Phone      = "ImportedBuyer_Phone",
            };
            var _transaction_letterofcredits_transaction = new DSS5_SupplyChainFinancialsOptimisation.BO.LetterOfCredit
            {
                ValueOfLoC     = 222222.22M,
                IssuingBank    = "LetterOfCredit_IssuingBank",
                Detail         = "LetterOfCredit_Detail",
                UploadOfScan   = "LetterOfCredit_UploadOfScan",
                Calculated     = 222222.22M,
                DateOfValidity = now,
                DateOfExpiry   = now,
            };
            var _transaction_letterofcredits_transaction2 = new DSS5_SupplyChainFinancialsOptimisation.BO.LetterOfCredit
            {
                ValueOfLoC     = 222222.22M,
                IssuingBank    = "LetterOfCredit_IssuingBank",
                Detail         = "LetterOfCredit_Detail",
                UploadOfScan   = "LetterOfCredit_UploadOfScan",
                Calculated     = 222222.22M,
                DateOfValidity = now,
                DateOfExpiry   = now,
            };
            var _transaction_intermediaries_transactions = new DSS5_SupplyChainFinancialsOptimisation.BO.Intermediary
            {
                OtherDescription = "Intermediary_OtherDescription",
                Company          = "Intermediary_Company",
                EMail            = "Intermediary_EMail",
                GUID             = "Intermediary_GUID",
            };
            var _transaction_intermediaries_transactions2 = new DSS5_SupplyChainFinancialsOptimisation.BO.Intermediary
            {
                OtherDescription = "Intermediary_OtherDescription",
                Company          = "Intermediary_Company",
                EMail            = "Intermediary_EMail",
                GUID             = "Intermediary_GUID",
            };
            var _transaction_partialproofofdeliveries_transaction = new DSS5_SupplyChainFinancialsOptimisation.BO.PartialProofOfDelivery
            {
                PODNumber      = "PartialProofOfDelivery_PODNumber",
                DateIssued     = now,
                QualityStatus  = "PartialProofOfDelivery_QualityStatus",
                QuantityStatus = "PartialProofOfDelivery_QuantityStatus",
                DeliveryStatus = "PartialProofOfDelivery_DeliveryStatus",
                PODAttachment  = "PartialProofOfDelivery_PODAttachment",
                Comments       = "PartialProofOfDelivery_Comments",
            };
            var _transaction_partialproofofdeliveries_transaction2 = new DSS5_SupplyChainFinancialsOptimisation.BO.PartialProofOfDelivery
            {
                PODNumber      = "PartialProofOfDelivery_PODNumber",
                DateIssued     = now,
                QualityStatus  = "PartialProofOfDelivery_QualityStatus",
                QuantityStatus = "PartialProofOfDelivery_QuantityStatus",
                DeliveryStatus = "PartialProofOfDelivery_DeliveryStatus",
                PODAttachment  = "PartialProofOfDelivery_PODAttachment",
                Comments       = "PartialProofOfDelivery_Comments",
            };
            var _transaction_customsclearingdocumentations_transaction = new DSS5_SupplyChainFinancialsOptimisation.BO.CustomsClearingDocumentation
            {
                CustomsClearingDate = now,
                ExportingCountry    = "CustomsClearingDocumentation_ExportingCountry",
                ImportingCountry    = "CustomsClearingDocumentation_ImportingCountry",
                BuyerName           = "CustomsClearingDocumentation_BuyerName",
            };
            var _transaction_customsclearingdocumentations_transaction2 = new DSS5_SupplyChainFinancialsOptimisation.BO.CustomsClearingDocumentation
            {
                CustomsClearingDate = now,
                ExportingCountry    = "CustomsClearingDocumentation_ExportingCountry",
                ImportingCountry    = "CustomsClearingDocumentation_ImportingCountry",
                BuyerName           = "CustomsClearingDocumentation_BuyerName",
            };
            var _transaction_billoflandings_transaction = new DSS5_SupplyChainFinancialsOptimisation.BO.BillOfLanding
            {
                LandingPlace     = "BillOfLanding_LandingPlace",
                LandingDate      = now,
                DeliveryPlace    = "BillOfLanding_DeliveryPlace",
                DeliveryDate     = now,
                DOCNumber        = 5377,
                ReceivingPartyId = 8383,
                IsBuyerReceiving = true,
            };
            var _transaction_billoflandings_transaction2 = new DSS5_SupplyChainFinancialsOptimisation.BO.BillOfLanding
            {
                LandingPlace     = "BillOfLanding_LandingPlace",
                LandingDate      = now,
                DeliveryPlace    = "BillOfLanding_DeliveryPlace",
                DeliveryDate     = now,
                DOCNumber        = 1637,
                ReceivingPartyId = 8022,
                IsBuyerReceiving = true,
            };
            var _transaction_transactionoverview_transaction = new DSS5_SupplyChainFinancialsOptimisation.BO.TransactionOverview
            {
                DeliveryDate     = now,
                OrderQuantity    = 2222222222.22222M,
                OrderDate        = now,
                InvoiceId        = 7059,
                InvoiceDate      = now,
                FundedRate       = 2222222222.22222M,
                InterestRate     = 2222222222.22222M,
                TotalValue       = 2222222222.22222M,
                FundingValue     = 2222222222.22222M,
                PaymentId        = 4011,
                PayementDate     = now,
                CreditNoteNumber = "TransactionOverview_CreditNoteNumber",
            };

            new PersistenceSpecification <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction>(Session)
            .CheckProperty(p => p.TransactionDateOccured, now)
            .CheckProperty(p => p.ToBePaidAmount, 2222222222.22222M)
            .CheckProperty(p => p.InvoicedDate, now)
            .CheckProperty(p => p.PaymentStatus, "Transaction_PaymentStatus")
            .CheckProperty(p => p.PaymentDate, now)
            .CheckProperty(p => p.RestPaymentAmount, 2222222222.22222M)
            .CheckProperty(p => p.PaidByBuyer, true)
            .CheckReference(p => p.CommercialAgreement, _agreement_commercialagreement_transactions)
            .CheckBag(p => p.Orders, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.Order>
            {
                _transaction_orders_transaction,
                _transaction_orders_transaction2
            }))
            .CheckBag(p => p.CreditNotes, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.CreditNote>
            {
                _transaction_creditnotes_transaction,
                _transaction_creditnotes_transaction2
            }))
            .CheckBag(p => p.DeliveryNotes, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.DeliveryNote>
            {
                _transaction_deliverynotes_transaction,
                _transaction_deliverynotes_transaction2
            }))
            .CheckBag(p => p.Invoices, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.Invoice>
            {
                _transaction_invoices_transaction,
                _transaction_invoices_transaction2
            }))
            .CheckBag(p => p.ProofOfDeliveries, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.ProofOfDelivery>
            {
                _transaction_proofofdeliveries_transaction,
                _transaction_proofofdeliveries_transaction2
            }))
            .CheckReference(p => p.TransactionStatus, _transaction_transactionstatus_transaction)
            .CheckReference(p => p.Supplier, _transaction_supplier_transactions)
            .CheckReference(p => p.ImportedBuyer, _transaction_importedbuyer_transactions)
            .CheckBag(p => p.LetterOfCredits, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.LetterOfCredit>
            {
                _transaction_letterofcredits_transaction,
                _transaction_letterofcredits_transaction2
            }))
            .CheckBag(p => p.Intermediaries, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.Intermediary>
            {
                _transaction_intermediaries_transactions,
                _transaction_intermediaries_transactions2
            }))
            .CheckBag(p => p.PartialProofOfDeliveries, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.PartialProofOfDelivery>
            {
                _transaction_partialproofofdeliveries_transaction,
                _transaction_partialproofofdeliveries_transaction2
            }))
            .CheckBag(p => p.CustomsClearingDocumentations, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.CustomsClearingDocumentation>
            {
                _transaction_customsclearingdocumentations_transaction,
                _transaction_customsclearingdocumentations_transaction2
            }))
            .CheckBag(p => p.BillOfLandings, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.BillOfLanding>
            {
                _transaction_billoflandings_transaction,
                _transaction_billoflandings_transaction2
            }))
            .CheckReference(p => p.TransactionOverview, _transaction_transactionoverview_transaction)
            .VerifyTheMappings();
        }