Exemplo n.º 1
0
        public void button1_Click(object sender, EventArgs e)
        {
            operaciones oper     = new operaciones();
            DataTable   dgvdatos = oper.cosnsultaconresultado("select * from empleado inner join  cargo where empleado_id = '" + txtdgid.Text + "' and Empleado_empleado_id = '" + txtdgid.Text + "'");

            foreach (DataRow dr in dgvdatos.Rows)

            {
                string nombre, apellido, sexo, cargo, fecha_nac, fecha_ingre, salario;
                nombre = dr["nombre"].ToString();
                txtdatosnombre.Text = nombre;
                apellido            = dr["apellido"].ToString();
                txtapellidod.Text   = apellido;
                sexo            = dr["sexo"].ToString();
                txtsexo.Text    = sexo;
                fecha_nac       = dr["fecha_naci"].ToString();
                txtnaci.Text    = fecha_nac;
                fecha_ingre     = dr["fecha_ingr"].ToString();
                txtingre.Text   = fecha_ingre;
                salario         = dr["sueldo"].ToString();
                txtsalario.Text = salario;
                cargo           = dr["cargo"].ToString();
                txtcargo.Text   = cargo;

                try
                {
                    pictureBox1.Image = Image.FromFile(@"C:\bdd\" + txtapellidod.Text + ".jpg");
                }

                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Exemplo n.º 2
0
        private void btnbuscarcn_Click(object sender, EventArgs e)
        {
            operaciones oper     = new operaciones();
            DataTable   dgvdatos = oper.cosnsultaconresultado("select * from detalle_nomina inner join cabecera_nomina,cargo where detalle_id = '" + txtidcn.Text + "' and nomina_id = '" + txtidcn.Text + "' and cargo_id = '" + txtidcn.Text + "' ");

            foreach (DataRow dr in dgvdatos.Rows)
            {
                string idnomina, isr, tnomina, fecha_i, fecha_f, isrc, ddss, s_neto, t_otros, t_dedu, sueld, empl_id;
                idnomina        = dr["nomina_id"].ToString();
                txtidn.Text     = idnomina;
                isr             = dr["nombre_empresa"].ToString();
                txtnomemp.Text  = isr;
                tnomina         = dr["tipo_nomina"].ToString();
                txtipo.Text     = tnomina;
                fecha_i         = dr["fecha_inicio"].ToString();
                txtfini.Text    = fecha_i;
                fecha_f         = dr["fecha_final"].ToString();
                txtffinal.Text  = fecha_f;
                isrc            = dr["i_s_r"].ToString();
                txtisr.Text     = isrc;
                ddss            = dr["deduccion_ss"].ToString();
                txtdss.Text     = ddss;
                s_neto          = dr["sueldo_neto"].ToString();
                txtsneto.Text   = s_neto;
                t_otros         = dr["otros"].ToString();
                txtotros.Text   = t_otros;
                t_dedu          = dr["total_deduc"].ToString();
                txttdeducc.Text = t_dedu;
                sueld           = dr["sueldo"].ToString();
                txtsueldo.Text  = sueld;
                empl_id         = dr["Empleado_empleado_id"].ToString();
                txtidempc.Text  = empl_id;
            }
        }
Exemplo n.º 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (cmbtablas.Text == "Empleado")
            {
                operaciones oper = new operaciones();
                dgvdatos.DataSource = oper.cosnsultaconresultado("select * from  empleado ");
            }

            else if (cmbtablas.Text == "Cargo")
            {
                operaciones oper = new operaciones();
                dgvdatos.DataSource = oper.cosnsultaconresultado("select * from  cargo ");
            }

            else if (cmbtablas.Text == "Detalles Nomina")
            {
                operaciones oper = new operaciones();
                dgvdatos.DataSource = oper.cosnsultaconresultado("select * from  detalle_nomina ");
            }

            else if (cmbtablas.Text == "Cabecera Nomina")
            {
                operaciones oper = new operaciones();
                dgvdatos.DataSource = oper.cosnsultaconresultado("select * from  cabecera_nomina ");
            }
        }
Exemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            operaciones oper      = new operaciones();
            string      resultado = oper.conectar();

            MessageBox.Show(resultado);
        }
Exemplo n.º 5
0
        private void btnguardar_Click(object sender, EventArgs e)
        {
            string      i    = txtfini.Text;
            string      f    = txtffinal.Text;
            DateTime    x    = Convert.ToDateTime(i);
            DateTime    y    = Convert.ToDateTime(f);
            operaciones oper = new operaciones();

            oper.consultasinreaultado("insert into cabecera_nomina(nomina_id,nombre_empresa,tipo_nomina,fecha_inicio,fecha_final) values('" + txtnid.Text + "','" + txtnombreemp.Text + "','" + txttipono.Text + "','" + txtfini + "','" + txtffinal + "')");
        }
Exemplo n.º 6
0
        private void btnimp_Click(object sender, EventArgs e)
        {
            if (cmbtablas.Text == "Empleado")
            {
                operaciones oper = new operaciones();
                DataSet     ds   = new DataSet();

                DataTable dt = oper.cosnsultaconresultado(" SELECT * FROM empleado");
                ds.Tables.Add(dt);

                ds.WriteXml(@"C:\bdd\empleado.xml");

                frm_visor f = new frm_visor("visorempl.rpt");
                f.Show();
            }

            else if (cmbtablas.Text == "Detalles Nomina")
            {
                operaciones oper = new operaciones();
                DataSet     ds   = new DataSet();

                DataTable dt = oper.cosnsultaconresultado(" SELECT * FROM detalle_nomina");
                ds.Tables.Add(dt);

                ds.WriteXml(@"C:\bdd\nomina.xml");

                frm_visor f = new frm_visor("visordn.rpt");
                f.Show();
            }

            else if (cmbtablas.Text == "Cargo")
            {
                operaciones oper = new operaciones();
                DataSet     ds   = new DataSet();

                DataTable dt = oper.cosnsultaconresultado(" SELECT * FROM cargo");
                ds.Tables.Add(dt);

                ds.WriteXml(@"C:\bdd\Cargo.xml");

                frm_visor f = new frm_visor("visorcar.rpt");
                f.Show();
            }
        }
Exemplo n.º 7
0
        private void btnbuscar_Click(object sender, EventArgs e)
        {
            try
            {
                if (rdbid.Checked == true)
                {
                    operaciones oper = new operaciones();
                    dgvdatos.DataSource = oper.cosnsultaconresultado("select " + txtcondiocional.Text + "  from  empleado where empleado_id = '" + txtbuscar.Text + "'");
                }

                else if (rdbnombre.Checked == true)
                {
                    operaciones oper = new operaciones();
                    dgvdatos.DataSource = oper.cosnsultaconresultado("select " + txtcondiocional.Text + "  from  empleado where nombre = '" + txtbuscar.Text + "'");
                }
                else if (rdbapellido.Checked == true)
                {
                    operaciones oper = new operaciones();
                    dgvdatos.DataSource = oper.cosnsultaconresultado("select " + txtcondiocional.Text + "  from  empleado where apellido = '" + txtbuscar.Text + "'");
                }

                else if (rdbcedula.Checked == true)
                {
                    operaciones oper = new operaciones();
                    dgvdatos.DataSource = oper.cosnsultaconresultado("select " + txtcondiocional.Text + "  from  empleado where cedula = '" + txtbuscar.Text + "'");
                }

                else if (rdbsexo.Checked == true)
                {
                    operaciones oper = new operaciones();
                    dgvdatos.DataSource = oper.cosnsultaconresultado("select " + txtcondiocional.Text + "  from  empleado where sexo = '" + txtbuscar.Text + "'");
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 8
0
 private void btnguardar_Click(object sender, EventArgs e)
 {
     try
     {
         if (string.IsNullOrEmpty(txtape.Text))
         {
             MessageBox.Show("Favor ingrese el Apellido del ampleado antes!");
         }
         else
         {
             string start = Convert.ToString(txtfoto.Text);
             string end   = @"C:\bdd\" + txtape.Text + ".jpg";
             File.Copy(start, end);
         }
         string      photo = txtape.Text;
         operaciones oper  = new operaciones();
         oper.consultasinreaultado("insert into empleado(nombre,apellido,cedula,sexo,fecha_naci,fecha_ingr,foto) values('" + txtnom.Text + "','" + txtape.Text + "','" + txtcedula.Text + "','" + texsex.Text + "','" + txtnacimiento.Text + "','" + txtingreso.Text + "','" + photo + "')");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 9
0
        private void btnguardcargo_Click(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();

            oper.consultasinreaultado("insert into cargo(cargo,sueldo,Empleado_empleado_id) values('" + txtcargo.Text + "','" + txtsueldo.Text + "','" + txtidemplecargo.Text + "')");
        }
Exemplo n.º 10
0
        private void btnguarnomina_Click(object sender, EventArgs e)
        {
            operaciones oper = new operaciones();

            oper.consultasinreaultado("insert into detalle_nomina(i_s_r,deduccion_ss,otros,total_deduc,sueldo_neto,fecha,Empleado_empleado_id) values('" + txtisr.Text + "','" + txtdeducionss.Text + "','" + txtotros.Text + "','" + txtdeducciontt.Text + "','" + txtsueldoneto.Text + "','" + txtfechanomina.Text + "','" + txtidempleadonomina.Text + "')");
        }