Exemplo n.º 1
0
 public IndexViewModel()
 {
     this.context          = new BankAppDataContext();
     this.Account_Queries  = new AccountQueriesHandler(context);
     this.Customer_Queries = new CustomerQueriesHandler(context);
     this.TotalCustomers   = Customer_Queries.GetCustomersList().Count;
     this.TotalAccounts    = Account_Queries.GetAllAccounts().Count;
     this.TotalBalance     = Account_Queries.CalculateTotalBalance();
 }
Exemplo n.º 2
0
        public void NewConnectedAccountIsCreated_WhenNewCustomerIsCreated()
        {
            customerCommandHandler.CreateNewCustomer("male", "Alfie", "Meow", "Meow street 4", "Meow city", "12345", "Meowland", "MW", new System.DateTime(2013, 05, 02), "", "", "");
            Customer customer = customerQueriesHandler.GetCustomersList().SingleOrDefault(c => c.Givenname == "Alfie" && c.Surname == "Meow");

            Disposition disposition = dispositionQueriesHandler.GetConnectedDispositions(customer.CustomerId).FirstOrDefault();

            Assert.IsNotNull(disposition);
        }
Exemplo n.º 3
0
        public ActionResult /*<Domain.Customer>*/ GetCustomerProfile()
        {
            var idClaim   = User.Claims.FirstOrDefault(x => x.Type.Equals("id", StringComparison.InvariantCultureIgnoreCase));
            var customers = customerQueriesHandler.GetCustomersList();
            var customer  = customers.FirstOrDefault(c => c.Emailaddress == idClaim.Value);

            if (idClaim != null)
            {
                return(Ok(customer));
            }
            return(BadRequest("No claim"));
        }