public bool customerUpdate() { CUSTOMER_PROFILE updateCustomer = new CUSTOMER_PROFILE(); updateCustomer.CUST_ID = this.CUST_ID; updateCustomer.FIRST_NAME = this.FIRST_NAME; updateCustomer.LAST_NAME = this.LAST_NAME; updateCustomer.GENDER = this.GENDER; updateCustomer.ADDRESS = this.ADDRESS; updateCustomer.PHONE_NO = this.PHONE_NO; updateCustomer.EMAIL = this.EMAIL; updateCustomer.PASSWORD = this.PASSWORD; da = new DataAccess(); return(da.CustomerUpdate(updateCustomer)); }
internal bool CustomerSignUp() { da = new DataAccess(); bool isLoginSuccessful = false; try { CUSTOMER_PROFILE Profile = new CUSTOMER_PROFILE(); Profile.CUST_ID = Guid.NewGuid(); Profile.FIRST_NAME = this.FIRST_NAME; Profile.LAST_NAME = this.LAST_NAME; Profile.GENDER = this.GENDER; Profile.ADDRESS = this.ADDRESS; Profile.EMAIL = this.EMAIL; Profile.PHONE_NO = this.PHONE_NO; Profile.PASSWORD = this.PASSWORD; Profile.CONFIRMPASSWORD = this.CONFIRMPASSWORD; Profile.STATUS = this.STATUS; isLoginSuccessful = da.CustomerSignUp(Profile); if (isLoginSuccessful) { SessionUser user = new SessionUser() { UserID = Profile.CUST_ID, FirstName = Profile.FIRST_NAME, LastName = Profile.LAST_NAME, Email = Profile.EMAIL, PhoneNo = Profile.PHONE_NO, Status = Profile.STATUS }; SessionHandler.User = user; SessionHandler.AddToCookie(user); } } catch { isLoginSuccessful = false; } return(isLoginSuccessful); }
public CUSTOMER_PROFILE CustomerLogin() { da = new DataAccess(); CUSTOMER_PROFILE profile = da.CustomerLogin(this.EMAIL, this.PASSWORD); if (profile != null) { SessionUser user = new SessionUser() { UserID = profile.CUST_ID, FirstName = profile.FIRST_NAME, LastName = profile.LAST_NAME, PhoneNo = profile.PHONE_NO, Email = profile.EMAIL, Status = profile.STATUS }; SessionHandler.User = user; SessionHandler.AddToCookie(user); } return(profile); }