예제 #1
0
        public async Task <IActionResult> DeleteStore()
        {
            //Geschäft löschen
            var storeId = int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value);

            RestAccess ra  = new RestAccess(Constants.ServiceClientEndPointWithApiPrefix);
            var        res = await ra.DeleteShop(new ExDeleteRequest
            {
                Id            = storeId,
                CheckPassword = WebAppSettings.CheckPassword,
            });

            if (res.Ok)
            {
                if (!res.Result)
                {
                    TempData["message"] = "Geschäft konnte nicht gelöscht werden";
                    return(RedirectToAction(nameof(StoreData)));
                }

                //user ausloggen
                return(RedirectToAction("Logout", "Account"));
            }

            TempData["message"] = "Geschäft konnte nicht gelöscht werden";
            return(RedirectToAction(nameof(StoreData)));
        }
예제 #2
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            var res = new RestAccess("", "", Constants.ServiceClientEndPointWithApiPrefix);
            await res.DeleteShop(new ExDeleteRequest
            {
                Id            = id,
                CheckPassword = WebAppSettings.CheckPassword,
            });

            return(RedirectToAction("Logout", "Account"));
        }