private void CargaDatos()
        {
            var sorted = default(SortOrder);
            var xnomcolumna = string.Empty;
            if (Examinar.SortedColumn != null)
            {
                xnomcolumna = Examinar.Columns[Examinar.SortedColumn.Index].Name;
                sorted = Examinar.SortOrder;
            }
            var BL = new tb_plla_porcentleyesBL();
            var BE = new tb_plla_porcentleyes();

            BE.perianio = spnperiodo.Value.ToString();
            Tabla = BL.GetAll_Consulta(VariablesPublicas.EmpresaID, BE).Tables[0];
            Examinar.AutoGenerateColumns = false;
            Examinar.DataSource = Tabla;
            Examinar.Sort(Examinar.Columns["perimes"], System.ComponentModel.ListSortDirection.Ascending);
        }
        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]["perianio"] = spnperiodo.Value.ToString();
                }
                Tabla.AcceptChanges();

                var BL = new tb_plla_porcentleyesBL();
                var BE = new tb_plla_porcentleyes();

                BE.perianio = spnperiodo.Value.ToString();
                if (BL.BapSoft_PorcentajesLeyesInsert(VariablesPublicas.EmpresaID, BE, Tabla))
                {
                    U_CancelarEdicion(0);
                }
                else
                {
                    Frm_Class.ShowError(BL.Sql_Error, this);
                }
            }
        }