P0_TrevorGraham/StoreApplication/StoreMain/Logic/StoreSession.cs
/// <summary>
/// Adds a customer to the db; returns true if successful, and returns false if username already exists.
/// </summary>
/// <param name="customer"></param>
/// <returns></returns>
Adds a customer to the db; returns true if successful, and returns false if username already exists.
Adds a customer to the db ; returns true if successful and returns false if username already exists .
public bool AddCustomerToDb(string username, string fName, string lName){
            if(AttemptLogin(username)){
                Logout();
                return false;
            }
            Customer newCustomer = new Customer(){
                Username = username,
                Fname = fName,
                LName = lName
            };
            db.Customers.Add(newCustomer);
            db.SaveChanges();
            return true;
        }
public bool AddCustomerToDb ( string username , string fName , string lName ) { if ( AttemptLogin ( username ) ) { Logout ( ) ; return false ; } Customer newCustomer = new Customer ( ) { Username = username , Fname = fName , LName = lName } ; db . Customers . Add ( newCustomer ) ; db . SaveChanges ( ) ; return true ; }
Adds a customer to the db; returns true if successful, and returns false if username already exists.
Adds a customer to the db ; returns true if successful and returns false if username already exists .
//check if username already exists //username already exists //username is not in db, add them!
None
username
string
fName
string
lName
string
customer
None