/// <summary>
        /// Returns true if BankingLendingBalance instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingLendingBalance to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingLendingBalance other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     AccountBalance == other.AccountBalance ||
                     AccountBalance != null &&
                     AccountBalance.Equals(other.AccountBalance)
                     ) &&
                 (
                     AvailableBalance == other.AvailableBalance ||
                     AvailableBalance != null &&
                     AvailableBalance.Equals(other.AvailableBalance)
                 ) &&
                 (
                     CreditLimit == other.CreditLimit ||
                     CreditLimit != null &&
                     CreditLimit.Equals(other.CreditLimit)
                 ) &&
                 (
                     AmortisedLimit == other.AmortisedLimit ||
                     AmortisedLimit != null &&
                     AmortisedLimit.Equals(other.AmortisedLimit)
                 ));
        }
Ejemplo n.º 2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (entityId_ != null)
            {
                hash ^= EntityId.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (GroupType != 0)
            {
                hash ^= GroupType.GetHashCode();
            }
            if (GroupNumber.Length != 0)
            {
                hash ^= GroupNumber.GetHashCode();
            }
            if (creditLimit_ != null)
            {
                hash ^= CreditLimit.GetHashCode();
            }
            if (Active != false)
            {
                hash ^= Active.GetHashCode();
            }
            if (contactInfo_ != null)
            {
                hash ^= ContactInfo.GetHashCode();
            }
            return(hash);
        }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (AccountBalance != null)
         {
             hashCode = hashCode * 59 + AccountBalance.GetHashCode();
         }
         if (AvailableBalance != null)
         {
             hashCode = hashCode * 59 + AvailableBalance.GetHashCode();
         }
         if (CreditLimit != null)
         {
             hashCode = hashCode * 59 + CreditLimit.GetHashCode();
         }
         if (AmortisedLimit != null)
         {
             hashCode = hashCode * 59 + AmortisedLimit.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo n.º 4
0
 public CreditLimit Post(CreditLimit creditLimit)
 {
     if (creditLimit == null || !ModelState.IsValid)
     {
         throw new HttpException((int)HttpStatusCode.BadRequest, "Invalid Request");
     }
     return(creditLimitService.AddUpdateCreditLimit(creditLimit.CreateFrom()).CreateFrom());
 }
Ejemplo n.º 5
0
            public override XElement GenerateAddRq()
            {
                XElement Add = new XElement("CustomerAdd");

                Add.Add(Name?.ToQBXML(nameof(Name)));
                Add.Add(IsActive.ToQBXML(nameof(IsActive)));
                Add.Add(ClassRef?.ToQBXML(nameof(ClassRef)));
                Add.Add(ParentRef?.ToQBXML(nameof(ParentRef)));
                Add.Add(CompanyName?.ToQBXML(nameof(CompanyName)));
                Add.Add(Salutation?.ToQBXML(nameof(Salutation)));
                Add.Add(FirstName?.ToQBXML(nameof(FirstName)));
                Add.Add(MiddleName?.ToQBXML(nameof(MiddleName)));
                Add.Add(LastName?.ToQBXML(nameof(LastName)));
                Add.Add(JobTitle?.ToQBXML(nameof(JobTitle)));
                Add.Add(BillAddress?.ToQBXML(nameof(BillAddress)));
                Add.Add(ShipAddress?.ToQBXML(nameof(ShipAddress)));
                Add.Add(ShipToAddress?.ToQBXML(nameof(ShipToAddress)));
                Add.Add(Phone?.ToQBXML(nameof(Phone)));
                Add.Add(AltPhone?.ToQBXML(nameof(AltPhone)));
                Add.Add(Fax?.ToQBXML(nameof(Fax)));
                Add.Add(Email?.ToQBXML(nameof(Email)));
                Add.Add(Cc?.ToQBXML(nameof(Cc)));
                Add.Add(Contact?.ToQBXML(nameof(Contact)));
                Add.Add(AltContact?.ToQBXML(nameof(AltContact)));
                Add.Add(AdditionalContactRef?.ToQBXML(nameof(AdditionalContactRef)));
                Add.Add(Contacts?.ToQBXML <Contacts>(nameof(Contacts)));
                Add.Add(CustomerTypeRef?.ToQBXML(nameof(CustomerTypeRef)));
                Add.Add(TermsRef?.ToQBXML(nameof(TermsRef)));
                Add.Add(SalesRepRef?.ToQBXML(nameof(SalesRepRef)));
                Add.Add(OpenBalance?.ToQBXML(nameof(OpenBalance)));
                Add.Add(OpenBalanceDate?.ToQBXML(nameof(OpenBalanceDate)));
                Add.Add(SalesTaxCodeRef?.ToQBXML(nameof(SalesTaxCodeRef)));
                Add.Add(ItemSalesTaxRef?.ToQBXML(nameof(ItemSalesTaxRef)));
                Add.Add(ResaleNumber?.ToQBXML(nameof(ResaleNumber)));
                Add.Add(AccountNumber?.ToQBXML(nameof(AccountNumber)));
                Add.Add(CreditLimit?.ToQBXML(nameof(CreditLimit)));
                Add.Add(PreferredPaymentMethodRef?.ToQBXML(nameof(PreferredPaymentMethodRef)));
                Add.Add(CreditCardInfo?.ToQBXML(nameof(CreditCardInfo)));
                Add.Add(JobStatus.ToQBXML(nameof(JobStatus)));
                Add.Add(JobStartDate?.ToQBXML(nameof(JobStartDate)));
                Add.Add(JobProjectedEndDate?.ToQBXML(nameof(JobProjectedEndDate)));
                Add.Add(JobEndDate?.ToQBXML(nameof(JobEndDate)));
                Add.Add(JobDesc?.ToQBXML(nameof(JobDesc)));
                Add.Add(JobTypeRef?.ToQBXML(nameof(JobTypeRef)));
                Add.Add(Notes?.ToQBXML(nameof(Notes)));
                Add.Add(AdditionalNotes?.ToQBXML(nameof(AdditionalNotes)));
                Add.Add(PreferredDeliveryMethod.ToQBXML(nameof(PreferredDeliveryMethod)));
                Add.Add(PriceLevelRef?.ToQBXML(nameof(PriceLevelRef)));
                Add.Add(ExternalGUID?.ToQBXML(nameof(ExternalGUID)));
                Add.Add(CurrencyRef?.ToQBXML(nameof(CurrencyRef)));

                XElement AddRq = new XElement("CustomerAddRq");

                AddRq.Add(Add);
                AddRq.Add(IncludeRetElement?.ToQBXML(nameof(IncludeRetElement)));

                return(AddRq);
            }
Ejemplo n.º 6
0
 public Boolean Delete(CreditLimit creditLimit)
 {
     if (creditLimit == null || !ModelState.IsValid)
     {
         throw new HttpException((int)HttpStatusCode.BadRequest, "Invalid Request");
     }
     creditLimitService.DeleteCreditLimit(creditLimit.CreditLimitId);
     return(true);
 }
 public void MergeFrom(Group other)
 {
     if (other == null)
     {
         return;
     }
     if (other.entityId_ != null)
     {
         if (entityId_ == null)
         {
             entityId_ = new global::HOLMS.Types.CRM.Groups.GroupIndicator();
         }
         EntityId.MergeFrom(other.EntityId);
     }
     if (other.Name.Length != 0)
     {
         Name = other.Name;
     }
     if (other.GroupType != 0)
     {
         GroupType = other.GroupType;
     }
     if (other.GroupNumber.Length != 0)
     {
         GroupNumber = other.GroupNumber;
     }
     if (other.creditLimit_ != null)
     {
         if (creditLimit_ == null)
         {
             creditLimit_ = new global::HOLMS.Types.Primitive.MonetaryAmount();
         }
         CreditLimit.MergeFrom(other.CreditLimit);
     }
     if (other.Active != false)
     {
         Active = other.Active;
     }
     if (other.contactInfo_ != null)
     {
         if (contactInfo_ == null)
         {
             contactInfo_ = new global::HOLMS.Types.Primitive.ContactInformation();
         }
         ContactInfo.MergeFrom(other.ContactInfo);
     }
     if (other.property_ != null)
     {
         if (property_ == null)
         {
             property_ = new global::HOLMS.Types.TenancyConfig.Indicators.PropertyIndicator();
         }
         Property.MergeFrom(other.Property);
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Update Credit Limit Properties while updating the instance
 /// </summary>
 private void UpdateCreditLimitProperties(CreditLimit creditLimit, CreditLimit dbVersion)
 {
     dbVersion.RecLastUpdatedBy    = creditLimitRepository.LoggedInUserIdentity;
     dbVersion.RecLastUpdatedDt    = DateTime.Now;
     dbVersion.RowVersion          = dbVersion.RowVersion++;
     dbVersion.BpSubTypeId         = creditLimit.BpSubTypeId;
     dbVersion.BpRatingTypeId      = creditLimit.BpRatingTypeId;
     dbVersion.Description         = creditLimit.Description;
     dbVersion.StandardCreditLimit = creditLimit.StandardCreditLimit;
     dbVersion.IsIndividual        = creditLimit.IsIndividual;
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Delete Credit Limit
        /// </summary>
        public void DeleteCreditLimit(long creditLimitid)
        {
            CreditLimit dbversion = creditLimitRepository.Find(creditLimitid);

            if (dbversion == null)
            {
                throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
                                                                  "Credit Limit with Id {0} not found!", creditLimitid));
            }
            creditLimitRepository.Delete(dbversion);
            creditLimitRepository.SaveChanges();
        }
Ejemplo n.º 10
0
 /// <summary>
 ///  Create web model from entity
 /// </summary>
 public static Models.CreditLimit CreateFrom(this CreditLimit source)
 {
     return(new Models.CreditLimit
     {
         CreditLimitId = source.CreditLimitId,
         BpSubTypeId = source.BpSubTypeId,
         BpSubTypeName = source.BpSubType.BusinessPartnerSubTypeName,
         BpRatingTypeId = source.BpRatingTypeId,
         BpRatingTypeName = source.BpRatingType.BpRatingTypeName,
         IsIndividual = source.IsIndividual,
         StandardCreditLimit = source.StandardCreditLimit,
         Description = source.Description
     });
 }
Ejemplo n.º 11
0
        private void SetCreditLimit(CreditLimit creditLimitType, Customer customer)
        {
            if (creditLimitType == CreditLimit.None)
            {
                customer.HasCreditLimit = false;
            }
            else
            {
                customer.HasCreditLimit = true;

                var creditLimit = _customerCreditService.GetCreditLimit(customer.Firstname, customer.Surname, customer.DateOfBirth);
                creditLimit          = creditLimitType == CreditLimit.Normal ? creditLimit : creditLimit * 2;
                customer.CreditLimit = creditLimit;
            }
        }
        private void SetControlsFromPassedInFields()
        {
            var classID = custTypes.FirstOrDefault(type => type.Key == CustClassKey).Id.TrimEnd();

            rdoEndUser.Checked    = classID == "EndUser" ? true : false;
            rdoDealer.Checked     = classID == "Dealer" ? true : false;
            rdoWholesaler.Checked = classID == "Wholesale" ? true : false;

            cboPaymentTerms.SelectedIndex = paymentTerms.FindIndex(c => c.Key == PaymentTermsKey);
            txtCreditLimit.Text           = CreditLimit.ToString();
            cboShipMethod.SelectedIndex   = shipMethods.FindIndex(meth => meth.Key == ShipMethodKey);

            chkPricePackingSlip.Checked = PricePackingSlip == "No" ? false : true;
            chkPORequired.Checked       = ReqPO == 0 ? false : true;
        }
Ejemplo n.º 13
0
        public CreditLimit ReturnCreditLimit(UserInformation userInformation)
        {
            CreditLimit creditLimit = new CreditLimit()
            {
                Limit  = 0,
                Result = "Onay"
            };

            long score = GetCreditSkor(userInformation.TCNo);

            //Kurallardaki ilk eksik . Eğer kullanıcının hiç skoru yoksa ilk defa kredi çekecekse nasıl bir işlem yapılmalı belirtilmemiştir.

            if (score < 500)
            {
                creditLimit.Limit  = 0;
                creditLimit.Result = "Red";
            }

            if ((500 <= score) && (score < 1000))
            {
                if (userInformation.MonthlyGain < 5000)
                {
                    creditLimit.Limit  = 10000;
                    creditLimit.Result = "Onay";

                    //_userInformationRepository.AddUser(userInformation);
                    //_smsEngine.SendSms(userInformation.TelNo);
                }

                //Kurallardan ikinci eksik eğer aylık gelir 5000 den fazla ise nasıl bir işlem sağlanılacak onun bilgisi de verilmemiş.
            }

            if (1000 <= score)
            {
                creditLimit.Limit  = Convert.ToInt64(userInformation.MonthlyGain * 4);
                creditLimit.Result = "Onay";

                //_userInformationRepository.AddUser(userInformation);
                //_smsEngine.SendSms(userInformation.TelNo);
            }
            if (creditLimit.Result == "Onay")
            {
                _userInformationRepository.AddUser(userInformation);
                _smsEngine.SendSms(userInformation.TelNo);
            }

            return(creditLimit);
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Add / Update Credit Limit
        /// </summary>
        public CreditLimit AddUpdateCreditLimit(CreditLimit creditLimit)
        {
            CreditLimit dbVersion = creditLimitRepository.Find(creditLimit.CreditLimitId);

            if (dbVersion != null)
            {
                UpdateCreditLimitProperties(creditLimit, dbVersion);
                creditLimitRepository.Update(dbVersion);
            }
            else
            {
                dbVersion = new CreditLimit();
                SetDocumentProperties(creditLimit, dbVersion);
                creditLimitRepository.Add(dbVersion);
            }
            creditLimitRepository.SaveChanges();
            // To Load the proprties
            return(creditLimitRepository.GetCreditLimitWithDetail(dbVersion.CreditLimitId));
        }
Ejemplo n.º 15
0
        public Participant Read(int sampleNo)
        {
            try
            {
                Init();
                var sheet = workbook.GetSheetAt(0);

                Participant.Id Id = new Participant.Id();
                Participant.PhysicalAddress           physicalAddress                     = new PhysicalAddress();
                Participant.PostalAddress             postalAddress                       = new PostalAddress();
                Participant.Contacts                  contacts                            = new Contacts();
                Participant.ExternalSystemsReferences externalSystemsReferences           = new ExternalSystemsReferences();
                Participant.NOTES                          notes                          = new NOTES();
                Participant.BankingDetails                 bankingDetails                 = new BankingDetails();
                Participant.Conventions                    conventions                    = new Conventions();
                Participant.BillingPracticeDetails         billingPracticeDetails         = new BillingPracticeDetails();
                Participant.PenaltyGracePeriod             penaltyGracePeriod             = new PenaltyGracePeriod();
                Participant.PenaltyGracePeriodforGuarantor penaltyGracePeriodforGuarantor = new PenaltyGracePeriodforGuarantor();
                Participant.BusinessDayConvention          businessDayConvention          = new BusinessDayConvention();
                Participant.IssuerPractices                issuerPractices                = new IssuerPractices();
                Participant.LimitsandRatings               limitsandRatings               = new LimitsandRatings();
                Participant.CreditLimit                    creditLimit                    = new CreditLimit();
                Participant.CreditRatings                  creditRatings                  = new CreditRatings();
                foreach (IRow row in sheet)



                {
                    var attrib = row.GetCell(1).StringCellValue.ToUpper();
                    var value  = GetUnformattedValue(row.GetCell(2 + sampleNo));

                    switch (row.GetCell(1).StringCellValue.ToUpper())
                    {
                    case "IDENTIFICATION":

                        if (attrib == "NAME")
                        {
                            Id.Name = value;
                        }
                        else if (attrib == "COUNTRY OF RESIDENCE")
                        {
                            Id.CountryOfResidence = value;
                        }
                        else if (attrib == "COUNTRY OF DOMICILE")
                        {
                            Id.CountryOfDomicile = value;
                        }
                        else if (attrib == "RESIDENCY")
                        {
                            Id.Residency = value;
                        }
                        else if (attrib == "ROLE")
                        {
                            Id.Role = value;
                        }
                        else if (attrib == "CATEGORY")
                        {
                            Id.Category = value;
                        }
                        else if (attrib == "NATIONALSECTOR")
                        {
                            Id.NationalSector = value;
                        }
                        else if (attrib == "INSTTITUTINALSECTOR")
                        {
                            Id.InsttitutinalSector = value;
                        }
                        else if (attrib == "PARENTCOMPANY")
                        {
                            Id.ParentCompany = value;
                        }
                        else if (attrib == "STATUS")
                        {
                            Id.Status = value;
                        }
                        else if (attrib == "PARTICIPANTNOTUSED")
                        {
                            Id.ParticipantNotUsed = value;
                        }
                        else if (attrib == "PARTICIPANTISOWNER")
                        {
                            Id.ParticipantIsOwner = value;
                        }
                        else if (attrib == "EXPORTCODE")
                        {
                            Id.ExportCode = value;
                        }
                        else if (attrib == "EXTERNALCODE")
                        {
                            Id.ExternalCode = value;
                        }
                        break;

                    case "PHYSICAL ADDRESS":
                        if (attrib == "ADDRESSLINE1")
                        {
                            physicalAddress.AddressLine1 = value;
                        }
                        else if (attrib == "ADDRESSLINE2")
                        {
                            physicalAddress.AddressLine2 = value;
                        }
                        else if (attrib == "ADDRESSLINE3")
                        {
                            physicalAddress.AddressLine3 = value;
                        }
                        else if (attrib == "CODE")
                        {
                            physicalAddress.Code = value;
                        }
                        else if (attrib == "COUNTRY")
                        {
                            physicalAddress.Country = value;
                        }
                        else if (attrib == "CITY")
                        {
                            physicalAddress.City = value;
                        }
                        break;

                    case "POSTAL ADDRESS":
                        if (attrib == "ADDRESSLINE1")
                        {
                            postalAddress.AddressLine1 = value;
                        }
                        else if (attrib == "ADDRESSLINE2")
                        {
                            postalAddress.AddressLine2 = value;
                        }
                        else if (attrib == "ADDRESSLINE3")
                        {
                            postalAddress.AddressLine3 = value;
                        }
                        else if (attrib == "CODE")
                        {
                            postalAddress.Code = value;
                        }
                        else if (attrib == "CITY")
                        {
                            postalAddress.City = value;
                        }
                        else if (attrib == "WEBADDRESS")
                        {
                            postalAddress.WebAddress = value;
                        }

                        break;

                    case "CONTACTS":
                        if (attrib == "CONTACTNAME")
                        {
                            contacts.ContactName = value;
                        }
                        else if (attrib == "CONTACTTELEPHONENUMBER")
                        {
                            contacts.ContactTelephoneNumber = value;
                        }
                        else if (attrib == "CONTACTFAXNUMBER")
                        {
                            contacts.ContactFaxNumber = value;
                        }
                        else if (attrib == "CONTACTEMAIL")
                        {
                            contacts.ContactEmail = value;
                        }
                        else if (attrib == "PRIMARYCONTACTINDICATOR")
                        {
                            contacts.PrimaryContactIndicator = value;
                        }
                        break;

                    case "EXTERNAL SYSTEMS REFERENCES":
                        if (attrib == "EXTERNALSYSTEM")
                        {
                            externalSystemsReferences.Externalsystem = value;
                        }
                        else if (attrib == "REFERENCE")
                        {
                            externalSystemsReferences.Reference = value;
                        }
                        break;

                    case "NOTES":
                        if (attrib == "NOTESDATE")
                        {
                            notes.NotesDate = value;
                        }
                        else if (attrib == "NOTES")
                        {
                            notes.Notes = value;
                        }
                        break;

                    case "BANKING DETAILS":
                        if (attrib == "BANKNAME")
                        {
                            bankingDetails.BankName = value;
                        }
                        else if (attrib == "ACCOUNTNAME")
                        {
                            bankingDetails.AccountName = value;
                        }
                        else if (attrib == "CURRENCY")
                        {
                            bankingDetails.Currency = value;
                        }
                        else if (attrib == "IBAN")
                        {
                            bankingDetails.IBAN = value;
                        }
                        else if (attrib == "SWIFTBICNUMBER")
                        {
                            bankingDetails.SWIFTBICNumber = value;
                        }
                        else if (attrib == "COUNTRY")
                        {
                            bankingDetails.Country = value;
                        }
                        else if (attrib == "CITY")
                        {
                            bankingDetails.City = value;
                        }
                        else if (attrib == "STARTDATE")
                        {
                            bankingDetails.StartDate = value;
                        }
                        else if (attrib == "ENDDATE")
                        {
                            bankingDetails.EndDate = value;
                        }
                        else if (attrib == "ACCOUNTUSE")
                        {
                            bankingDetails.AccountUse = value;
                        }
                        else if (attrib == "BANKACCOUNTSTATUS")
                        {
                            bankingDetails.BankAccountStatus = value;
                        }
                        else if (attrib == "APPLICABLEINSTRUMENTTYPES")
                        {
                            bankingDetails.ApplicableInstrumentTypes = value;
                        }
                        else if (attrib == "DEFAULTDEBITACCOUNT")
                        {
                            bankingDetails.DefaultDebitAccount = value;
                        }
                        else if (attrib == "DEFAULTDEBITSTARTDATE")
                        {
                            bankingDetails.DefaultDebitStartDate = value;
                        }
                        else if (attrib == "DEFAULTDEBITENDDATE")
                        {
                            bankingDetails.DefaultDebitEndDate = value;
                        }
                        else if (attrib == "DEFAULTCREDITACCOUNT")
                        {
                            bankingDetails.DefaultCreditAccount = value;
                        }
                        else if (attrib == "DEFAULTCREDITSTARTDATE")
                        {
                            bankingDetails.DefaultCreditStartDate = value;
                        }
                        else if (attrib == "DEFAULTCREDITENDDATE")
                        {
                            bankingDetails.DefaultCreditEndDate = value;
                        }
                        else if (attrib == "INTERMEDIARYBANKINGDETAILS")
                        {
                            bankingDetails.IntermediaryBankingdetails = value;
                        }
                        break;

                    case "BILLING PRACTICE DETAILS":
                        if (attrib == "OPTIONS")
                        {
                            billingPracticeDetails.Options = value;
                        }
                        else if (attrib == "INTERMEDIARYBANKINGDETAILS")
                        {
                            billingPracticeDetails.Period = value;
                        }
                        break;

                    case "PENALTY GRACE PERIOD":
                        if (attrib == "PERIOD")
                        {
                            penaltyGracePeriod.Period = value;
                        }
                        else if (attrib == "PERIODICITY")
                        {
                            penaltyGracePeriod.Periodicity = value;
                        }
                        break;

                    case "PENALTY GRACE PERIOD (FOR GUARANTOR)":
                        if (attrib == "PERIOD")
                        {
                            penaltyGracePeriodforGuarantor.Period = value;
                        }
                        else if (attrib == "PERIODICITY")
                        {
                            penaltyGracePeriodforGuarantor.Periodicity = value;
                        }
                        else if (attrib == "PAYMENTFREQUENCY")
                        {
                            penaltyGracePeriodforGuarantor.PaymentFrequency = value;
                        }
                        else if (attrib == "EXPECTEDTIMEFORCLAIMSETTLEMENTINDAYS")
                        {
                            penaltyGracePeriodforGuarantor.ExpectedTimeforClaimSettlementindays = value;
                        }
                        else if (attrib == "PAYMENTAPPLICATIONMETHOD")
                        {
                            penaltyGracePeriodforGuarantor.PaymentApplicationMethod = value;
                        }
                        else if (attrib == "MINIMUMBILLAMOUNT")
                        {
                            penaltyGracePeriodforGuarantor.MinimumBillAmount = value;
                        }
                        else if (attrib == "PREPAYMENTMETHODS")
                        {
                            penaltyGracePeriodforGuarantor.Prepaymentmethods = value;
                        }
                        else if (attrib == "LEGALCLAUSES")
                        {
                            penaltyGracePeriodforGuarantor.LegalClauses = value;
                        }
                        break;

                    case "BUSINESS DAY CONVENTION":
                        if (attrib == "CASHFLOWTYPE")
                        {
                            businessDayConvention.CashFlowType = value;
                        }
                        else if (attrib == "DATEROLL")
                        {
                            businessDayConvention.DateRoll = value;
                        }
                        else if (attrib == "CALCULATEARREARSFROM")
                        {
                            businessDayConvention.Calculatearrearsfrom = value;
                        }
                        else if (attrib == "ENDMONTHINDICATOR")
                        {
                            businessDayConvention.EndMonthIndicator = value;
                        }
                        else if (attrib == "INTERESTCALCULATEDTO")
                        {
                            businessDayConvention.InterestCalculatedTo = value;
                        }
                        break;

                    case "ISSUER PRACTICES":
                        if (attrib == "OPTIONS")
                        {
                            issuerPractices.Options = value;
                        }
                        else if (attrib == "BOOKCLOSEDPERIODPERIOD")
                        {
                            issuerPractices.BookClosedPeriodPeriod = value;
                        }
                        else if (attrib == "PERIODICITY")
                        {
                            issuerPractices.Periodicity = value;
                        }
                        break;

                    case "CREDIT LIMIT":
                        if (attrib == "CATEGORY")
                        {
                            creditLimit.Category = value;
                        }
                        else if (attrib == "AMOUNTPERIOD")
                        {
                            creditLimit.AmountPeriod = value;
                        }
                        break;

                    case "CREDIT RATINGS":
                        if (attrib == "RATINGAGENCY")
                        {
                            creditRatings.RatingAgency = value;
                        }
                        else if (attrib == "RATINGDATE")
                        {
                            creditRatings.RatingDate = value;
                        }
                        else if (attrib == "CREDITRATING")
                        {
                            creditRatings.CreditRating = value;
                        }
                        else if (attrib == "RATINGOUTLOOK")
                        {
                            creditRatings.RatingOutlook = value;
                        }
                        else if (attrib == "WATCHDATE")
                        {
                            creditRatings.WatchDate = value;
                        }
                        break;
                    }
                }


                participant     = new Participant();
                participant._Id = Id;
                //participant._PhysicalAddress =

                return(participant);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error Reading Input Excel file");
                throw (ex);
            }
        }
Ejemplo n.º 16
0
        public List <NewCustomer> GetFireHoseCustomersAndTransactions()
        {
            var newCustomers = new List <NewCustomer>();

            string token     = GetToken();
            var    jsonToken = (JObject)JsonConvert.DeserializeObject(token);
            string uri       = string.Empty;
            string method    = "GET";

            var allCustomers = new List <JObject>();

            var bankList = new List <string>();

            bankList.Add("ftg.01.bh.bh");
            bankList.Add("ftg.01.aedu.aedu");
            bankList.Add("ftg.01.eg.eg");
            bankList.Add("ftg.01.jo.jo");
            bankList.Add("ftg.01.sar.sa");
            bankList.Add("ftg.01.uk.uk");


            foreach (var item in bankList)
            {
                uri = "https://finx22openplatform.fintech-galaxy.com/obp/v4.0.0/banks/" + item + "/firehose/customers";
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
                request.Method = method;
                request.Headers.Add("Authorization", "DirectLogin token=\"" + jsonToken["token"] + "\"");
                request.Headers.Add("Cookie", "JSESSIONID=cs78uu0qnltpt49ktpmcneh1");

                string responseFromServer = string.Empty;
                var    deger = string.Empty;

                HttpWebResponse result = new HttpWebResponse();


                result = (HttpWebResponse)request.GetResponse();
                Stream       dataStream = result.GetResponseStream();
                StreamReader reader     = new StreamReader(dataStream);
                responseFromServer = reader.ReadToEnd();
                reader.Close();
                dataStream.Close();
                result.Close();

                deger = responseFromServer;
                allCustomers.Add((JObject)JsonConvert.DeserializeObject(responseFromServer));
            }

            foreach (var item in allCustomers)
            {
                var customers      = item["customers"];
                var customersCount = customers.Count();

                for (int i = 0; i < customersCount; i++)
                {
                    var creditRating = customers[i]["credit_rating"];
                    var creditLimit  = customers[i]["credit_limit"];

                    var newCustomer = new NewCustomer()
                    {
                        BankId           = customers[i]["bank_id"].ToString(),
                        CustomerId       = customers[i]["customer_id"].ToString(),
                        CustomerNumber   = customers[i]["customer_number"].ToString(),
                        DateOfBirth      = customers[i]["date_of_birth"].ToString(),
                        Email            = customers[i]["email"].ToString(),
                        EmploymentStatus = customers[i]["employment_status"].ToString(),
                        HighestEducation = customers[i]["highest_education_attained"].ToString(),
                        PhoneNumber      = customers[i]["mobile_phone_number"].ToString(),
                        RelationStatus   = customers[i]["relationship_status"].ToString(),
                    };

                    var CreditRatings = new CreditRating()
                    {
                        Rating = creditRating["rating"].ToString(),
                        Source = creditRating["source"].ToString(),
                    };

                    newCustomer.CreditRatings.Add(CreditRatings);

                    var CreditLimits = new CreditLimit()
                    {
                        Amount   = decimal.Parse(creditLimit["amount"].ToString()),
                        Currency = creditLimit["currency"].ToString()
                    };
                    newCustomer.CreditLimits.Add(CreditLimits);


                    uri = "https://finx22openplatform.fintech-galaxy.com/obp/v4.0.0/banks/" + newCustomer.BankId + "/firehose/accounts/" + newCustomer.CustomerId + "/views/owner/transactions";
                    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
                    request.Method = method;
                    request.Headers.Add("Authorization", "DirectLogin token=\"" + jsonToken["token"] + "\"");
                    request.Headers.Add("Cookie", "JSESSIONID=cs78uu0qnltpt49ktpmcneh1");

                    string responseFromServer = string.Empty;
                    var    deger = string.Empty;

                    HttpWebResponse result = new HttpWebResponse();
                    result = (HttpWebResponse)request.GetResponse();
                    Stream       dataStream = result.GetResponseStream();
                    StreamReader reader     = new StreamReader(dataStream);
                    responseFromServer = reader.ReadToEnd();
                    reader.Close();
                    dataStream.Close();
                    result.Close();

                    deger = responseFromServer;


                    newCustomers.Add(newCustomer);
                }
            }

            return(newCustomers);
        }