public void insertar(inicio data, int po) { for (int i = 0; i <= t; i++) { car[po] = car[po + 1]; car[po] = data; } i++; }
private void btnAgregar_Click(object sender, EventArgs e) { a = new inicio(); a.pla = txtPlacas.Text; a.mar = txtModelo.Text; a.mo = txtMarca.Text; a.tel = txtTelefono.Text; a.ano = txtAño.Text; n.agregar(a); if (n.i < n.t) { MessageBox.Show(" agregado correctamente", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Sin espacio", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning); } txtPlacas.Clear(); txtMarca.Clear(); txtModelo.Clear(); txtTelefono.Clear(); txtAño.Clear(); }
public void agregar(inicio datos) { car[cuantosHay] = datos; cuantosHay++; }