Ejemplo n.º 1
0
 private void createNewTurn()
 {
     try
     {
         if (comboTurno.SelectedIndex.Equals(-1))
         {
             throw new Exception("Debe seleccionar un turno");
         }
         Turno turno = this.comboTurno.SelectedItem as Turno;
         if (turno.getId() != (int)unAuto.Cells["IdTurno"].Value)
         {
             dao.createTurno(unAuto, turno);
             MessageBox.Show("El turno fue agregado con exito");
         }
         else
         {
             MessageBox.Show("El turno no cambio");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
     }
 }
Ejemplo n.º 2
0
        private Auto getFormData()
        {
            Marca       m = this.comboMarca.SelectedItem as Marca;
            Turno       t = this.comboTurno.SelectedItem as Turno;
            Chofer_Auto c = this.comboChofer.SelectedItem as Chofer_Auto;

            return(new Auto(textPatente.Text, checkHabilitado.Checked, c.getId(), m.getId(), textModelo.Text, t.getId()));
        }