protected void Page_Load(object sender, EventArgs e) { string id = Request.QueryString["id"]; string sid = Request.QueryString["sid"]; if (id != null) { UserContent usercontent = new UserContent(); alamaat_User currentuser = usercontent.GetuserById(id); if (currentuser != null) { if (currentuser.block == false) { currentuser.active = true; if (usercontent.UpdateUser(currentuser)) { lblactivation.Text = "You have successfully activated your account."; } } else { lblactivation.Text = "User account is already activated."; } } } else if (sid != null) { SubscriberContent usercontent = new SubscriberContent(); alamaat_subscriber user = usercontent.Getuserbyid(sid); if (user != null) { if (user.active == false) { user.active = true; if (usercontent.UpdateSubscriber(user)) { lblactivation.Text = "You have successfully verified your email."; } } else { lblactivation.Text = "Email is already verified."; } } } else { Response.Redirect("~/Default.aspx"); } }
protected void SendClick(object sender, CommandEventArgs e) { Guid id = new Guid((e.CommandArgument).ToString()); UserContent uContent = new UserContent(); UserInterface user = uContent.GetuserById(id); if (null != user) { string emailcontent = "Hello " + user.UserName + "," + "<br/><br/><b>Username:</b> " + user.UserName + "<br/><br/>Thank you for registering at Alamaat. Your account is created and must be activated before you can use it." + "<br/>To activate the account click on the following link or copy-paste it in your browser:" + "<br/>www.alamaat.biz/activation.aspx?id=" + user.ID + "<br/>After activation you may login to http://www.alamaat.biz/ using the following username and the password you entered during registration:"; SendEmail(user.Email, "Alamaat Account Details for " + user.UserName, emailcontent); } }