private void Frm_Planilla_RubrosDescuento_Activated(object sender, EventArgs e)
        {
            if (Sw_LOad)
            {
                cmbfiltrotipoplanilla.ValueMember = "tipoplla";
                cmbfiltrotipoplanilla.DisplayMember = "tipopllaname";
                var BL = new tb_plla_tipoplanillaBL();
                var BE = new tb_plla_tipoplanilla();

                BE.norden = 1;
                BE.ver_blanco = 0;
                tmpcursor = BL.GetAll_Consulta(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0];
                cmbfiltrotipoplanilla.SelectedValue = string.Empty;

                if (BL.Sql_Error.Length == 0)
                {
                    cmbfiltrotipoplanilla.DataSource = tmpcursor;
                    if (tmpcursor.Rows.Count > 0)
                    {
                        cmbfiltrotipoplanilla.SelectedValue = tmpcursor.Rows[0]["tipoplla"];
                    }
                }

                cmbmodalidad.ValueMember = "cele";
                cmbmodalidad.DisplayMember = "descripcion";
                var BL1 = new tb_plla_tab0100BL();
                var BE1 = new tb_plla_tab0100();
                BE1.ver_blanco = 1;
                cmbmodalidad.DataSource = BL1.gspTbPllaModalidadRubros(VariablesPublicas.EmpresaID.ToString(), BE1).Tables[0];

                cmbtipocalculo.ValueMember = "cele";
                cmbtipocalculo.DisplayMember = "descripcion";
                var BL2 = new tb_plla_tab0100BL();
                var BE2 = new tb_plla_tab0100();
                BE2.ver_blanco = 1;
                cmbtipocalculo.DataSource = BL2.gspTbPllaTipoCalculoRubros(VariablesPublicas.EmpresaID.ToString(), BE2).Tables[0];

                cmbtipo.ValueMember = "cele";
                cmbtipo.DisplayMember = "descripcion";
                var BL3 = new tb_plla_tab0100BL();
                var BE3 = new tb_plla_tab0100();
                BE3.ver_blanco = 1;
                cmbtipo.DataSource = BL3.GetTipoDescuento(VariablesPublicas.EmpresaID.ToString(), BE3).Tables[0];

                RequeryTipoPlanilla();

                cmbrubrorpts.ValueMember = "rubroid";
                cmbrubrorpts.DisplayMember = "descripcion";
                var BL4 = new tb_plla_pdt_tabla22BL();
                var BE4 = new tb_plla_pdt_tabla22();
                BE4.relrubroidtipo = GlobalVars.GetInstance().RubrosDescuentoRPTS;
                BE4.detallado = 1;
                BE4.norden = 1;
                BE4.incluir_blanco = 1;
                cmbrubrorpts.DataSource = BL4.GetAll_Consulta(VariablesPublicas.EmpresaID, BE4).Tables[0];

                U_RefrescaControles();
                CargaDatos();
                U_RefrescaControles();
                Sw_LOad = false;
            }
        }
        private BindingSource NewMethoTC()
        {
            var BL = new tb_plla_tab0100BL();
            var BE = new tb_plla_tab0100();

            BE.ver_blanco = 1;
            var table = BL.gspTbPllaTipoCalculoRubros(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0];
            var rows = table.Rows;

            object[] cell;
            var dic = new Dictionary<string, string>();
            var binding = new BindingSource();

            foreach (DataRow item in rows)
            {
                cell = item.ItemArray;
                dic.Add(cell[0].ToString(), cell[0].ToString() + "    " + cell[1].ToString());
                cell = null;
            }
            binding.DataSource = dic;
            return binding;
        }