private void btnMotivos_Click(object sender, EventArgs e)//llamar al formulario de Motivos
        {
            panel2.Controls.Clear();
            FormMantencionesMotivos MM = new FormMantencionesMotivos();

            label2.Text = ("Mantencion de Motivos");
            MM.TopLevel = false;
            panel2.Controls.Add(MM);
            AbrirSubFormInPanel(MM);
            CDconexion Conm = new CDconexion();

            Ora = Conm.AbrirConexion();
            OracleCommand cmdm = new OracleCommand("SP_CARGAR_MOTIVOS", Ora);

            cmdm.CommandType = System.Data.CommandType.StoredProcedure;
            cmdm.Parameters.Add("registros", OracleType.Cursor).Direction = ParameterDirection.Output;
            OracleDataAdapter odam = new OracleDataAdapter();

            odam.SelectCommand = cmdm;
            DataTable listam = new DataTable();

            odam.Fill(listam);
            MM.dgvMotivos.DataSource = listam;
            Console.WriteLine("Status: " + Conm.CerrarConexion());
        }
        private void btnUnidades_Click_1(object sender, EventArgs e)//llamar al formulario de Unidades
        {
            panel2.Controls.Clear();
            FormMantencionesUnidades MU = new FormMantencionesUnidades();

            label2.Text = ("Mantencion de Unidades");
            MU.TopLevel = false;
            panel2.Controls.Add(MU);
            AbrirSubFormInPanel(MU);
            CDconexion Conu = new CDconexion();

            Ora = Conu.AbrirConexion();
            OracleCommand cmdu = new OracleCommand("SP_CARGAR_UNIDADES", Ora);

            cmdu.CommandType = System.Data.CommandType.StoredProcedure;
            cmdu.Parameters.Add("registros", OracleType.Cursor).Direction = ParameterDirection.Output;
            OracleDataAdapter odau = new OracleDataAdapter();

            odau.SelectCommand = cmdu;
            DataTable listau = new DataTable();

            odau.Fill(listau);
            MU.dgvUnidad.DataSource = listau;
            Console.WriteLine("Status: " + Conu.CerrarConexion());
        }
        //desde aqui hacia abajo, las funciones correctas
        private void btnTipos_Click(object sender, EventArgs e) //llamar al formulario de tipos
        {
            panel2.Controls.Clear();
            FormMantencionesTipos MT = new FormMantencionesTipos();

            label2.Text = ("Mantencion de Tipos");
            MT.TopLevel = false;
            panel2.Controls.Add(MT);
            AbrirSubFormInPanel(MT);
            CDconexion Cont = new CDconexion();

            Ora = Cont.AbrirConexion();
            //OracleCommand cmdt = new OracleCommand("SP_CARGAR_TIPO_PERMISO", Ora);
            OracleCommand cmdt = new OracleCommand("SP_ListarTipoPermiso", Ora);

            cmdt.CommandType = System.Data.CommandType.StoredProcedure;
            cmdt.Parameters.Add("registros", OracleType.Cursor).Direction = ParameterDirection.Output;
            OracleDataAdapter odat = new OracleDataAdapter();

            odat.SelectCommand = cmdt;
            DataTable listat = new DataTable();

            odat.Fill(listat);
            MT.dgvTipos.DataSource = listat;
            Console.WriteLine("Status: " + Cont.CerrarConexion());
        }
Beispiel #4
0
        private void BtnVerificaciones_Click(object sender, EventArgs e) //BOTON VERIFICACIONES
        {
            FormVerificaciones FV = new FormVerificaciones();

            AbrirFormInPanel(FV);
            CDconexion Conn = new CDconexion();

            Ora = Conn.AbrirConexion();
            OracleCommand cmd = new OracleCommand("SP_ListarEstado", Ora);

            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.Parameters.Add("registros", OracleType.Cursor).Direction = ParameterDirection.Output;
            OracleDataAdapter oda = new OracleDataAdapter();

            oda.SelectCommand = cmd;
            DataTable lista = new DataTable();

            oda.Fill(lista);
            FV.dgvverificaciones.DataSource = lista;
            Console.WriteLine("Status: " + Conn.CerrarConexion());
        }
Beispiel #5
0
        private void BtnPermisos_Click(object sender, EventArgs e) //BOTON PERMISOS
        {
            FormPermisosIngresados FPI = new FormPermisosIngresados();

            AbrirFormInPanel(FPI);
            CDconexion Conn = new CDconexion();

            Ora = Conn.AbrirConexion();
            OracleCommand cmd = new OracleCommand("SP_ListarSoliPermiso", Ora);

            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.Parameters.Add("registros", OracleType.Cursor).Direction = ParameterDirection.Output;
            OracleDataAdapter oda = new OracleDataAdapter();

            oda.SelectCommand = cmd;
            DataTable lista = new DataTable();

            oda.Fill(lista);
            FPI.dgvPermisos.DataSource = lista;
            Console.WriteLine("Status: " + Conn.CerrarConexion());
        }
Beispiel #6
0
        private void BtnFuncionarios_Click(object sender, EventArgs e) //BOTON FUNCIONARIO
        {
            FormFuncionarios FF = new FormFuncionarios();

            AbrirFormInPanel(FF); // llamamos al formulario desde el boton funcionarios
            CDconexion Conn = new CDconexion();

            Ora = Conn.AbrirConexion();
            OracleCommand cmd = new OracleCommand("SP_ListarPersonal", Ora);

            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.Parameters.Add("registros", OracleType.Cursor).Direction = ParameterDirection.Output;
            OracleDataAdapter oda = new OracleDataAdapter();

            oda.SelectCommand = cmd;
            DataTable lista = new DataTable();

            oda.Fill(lista);
            FF.DGVListarPersonal.DataSource = lista;
            Console.WriteLine("Status: " + Conn.CerrarConexion());
        }
Beispiel #7
0
        private void BtnDescargas_Click(object sender, EventArgs e) //BOTON DESCARGAS
        // **** falta realizar procedimiento para descargas y aplicarlo aqui ****
        {
            FormDescargas FD = new FormDescargas();

            AbrirFormInPanel(FD);
            CDconexion Conn = new CDconexion();

            Ora = Conn.AbrirConexion();
            OracleCommand cmd = new OracleCommand("SP_ListarEstado", Ora);

            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.Parameters.Add("registros", OracleType.Cursor).Direction = ParameterDirection.Output;
            OracleDataAdapter oda = new OracleDataAdapter();

            oda.SelectCommand = cmd;
            DataTable lista = new DataTable();

            oda.Fill(lista);
            FD.DGVDescargas.DataSource = lista;
            Console.WriteLine("Status: " + Conn.CerrarConexion());
        }
Beispiel #8
0
        private void btnlogin_Click(object sender, EventArgs e)
        {
            CDconexion       Conn = new CDconexion();
            OracleConnection OC   = Conn.AbrirConexion();



            if (Conn.obtenerCodUser(txtuser.Text, txtpass.Text).Equals("1"))
            {
                Console.WriteLine("Objeto Persona:" + Conn.obtenerNombreUser(txtuser.Text));
                MessageBox.Show("Bienvenido Administrador");
                this.Hide();
                Form2 f2 = new Form2();
                f2.ShowDialog();
            }
            else
            {
                MessageBox.Show("Usuario o Clave incorrecta");
                txtuser.Clear();
                txtpass.Clear();
            }
            Console.WriteLine("Estado Conexion: " + Conn.CerrarConexion());
        }