Пример #1
0
        public async Task <IActionResult> OnPostAsync(HintDto hint)
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            var updateHint = await _hintRepository.GetAsync(x => x.Id == hint.Id);

            updateHint.Description = hint.Description;
            updateHint.Processed   = true;

            await _hintRepository.UpdateAsync(updateHint);

            return(Redirect("~/"));
        }
        public async Task <ActionResult> Index(HintDto hint)
        {
            string url = "";

            if (hint.Picture != null)
            {
                url = await SavePictureAsync(hint.Picture);
            }

            _repository.SaveHint(new Hint
            {
                Header    = hint.Header,
                Text      = hint.Text,
                Longitude = hint.Longitude,
                Latitude  = hint.Latitude,
                Url       = url
            });

            return(RedirectToAction("Stories", new { id = hint.Header.Replace(' ', '.') }));
        }
 public void AddHintLetter(HintDto hint)
 {
     Characters[hint.Index] = hint.Letter;
 }
Пример #4
0
 private async Task SendHint(HintDto hint, object sender)
 {
     ((HintTimer)sender).Stop();
     await _lobbyHub.Clients.Group(Id).SendAsync("ReceiveHint", hint);
 }
Пример #5
0
 public HintTimer(HintDto hint, double interval) : base(interval)
 {
     Hint = hint;
 }