private void CreateNewCustomer() { DB db = new DB(); string sql = "INSERT INTO Customers(first_name,last_name,address1,tel) VALUES ('"+firstName+"','"+lastName+"','"+addressOne+"','"+telephoneNumber+"') "; this.custid = db.Insert(sql); CreateNewCustomerAccount(); }
private void CreateChecking() { double depositAmt; Console.WriteLine("How much would you like to start your opening deposit? The minimum opening deposit is $50.00..."); depositAmt = Double.Parse(Console.ReadLine()); DB db = new DB(); string sql = "INSERT INTO Checking(account_id,customer_id,account_balance) VALUES ('" + acctid + "','" + custid + "','" + depositAmt + "') "; db.Insert(sql); }
private void CreateNewCustomerAccount() { string accountOptions; Random rng = new Random(); string acctNum =""; int count = 0; while (count != 16) { acctNum = acctNum + rng.Next(1, 9).ToString(); count+=1; } DB db = new DB(); string sql; sql = "INSERT INTO Accounts(account_num,account_pin) VALUES ('" + acctNum + "', null) "; this.acctid = db.Insert(sql); sql = null; sql = "UPDATE Customers SET account_id = '"+acctid+"' WHERE customer_id = '"+custid+"' "; db.Update(sql); Console.WriteLine("Your account has successfully been created, would you like to create a checking or savings account or both today?"); accountOptions = Console.ReadLine(); accountOptions.ToUpper(); accountOptions = CustomerInput(accountOptions); if (accountOptions == "CHECKING" || accountOptions == "C") { CreateChecking(); } else if(accountOptions == "SAVINGS" || accountOptions == "S") { CreateSavings(); } else { Console.WriteLine("Ok we will open your checking account first and then we will open your savings account"); CreateChecking(); CreateSavings(); } }