コード例 #1
0
        public async Task <IActionResult> DisableAnyoneCanCreateInvoice(string storeId)
        {
            var blob = GetCurrentStore.GetStoreBlob();

            blob.AnyoneCanInvoice = false;
            GetCurrentStore.SetStoreBlob(blob);
            TempData[WellKnownTempData.SuccessMessage] = "Feature disabled";
            await _repo.UpdateStore(GetCurrentStore);

            return(RedirectToAction(nameof(PayButton), new { storeId }));
        }
コード例 #2
0
        public async Task <IActionResult> PayButton(bool enableStore)
        {
            var blob = GetCurrentStore.GetStoreBlob();

            blob.AnyoneCanInvoice = enableStore;
            if (GetCurrentStore.SetStoreBlob(blob))
            {
                await _repo.UpdateStore(GetCurrentStore);

                TempData[WellKnownTempData.SuccessMessage] = "Store successfully updated";
            }

            return(RedirectToAction(nameof(PayButton), new
            {
                storeId = GetCurrentStore.Id
            }));
        }