Esempio n. 1
0
        public async Task <IActionResult> EventDone(int id)
        {
            IResult result = await _eventService.EventDone(id);

            TempData["ToastMessage"] = result.IsSuccess
                ? JsonSerializer.Serialize <ToastModel>(ToastModel.Success("Etkinlik Sonlandırıldı !"))
                : JsonSerializer.Serialize <ToastModel>(ToastModel.Fail(result.Message));

            return(RedirectToAction(nameof(Index)));
        }
Esempio n. 2
0
        public async Task <IActionResult> Basket()
        {
            IDataResult <CartDTO> cart = await _cartService.GetCart();

            if (!cart.IsSuccess)
            {
                TempData["ToastMessage"] = JsonSerializer.Serialize <ToastModel>(ToastModel.Fail("Sepetinizde Ürün Bulunmuyor !"));
                return(RedirectToAction(nameof(Index), "Home"));
            }
            int            userId         = Convert.ToInt32(User.FindFirst("UserId").Value);
            CreateOrderDto createOrderDto = new CreateOrderDto();

            createOrderDto.UserAddresses = await _userAddressService.GetListAsync(userId);

            return(View(createOrderDto));
        }