Ejemplo n.º 1
0
        public void agregarDestino()
        {
            frmGestionDestino = FrmGestionDestino.GetInstancia();
            Destino destino = new Destino();

            destino.Des_Descripcion = txtDescripcion.Text;
            GestionDestino.insert_Destino(destino);
            MessageBox.Show("Destino agregado con éxito", "Agregar destino", MessageBoxButtons.OK, MessageBoxIcon.Information);
            frmGestionDestino.cargar_Destinos();
            this.Close();
        }
Ejemplo n.º 2
0
 private void btnGuardar_Click(object sender, EventArgs e)
 {
     frmGestionDestino = FrmGestionDestino.GetInstancia();
     cargar_Datos();
     if (!validarCamposVacios())
     {
         if (!modificar)
         {
             if (validar_Destino())
             {
                 agregarDestino();
             }
             else
             {
                 MessageBox.Show("El destino ingresado ya existe", "Agregar destino", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
         else
         {
             modificar_Destino();
             frmGestionDestino.cargar_Destinos();
             this.Close();
         }
     }
     else
     {
         if (!modificar)
         {
             MessageBox.Show("Algunos campos están vacíos", "Agregar destino", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
         {
             MessageBox.Show("Algunos campos están vacíos", "Modificar destino", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }