/*<ControllerActionImplementation:InterestedInInvestor:1/>*/
        public ActionResult ExecuteInterestedInInvestor()
        {
            ActionResult _result = null;

            DSS5_SupplyChainFinancialsOptimisation.BO.Agreement       newAgreement = new DSS5_SupplyChainFinancialsOptimisation.BO.Agreement();
            DSS5_SupplyChainFinancialsOptimisation.BO.AgreementStatus newStatus    = new DSS5_SupplyChainFinancialsOptimisation.BO.AgreementStatus();
            newStatus.Status      = "Interested";
            newStatus.ProvidedBy  = "Supplier";
            newStatus.DateOccured = DateTime.UtcNow;
            newAgreement?.AddAgreementStatus(newStatus);
            if ((zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentApplicationUser()?.IsInRole("ValidatedSupplier") ?? false) || (zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentApplicationUser()?.IsInRole("ActiveSupplier") ?? false))
            {
                DSS5_SupplyChainFinancialsOptimisation.BO.Supplier newSup = new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().GetById <DSS5_SupplyChainFinancialsOptimisation.BO.Supplier>(zAppDev.DotNet.Framework.Identity.IdentityHelper.GetCurrentUserName());
                newAgreement.Supplier = newSup;
            }
            newAgreement.Investor = new DSS5_SupplyChainFinancialsOptimisation.BO.Investor();
            newAgreement.Investor = @model.Investor;
            new DSS5_SupplyChainFinancialsOptimisation.DAL.Repository().Save <DSS5_SupplyChainFinancialsOptimisation.BO.Agreement>(newAgreement);
            System.Collections.Generic.List <string> recipients = new System.Collections.Generic.List <string>();
            recipients.Add((@model.Investor?.Email ?? ""));
            zAppDev.DotNet.Framework.Utilities.EMailMessage em = new zAppDev.DotNet.Framework.Utilities.EMailMessage();
            em.Subject = "New Agreement";
            em.Body    = "A new Agreement is created" + "Please edit the Agreement.";
            em.To      = recipients.Distinct().ToList().ToList();
            zAppDev.DotNet.Framework.Utilities.Email.SendMail(em, true);
            ClientCommand(ClientCommands.SHOW_MESSAGE, "New Agreement created.");
            return(_result);
        }
        public void TransactionPayment_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _transactionpayment_transactions_transactionpayment = 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 _transactionpayment_transactions_transactionpayment2 = 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 _transactionpayment_agreement_transactionpayment = new DSS5_SupplyChainFinancialsOptimisation.BO.Agreement
            {
                StartDate              = now,
                EndDate                = now,
                FundedRate             = 222222.22M,
                FundedAmount           = 222222.22M,
                CurrentAgreementStatus = "Agreement_CurrentAgreementStatus",
                InterestRate           = 222222.22M,
            };

            new PersistenceSpecification <DSS5_SupplyChainFinancialsOptimisation.BO.TransactionPayment>(Session)
            .CheckProperty(p => p.PaymentAmount, 222222.22M)
            .CheckProperty(p => p.Receipt, "TransactionPayment_Receipt")
            .CheckProperty(p => p.PaymentDate, now)
            .CheckBag(p => p.Transactions, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction>
            {
                _transactionpayment_transactions_transactionpayment,
                _transactionpayment_transactions_transactionpayment2
            }))
            .CheckReference(p => p.Agreement, _transactionpayment_agreement_transactionpayment)
            .VerifyTheMappings();
        }
Пример #3
0
        public void DocumentAgreement_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _agreement_agreement_documentagreement = new DSS5_SupplyChainFinancialsOptimisation.BO.Agreement
            {
                StartDate              = now,
                EndDate                = now,
                FundedRate             = 222222.22M,
                FundedAmount           = 222222.22M,
                CurrentAgreementStatus = "Agreement_CurrentAgreementStatus",
                InterestRate           = 222222.22M,
            };

            new PersistenceSpecification <DSS5_SupplyChainFinancialsOptimisation.BO.DocumentAgreement>(Session)
            .CheckProperty(p => p.SupplierDocument, "DocumentAgreement_SupplierDocument")
            .CheckProperty(p => p.InvestorDocument, "DocumentAgreement_InvestorDocument")
            .CheckProperty(p => p.AdminDocument, "DocumentAgreement_AdminDocument")
            .CheckReference(p => p.Agreement, _agreement_agreement_documentagreement)
            .VerifyTheMappings();
        }
