Example #1
0
 public void eliminarAutomovilEnBD(int idAuto, GD1C2017DataSetTableAdapters.QueriesTableAdapter adaptador)
 {
     try
     {
         adaptador.eliminarAutomovil
             (idAuto);
     }
     catch (SqlException e)
     {
         mensajeErrorEnDB();
     }
 }
Example #2
0
        public static bool validarExistenciaDeRango(int horarioInicio, int horarioFin)
        {
            GD1C2017DataSetTableAdapters.QueriesTableAdapter adaptador =
                new GD1C2017DataSetTableAdapters.QueriesTableAdapter();
            Boolean resultado = (Boolean)adaptador.rangoInterceptaAlgunoExistente(
                horarioInicio,
                horarioFin);

            if (resultado)
            {
                throw new RangoHorarioDuplicadoException();
            }
            return(resultado);
        }
Example #3
0
 public void modificarChoferEnBD(Control.ControlCollection c, GD1C2017DataSetTableAdapters.QueriesTableAdapter adaptador)
 {
     try
     {
         adaptador.modificarChofer
             (Convert.ToInt32(c["lblIdPersona"].Text), Convert.ToInt32(c["txtDNI"].Text), c["txtNombre"].Text, c["txtApellido"].Text, c["txtCalle"].Text
             , Convert.ToInt16(c["txtPisoManzana"].Text), c["txtDeptoLote"].Text, c["txtLocalidad"].Text, c["txtCodigoPostal"].Text
             , Convert.ToInt32(c["txtTelefono"].Text), c["txtCorreo"].Text, ((DateTimePicker)c["selectorFechaNacimiento"]).Value,
             Convert.ToBoolean(((CheckBox)c["ccHabilitado"]).Checked));
     }
     catch (SqlException e)
     {
         mensajeErrorEnDB();
     }
 }
Example #4
0
 protected override void ejecutarSegunAccion()
 {
     if (Validaciones.validarCampoAlfanumerico(this.comboRol.Text))
     {
         GD1C2017DataSetTableAdapters.QueriesTableAdapter adaptador =
             new GD1C2017DataSetTableAdapters.QueriesTableAdapter();
         adaptador.agregarRol(this.comboRol.Text, armarCadenaConIdsFunciones());
         mensajeConfirmaAccion();
         this.Close();
     }
     else
     {
         MetodosGlobales.mansajeErrorValidacion();
     }
 }
Example #5
0
 public void agregarAutomovilEnBD(Control.ControlCollection c, GD1C2017DataSetTableAdapters.QueriesTableAdapter adaptador)
 {
     try
     {
         adaptador.agregarAutomovil
             (Convert.ToInt32(((ComboBox)c["comboMarca"]).SelectedValue),
             Convert.ToInt32(((ComboBox)c["comboModelo"]).SelectedValue),
             c["txtPatente"].Text,
             Convert.ToInt32(((ComboBox)c["comboTurno"]).SelectedValue),
             Convert.ToInt32(((ComboBox)c["comboChofer"]).SelectedValue));
     }
     catch (SqlException e)
     {
         mensajeErrorEnDB();
     }
 }
Example #6
0
 public void agregarTurnoEnBD(Control.ControlCollection c, GD1C2017DataSetTableAdapters.QueriesTableAdapter adaptador)
 {
     try
     {
         adaptador.agregarTurno
             (Convert.ToInt16(c["txtHoraInicio"].Text),
             Convert.ToInt16(c["txtHoraFin"].Text),
             c["txtDescripcion"].Text,
             Convert.ToDecimal(c["txtValorKilometro"].Text),
             Convert.ToDecimal(c["txtPrecioBase"].Text),
             Convert.ToBoolean(((CheckBox)c["ccHabilitado"]).Checked));
     }
     catch (SqlException e)
     {
         mensajeErrorEnDB();
     }
 }
