Exemplo n.º 1
0
        public IActionResult OnGetMakeComment(Account account, int idBook, string textComment)
        {
            repos.MakeComment(account, idBook, textComment);
            IdBookAccountViewModel bookAccountViewModel = new IdBookAccountViewModel(idBook, account.Id);

            return(RedirectToPage("BookPage", "Restart", bookAccountViewModel));
        }
Exemplo n.º 2
0
        public IActionResult OnGetTakeOff(int idBook, int idAccount)
        {
            repos.TakeOff(idBook);
            IdBookAccountViewModel bookAccountViewModel = new IdBookAccountViewModel(idBook, idAccount);

            return(RedirectToPage("BookPage", "Restart", bookAccountViewModel));
        }
Exemplo n.º 3
0
 /// <summary>
 /// Перезапуск страницы
 /// </summary>
 /// <param name="bookAccountViewModel"></param>
 public void OnGetRestart(IdBookAccountViewModel bookAccountViewModel)
 {
     Comments    = repos.ReadComments(bookAccountViewModel.IdBook).ToList();
     UserBook    = repos.GetBook(bookAccountViewModel.IdBook);
     idAccount   = bookAccountViewModel.IdAccount;
     UserAccount = repos.MyAccount(idAccount);
 }
Exemplo n.º 4
0
        public IActionResult OnPost(int idAccount, string nameAccount, int idBook, string textComment)
        {
            UserAccount = new Account()
            {
                Id = idAccount, Name = nameAccount
            };

            repos.MakeComment(UserAccount, idBook, textComment);
            IdBookAccountViewModel bookAccountViewModel = new IdBookAccountViewModel(idBook, idAccount);

            return(RedirectToPage("BookPage", "Restart", bookAccountViewModel));
        }