/// <summary> /// Updates the current profile. /// </summary> /// <returns></returns> public int UpdateCurrentProfile() { Hashtable hshCust = new Hashtable(); int result = -1; try { CustomerData myData = new CustomerData(); hshCust["cid"] = _customerid; hshCust["username"] = _username; hshCust["firstname"] = _firstname; hshCust["lastname"] = _lastname; hshCust["age"] = _age; hshCust["address1"] = _address1; hshCust["city"] = _city; hshCust["mailcode"] = _mailcode; hshCust["region"] = _region; hshCust["email"] = _email; hshCust["country"] = _country; hshCust["creditcardtype"] = _creditcardtype; hshCust["password"] = _password; result = myData.UpdateCurrentProfile(hshCust); } catch (Exception ex) { ErrorRoutine(ex, "Customer", "UpdateCurrentProfile"); } return result; }
/// <summary> /// Registers this instance. /// </summary> public void Register() { Hashtable hshCust = new Hashtable(); try { CustomerData myData = new CustomerData(); hshCust["username"] = _username; hshCust["firstname"] = _firstname; hshCust["lastname"] = _lastname; hshCust["age"] = _age; hshCust["address1"] = _address1; hshCust["city"] = _city; hshCust["mailcode"] = _mailcode; hshCust["region"] = _region; hshCust["email"] = _email; hshCust["country"] = _country; hshCust["creditcardtype"] = _creditcardtype; hshCust["password"] = _password; _customerid = myData.Register(hshCust); } catch (Exception ex) { ErrorRoutine(ex, "Customer", "Register"); } }
/// <summary> /// Gets the names. /// </summary> /// <param name="customerID">The customer ID.</param> public void GetNames(int customerID) { Hashtable hshCust = new Hashtable(); try { CustomerData myData = new CustomerData(); hshCust = myData.GetNames(customerID); _firstname = hshCust["firstname"].ToString(); _lastname = hshCust["lastname"].ToString(); } catch (Exception ex) { ErrorRoutine(ex, "Customer", "GetNames"); } }
// method /// <summary> /// Logins the specified username. /// </summary> /// <param name="username">The username.</param> /// <param name="password">The password.</param> public void Login(string username, string password) { try { CustomerData custData = new CustomerData(); Hashtable hshCustomer = new Hashtable(); hshCustomer["username"] = username.Trim(); hshCustomer["password"] = password.Trim(); _customerid = custData.Login(hshCustomer); } catch (Exception ex) { ErrorRoutine(ex, "Customer", "Login"); } }
/// <summary> /// Gets the current profile. /// </summary> /// <param name="customerID">The customer ID.</param> public void GetCurrentProfile(int customerID) { Hashtable hshCust = new Hashtable(); try { CustomerData myData = new CustomerData(); hshCust = myData.GetCurrentProfile(customerID); _customerid = customerID; _firstname = hshCust["firstname"].ToString(); _lastname = hshCust["lastname"].ToString(); _username = hshCust["username"].ToString(); _age = Convert.ToInt32(hshCust["age"]); _creditcardtype = hshCust["creditcardtype"].ToString(); _country = hshCust["country"].ToString(); _city = hshCust["city"].ToString(); _email = hshCust["email"].ToString(); _region = hshCust["region"].ToString(); _mailcode = hshCust["mailcode"].ToString(); _password = hshCust["password"].ToString(); _address1 = hshCust["address1"].ToString(); } catch (Exception ex) { ErrorRoutine(ex, "Customer", "GetCurrentProfile"); } }