示例#1
0
 /// <summary>
 /// post a note
 /// </summary>
 /// <param name="id">ID of note</param>
 public void OnPostNote(int id)
 {
     try
     {
         Note   note     = _note.GetNoteByID(id).Result;
         string blobText = _blob.GetText(note).Result;
         Note = note;
         Text = blobText;
         byte[] blobImage = _blob.GetImage(note).Result;
         ImageDisplayExtensions.DisplayImage(blobImage);
         Users = _userManager.Users.ToList();
         List <Note> Notes = _note.GetAllNotes().Result;
         foreach (Note tempNote in Notes)
         {
             var user = _userManager.FindByIdAsync(tempNote.UserID).Result;
             AVMs.Add(new AdminViewModel()
             {
                 Note     = tempNote,
                 UserName = user.UserName
             });
         }
     }
     catch (Exception)
     {
         TempData["Error"] = "Something went wrong with the Post Note";
     }
 }
示例#2
0
        public void OnGet()
        {
            Users = _userManager.Users.ToList();
            List <Note> Notes = _note.GetAllNotes().Result;

            foreach (Note note in Notes)
            {
                var user = _userManager.FindByIdAsync(note.UserID).Result;
                AVMs.Add(new AdminViewModel()
                {
                    Note     = note,
                    UserName = user.UserName
                });
            }
        }