Пример #1
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()}");
            }
        }