Exemple #1
0
 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 cargaAutomovil(int auto_id = Entidad.NUEVO)
 {
     try
     {
         ComboBoxManager cbm = new ComboBoxManager();
         if (auto_id == Entidad.NUEVO)
         {
             automovil      = new Automovil();
             comboBoxMarca  = cbm.Marca(comboBoxMarca);
             comboBoxTurno  = cbm.Turno(comboBoxTurno);
             comboBoxChofer = cbm.Chofer(comboBoxChofer);
         }
         else
         {
             Automovil automovil_mapper = new Automovil();
             this.automovil             = automovil_mapper.Mapear(auto_id);
             checkBoxHabilitado.Checked = automovil.habilitado;
             textBoxModelo.Text         = automovil.modelo;
             textBoxPatente.Text        = automovil.patente;
             comboBoxMarca  = cbm.Marca(comboBoxMarca, automovil.marca.nombre);
             comboBoxTurno  = cbm.Turno(comboBoxTurno, automovil.turno.descripcion);
             comboBoxChofer = cbm.Chofer(comboBoxChofer, automovil.chofer.nombre + ' ' + automovil.chofer.apellido);
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message, "Automovil error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #3
0
 private void InitializeAuxComponent()
 {
     cbbManager = new ComboBoxManager();
     cbbManager.CreateList <string>();
     foreach (KeyValuePair <string, string> codes in GlobalInfo.CodeTypes)
     {
         cbbManager.AddValue(codes.Key, codes.Value);
     }
     cbbManager.AttachTo(cbbCode);
     //eSegmentType = new EnumsManager<InputType>(sgmCodeType, Properties.Resources.ResourceManager);
 }
Exemple #4
0
        private void InitializeAuxComponent()
        {
            cbbManager = new ComboBoxManager();
            cbbManager.CreateList <int>();
            foreach (KeyValuePair <int, string> counter in GlobalInfo.CounterTypes)
            {
                cbbManager.AddValue(counter.Key, counter.Value);
            }

            cbbManager.AttachTo(cbbCode);
        }
Exemple #5
0
 private void cargaCombos()
 {
     try
     {
         ComboBoxManager cmb = new ComboBoxManager();
         comboBoxMarca = cmb.Marca(comboBoxMarca);
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message, "Carga de automoviles error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #6
0
 virtual public void AttachDataReader <T>(IDataReaderUpdater dr, IColumn code, IColumn description, bool alsoNULL)
 {
     cbbManager = new ComboBoxManager(this);
     if (GlobalInfo.DBaseInfo.dbManager != null)
     {
         if (alsoNULL)
         {
             cbbManager.AddValue <T>(default(T) == null ? (T)Convert.ChangeType(string.Empty, typeof(T)) : default(T), string.Empty);
         }
         FillComboBox <T>(dr, code, description);
         cbbManager.Refresh();
     }
 }
Exemple #7
0
 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);
     }
 }
Exemple #8
0
 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);
     }
 }
 virtual public void AttachDataReader(IDataReaderUpdater dr, IColumn code, IColumn description, bool alsoNULL)
 {
     cbbManager = new ComboBoxManager(this);
     cbbManager.CreateList <string>();
     if (GlobalInfo.DBaseInfo.dbManager != null)
     {
         if (alsoNULL)
         {
             cbbManager.AddValue(string.Empty, string.Empty);
         }
         FillComboBox(dr, code, description);
         cbbManager.AttachTo(this);
         cbbManager.Refresh();
     }
 }
Exemple #10
0
 private void comboBoxChofer_SelectionChangeCommitted(object sender, EventArgs e)
 {
     if ((comboBoxChofer.SelectedItem as dynamic).Value > 0)
     {
         try
         {
             ComboBoxManager cbm                    = new ComboBoxManager();
             Chofer          chofer_mapper          = new Chofer();
             Chofer          chofer                 = chofer_mapper.Mapear((comboBoxChofer.SelectedItem as dynamic).Value);
             string          automovil_seleccionado = cargaAutomovilSeleccionado(chofer.usuario.id);
             comboBoxAutomovil = cbm.Automovil(comboBoxAutomovil, automovil_seleccionado);
         }
         catch (Exception exception)
         {
             comboBoxAutomovil.SelectedIndex = 0;
             MessageBox.Show(exception.Message, "Seleccion de chofer error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
Exemple #11
0
        //private IComboBoxObjectCollection _objectCollection;

        ///<summary>
        /// Constructor for ComboBoxWin
        ///</summary>
        public ComboBoxWin()
        {
            _manager = new ComboBoxManager(this);
            this.ObserveGlobalUIHints();
            //  _objectCollection = new ComboBoxObjectCollectionWin(base.Items);
        }