コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if ((Request.QueryString["ConfID"] != null))
                {
                    int paramConfID = (Convert.ToInt32(Request.QueryString["ConfID"]));         //ConfID (URL parameter recuperation)
                    dtoAccount = blAccount.GetCustomerByConfID(paramConfID);                    //Admin recuperation

                    if (dtoAccount.GetConfirmationID() == 0)
                    {
                        lblRegistrationResult.Text = "Account already confirmed or ConfID invalid";
                    }
                    else if ((paramConfID == dtoAccount.GetConfirmationID()))        //Test parameterConfID =?= ConfID in DB
                    {
                        if (blAccount.UpdateIsConfirmed(dtoAccount.GetEmail()) == 1) //Update isConfirmed
                        {
                            lblRegistrationResult.Text = " you are well registered";
                        }
                        else
                        {
                            lblRegistrationResult.Text = "Issue during verification";
                        }
                    }
                    else
                    {
                        Response.Redirect(url);
                    }
                }
                else
                {
                    Response.Redirect(url);
                }
            }
        }