예제 #1
0
 private void btnEliminar_Click(object sender, EventArgs e)
 {
     if (dgvPaquetes.CurrentRow != null)
     {
         if (FuncionesGenerales.Mensaje(this, Mensajes.Pregunta, "¿Realmente desea eliminar este paquete?", "Admin CSY") == System.Windows.Forms.DialogResult.Yes)
         {
             try
             {
                 if ((bool)dgvPaquetes[3, dgvPaquetes.CurrentRow.Index].Value)
                 {
                     Paquete.Eliminar((int)dgvPaquetes[0, dgvPaquetes.CurrentRow.Index].Value);
                 }
                 EliminarDataGrid(dgvPaquetes.CurrentRow.Index);
             }
             catch (MySqlException ex)
             {
                 FuncionesGenerales.Mensaje(this, Mensajes.Error, "Ocurrió un error al eliminar el paquete. No se ha podido conectar con la base de datos.", "Admin CSY", ex);
             }
             catch (Exception ex)
             {
                 FuncionesGenerales.Mensaje(this, Mensajes.Error, "Ocurrió un error al eliminar el paquete.", "Admin CSY", ex);
             }
         }
     }
 }
예제 #2
0
        public void EliminarPaquete(int id)
        {
            Paquete pac = new Paquete();

            pac.Eliminar(id);
        }