public void ProcessPurchase(Purchase p, Account a, IList <Transaction> tt) { Factory factory = Factory.GetInstance(); IAccountSvc AccountSvc = (IAccountSvc)factory.GetService(typeof(IAccountSvc).Name); ITransactionSvc TransactionSvc = (ITransactionSvc)factory.GetService(typeof(ITransactionSvc).Name); TransactionSvc.ProcessTransaction(p, tt); var entry = from e in a.Entries where e.Currency == p.Currency select e; //Subtract cost if (entry.FirstOrDefault() != null) { entry.FirstOrDefault().Amount -= p.Cost; } //Display message if for some reason we don't have any of the currency else { Console.WriteLine("ERROR: CANNOT EXCHANGE CURRENCY: " + p.Currency); } AccountSvc.GenerateJSON(a); }
public void Clear() { Factory factory = Factory.GetInstance(); IAccountSvc AccountSvc = (IAccountSvc)factory.GetService(typeof(IAccountSvc).Name); Account account = new Account(); AccountSvc.GenerateJSON(account); }
public IList <Transaction> GenerateTList() { Factory factory = Factory.GetInstance(); IAccountSvc AccountSvc = (IAccountSvc)factory.GetService(typeof(IAccountSvc).Name); IList <Transaction> tt = AccountSvc.GenerateTList(); return(tt); }
public Account GenerateAccount() { Factory factory = Factory.GetInstance(); IAccountSvc AccountSvc = (IAccountSvc)factory.GetService(typeof(IAccountSvc).Name); Account account = AccountSvc.GenerateAccount(); return(account); }
public void ProcessExchange(Exchange d, Account a, IList <Transaction> tt) { Factory factory = Factory.GetInstance(); IAccountSvc AccountSvc = (IAccountSvc)factory.GetService(typeof(IAccountSvc).Name); ITransactionSvc TransactionSvc = (ITransactionSvc)factory.GetService(typeof(ITransactionSvc).Name); TransactionSvc.ProcessTransaction(d, tt); var entry = from e in a.Entries where e.Currency == d.OutCurr select e; //Add to the currency if it's already there if (entry.FirstOrDefault() != null) { entry.FirstOrDefault().Amount += d.OutAmt; } //If the currency isn't there yet, we must add it else { CurrEntry c = new CurrEntry(d.OutAmt, d.OutCurr); a.AddCurrency(c); } var entry2 = from e2 in a.Entries where e2.Currency == d.InCurr select e2; if (entry2.FirstOrDefault() != null) { entry2.FirstOrDefault().Amount -= d.InAmt; } //Display message if for some reason we don't have any of the input currency else { Console.WriteLine("ERROR: CANNOT EXCHANGE CURRENCY: " + d.InCurr); } AccountSvc.GenerateJSON(a); }
public void ProcessDeposit(Deposit d, Account a, IList <Transaction> tt) { Factory factory = Factory.GetInstance(); IAccountSvc AccountSvc = (IAccountSvc)factory.GetService(typeof(IAccountSvc).Name); ITransactionSvc TransactionSvc = (ITransactionSvc)factory.GetService(typeof(ITransactionSvc).Name); TransactionSvc.ProcessTransaction(d, tt); var entry = from e in a.Entries where e.Currency == d.Currency select e; //Add to the currency if it's already there if (entry.FirstOrDefault() != null) { entry.FirstOrDefault().Amount += d.Amt; } //If the currency isn't there yet, we must add it else { CurrEntry c = new CurrEntry(d.Amt, d.Currency); a.AddCurrency(c); } AccountSvc.GenerateJSON(a); Console.WriteLine(); Console.WriteLine(d.ToString()); Console.WriteLine(); }
public NewsletterSubscribedConsumer(IAccountSvc svc) { _svc = svc; }
public AccountController(IAccountSvc service) { this.acctService = service; }
public AccountController() { acctService = new AccountSvc(); }
public AccountInfoRequestConsumer(IAccountSvc svc) { _svc = svc; }
public AccountController(IAccountSvc accountSvc) { _accountSvc = accountSvc; }
public AccountController(IComponentContext componentContext, IAccountSvc accountService, IUserSvc userService, IWxSvc wxSvc) { _accountService = accountService; _userService = userService; _wxSvc = wxSvc; }
public AccountController(IAccountSvc accountSvc, ICurrentUser currentUser) { _accountSvc = accountSvc; _currentUser = currentUser; }
public AccountController(IAccountSvc svc, IConfiguration cfg) { this._svc = svc; this.cfg = cfg; }
public AccountPresenter(IAccountSvc _AccountSvc) { AccountSvc = _AccountSvc; }
public AccountController(ILogger logger, IAccountSvc accountSvc) : base(logger) { _accountSvc = accountSvc; }