Beispiel #1
0
        public IActionResult Check(int id)
        {
            var exist = _accountGameRepository.ExistById(id);

            if (!exist)
            {
                return(RedirectToAction(nameof(Waiting)));
            }

            if (!_accountGameRepository.AccountStateIsWaiting(id))
            {
                return(RedirectToAction(nameof(Waiting)));
            }

            var model = _accountGameRepository.GetById(id);

            return(View(model));
        }
Beispiel #2
0
        public IActionResult AccountDetail(int id)
        {
            var userId = User.GetUserId();

            // ایا اکانت موجود می باشد
            var exist = _accountGameRepository.ExistById(id);

            if (!exist)
            {
                return(RedirectToAction(nameof(AccountList)));
            }

            // آیا اکانت توسط کاربر ایجاد شده است
            var isCreateByUser = _accountGameRepository.IsCreateByUser(userId, id);

            if (!isCreateByUser)
            {
                return(RedirectToAction(nameof(AccountList)));
            }

            var model = _accountGameRepository.GetById(id);

            return(View(model));
        }
        public IActionResult Detail(int id)
        {
            var exist = _accountGameRepository.ExistById(id);

            if (!exist)
            {
                return(RedirectPermanent("/"));
            }

            var model = _accountGameRepository.GetById(id);

            if (model.State == AccountGameState.Confirmed)
            {
                return(View(model));
            }
            else
            {
                return(RedirectPermanent("/"));
            }
        }