Пример #1
0
        private void btnSecreto_Click(object sender, EventArgs e)
        {
            DataGridViewRow          row = Tabla.CurrentRow;
            EmpresaCurtidoraDePieles Aux = new EmpresaCurtidoraDePieles();

            if (row != null)
            {
                try
                {
                    txtNombre.Text = Aux.Nombre = Tabla.CurrentRow.Cells[0].Value.ToString();
                    Aux.ID         = int.Parse($"{Tabla.CurrentRow.Cells[1].Value}");
                    Aux.Genero     = $"{Tabla.CurrentRow.Cells[2].Value}";
                    Aux.Sueldo     = int.Parse($"{Tabla.CurrentRow.Cells[3].Value}");
                    Aux.Inicial    = char.Parse($"{Tabla.CurrentRow.Cells[4].Value}");
                    Aux.Fecha      = (DateTime)Tabla.CurrentRow.Cells[5].Value;
                    Aux.Productos  = int.Parse($"{Tabla.CurrentRow.Cells[6].Value}");
                    Aux.Puesto     = Tabla.CurrentRow.Cells[7].Value.ToString();
                    if (Tabla.CurrentRow.Cells[8].Value.ToString() == "Si")
                    {
                        Aux.Seguro = true;
                    }
                    else
                    {
                        Aux.Seguro = false;
                    }
                    Aux.Direccion = Tabla.CurrentRow.Cells[9].Value.ToString();
                }
                catch (Exception)
                {
                    throw new Exception("Error");
                }

                MessageBox.Show($"{listaSimple.ObtenerResultado(Aux)}");
            }
        }
Пример #2
0
        void Llenar()
        {
            DataGridViewRow          row = Tabla.CurrentRow;
            EmpresaCurtidoraDePieles Aux = new EmpresaCurtidoraDePieles();

            if (row != null)
            {
                try
                {
                    txtNombre.Text = Aux.Nombre = Tabla.CurrentRow.Cells[0].Value.ToString();
                    Aux.ID         = int.Parse($"{Tabla.CurrentRow.Cells[1].Value}");
                    Aux.Genero     = $"{Tabla.CurrentRow.Cells[2].Value}";
                    Aux.Sueldo     = int.Parse($"{Tabla.CurrentRow.Cells[3].Value}");
                    Aux.Inicial    = char.Parse($"{Tabla.CurrentRow.Cells[4].Value}");
                    Aux.Fecha      = (DateTime)Tabla.CurrentRow.Cells[5].Value;
                    Aux.Productos  = int.Parse($"{Tabla.CurrentRow.Cells[6].Value}");
                    Aux.Puesto     = Tabla.CurrentRow.Cells[7].Value.ToString();
                    if (Tabla.CurrentRow.Cells[8].Value.ToString() == "Si")
                    {
                        Aux.Seguro = true;
                    }
                    else
                    {
                        Aux.Seguro = false;
                    }
                    Aux.Direccion = Tabla.CurrentRow.Cells[9].Value.ToString();
                }
                catch (Exception)
                {
                    throw new Exception("Error");
                }
            }
        }
Пример #3
0
 private void clickData(object sender, EventArgs e)
 {
     if (chbEvento.Checked)
     {
         DataGridViewRow row = Tabla.CurrentRow;
         if (row != null)
         {
             try
             {
                 EmpresaCurtidoraDePieles Aux = new EmpresaCurtidoraDePieles();
                 txtNombre.Text = Tabla.CurrentRow.Cells[0].Value.ToString();
                 txtID.Text     = Tabla.CurrentRow.Cells[1].Value.ToString();
                 Aux.Genero     = $"{Tabla.CurrentRow.Cells[2].Value}";
                 if (Aux.Genero == "Masculino")
                 {
                     rdbHombre.Checked = true;
                 }
                 else
                 {
                     rdbMujer.Checked = true;
                 }
                 txtSueldo.Text   = Tabla.CurrentRow.Cells[3].Value.ToString();
                 txtInicial.Text  = Tabla.CurrentRow.Cells[4].Value.ToString();
                 dtpFecha.Value   = (DateTime)Tabla.CurrentRow.Cells[5].Value;
                 txtCantidad.Text = Tabla.CurrentRow.Cells[6].Value.ToString();
                 cmbPuesto.Text   = Tabla.CurrentRow.Cells[7].Value.ToString();
                 if (Tabla.CurrentRow.Cells[8].Value.ToString() == "Si")
                 {
                     Aux.Seguro        = true;
                     cbxSeguro.Checked = true;
                 }
                 else
                 {
                     Aux.Seguro        = false;
                     cbxSeguro.Checked = false;
                 }
                 MostrarImagen(Tabla.CurrentRow.Cells[9].Value.ToString());
             }
             catch (Exception)
             {
                 throw new Exception("Error");
             }
         }
         else
         {
             MessageBox.Show("Seleccione un renglon de la tabla");
         }
     }
 }