Пример #4
0
        public void CommercialAgreement_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _agreement_supplier_commercialagreements = new DSS5_SupplyChainFinancialsOptimisation.BO.Supplier
            {
                SupplierId              = 6701,
                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   = 4053,
                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       = 3664,
                Name                    = "Supplier_Name",
                Email                   = "Supplier_Email",
                PhoneNumber             = "Supplier_PhoneNumber",
                LockoutEndDate          = now,
            };
            var _agreement_buyer_commercialagreements = new DSS5_SupplyChainFinancialsOptimisation.BO.Buyer
            {
                BuyerId              = 4912,
                PrimaryPhone         = "Buyer_PrimaryPhone",
                SecondaryPhone       = "Buyer_SecondaryPhone",
                Fax                  = "Buyer_Fax",
                WebSite              = "Buyer_WebSite",
                Company              = "Buyer_Company",
                AnnualTurnOver       = 2222222222.22222M,
                LegalRepresentative  = "Buyer_LegalRepresentative",
                Rating               = "Buyer_Rating",
                CreditInsurance      = true,
                Logo                 = "Buyer_Logo",
                AddressOne           = "Buyer_AddressOne",
                AddressTwo           = "Buyer_AddressTwo",
                VatNumber            = "Buyer_VatNumber",
                ContactPerson        = "Buyer_ContactPerson",
                Prefix               = "Buyer_Prefix",
                Temp                 = "Buyer_Temp",
                UserName             = "******",
                PasswordHash         = "Buyer_PasswordHash",
                SecurityStamp        = "Buyer_SecurityStamp",
                EmailConfirmed       = true,
                LockoutEnabled       = true,
                PhoneNumberConfirmed = true,
                TwoFactorEnabled     = true,
                AccessFailedCount    = 4366,
                Name                 = "Buyer_Name",
                Email                = "Buyer_Email",
                PhoneNumber          = "Buyer_PhoneNumber",
                LockoutEndDate       = now,
            };
            var _agreement_orders_commercialagreement = 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 _agreement_orders_commercialagreement2 = 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 _agreement_importedbuyer_commercialagreement = new DSS5_SupplyChainFinancialsOptimisation.BO.ImportedBuyer
            {
                Code       = "ImportedBuyer_Code",
                VATNumber  = "ImportedBuyer_VATNumber",
                Company    = "ImportedBuyer_Company",
                AddressOne = "ImportedBuyer_AddressOne",
                AddressTwo = "ImportedBuyer_AddressTwo",
                Phone      = "ImportedBuyer_Phone",
            };
            var _agreement_transactions_commercialagreement = 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 _agreement_transactions_commercialagreement2 = 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 _agreement_agreement_commercialagreements = new DSS5_SupplyChainFinancialsOptimisation.BO.Agreement
            {
                StartDate              = now,
                EndDate                = now,
                FundedRate             = 222222.22M,
                FundedAmount           = 222222.22M,
                CurrentAgreementStatus = "Agreement_CurrentAgreementStatus",
                InterestRate           = 222222.22M,
            };

            new PersistenceSpecification <DSS5_SupplyChainFinancialsOptimisation.BO.CommercialAgreement>(Session)
            .CheckProperty(p => p.ProductCategory, "CommercialAgreement_ProductCategory")
            .CheckProperty(p => p.PaymentTerms, "CommercialAgreement_PaymentTerms")
            .CheckReference(p => p.Supplier, _agreement_supplier_commercialagreements)
            .CheckReference(p => p.Buyer, _agreement_buyer_commercialagreements)
            .CheckBag(p => p.Orders, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.Order>
            {
                _agreement_orders_commercialagreement,
                _agreement_orders_commercialagreement2
            }))
            .CheckReference(p => p.ImportedBuyer, _agreement_importedbuyer_commercialagreement)
            .CheckBag(p => p.Transactions, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction>
            {
                _agreement_transactions_commercialagreement,
                _agreement_transactions_commercialagreement2
            }))
            .CheckReference(p => p.Agreement, _agreement_agreement_commercialagreements)
            .VerifyTheMappings();
        }
