private void save()
        {
            if (u_Validate())
            {
                if (Examinar.IsCurrentCellInEditMode)
                {
                    Examinar.CommitEdit(DataGridViewDataErrorContexts.Commit);
                }
                Tabla.AcceptChanges();
                for (lc_cont = 0; lc_cont <= Tabla.Rows.Count - 1; lc_cont++)
                {
                    Tabla.Rows[lc_cont]["regipenid"] = cboAfp.SelectedValue;
                }
                Tabla.AcceptChanges();

                var BL = new tb_plla_porcentafpBL();
                var BE = new tb_plla_porcentafp();

                BE.regipenid = cboAfp.SelectedValue.ToString();
                BE.perianio = spnperiodo.Value.ToString();
                if (BL.BapSoft_PorcentajesAFPInsert(VariablesPublicas.EmpresaID, BE, Tabla))
                {
                    U_CancelarEdicion(0);
                }
                else
                {
                    Frm_Class.ShowError(BL.Sql_Error, this);
                }
            }
        }
        private void CargaDatos()
        {
            var xcodafp = "...";
            var sorted = default(SortOrder);
            var xnomcolumna = string.Empty;
            if (cboAfp.SelectedValue != null)
            {
                xcodafp = cboAfp.SelectedValue.ToString();
            }

            if (Examinar.SortedColumn != null)
            {
                xnomcolumna = Examinar.Columns[Examinar.SortedColumn.Index].Name;
                sorted = Examinar.SortOrder;
            }
            var BL = new tb_plla_porcentafpBL();
            var BE = new tb_plla_porcentafp();

            BE.perianio = spnperiodo.Value.ToString();
            BE.regipenid = xcodafp;
            Tabla = BL.GetAll_Consulta(VariablesPublicas.EmpresaID, BE).Tables[0];
            if (BL.Sql_Error.Length > 0)
            {
                Frm_Class.ShowError(BL.Sql_Error, this);
            }
            Examinar.AutoGenerateColumns = false;
            Examinar.DataSource = Tabla;
        }