private void Group_chks_SelectedIndexChanged(object sender, EventArgs e)
        {
            var BL = new tb_px_promocionesBL();
            var BE = new tb_px_promociones();

            BE.fechaActual = Convert.ToDateTime(DateTime.Today.ToShortDateString());
            if (Group_chks.SelectedIndex == 0)
            {
                BE.filtro = Group_chks.SelectedIndex;
            }
            else
            {
                if (Group_chks.SelectedIndex == 1)
                {
                    BE.filtro = Group_chks.SelectedIndex;
                }
                else
                {
                    if (Group_chks.SelectedIndex == 2)
                    {
                        BE.filtro = Group_chks.SelectedIndex;
                    }
                }
            }
            Tablapromo = BL.GetFiltro(EmpresaID, BE).Tables[0];
            if (Tablapromo.Rows.Count > 0)
            {
                Mdi_dgv_promociones.DataSource = Tablapromo;
            }
            else
            {
                Mdi_dgv_promociones.DataSource = Tablapromo;
            }
        }
        private void data_Tablapromo()
        {
            try
            {
                Tablapromo = new DataTable();

                if (Tablapromo.Rows.Count > 0)
                {
                    Tablapromo.Rows.Clear();
                }
                var BL = new tb_px_promocionesBL();
                var BE = new tb_px_promociones();
                Tablapromo = BL.GetAll(EmpresaID, BE).Tables[0];
                if (Tablapromo.Rows.Count > 0)
                {
                    btn_imprimir.Enabled = true;
                    Mdi_dgv_promociones.DataSource = Tablapromo;
                }
                else
                {
                    Mdi_dgv_promociones.DataSource = Tablapromo;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void Delete()
        {
            try
            {
                if (promoid.Text.Trim().Length == 0)
                {
                    MessageBox.Show("Falta Codigo Lista !!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else
                {
                    var BL = new tb_px_promocionesBL();
                    var BE = new tb_px_promociones();

                    BE.promoid = Convert.ToInt32(promoid.Text.Trim());

                    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_Tablapromo();
                        CargarDetalle();
                        btn_nuevo.Enabled = true;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void Update()
        {
            try
            {
                if (promoid.Text.Trim().Length == 0)
                {
                    MessageBox.Show("Falta Codigo de Promoción", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else
                {
                    var BL = new tb_px_promocionesBL();
                    var BE = new tb_px_promociones();

                    BE.promoid = Convert.ToInt32(promoid.Text.Trim());
                    BE.prioridad = prioridad.Text.Trim();

                    var n = rdb_estado.SelectedIndex;
                    if (n == 0)
                    {
                        BE.status = "0";
                    }
                    else
                    {
                        BE.status = "9";
                    }
                    BE.exclusivo = exclusivo.Text.Trim();
                    BE.promoname = promoname.Text.Trim();

                    if (cmb_tiendalist.SelectedIndex != -1)
                    {
                        BE.tiendalist = Convert.ToInt32(cmb_tiendalist.SelectedValue.ToString().Trim());
                    }
                    if (cmb_tarjgrupoid.SelectedIndex != -1)
                    {
                        BE.tarjgrupoid = Convert.ToInt32(cmb_tarjgrupoid.SelectedValue.ToString().Trim());
                    }

                    BE.percdscto = Convert.ToDecimal(perdsctocab.Text.Trim());
                    BE.al_docum = chk_aldocum.Checked;
                    BE.fechaini = Convert.ToDateTime(fechaini.Text);
                    BE.fechafin = Convert.ToDateTime(fechafin.Text);
                    if (cmb_grupopromocion.SelectedIndex != -1)
                    {
                        BE.grupopromoid = Convert.ToInt32(cmb_grupopromocion.SelectedValue.ToString().Trim());
                    }
                    BE.usuar = VariablesPublicas.Usuar.Trim();
                    BE.fecre = Convert.ToDateTime(DateTime.Today.ToShortDateString());
                    BE.feact = Convert.ToDateTime(DateTime.Today.ToShortDateString());
                    BE.usuarap = VariablesPublicas.Usuar.Trim();
                    BE.fechap = Convert.ToDateTime(DateTime.Today.ToShortDateString());
                    BE.solodias = chk_solodias.Checked;
                    BE.dom = chk_dom.Checked;
                    BE.lun = chk_lun.Checked;
                    BE.mar = chk_mar.Checked;
                    BE.mie = chk_mie.Checked;
                    BE.jue = chk_jue.Checked;
                    BE.vie = chk_vie.Checked;
                    BE.sab = chk_sab.Checked;
                    BE.npack = Convert.ToInt32(npack.Text.Trim());
                    BE.impodoc = Convert.ToDecimal(impopack.Text.Trim());
                    BE.aplicini = Convert.ToInt32(aplicini.Text.Trim());
                    BE.aplicfin = Convert.ToInt32(aplicfin.Text.Trim());
                    BE.impodoc = Convert.ToDecimal(impodoc.Text.Trim());

                    if (BL.Update(EmpresaID, BE))
                    {
                        SEGURIDAD_LOG("M");
                        MessageBox.Show("Datos Modificado Correctamente !!!", "Confirmación", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        procesado = true;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }