/// <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)); }
/// <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); }
/// <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)); }