private void Delete() { try { if (perianio.Text.Trim().Length == 0) { MessageBox.Show("Ingrese Año", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else if (cmb_perimes.SelectedIndex == -1) { MessageBox.Show("Seleccione El Mes", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { tb_me_cuota_tiendacargoBL BL = new tb_me_cuota_tiendacargoBL(); tb_me_cuota_tiendacargo BE = new tb_me_cuota_tiendacargo(); BE.perianio = perianio.Text.ToString().Trim(); BE.perimes = cmb_perimes.SelectedValue.ToString(); BE.local = cmb_local.SelectedValue.ToString(); if (BL.Delete(EmpresaID, BE)) { SEGURIDAD_LOG("E"); MessageBox.Show("Datos Eliminado Correctamente !!!", "Confirmación", MessageBoxButtons.OK, MessageBoxIcon.Information); NIVEL_FORMS(); limpiar_documento(); form_bloqueado(false); data_TablaCuotas(); CargarDetalle(); btn_nuevo.Enabled = true; } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btn_del_Click(object sender, EventArgs e) { if ((dgb_localcuota.RowCount != null)) { if (perianio.Text.Trim().Length == 0) { MessageBox.Show("Ingrese Año", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else if (cmb_perimes.SelectedIndex == -1) { MessageBox.Show("Seleccione El Mes", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { tb_me_cuota_tiendacargoBL BL = new tb_me_cuota_tiendacargoBL(); tb_me_cuota_tiendacargo BE = new tb_me_cuota_tiendacargo(); BE.perianio = perianio.Text.ToString().Trim(); BE.perimes = cmb_perimes.SelectedValue.ToString(); BE.local = cmb_local.SelectedValue.ToString(); BE.cargoid = cmb_cargo.SelectedValue.ToString(); BE.filtro = 1; if (BL.Delete(EmpresaID, BE)) { CargarDetalle(); cuota1.Text = ""; cuota2.Text = ""; cmb_cargo.SelectedIndex = -1; btn_del.Enabled = false; } } } }