Exemplo n.º 1
0
        private void btnMostrar_Click(object sender, EventArgs e)
        {
            Coche tem;
            int   numFila;

            tem = ServicioCoche.GetCoches();

            if (tem == null)
            {
                MessageBox.Show("No hay Coches!");
                return;
            }

            grilla.Rows.Clear();

            while (tem != null)
            {
                numFila = grilla.Rows.Add();
                grilla.Rows[numFila].Cells[0].Value = tem.getID();
                grilla.Rows[numFila].Cells[1].Value = tem.getMarca();
                grilla.Rows[numFila].Cells[2].Value = tem.getModelo();
                grilla.Rows[numFila].Cells[3].Value = tem.getNumeroAirBag();
                grilla.Rows[numFila].Cells[4].Value = tem.getFechaCreacion().ToString("dd/MM/yyyy");

                tem = tem.getSgte();
            }
        }