Beispiel #1
0
        protected void Unnamed_Click(object sender, EventArgs e)
        {
            try
            {
                log = new Models.Login(
                    users.Text,
                    pass.Value
                    );

                DataTable dato = null;
                dato = log.consultarLogin(log);


                if (dato.Rows[0] != null)
                {
                    Session["Nombre"] = dato.Rows[0]["userLOGIN"];
                    Session["Rol"]    = dato.Rows[0]["nombreROL"];
                    Response.Redirect("Inicio.aspx");
                }
                else
                {
                    dato = log.ConsultarLoginTecnico(log);
                    if (dato.Rows[0] != null)
                    {
                        Session["Nombre"]   = dato.Rows[0]["nombTECNICO"];
                        Session["Apellido"] = dato.Rows[0]["apelTECNICO"];
                        Session["Rol"]      = dato.Rows[0]["NombreROL"];
                        Response.Redirect("Inicio.aspx");
                    }
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", " swal('usuario no encontrado', '', 'error');", true);
                }
            }
            catch (Exception)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", " swal('CONTRASEÑA INCORRECTA', '', 'error');", true);
            }
        }