} // constructor public ReApprovalInputData GetInputData() { DbHelper dbHelper = new DbHelper(this.m_oDB, this.m_oLog); AutoReApprovalInputDataModelDb dbData = dbHelper.GetAutoReApprovalInputData(this.CustomerId); AvailableFunds availableFunds = dbHelper.GetAvailableFunds(); var model = new ReApprovalInputData { AutoReApproveMaxLacrAge = dbData.AutoReApproveMaxLacrAge, AutoReApproveMaxLatePayment = dbData.AutoReApproveMaxLatePayment, AutoReApproveMaxNumOfOutstandingLoans = dbData.AutoReApproveMaxNumOfOutstandingLoans, AvaliableFunds = availableFunds.Available - availableFunds.Reserved, HasLoanCharges = dbData.HasLoanCharges, FraudStatus = (FraudStatus)dbData.FraudStatus, ManualApproveDate = dbData.ManualApproveDate, MaxLateDays = dbData.MaxLateDays, NewDataSourceAdded = dbData.NewDataSourceAdded, NumOutstandingLoans = dbData.NumOutstandingLoans, ReApproveAmount = dbData.ApprovedAmount - dbData.TookLoanAmount + dbData.RepaidPrincipal, WasLate = dbData.WasLate, WasRejected = dbData.WasRejected, MinLoan = dbData.MinLoan, LacrID = dbData.LacrID, }; this.m_oLog.Debug( "AutoReApprovalInputDataModelDb: {0}, {1}, {2}, {3}", dbData.ApprovedAmount, dbData.TookLoanAmount, dbData.RepaidPrincipal, dbData.SetupFee ); this.m_oLog.Debug("ReApprovalInputData = {0}", model.Serialize()); return(model); } // GetInputData
} // constructor public virtual Agent Init() { Now = DateTime.UtcNow; MetaData = new MetaData(); LatePayments = new List <Payment>(); NewMarketplaces = new List <Marketplace>(); ApprovedAmount = 0; Trail = new ReapprovalTrail( Args.CustomerID, Args.CashRequestID, Args.NLCashRequestID, Log, CurrentValues.Instance.AutomationExplanationMailReciever, CurrentValues.Instance.MailSenderEmail, CurrentValues.Instance.MailSenderName ); Trail.SetTag(this.tag); Funds = new AvailableFunds(); Cfg = InitCfg(); return(this); } // Init
public AvailableFunds GetAvailableFunds() { var availableFunds = new AvailableFunds(); _db.GetFirst("GetAvailableFunds", CommandSpecies.StoredProcedure) .Fill(availableFunds); return(availableFunds); }
private void InvestorCommitment_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == "PeFundId") { PeFund fund = AvailableFunds.FirstOrDefault(f => f.Id == InvestorCommitment.PeFundId); if (fund != null) { InvestorCommitment.PeFund = fund; RaisePropertyChanged("PeFund"); } } }
/// <summary> /// Returns true if CurrencyPortfolio instances are equal /// </summary> /// <param name="other">Instance of CurrencyPortfolio to be compared</param> /// <returns>Boolean</returns> public bool Equals(CurrencyPortfolio other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( MaintenanceMargin == other.MaintenanceMargin || MaintenanceMargin != null && MaintenanceMargin.Equals(other.MaintenanceMargin) ) && ( AvailableWithdrawalFunds == other.AvailableWithdrawalFunds || AvailableWithdrawalFunds != null && AvailableWithdrawalFunds.Equals(other.AvailableWithdrawalFunds) ) && ( InitialMargin == other.InitialMargin || InitialMargin != null && InitialMargin.Equals(other.InitialMargin) ) && ( AvailableFunds == other.AvailableFunds || AvailableFunds != null && AvailableFunds.Equals(other.AvailableFunds) ) && ( Currency == other.Currency || Currency.Equals(other.Currency) ) && ( MarginBalance == other.MarginBalance || MarginBalance != null && MarginBalance.Equals(other.MarginBalance) ) && ( Equity == other.Equity || Equity != null && Equity.Equals(other.Equity) ) && ( Balance == other.Balance || Balance != null && Balance.Equals(other.Balance) )); }
//public void SmaSmallUpdateEventHandler(object sender, EventArgs args) //{ // //var currentSmaData = (MAUpdateEventArgs)args; // //decimal newSmaPrice = currentSmaData.CurrentMAPrice; // ////MessageBox.Show("handling sma update"); // //sharedCurrentLargeSmaPrice = currentSmaData.CurrentMAPrice; // ////var x = this.Dispatcher.Invoke(() => chkUseSd.IsChecked); // ////if (x == true) // ////{ // //// //LTCManager.UpdateBuySellBuffer(currentSmaData.CurrentSd); // //// bool isUseInvers = (bool)Dispatcher.Invoke(() => chkUseInverse.IsChecked); // //// LTCManager.UpdateBuySellBuffer(currentSmaData.CiBuffer, isUseInvers); //use the 95% confidence interval buffer // ////} // //this.Dispatcher.Invoke(() => // //{ // // lblSmaSmall.Content = Math.Round(newSmaPrice, 4); // ////lblUpdatedTime.Content = DateTime.UtcNow.ToLocalTime().ToLongTimeString(); // ////lblSmaValue.Content = "SMA-" + currentSmaData.CurrentSlices.ToString() + " (" + currentSmaData.CurrentTimeInterval.ToString() + " min)"; // // lblSmallSd.Content = Math.Round(currentSmaData.CurrentSd, 4); // // btnUpdateSmallSma.IsEnabled = true; // // //txtPriceBuffer.Text = currentSmaData.CurrentSd.ToString(); // //}); //} public void FundsUpdatedHandler(object sender, EventArgs args) { AvailableFunds af = ((FundsEventArgs)args).AvaFunds; this.Dispatcher.Invoke(() => { lblAvailableProduct.Content = af.AvailableProduct; lblAvailableUSD.Content = af.AvailableDollars; var maxProd = Math.Round(Math.Max(af.AvailableProduct, af.AvailableDollars / Convert.ToDecimal(lblCurPrice.Content)), 4); txtBuySellAmount.Text = maxProd.ToString();//af.AvailableProduct.ToString(); Button_Click_1(null, null); }); }
} // FullInit public void FullInit( DateTime oDataAsOf, Configuration oCfg, Arguments oArgs, MetaData oMetaData, IEnumerable <Payment> oPayments, OriginationTime oOriginationTime, AutoApprovalTurnover oTurnover, AvailableFunds oFunds, List <Name> oDirectorNames, IEnumerable <NameForComparison> oHmrcBusinessNames ) { PartialInit(oDataAsOf, oCfg, oArgs, oMetaData, oPayments, oDirectorNames, oHmrcBusinessNames); SetSeniority(oOriginationTime.Seniority); SetAvailableFunds(oFunds.Available, oFunds.Reserved); SetTurnoverData(oTurnover); } // FullInit
/// <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 (MaintenanceMargin != null) { hashCode = hashCode * 59 + MaintenanceMargin.GetHashCode(); } if (AvailableWithdrawalFunds != null) { hashCode = hashCode * 59 + AvailableWithdrawalFunds.GetHashCode(); } if (InitialMargin != null) { hashCode = hashCode * 59 + InitialMargin.GetHashCode(); } if (AvailableFunds != null) { hashCode = hashCode * 59 + AvailableFunds.GetHashCode(); } hashCode = hashCode * 59 + Currency.GetHashCode(); if (MarginBalance != null) { hashCode = hashCode * 59 + MarginBalance.GetHashCode(); } if (Equity != null) { hashCode = hashCode * 59 + Equity.GetHashCode(); } if (Balance != null) { hashCode = hashCode * 59 + Balance.GetHashCode(); } return(hashCode); } }