Ejemplo n.º 1
0
        protected override void OnLoad(EventArgs e)
        {
            if (!IsPostBack){

                enterAddress.Visible = true;
                confirmAddress.Visible = false;

                ProcessFlow.AccountController accountController = new ProcessFlow.AccountController();

                AccountInfo myAccount = accountController.GetAccountInfo(true);

                if (myAccount != null){
                    Account account = new Account();
                    billAddr.Address = account.GetAddress(myAccount.UserId);
                }
            }
        }
Ejemplo n.º 2
0
        public bool CreateAccount(AccountInfo newAccountInfo)
        {
            try {
                // Creata a new business logic tier
                Account account = new Account();

                // Call the insert method
                account.Insert(newAccountInfo);

                // Store the data in session state and store the authenticated cookie
                HttpContext.Current.Session[ACCOUNT_KEY] = newAccountInfo;
                FormsAuthentication.SetAuthCookie(newAccountInfo.UserId, false);

                //Finally forward to the welcome page
                HttpContext.Current.Response.Redirect(URL_ACCOUNTCREATE, true);

            }catch {
                return false;
            }

            return true;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// A method to process an updated account
        /// </summary>
        /// <param name="updatedAccountInfo">Updated account information</param>
        public void UpdateAccount(AccountInfo updatedAccountInfo)
        {
            // Create the business logic tier
            Account account = new Account();

            // Call the udpate method
            account.Update(updatedAccountInfo);

            //Store the update info back in session state
            HttpContext.Current.Session[ACCOUNT_KEY] = updatedAccountInfo;

            //Redirect the user to the my account page
            HttpContext.Current.Response.Redirect(URL_ACCOUNTUPDATE, true);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Verify Login process
        /// User passes in a user name and password and will be redirected on if successful
        /// </summary>
        /// <param name="userId">User name the customer is authenticating with</param>
        /// <param name="password">Password the customer is using</param>
        /// <returns>true if the login is successful</returns>
        public bool ProcessLogin(string userId, string password)
        {
            // Use the account business logic layer to login
            Account account = new Account();
            AccountInfo myAccountInfo = account.SignIn(userId, password);

            //If login is successful then store the state in session and redirect
            if (myAccountInfo != null) {
                HttpContext.Current.Session[ACCOUNT_KEY] = myAccountInfo;

                // Determine where to redirect the user back too
                // If they came in from the home page, take them to a similar page
                if (FormsAuthentication.GetRedirectUrl(userId, false).EndsWith(URL_DEFAULT)) {

                    FormsAuthentication.SetAuthCookie(userId, false);
                    HttpContext.Current.Response.Redirect(URL_ACCOUNTSIGNIN, true);

                }else{
                    // Take the customer back to where the came from
                    FormsAuthentication.SetAuthCookie(userId, false);

                    HttpContext.Current.Response.Redirect(FormsAuthentication.GetRedirectUrl(userId, false), true);
                }

                return true;

            }else {
                // Login has failed so return false
                return false;
            }
        }