} // CheckAvailableFunds private void ProcessRow(SafeReader sr) { RowType nRowType; string sRowType = sr["RowType"]; if (!Enum.TryParse(sRowType, out nRowType)) { Log.Alert("Unsupported row type encountered: '{0}'.", sRowType); return; } // if switch (nRowType) { case RowType.MetaData: sr.Fill(MetaData); break; case RowType.LatePayment: LatePayments.Add(sr.Fill <Payment>()); break; case RowType.Marketplace: NewMarketplaces.Add(sr.Fill <Marketplace>()); break; default: throw new ArgumentOutOfRangeException(); } // switch } // ProcessRow
} // SetTurnoverData private void PartialInit( DateTime oDataAsOf, Configuration oCfg, Arguments oArgs, MetaData oMetaData, IEnumerable <Payment> oPayments, List <Name> oDirectorNames, IEnumerable <NameForComparison> oHmrcBusinessNames ) { SetDataAsOf(oDataAsOf); SetConfiguration(oCfg); this.m_oArguments = oArgs; SetMetaData(oMetaData); if (oPayments != null) { LatePayments.AddRange(oPayments); } SetDirectorNames(oDirectorNames); SetHmrcBusinessNames(oHmrcBusinessNames); } // PartialInit
protected virtual void GatherData() { Cfg.Load(); DB.ForEachRowSafe( ProcessRow, "LoadAutoReapprovalData", CommandSpecies.StoredProcedure, new QueryParameter("CustomerID", Args.CustomerID), new QueryParameter("Now", Now) ); GatherAvailableFunds(); MetaData.Validate(); Trail.MyInputData.Init(Now, null); Trail.MyInputData.ReApproveAmount = MetaData.ApprovedAmount; Trail.MyInputData.FraudStatus = MetaData.FraudStatus; Trail.MyInputData.ManualApproveDate = MetaData.LacrTime; Trail.MyInputData.WasLate = MetaData.LateLoanCount > 0; Trail.MyInputData.WasRejected = MetaData.RejectAfterLacrID > 0; Trail.MyInputData.NumOutstandingLoans = MetaData.OpenLoanCount; Trail.MyInputData.HasLoanCharges = MetaData.SumOfCharges > 0.00000001m; Trail.MyInputData.LacrID = MetaData.LacrID; Trail.MyInputData.MaxLateDays = LatePayments.Count < 1 ? 0 : LatePayments.Select(lp => lp.Delay).Max(); Trail.MyInputData.NewDataSourceAdded = NewMarketplaces.Count > 0; Trail.MyInputData.AvaliableFunds = Funds.Available - Funds.Reserved; Trail.MyInputData.AutoReApproveMaxLacrAge = Cfg.MaxLacrAge; Trail.MyInputData.AutoReApproveMaxLatePayment = Cfg.MaxLatePayment; Trail.MyInputData.AutoReApproveMaxNumOfOutstandingLoans = Cfg.MaxNumOfOutstandingLoans; Trail.MyInputData.MinLoan = ConfigManager.CurrentValues.Instance.MinLoan; Output = new AutoReapprovalOutput { AppValidFor = Now.AddHours(MetaData.OfferLength), IsEmailSendingBanned = MetaData.IsEmailSendingBanned, LastApprovedCashRequestID = MetaData.LacrID, }; } // GatherData
} // constructor public void AddLatePayment(Payment oPayment) { LatePayments.Add(oPayment); } // AddLatePayment