private void cargaDatos() { try { ComboBoxManager cbm = new ComboBoxManager(); string chofer_seleccionado = ""; string automovil_seleccionado = ""; if (SingletonUsuario.Instance.rol_actual.nombre == "Chofer") { chofer_seleccionado = cargaChoferSeleccionado(SingletonUsuario.Instance.id); comboBoxChofer.Enabled = false; automovil_seleccionado = cargaAutomovilSeleccionado(SingletonUsuario.Instance.id); } comboBoxChofer = cbm.Chofer(comboBoxChofer, chofer_seleccionado); comboBoxAutomovil = cbm.Automovil(comboBoxAutomovil, automovil_seleccionado); comboBoxCliente = cbm.Cliente(comboBoxCliente); comboBoxTurno = cbm.Turno(comboBoxTurno); dateTimePickerFechaInicio.Value = FechaSistema.getDateTime(); dateTimePickerFechaFin.Value = FechaSistema.getDateTime(); dateTimePickerFechaInicio.CustomFormat = "dd/MM/yyyy - HH:mm"; dateTimePickerFechaFin.CustomFormat = "dd/MM/yyyy - HH:mm"; } catch (Exception exception) { throw new Exception(exception.Message); } }
private void cargaDatos() { try { ComboBoxManager cbm = new ComboBoxManager(); comboBoxChofer = cbm.Chofer(comboBoxChofer); comboBoxTurno = cbm.Turno(comboBoxTurno); dateTimePickerFecha.Value = FechaSistema.getDateTime(); } catch (Exception exception) { MessageBox.Show(exception.Message, "Error en rendicion", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void cargaDatos() { try { ComboBoxManager cbm = new ComboBoxManager(); comboBoxCliente = cbm.Cliente(comboBoxCliente); dateTimePickerFecha.CustomFormat = "MM/yyyy"; dateTimePickerFecha.ShowUpDown = true; dateTimePickerFecha.Value = FechaSistema.getDateTime(); } catch (Exception exception) { MessageBox.Show(exception.Message, "Error en facturacion", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void cargaCliente(int cliente_id = Entidad.NUEVO) { try { if (cliente_id == Entidad.NUEVO) { dateTimePickerFechaNacimiento.Value = FechaSistema.getDateTime(); cliente = new Cliente(); Usuario usuario_mapper = new Usuario(); List <Usuario> usuarios = usuario_mapper.ObtenerUsuarios(); comboBoxUsuarios.DisplayMember = "Text"; comboBoxUsuarios.ValueMember = "Value"; comboBoxUsuarios.Items.Add(new { Text = "Seleccione el usuario", Value = 0 }); foreach (Usuario usuario in usuarios) { comboBoxUsuarios.Items.Add(new { Text = usuario.usuario, Value = usuario.id }); } comboBoxUsuarios.SelectedIndex = 0; } else { Cliente cliente_mapper = new Cliente(); this.cliente = cliente_mapper.Mapear(cliente_id); checkBox1.Checked = cliente.habilitado; textBoxNombre.Text = cliente.nombre; textBoxApellido.Text = cliente.apellido; textBoxMail.Text = cliente.mail; textBoxDNI.Text = Convert.ToString(cliente.dni); textBoxTelefono.Text = Convert.ToString(cliente.telefono); textBoxDireccion.Text = cliente.direccion; textBoxCodigoPostal.Text = cliente.codigo_postal; dateTimePickerFechaNacimiento.Value = cliente.fecha_nacimiento; comboBoxUsuarios.Enabled = false; comboBoxUsuarios.DisplayMember = "Text"; comboBoxUsuarios.ValueMember = "Value"; comboBoxUsuarios.Items.Add(new { Text = cliente.usuario.usuario, Value = cliente.usuario.id }); comboBoxUsuarios.SelectedIndex = 0; } } catch (Exception exception) { MessageBox.Show(exception.Message, "Cliente error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void cargaDatos() { dateTimePickerFecha.CustomFormat = "yyyy"; dateTimePickerFecha.ShowUpDown = true; dateTimePickerFecha.Value = FechaSistema.getDateTime(); }