예제 #1
0
        public async Task <ActionResult> Get(PurchasingAgreementPage currentPage, string priceAreaId, string productionItemId = "", string grainTypeId = "", string agreementId = "")
        {
            var supplier = UserManager.GetActiveCustomer(HttpContext);

            if (SiteUser == null || supplier == null)
            {
                return(HttpNotFound());
            }

            if (currentPage.AgreementType != AgreementType.PrissakringDepaavtal)
            {
                await _agreementRepository.SaveCustomerFavoritePriceAreaAsync(supplier.CustomerNo, priceAreaId);
            }
            var model = await CreatePurchasingAgreementViewModel(currentPage, supplier.CustomerNo, priceAreaId, productionItemId, grainTypeId, agreementId);

            // ReSharper disable once Mvc.PartialViewNotResolved
            var viewName = currentPage.AgreementType != AgreementType.PrissakringDepaavtal
                ? "Partial/PriceWatchList"
                : "Partial/PriceWatchListForProtectedAgreement";

            return(PartialView(viewName, model));
        }