Beispiel #1
0
        /// <summary>
        /// subscriber section list.
        /// </summary>
        /// <returns></returns>
        public async Task <ActionResult> GetSubscribers()
        {
            SubscribersViewData  subscriberViewData = new SubscribersViewData();
            SubscriberResultData result             = await WebApiClient.GetAsync <SubscriberResultData>(Constant.WebApiControllerNewsletters, Constant.WebApiSubscriberList);

            if (result?.SubscriberDtoList != null && result.OperationSuccess)
            {
                subscriberViewData.Subscribers = result.SubscriberDtoList;
            }

            return(PartialView("Partials/_SubscribersList", subscriberViewData));
        }
Beispiel #2
0
        /// <summary>
        /// The index page.
        /// </summary>
        /// <returns></returns>
        public async Task <ActionResult> Index()
        {
            if (Session["ConnectedUser"] == null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            bool isAuthorizedUser = await AuthorizeUserAttribute.Authorize("A_NEWSLETTERS");

            if (!isAuthorizedUser)
            {
                return(RedirectToAction("NoAccess", "Errors"));
            }
            SubscribersViewData  subscriberViewData = new SubscribersViewData();
            SubscriberResultData result             = await WebApiClient.GetAsync <SubscriberResultData>(Constant.WebApiControllerNewsletters, Constant.WebApiSubscriberList);

            if (result?.SubscriberDtoList != null && result.OperationSuccess)
            {
                subscriberViewData.Subscribers = result.SubscriberDtoList;
            }

            ViewBag.Newsletters = "active";
            return(View(subscriberViewData));
        }