Example #1
0
        protected void LoadItems()
        {
            if (!HasEditPermission)
            {
                dgTemplates.Columns[dgTemplates.Columns.Count - 1].Visible = false;
            }

            dgTemplates.VirtualItemCount = (int)EmailTemplateController.GetItemCount();
            if (dgTemplates.VirtualItemCount == 0)
            {
                phHasItems.Visible   = false;
                phHasNoItems.Visible = true;
            }
            else
            {
                phHasItems.Visible   = true;
                phHasNoItems.Visible = false;

                int limit  = dgTemplates.PageSize;
                int offset = dgTemplates.CurrentPageIndex * dgTemplates.PageSize;

                EmailTemplateCollection items = EmailTemplateController.GetItems(
                    EmailTemplate.Columns.Name, dg.Sql.SortDirection.ASC,
                    limit, offset);

                BindList(items);
            }
        }