Example #1
0
        /// <summary>
        /// For Acctivate User Account
        /// </summary>

        private void Acctivation()
        {
            try
            {
                RijndaelEncryption decreption    = new RijndaelEncryption();
                string             encryptionKey = ConfigurationManager.AppSettings["EncryptionKey"];
                string             userId        = decreption.DecryptText((Request.QueryString["e"].ToString()), encryptionKey);
                string             accountNumber = decreption.DecryptText((Request.QueryString["a"].ToString()), encryptionKey);

                if (string.IsNullOrEmpty(userId))
                {
                    return;
                }

                //string accountNumber = Request.Form["AccountNumber"].ToString();
                //SqlConnection sconAcctivation = DatabaseConnection.GetConnection();
                CommonFunction cmAcctivation    = new CommonFunction();
                string         acctivationQuery = "update ApplicationUser set IsRegistered='true' where(UserID='" + userId + " ' and AccountNumber='" + accountNumber + "' )";
                //SqlCommand cmdAcctivation = new SqlCommand(acctivationQuery, sconAcctivation);
                //cmdAcctivation.ExecuteNonQuery();
                //sconAcctivation.Close();
                cmAcctivation.InsertQuery(acctivationQuery);
                if (userId != null)
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "Alert", "<script type='text/javascript'>alert('Your Account Has Been Acctivated, Please Login');window.location='LoginPage.aspx';</script>'");
                }
            }
            catch (Exception)
            {
                Exception ex;
            }
        }
Example #2
0
        /// <summary>
        /// For Acctivate User Account
        /// </summary>
        private void Acctivation()
        {
            try
            {
                RijndaelEncryption decreption    = new RijndaelEncryption();
                string             encryptionKey = ConfigurationManager.AppSettings["EncryptionKey"];
                string             userId        = decreption.DecryptText((Request.QueryString["e"].ToString()), encryptionKey);
                string             accountNumber = decreption.DecryptText((Request.QueryString["a"].ToString()), encryptionKey);

                if (string.IsNullOrEmpty(userId))
                {
                    return;
                }

                //string accountNumber = Request.Form["AccountNumber"].ToString();
                //SqlConnection sconAcctivation = DatabaseConnection.GetConnection();
                CommonFunction cmAcctivation    = new CommonFunction();
                string         acctivationQuery = "update ApplicationUser set IsRegistered='true',Status='Active' where(UserID='" + userId + " ' and AccountNumber='" + accountNumber + "' )";
                //SqlCommand cmdAcctivation = new SqlCommand(acctivationQuery, sconAcctivation);
                //cmdAcctivation.ExecuteNonQuery();
                //sconAcctivation.Close();
                cmAcctivation.InsertQuery(acctivationQuery);
                if (userId != null)
                {
                    //ClientScript.RegisterStartupScript(this.GetType(), "Alert", "<script type='text/javascript'>alert('Your Account Has Been Acctivated, Please Login');window.location='default.aspx';</script>'");
                    pnlMessage.Visible  = true;
                    lblShowMessage.Text = "Your account has been acctivated. Please login";
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("LoginErrorPage.aspx?ex=" + Server.UrlEncode(ex.Message) + "&st=" + Server.UrlEncode(ex.StackTrace));
            }
        }