Exemplo n.º 1
0
 //eliminar
 private void btn_Eliminar_Click(object sender, EventArgs e)
 {
     try
     {
         int dni = Convert.ToInt32(txt_Dni.Text);
         hu.ID_Tipo_Documento = int.Parse(cbo_tipoDocumento.SelectedValue.ToString());
         if (MessageBox.Show("Está seguro de Eliminar el Huesped ", "Importante", MessageBoxButtons.YesNo
                             , MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
         {
             hu.Eliminar_Huesped(dni);
             MessageBox.Show("Se han Eliminado los Datos del Huesped correctamente", "Informacion", MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.btn_Buscar_Logo.Enabled = true; this.btn_Buscar.Visible = false;
             tabla = hu.consultarHuesped();
             this.dgv_Huesped.DataSource = tabla;
             this.blanquear_objetos();
         }
     }
     catch (Exception err)
     {
         MessageBox.Show("Error no se ha podido Eliminar el Huesped\n" + err.Message, "Atencion", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
 }