示例#1
0
        public UsuarioUser buscarUsuario(string cedula)
        {
            UsuarioUser usuario = null;

            try
            {
                oracle.getSetComando             = new OracleCommand("GESTION_USUARIOS.BUSCAR_USUARIO", oracle.getSetConeccion);
                oracle.getSetComando.CommandType = CommandType.StoredProcedure;
                oracle.getSetComando.Parameters.Add("CEDULA", OracleDbType.Varchar2, cedula, ParameterDirection.Input);
                oracle.getSetComando.Parameters.Add("VARIABLE_CURSOR", OracleDbType.RefCursor, ParameterDirection.Output);
                oracle.getSetLeer = oracle.getSetComando.ExecuteReader();

                while (oracle.getSetLeer.Read())
                {
                    int    idusuario = Convert.ToInt32(oracle.getSetLeer.GetValue(0));
                    string rol       = oracle.getSetLeer.GetValue(1).ToString();
                    string categoria = oracle.getSetLeer.GetValue(2).ToString();
                    string nombre    = oracle.getSetLeer.GetValue(3).ToString();
                    cedula = oracle.getSetLeer.GetValue(4).ToString();
                    string correo         = oracle.getSetLeer.GetValue(5).ToString();
                    string activo         = oracle.getSetLeer.GetValue(6).ToString();
                    int    incumplimiento = Convert.ToInt32(oracle.getSetLeer.GetValue(7));
                    usuario = new UsuarioUser(idusuario, rol, categoria, nombre, cedula, correo, activo, incumplimiento);
                    return(usuario);
                }
                return(usuario);
            }
            catch
            {
                return(usuario);
            }
        }
示例#2
0
        public List <UsuarioUser> mostrarUsuarios()
        {
            List <UsuarioUser> usuarios = new List <UsuarioUser>();

            try
            {
                oracle.getSetComando             = new OracleCommand("GESTION_USUARIOS.MOSTRAR_USUARIOS", oracle.getSetConeccion);
                oracle.getSetComando.CommandType = CommandType.StoredProcedure;
                oracle.getSetComando.Parameters.Add("VARIABLE_CURSOR", OracleDbType.RefCursor, ParameterDirection.Output);
                //oracle.getSetComando.ExecuteNonQuery();
                oracle.getSetLeer = oracle.getSetComando.ExecuteReader();

                while (oracle.getSetLeer.Read())
                {
                    int         idusuario      = Convert.ToInt32(oracle.getSetLeer.GetValue(0));
                    string      rol            = oracle.getSetLeer.GetValue(1).ToString();
                    string      categoria      = oracle.getSetLeer.GetValue(2).ToString();
                    string      nombre         = oracle.getSetLeer.GetValue(3).ToString();
                    string      cedula         = oracle.getSetLeer.GetValue(4).ToString();
                    string      correo         = oracle.getSetLeer.GetValue(5).ToString();
                    string      activo         = oracle.getSetLeer.GetValue(6).ToString();
                    int         incumplimiento = Convert.ToInt32(oracle.getSetLeer.GetValue(7));
                    UsuarioUser u = new UsuarioUser(idusuario, rol, categoria, nombre, cedula, correo, activo, incumplimiento);
                    usuarios.Add(u);
                }
                return(usuarios);
            }
            catch
            {
                return(usuarios);
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string      cedula  = TextBox1.Text;
            UsuarioUser usuario = Default.controladora.buscarUsuario(cedula);

            TextBox2.Text = usuario.getSetRol;
            TextBox3.Text = usuario.getSetCategoria;
            TextBox4.Text = usuario.getSetNombre;
            TextBox5.Text = usuario.getSetCedula;
            TextBox6.Text = usuario.getSetCorreo;
            TextBox7.Text = usuario.getSetIncumplimiento.ToString();
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            Default.controladora.getSetCedula = TextBox1.Text;
            UsuarioUser   i   = Default.controladora.buscarUsuario(Default.controladora.getSetCedula);
            HtmlTableRow  tr  = new HtmlTableRow();
            HtmlTableCell td1 = new HtmlTableCell();

            td1.InnerText = i.getSetIdusuario.ToString();
            HtmlTableCell td2 = new HtmlTableCell();

            td2.InnerText = i.getSetRol;
            HtmlTableCell td3 = new HtmlTableCell();

            td3.InnerText = i.getSetCategoria;
            HtmlTableCell td4 = new HtmlTableCell();

            td4.InnerText = i.getSetNombre;
            HtmlTableCell td5 = new HtmlTableCell();

            td5.InnerText = i.getSetCedula;
            HtmlTableCell td6 = new HtmlTableCell();

            td6.InnerText = i.getSetCorreo;
            HtmlTableCell td7 = new HtmlTableCell();

            td7.InnerText = i.getSetActivo;
            HtmlTableCell td8 = new HtmlTableCell();

            td8.InnerText = i.getSetIncumplimiento.ToString();
            tr.Controls.Add(td1);
            tr.Controls.Add(td2);
            tr.Controls.Add(td3);
            tr.Controls.Add(td4);
            tr.Controls.Add(td5);
            tr.Controls.Add(td6);
            tr.Controls.Add(td7);
            tr.Controls.Add(td8);
            tabla1.Controls.Add(tr);
        }