Example #7
0
 public void agregarChoferEnBD(Control.ControlCollection c, GD1C2017DataSetTableAdapters.QueriesTableAdapter adaptador)
 {
     try
     {
         String Usu_Nombre_Usuario = Convert.ToString(adaptador.agregarChofer
                                                          (Convert.ToInt64(c["txtDNI"].Text), c["txtNombre"].Text, c["txtApellido"].Text,
                                                          c["txtCalle"].Text, Convert.ToInt16(c["txtPisoManzana"].Text), c["txtDeptoLote"].Text,
                                                          c["txtLocalidad"].Text, c["txtCodigoPostal"].Text, Convert.ToInt64(c["txtTelefono"].Text),
                                                          c["txtCorreo"].Text,
                                                          Convert.ToDateTime(((DateTimePicker)c["selectorFechaNacimiento"]).Value)));
         mensajeCreacionDeUsuario(Usu_Nombre_Usuario);
     }
     catch (SqlException e)
     {
         mensajeErrorEnDB();
     }
 }
Example #8
0
 public void modificarAutomovilEnBD(Control.ControlCollection c, GD1C2017DataSetTableAdapters.QueriesTableAdapter adaptador)
 {
     try
     {
         adaptador.modificarAutomovil
             (Convert.ToInt32(((Label)(c["lblIdAuto"])).Text),
             Convert.ToInt32(((ComboBox)c["comboMarca"]).SelectedValue),
             Convert.ToInt32(((ComboBox)c["comboModelo"]).SelectedValue),
             c["txtPatente"].Text,
             Convert.ToInt32(((ComboBox)c["comboTurno"]).SelectedValue),
             Convert.ToInt32(((ComboBox)c["comboChofer"]).SelectedValue),
             Convert.ToBoolean(((CheckBox)c["ccHabilitado"]).Checked));
     }
     catch (SqlException e)
     {
         mensajeErrorEnDB();
     }
 }
Example #9
0
        protected override void ejecutarSegunAccion()
        {
            GD1C2017DataSetTableAdapters.QueriesTableAdapter adaptador =
                new GD1C2017DataSetTableAdapters.QueriesTableAdapter();
            List <FuncionalidadSegunRol> listaNueva = this.cajaListaFuncionesSegunRol.Items
                                                      .Cast <FuncionalidadSegunRol>().ToList();
            List <FuncionalidadSegunRol> listaConFuncionesParaAgregar = listaNueva.Where(item =>
                                                                                         !listaFuncionesSegunRol.Any(funcion => funcion.nombreFuncion.Equals(item.nombreFuncion))).ToList();
            List <FuncionalidadSegunRol> listaConFuncionesParaQuitar = this.listaFuncionesSegunRol.Where(item =>
                                                                                                         !listaNueva.Any(funcion => funcion.nombreFuncion.Equals(item.nombreFuncion))).ToList();

            adaptador.modificarRol(Convert.ToInt32(this.comboRol.SelectedValue),
                                   this.txtModificarNombre.Text,
                                   Convert.ToInt16(this.ccHabilitado.Checked),
                                   armarListaConItem(listaConFuncionesParaAgregar),
                                   armarListaConItem(listaConFuncionesParaQuitar));
            //(((DataRowView)this.comboRol.SelectedItem).Row).ItemArray[1]
            mensajeConfirmaAccion();
            this.Close();
        }
Example #10
0
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     try
     {
         GD1C2017DataSetTableAdapters.QueriesTableAdapter adaptador =
             new GD1C2017DataSetTableAdapters.QueriesTableAdapter();
         adaptador.registrarViaje(
             (int)this.comboChofer.SelectedValue, (int)this.comboCliente.SelectedValue,
             Convert.ToInt32(this.idAuto), (int)this.comboTurno.SelectedValue,
             Convert.ToDecimal(this.txtCantidadKilometros.Text), (DateTime)this.selectorDiaHoraInicio.Value,
             (DateTime)this.selectorDiaHoraFin.Value
             );
         this.Close();
     }
     catch (SqlException ex)
     {
         MessageBox.Show("Error en la creacion del viaje. Probablemente este duplicado."
                         , "Error Creacion de viaje"
                         , MessageBoxButtons.OK
                         , MessageBoxIcon.Error);
     }
 }