Esempio n. 1
0
        /// <summary>
        /// partner section list.
        /// </summary>
        /// <returns></returns>
        public async Task <ActionResult> GetPartners()
        {
            PartnersViewData  partnerViewData = new PartnersViewData();
            PartnerResultData result          = await WebApiClient.GetAsync <PartnerResultData>(Constant.WebApiControllerPartners, Constant.WebApiPartnerList);

            if (result?.PartnerDtoList != null && result.OperationSuccess)
            {
                partnerViewData.Partners = result.PartnerDtoList;
            }

            return(PartialView("Partials/_PartnersList", partnerViewData));
        }
Esempio n. 2
0
        /// <summary>
        /// Get Partners
        /// </summary>
        /// <returns></returns>
        private async Task <PartnersViewData> GetPartners()
        {
            PartnersViewData  partnerViewData = new PartnersViewData();
            PartnerResultData result          =
                await WebApiClient.GetAsync <PartnerResultData>(Constant.WebApiControllerPartners,
                                                                Constant.WebApiPartnerList);

            if (result?.PartnerDtoList != null && result.OperationSuccess)
            {
                partnerViewData.Partners = result.PartnerDtoList;
            }
            return(partnerViewData);
        }
Esempio n. 3
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_PARTNERS");

            if (!isAuthorizedUser)
            {
                return(RedirectToAction("NoAccess", "Errors"));
            }

            PartnersViewData  partnerViewData = new PartnersViewData();
            PartnerResultData result          = await WebApiClient.GetAsync <PartnerResultData>(Constant.WebApiControllerPartners, Constant.WebApiPartnerList);

            if (result?.PartnerDtoList != null && result.OperationSuccess)
            {
                partnerViewData.Partners = result.PartnerDtoList;
            }
            ViewBag.Partners = "active";
            return(View(partnerViewData));
        }