Ejemplo n.º 1
0
        protected void RegisterButton_Click(object sender, EventArgs e)
        {
            //Goes to Registration Web Service to process registration
           
                registerservice.RegisterWebService obj = new registerservice.RegisterWebService();
                bool register = obj.RegisterUser(usernameText.Text, passwordText.Text,dateofBirth.Text, emailText.Text);
                if (register == true)
                {   
                    emailservice.EmailWebService em = new emailservice.EmailWebService();



                    string id = obj.getUserID(emailText.Text, passwordText.Text);
                    Session["ID"] = id;

                    int intID = int.Parse(id);
                    em.SendActivationEmail(intID, emailText.Text, usernameText.Text);
                    Label1.Text = "Activation email has been sent! Please go to your email account to activate it!";

                }
                else
                {
                    dateofBirth.Text=usernameText.Text = passwordText.Text = emailText.Text = string.Empty;
                    Label1.Text = "Registration failed as either Username or email has already been used! Please Try again!";
                }
            }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {   string activationCode = !string.IsNullOrEmpty(Request.QueryString["ActivationCode"]) ? Request.QueryString["ActivationCode"] : Guid.Empty.ToString();
         
         emailservice.EmailWebService em =new emailservice.EmailWebService();
         bool validated=em.ValidateActivation(activationCode);
         
                     if (validated == true)
                     {
                        lblMessage.Text= "Activation successful. ";
                    
                     }
                     else
                     {
                         lblMessage.Text = "Invalid Activation code.";
                     }
                 }
             }