Пример #1
0
        protected void LogIn(object sender, EventArgs e)
        {
            if (UserName.Text != "" && Password.Text != "")
            {
                try
                {
                    int  idU        = proxy.obtenerIDUS(UserName.Text);
                    bool suspension = proxy.VERIFICARSANCION(idU);
                    if (suspension == false)
                    {
                        if (proxy.IniciarSesion(UserName.Text, Password.Text) == true)
                        {
                            Session["NombreUsuario"] = UserName.Text;
                            Response.Write("<script language=javascript>");
                            Response.Write("alert('Se inició sesión')");
                            Response.Write("</script>");

                            if (UserName.Text == "admin" && Password.Text == "soft123warlock")
                            {
                                Response.Redirect("/IniciadaAdministrador.aspx");
                            }
                            else
                            {
                                Response.Redirect("/IniciadaNormal.aspx");
                            }
                        }
                        else
                        {
                            Response.Write("<script language=javascript>");
                            Response.Write("alert('Datos Incorrectos')");
                            Response.Write("</script>");
                        }
                    }
                    else
                    {
                        Response.Write("<script language=javascript>");
                        Response.Write("alert('Esta cuenta a sido suspendida por contenido indebido')");
                        Response.Write("</script>");
                    }
                }
                catch (Exception exx)
                {
                    Response.Write("Error: " + exx);
                }
            }
            else
            {
                Response.Write("<script language=javascript>");
                Response.Write("alert('Llene los campos')");
                Response.Write("</script>");
            }
        }