/*<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 virtual void RemoveAgreementStatus(AgreementStatus __item)
 {
     if (__item != null)
     {
         InternalRemoveAgreementStatus(__item);
     }
 }
 public virtual void AddAtIndexAgreementStatus(int index, AgreementStatus __item)
 {
     if (__item == null)
     {
         return;
     }
     agreementStatus?.Insert(index, __item);
 }
 public virtual void AddAgreementStatus(AgreementStatus __item)
 {
     if (__item == null)
     {
         return;
     }
     InternalAddAgreementStatus(__item);
 }
 public virtual void InternalRemoveAgreementStatus(AgreementStatus __item)
 {
     if (__item == null)
     {
         return;
     }
     agreementStatus?.Remove(__item);
 }
 public virtual void InternalAddAgreementStatus(AgreementStatus __item)
 {
     if (__item == null || disableInternalAdditions)
     {
         return;
     }
     agreementStatus?.Add(__item);
 }
 public virtual void SetAgreementStatusAt(AgreementStatus __item, int __index)
 {
     if (__item == null)
     {
         agreementStatus[__index] = null;
     }
     else
     {
         agreementStatus[__index] = __item;
     }
 }
Example #8
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();
        }
Example #9
0
/// <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(AgreementStatus compareTo)
        {
            return(!this.IsTransient() && !compareTo.IsTransient() && this.Id.Equals(compareTo.Id));
        }
Example #10
0
/// <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 [AgreementStatus] instance to use as the destination.</param>
/// <returns>A copy of the object</returns>
        public virtual AgreementStatus Copy(bool deep = false, Hashtable copiedObjects = null, bool asNew = false, bool reuseNestedObjects = false, AgreementStatus copy = null)
        {
            if (copiedObjects == null)
            {
                copiedObjects = new Hashtable();
            }
            if (copy == null && copiedObjects.Contains(this))
            {
                return((AgreementStatus)copiedObjects[this]);
            }
            copy = copy ?? new AgreementStatus();
            if (!asNew)
            {
                copy.TransientId = this.TransientId;
                copy.Id          = this.Id;
            }
            copy.Status      = this.Status;
            copy.DateOccured = this.DateOccured;
            copy.ProvidedBy  = this.ProvidedBy;
            if (!copiedObjects.Contains(this))
            {
                copiedObjects.Add(this, copy);
            }
            return(copy);
        }