public async Task <ActionResult> Index(DryingAgreementPage currentPage, FormCollection form)
        {
            var supplier = UserManager.GetActiveCustomer(HttpContext);

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

//#if !DEBUG
            var result = await _purchaseRepository.SaveDryingAgreementAsync(supplier.CustomerNo);

            if (!string.IsNullOrEmpty(result) && result.Contains("Saved dryagreement to database."))
            {
                ViewBag.GeneratePdf = true;
                return(View("~/Views/AppPages/DryingAgreementPage/DryingAgreementStep3.cshtml", new DryingAgreementViewModel(currentPage)));
            }
//#endif
            ViewBag.GeneratePdf = false;
            return(View("~/Views/AppPages/DryingAgreementPage/DryingAgreementStep3.cshtml", new DryingAgreementViewModel(currentPage)));
        }