Esempio n. 1
0
        protected void btnActivatePrem_ServerClick(object sender, EventArgs e)
        {
            UserService.UserCRUDClient service = new UserService.UserCRUDClient();
            service.Open();
            Object[] ds = service.Authenticate(txtEmail.Value, Security.HashPassword(txtUserPass.Value));
            service.Close();
            service = null;

            if (!(ds == null))
            {
                //if (txtEmail.Value.Equals(txtConfirmEmail.Value))
                //{
                UserService.UserCRUDClient UserCRUDService = new UserService.UserCRUDClient();
                UserCRUDService.Open();
                int result = 0;
                result = UserCRUDService.updateUserPremAccess(((UserData)Session["User"]).getID(), Security.HashPassword(txtUserPass.Value), txtEmail.Value, ((UserData)Session["User"]).getCellNumber(), ((UserData)Session["User"]).getDoB(), 1);
                UserCRUDService.Close();
                if (result == 1)
                {
                    Session["User"] = null;
                    changeCard();
                }
                else
                {
                    invalidPremActivation.InnerHtml = "<p>An error occured<br/>Please make sure you enter the correct account information for verification purposes</p>";
                }

                /*}
                 * else
                 * {
                 *  invalidPremActivation.InnerHtml = "<p>Please make sure you confirm your email address</p>";
                 * }*/
            }
            else
            {
                invalidPremActivation.InnerHtml = "<p>Invalid account details<br/>Please make sure you enter your current email address and password</p>";
            }
        }