コード例 #1
0
ファイル: Login.aspx.cs プロジェクト: HenrySD/APP
        protected void btnAcceder_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet1TableAdapters.UsuariosTableAdapter obj = new DataSet1TableAdapters.UsuariosTableAdapter();
                String userPass = obj.login(txtUsuario.Text, txtContra.Text);
                if (userPass != null)
                {
                    if (userPass == obj.login(txtUsuario.Text, txtContra.Text))
                    {
                        Session["Usuario"] = userPass;
                        Response.Redirect("Pages/Home.aspx");
                    }
                    else if (userPass == obj.login(txtUsuario.Text, txtContra.Text))
                    {
                        Session["Usuario1"] = userPass;
                        Response.Redirect("Pages/Cajero.aspx");
                    }
                }

                else
                {
                    Response.Write("<script>alert('Usuario incorrecto')</script>");
                }
            }
            catch
            {
            }
        }
コード例 #2
0
        protected void btnEnviar_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet1TableAdapters.UsuariosTableAdapter obj = new DataSet1TableAdapters.UsuariosTableAdapter();
                //tomando los valores del usuario y pass y mandarlos al dataset
                String usuarioContra = obj.login(txtUsuario.Text, txtContrasena.Text);

                if (usuarioContra != null)
                {
                    Session["usuario"] = usuarioContra;
                    Response.Redirect("verificar.aspx");
                }
            }
            catch
            {
            }
        }