コード例 #1
0
 //Eliminar
 private void btn_Eliminar_Click(object sender, EventArgs e)
 {
     try
     {
         int id = Convert.ToInt32(txt_IdServicio.Text);
         if (MessageBox.Show("Está seguro de Eliminar el Servicio ", "Importante", MessageBoxButtons.YesNo
                             , MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
         {
             servi.Borrar_Servicio(id);
             MessageBox.Show("Se han Eliminado los Datos del Servicio correctamente", "Informacion", MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.btn_Buscar_Logo.Enabled = true; this.btn_Buscar.Visible = false;
             tabla = servi.consultarServicio();
             dgv_Servicio.DataSource = tabla;
             this.blanquear_objetos();
         }
     }
     catch (Exception err)
     {
         MessageBox.Show("Error no se ha podido Eliminar el Servicio\n" + err.Message, "Atencion", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
 }