// GET: Admin/EmailAccount

        #region EmailAccount

        public ActionResult Index(int?page, string keyword)
        {
            EmailAccountListVM emailAccountListVM = GetElements(page, keyword);

            ViewBag.PageSizes = new SelectList(Site.PageSizes());
            return(View(emailAccountListVM));
        }
        private EmailAccountListVM GetElements(int?page, string keyword)
        {
            var emailAccountListVM = new EmailAccountListVM()
            {
                Keyword   = keyword,
                PageIndex = (page ?? 1),
                PageSize  = SettingsManager.EmailAccount.PageSize
            };
            int totalCount;
            var emailAccountlist = _emailAccountService.GetPagedElements(emailAccountListVM.PageIndex - 1, emailAccountListVM.PageSize, emailAccountListVM.Keyword, out totalCount);

            emailAccountListVM.TotalCount    = totalCount;
            emailAccountListVM.EmailAccounts = new StaticPagedList <EmailAccount>(emailAccountlist, emailAccountListVM.PageIndex, emailAccountListVM.PageSize, emailAccountListVM.TotalCount);;
            return(emailAccountListVM);
        }