/// <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 [Agreement] instance to use as the destination.</param>
/// <returns>A copy of the object</returns>
        public virtual Agreement Copy(bool deep = false, Hashtable copiedObjects = null, bool asNew = false, bool reuseNestedObjects = false, Agreement copy = null)
        {
            if (copiedObjects == null)
            {
                copiedObjects = new Hashtable();
            }
            if (copy == null && copiedObjects.Contains(this))
            {
                return((Agreement)copiedObjects[this]);
            }
            copy = copy ?? new Agreement();
            if (!asNew)
            {
                copy.TransientId = this.TransientId;
                copy.Id          = this.Id;
            }
            copy.StartDate              = this.StartDate;
            copy.EndDate                = this.EndDate;
            copy.FundedRate             = this.FundedRate;
            copy.FundedAmount           = this.FundedAmount;
            copy.CurrentAgreementStatus = this.CurrentAgreementStatus;
            copy.InterestRate           = this.InterestRate;
            if (!copiedObjects.Contains(this))
            {
                copiedObjects.Add(this, copy);
            }
            if (deep && this.investor != null)
            {
                if (!copiedObjects.Contains(this.investor))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.Investor = this.Investor;
                    }
                    else if (asNew)
                    {
                        copy.Investor = this.Investor.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.investor = this.investor.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.Investor = (Investor)copiedObjects[this.Investor];
                    }
                    else
                    {
                        copy.investor = (Investor)copiedObjects[this.Investor];
                    }
                }
            }
            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];
                    }
                }
            }
            copy.fundedTransactions = new List <FundedTransaction>();
            if (deep && this.fundedTransactions != null)
            {
                foreach (var __item in this.fundedTransactions)
                {
                    if (!copiedObjects.Contains(__item))
                    {
                        if (asNew && reuseNestedObjects)
                        {
                            copy.AddFundedTransactions(__item);
                        }
                        else
                        {
                            copy.AddFundedTransactions(__item.Copy(deep, copiedObjects, asNew));
                        }
                    }
                    else
                    {
                        copy.AddFundedTransactions((FundedTransaction)copiedObjects[__item]);
                    }
                }
            }
            copy.agreementStatus = new List <AgreementStatus>();
            if (deep && this.agreementStatus != null)
            {
                foreach (var __item in this.agreementStatus)
                {
                    if (!copiedObjects.Contains(__item))
                    {
                        if (asNew && reuseNestedObjects)
                        {
                            copy.AddAgreementStatus(__item);
                        }
                        else
                        {
                            copy.AddAgreementStatus(__item.Copy(deep, copiedObjects, asNew));
                        }
                    }
                    else
                    {
                        copy.AddAgreementStatus((AgreementStatus)copiedObjects[__item]);
                    }
                }
            }
            if (deep && this.documentAgreement != null)
            {
                if (!copiedObjects.Contains(this.documentAgreement))
                {
                    if (asNew && reuseNestedObjects)
                    {
                        copy.DocumentAgreement = this.DocumentAgreement;
                    }
                    else if (asNew)
                    {
                        copy.DocumentAgreement = this.DocumentAgreement.Copy(deep, copiedObjects, true);
                    }
                    else
                    {
                        copy.documentAgreement = this.documentAgreement.Copy(deep, copiedObjects, false);
                    }
                }
                else
                {
                    if (asNew)
                    {
                        copy.DocumentAgreement = (DocumentAgreement)copiedObjects[this.DocumentAgreement];
                    }
                    else
                    {
                        copy.documentAgreement = (DocumentAgreement)copiedObjects[this.DocumentAgreement];
                    }
                }
            }
            copy.commercialAgreements = new List <CommercialAgreement>();
            if (deep && this.commercialAgreements != null)
            {
                foreach (var __item in this.commercialAgreements)
                {
                    if (!copiedObjects.Contains(__item))
                    {
                        if (asNew && reuseNestedObjects)
                        {
                            copy.AddCommercialAgreements(__item);
                        }
                        else
                        {
                            copy.AddCommercialAgreements(__item.Copy(deep, copiedObjects, asNew));
                        }
                    }
                    else
                    {
                        copy.AddCommercialAgreements((CommercialAgreement)copiedObjects[__item]);
                    }
                }
            }
            return(copy);
        }
/// <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(Agreement compareTo)
        {
            return(!this.IsTransient() && !compareTo.IsTransient() && this.Id.Equals(compareTo.Id));
        }
