Exemplo n.º 1
0
        // Index
        // GET: Messeges
        // Index page acts as the user inbox
        public async Task <IActionResult> Index()
        {
            IdentityUser user = await _userManager.GetUserAsync(User);

            string username      = user.UserName;
            int    messegesCount = await _messegesHandler.CountReceivedUserMessegesAsync(username);

            int readCount = await _usersHandler.GetUserReadMesseges(user);

            int deletedCount = await _usersHandler.GetUserDeletedMesseges(user);

            ReadMessegesViewModel vm = new ReadMessegesViewModel
            {
                Senders              = await CreateInboxUserNamesSelectionList(username),
                SelectedSenders      = new List <string>(),
                MessegesCount        = messegesCount,
                ReadMessegesCount    = readCount,
                DeletedMessegesCount = deletedCount,
            };

            return(View(vm));
        }