protected void Page_Load(object sender, EventArgs e)
        {
            if (Convert.ToInt32(Application["Status"]) == 2)
            {
                Response.Redirect("~/Maintenance.html");
            }

            int UserId = 0;

            if (Session["UserId"] != null)
            {
                Response.Redirect("~/Done/Welcome");
            }
            if (Request.Cookies["VC"] != null)
            {
                string VC = Request.Cookies["VC"].Values["VC"];
                Classes.LoginSession ls = new Classes.LoginSession();
                UserId = ls.getUserId(VC);
                if (UserId != 0)
                {
                    Response.Redirect("~/Done/Welcome");
                }
            }

            if (!IsPostBack)
            {
                switch (Page.RouteData.Values["Mode"].ToString())
                {
                case "Request":
                {
                    PanelRequest.Visible = true;
                    break;
                }

                case "Recover":
                {
                    Classes.ForgotPassword fp = new Classes.ForgotPassword();
                    string email = fp.recoverEmailGet(Page.RouteData.Values["VCode"].ToString());

                    if (email == "")
                    {
                        Response.Redirect("~/Error/PRequestNotFound");
                    }
                    else
                    {
                        LabelRecoverEmail.Text = email;
                        PanelRecover.Visible   = true;
                    }
                    break;
                }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Convert.ToInt32(Application["Status"]) == 2) Response.Redirect("~/Maintenance.html");

            int UserId = 0;
            if (Session["UserId"] != null)
            {
                Response.Redirect("~/Done/Welcome");
            }
            if (Request.Cookies["VC"] != null)
            {
                string VC = Request.Cookies["VC"].Values["VC"];
                Classes.LoginSession ls = new Classes.LoginSession();
                UserId = ls.getUserId(VC);
                if (UserId != 0)
                {
                    Response.Redirect("~/Done/Welcome");
                }
            }

            if (!IsPostBack)
            {
                switch (Page.RouteData.Values["Mode"].ToString())
                {
                    case "Request":
                        {
                            PanelRequest.Visible = true;
                            break;
                        }
                    case "Recover":
                        {
                            Classes.ForgotPassword fp = new Classes.ForgotPassword();
                            string email = fp.recoverEmailGet(Page.RouteData.Values["VCode"].ToString());

                            if (email == "")
                            {
                                Response.Redirect("~/Error/PRequestNotFound");
                            }
                            else
                            {
                                LabelRecoverEmail.Text = email;
                                PanelRecover.Visible = true;
                            }
                            break;
                        }
                }
            }
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["VC"] != null)
            {
                string VC = Request.Cookies["VC"].Values["VC"];
                Classes.LoginSession ls = new Classes.LoginSession();
                int UserId = ls.getUserId(VC);
                if (UserId != 0)
                {
                    Response.Redirect("~/Home");
                }
            }

            switch (Page.RouteData.Values["Mode"].ToString())
            {
            case "Request":
            {
                PanelRequest.Visible = true;
                break;
            }

            case "Recover":
            {
                Classes.ForgotPassword fp = new Classes.ForgotPassword();
                string email = fp.recoverEmailGet(Page.RouteData.Values["VCode"].ToString());

                if (email == "")
                {
                    Response.Redirect("~/Error/PRequestNotFound");
                }
                else
                {
                    LabelRecoverEmail.Text = email;
                    PanelRecover.Visible   = true;
                }
                break;
            }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["VC"] != null)
            {
                string VC = Request.Cookies["VC"].Values["VC"];
                Classes.LoginSession ls = new Classes.LoginSession();
                int UserId = ls.getUserId(VC);
                if (UserId != 0)
                {
                    Response.Redirect("~/Home");
                }
            }

            switch (Page.RouteData.Values["Mode"].ToString())
            {
                case "Request":
                    {
                        PanelRequest.Visible = true;
                        break;
                    }
                case "Recover":
                    {
                        Classes.ForgotPassword fp = new Classes.ForgotPassword();
                        string email = fp.recoverEmailGet(Page.RouteData.Values["VCode"].ToString());

                        if(email == "")
                        {
                            Response.Redirect("~/Error/PRequestNotFound");
                        }
                        else
                        {
                            LabelRecoverEmail.Text = email;
                            PanelRecover.Visible = true;
                        }
                        break;
                    }
            }
        }