Пример #7
0
        public void Investor_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _agreement_agreements_investor = new DSS5_SupplyChainFinancialsOptimisation.BO.Agreement
            {
                StartDate              = now,
                EndDate                = now,
                FundedRate             = 222222.22M,
                FundedAmount           = 222222.22M,
                CurrentAgreementStatus = "Agreement_CurrentAgreementStatus",
                InterestRate           = 222222.22M,
            };
            var _agreement_agreements_investor2 = new DSS5_SupplyChainFinancialsOptimisation.BO.Agreement
            {
                StartDate              = now,
                EndDate                = now,
                FundedRate             = 222222.22M,
                FundedAmount           = 222222.22M,
                CurrentAgreementStatus = "Agreement_CurrentAgreementStatus",
                InterestRate           = 222222.22M,
            };
            var _investor_annualtransactionvolumes_investor = new DSS5_SupplyChainFinancialsOptimisation.BO.AnnualTransactionVolume
            {
                Volume = 222222.22M,
                Year   = 4594,
            };
            var _investor_annualtransactionvolumes_investor2 = new DSS5_SupplyChainFinancialsOptimisation.BO.AnnualTransactionVolume
            {
                Volume = 222222.22M,
                Year   = 165,
            };

            new PersistenceSpecification <DSS5_SupplyChainFinancialsOptimisation.BO.Investor>(Session)
            .CheckProperty(p => p.InvestorId, 1919)
            .CheckProperty(p => p.PrimaryPhone, "Investor_PrimaryPhone")
            .CheckProperty(p => p.SecondaryPhone, "Investor_SecondaryPhone")
            .CheckProperty(p => p.Fax, "Investor_Fax")
            .CheckProperty(p => p.WebSite, "Investor_WebSite")
            .CheckProperty(p => p.Company, "Investor_Company")
            .CheckProperty(p => p.ContactPerson, "Investor_ContactPerson")
            .CheckProperty(p => p.Logo, "Investor_Logo")
            .CheckProperty(p => p.SupervisingAuthority, "Investor_SupervisingAuthority")
            .CheckProperty(p => p.RegistrationNo, "Investor_RegistrationNo")
            .CheckProperty(p => p.DomainFocus, "Investor_DomainFocus")
            .CheckProperty(p => p.TurnOver, 2222222222.22222M)
            .CheckProperty(p => p.VatNumber, "Investor_VatNumber")
            .CheckProperty(p => p.AddressTwo, "Investor_AddressTwo")
            .CheckProperty(p => p.AddressOne, "Investor_AddressOne")
            .CheckProperty(p => p.ManagingDirector, "Investor_ManagingDirector")
            .CheckProperty(p => p.TargetMarket, "Investor_TargetMarket")
            .CheckProperty(p => p.CustomerSizeFrom, "Investor_CustomerSizeFrom")
            .CheckProperty(p => p.CustomerSizeTo, "Investor_CustomerSizeTo")
            .CheckProperty(p => p.LocalJurisdiction, "Investor_LocalJurisdiction")
            .CheckProperty(p => p.CommercialRegNo, "Investor_CommercialRegNo")
            .CheckProperty(p => p.OtherMinRequirements, "Investor_OtherMinRequirements")
            .CheckProperty(p => p.CRR, true)
            .CheckProperty(p => p.UploadCompliance, "Investor_UploadCompliance")
            .CheckProperty(p => p.OtherMemberships, "Investor_OtherMemberships")
            .CheckProperty(p => p.OtherDomainFocus, "Investor_OtherDomainFocus")
            .CheckProperty(p => p.InvestorStatus, "Investor_InvestorStatus")
            .CheckProperty(p => p.IAFC, true)
            .CheckProperty(p => p.Prefix, "Investor_Prefix")
            .CheckProperty(p => p.UserName, "b132c423-de8e-4751-9982-12ebb00304f2Investor_UserName")
            .CheckProperty(p => p.PasswordHash, "Investor_PasswordHash")
            .CheckProperty(p => p.SecurityStamp, "Investor_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, 7777)
            .CheckProperty(p => p.Name, "Investor_Name")
            .CheckProperty(p => p.Email, "Investor_Email")
            .CheckProperty(p => p.PhoneNumber, "Investor_PhoneNumber")
            .CheckProperty(p => p.LockoutEndDate, now)
            .CheckBag(p => p.Agreements, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.Agreement>
            {
                _agreement_agreements_investor,
                _agreement_agreements_investor2
            }))
            .CheckBag(p => p.AnnualTransactionVolumes, (new List <DSS5_SupplyChainFinancialsOptimisation.BO.AnnualTransactionVolume>
            {
                _investor_annualtransactionvolumes_investor,
                _investor_annualtransactionvolumes_investor2
            }))
            .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();
        }