public UserService(ATMDbContext dbContext, IServiceProvider provider) { _dbContext = dbContext; var secureaccessFactory = new SecureAccessFactory(); _encryption = secureaccessFactory.CreateInstance(provider).SecureAccess.GetEncryptionDecryption; }
public AccountResponse CheckBalance(string accountNumber) { AccountResponse response = new AccountResponse(); try { if (accountNumber != null) { using (var db = new ATMDbContext()) { response.Account = db.Accounts.Where(p => p.AccountNumber == accountNumber).First(); return(response); } } response.ErrorCode = 100; response.ErrorMessage = "String is null"; response.IsSuccess = false; return(response); } catch (Exception) { response.IsSuccess = false; response.ErrorCode = 222; response.ErrorMessage = $"An error occurred with account, {accountNumber}"; } return(null); }
public static void ShowPossibilities(Guid id) { int number; ATMDbContext db = new ATMDbContext(); do { Console.WriteLine("1. Show current account status"); Console.WriteLine("2. Withdraw money"); Console.WriteLine("3. Get code for phone"); Console.WriteLine("4. Exit"); number = Convert.ToInt32(Console.ReadLine()); if (number == 1) { Account.ShowStatus(id); } else if (number == 2) { Account.WithdrawMoney(id); } else if (number == 3) { Account.GenerateCode(id); } } while (number != 4); }
//ctores private UnityOfWork() { _Context = new ATMDbContext(); ATMs = new ATMRepository(_Context); Cuentas = new CuentaRepository(_Context); Retiros = new RetiroRepository(_Context); Clientes = new ClienteRepository(_Context); }
public void Setup() { TestObj = new ATMRepository(); Db = new ATMDbContext(); accountCreateDate = DateTime.Now; accountHolder = Faker.Name.FullName(); accountNumber = Faker.Name.First(); currentBalance = 456.77m; }
public ShoppingService(ATMDbContext dbContext, IServiceProvider provider, IConnect connectService, ILogger <ShoppingService> logger) { var secureaccessFactory = new SecureAccessFactory(); authentication = secureaccessFactory.CreateInstance(provider).SecureAccess.GetSecureAccess; _encryption = secureaccessFactory.CreateInstance(provider).SecureAccess.GetEncryptionDecryption; _dbContext = dbContext; _connectService = connectService; _logger = logger; }
public static void CheckPIN(string PIN, int number) { ATMDbContext db = new ATMDbContext(); if (db.Card.Where(c => c.Number == number).FirstOrDefault() != null) { if (db.Card.Where(c => c.Pin == PIN).FirstOrDefault() != null) { var id = db.Card.Where(c => c.Number == number).Select(c => c.Id); foreach (var i in id) { ShowPanel.ShowPossibilities(i); } } } else { Console.WriteLine("Wrong PIN"); ShowPanel.ShowStart(); } }
public SeasonalActivities(ATMDbContext dbContext) { this.dbContext = dbContext; }
public RecommendedActivities(ATMDbContext dbContext) { this.dbcontext = dbContext; }
public ClienteRepository(ATMDbContext context) : base(context) { }
public RecentlyBoughtActivities(ATMDbContext dbContext) { this.dbContext = dbContext; }
//private readonly _2013204637_SLNDbContext _Context; //private ATMRepository() //{ //} public ATMRepository(ATMDbContext context) : base(context) { //_Context = context; }
//private readonly _2013204637_SLNDbContext _Context; public CuentaRepository(ATMDbContext context) : base(context) { // TODO: Complete member initialization //this._Context = context; }
//ATMDbContext dbContext = new ATMDbContext(); public ActivityModule(Func <string, IActivityService> serviceResolver, ATMDbContext dbContext) { _serviceProvider = serviceResolver; this.dbContext = dbContext; }