public FormRegistrarCarga() { InitializeComponent(); fachada = FachadaUISistema.getFachada(); listaCargasRealizadas.Items.Clear(); foreach (Carga c in fachada.getListaCargas()) { listaCargasRealizadas.Items.Add(c); } listaCargasRealizadas.Show(); listaCargasRealizadas.HorizontalScrollbar = true; comboUsuarios.Items.Clear(); foreach (Usuario u in fachada.getListaUsuarios()) { comboUsuarios.Items.Add(u); } comboUsuarios.Show(); comboClientes.Items.Clear(); foreach (Cliente c in fachada.getListaClientes()) { comboClientes.Items.Add(c); } comboClientes.Show(); comboSurtidor.Items.Clear(); foreach (Surtidor s in fachada.getListaSurtidores()) { comboSurtidor.Items.Add(s); } comboSurtidor.Show(); }
private void btnRegistrar_Click(object sender, EventArgs e) { try { String nombre = txtNombre.Text.Trim(); String apellido = txtApellido.Text.Trim(); String cedula = txtCedula.Text.Trim(); if ((nombre.Length > 0) && (apellido.Length > 0) && (cedula.Length > 0)) { if (clienteSeleccionado == null) { fachada.crearCliente(cedula, nombre, apellido); MessageBox.Show("El cliente ha sido creado"); borrarDatos(); } else { fachada.editarCliente(cedula, nombre, apellido, clienteSeleccionado); MessageBox.Show("El cliente ha sido editado"); borrarDatos(); } listaClientes.Items.Clear(); foreach (Cliente c in fachada.getListaClientes()) { listaClientes.Items.Add(c); } listaClientes.Show(); } else { MessageBox.Show("Valores incorrectos.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (MiExcepcion es) { MessageBox.Show(es.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } clienteSeleccionado = null; listaClientes.SelectedItem = null; }
public FormCliente() { InitializeComponent(); fachada = FachadaUISistema.getFachada(); clienteSeleccionado = null; listaClientes.Items.Clear(); foreach (Cliente c in fachada.getListaClientes()) { listaClientes.Items.Add(c); } listaClientes.Show(); }
public FormVehiculo() { InitializeComponent(); fachada = FachadaUISistema.getFachada(); vehiculoSeleccionado = null; comboCliente.Items.Clear(); foreach (Cliente c in fachada.getListaClientes()) { comboCliente.Items.Add(c); } comboCliente.Show(); listaVehiculos.Items.Clear(); foreach (Vehiculo v in fachada.getListaVehiculos()) { listaVehiculos.Items.Add(v); } listaVehiculos.Show(); }