Пример #4
0
 private void btnCapturar_Click(object sender, EventArgs e)
 {
     try
     {
         Empresa           = new EmpresaCurtidoraDePieles();
         Empresa.Nombre    = txtNombre.Text;
         Empresa.ID        = int.Parse(txtID.Text);
         Empresa.Sueldo    = int.Parse(txtSueldo.Text);
         Empresa.Inicial   = char.Parse(txtInicial.Text);
         Empresa.Productos = int.Parse(txtCantidad.Text);
         Empresa.Puesto    = cmbPuesto.Text;
         Empresa.Seguro    = cbxSeguro.Checked;
         Empresa.Fecha     = dtpFecha.Value;
         if (rdbHombre.Checked)
         {
             Empresa.Genero = "Masculino";
         }
         else
         {
             Empresa.Genero = "Femenino";
         }
         Empresa.Direccion = PathDireccion;
         //IntroducirTabla(Empresa.Nombre, Empresa.ID, Empresa.Genero,Empresa.Sueldo, Empresa.Inicial,Empresa.Fecha,Empresa.Productos, Empresa.Puesto, Empresa.Seguro );
         listaSimple.AgregarNodo(Empresa);
         AgregarTabla();
     }
     catch (ArgumentNullException ex)
     {
         MessageBox.Show($"Error algun campo esta vacio {ex}");
     }
     catch (NullReferenceException exxx)
     {
         MessageBox.Show($"Error: {exxx}");
     }
     catch (Exception exx)
     {
         MessageBox.Show($"Error: {exx}");
     }
 }
Пример #5
0
        void Eliminacion()
        {
            DataGridViewRow          row = Tabla.CurrentRow;
            EmpresaCurtidoraDePieles Aux = new EmpresaCurtidoraDePieles();

            if (row != null)
            {
                try
                {
                    txtNombre.Text = Aux.Nombre = Tabla.CurrentRow.Cells[0].Value.ToString();
                    Aux.ID         = int.Parse($"{Tabla.CurrentRow.Cells[1].Value}");
                    Aux.Genero     = $"{Tabla.CurrentRow.Cells[2].Value}";
                    Aux.Sueldo     = int.Parse($"{Tabla.CurrentRow.Cells[3].Value}");
                    Aux.Inicial    = char.Parse($"{Tabla.CurrentRow.Cells[4].Value}");
                    Aux.Fecha      = (DateTime)Tabla.CurrentRow.Cells[5].Value;
                    Aux.Productos  = int.Parse($"{Tabla.CurrentRow.Cells[6].Value}");
                    Aux.Puesto     = Tabla.CurrentRow.Cells[7].Value.ToString();
                    if (Tabla.CurrentRow.Cells[8].Value.ToString() == "Si")
                    {
                        Aux.Seguro = true;
                    }
                    else
                    {
                        Aux.Seguro = false;
                    }
                    Aux.Direccion = Tabla.CurrentRow.Cells[9].Value.ToString();
                }
                catch (Exception)
                {
                    throw new Exception("Error");
                }
                Aux = listaSimple.EliminarNodo(Aux);
                AgregarTabla();
                MessageBox.Show($"Datos que se borraron:\n{Aux.ToString()}");
            }
        }