public async Task <IActionResult> MyNotes() { List <SharedNotes> userNotes = await dbConnection.GetUserNotes(User.Identity.Name); userNotes = SharedNotes.Distinct(userNotes); userNotes = await SharedNotes.AppendUsernameString(userNotes, dbConnection); var users = await dbConnection.GetUsers(); users.RemoveAll(u => u.Name == User.Identity.Name); ViewBag.Users = users; return(View("MyNotes", new UsersNotesModel { sharedNotes = userNotes })); }
public int updateCollaborator(SharedNotes sharedNotes, int id) { try { NotesModel tableModel = this.context.Notes.Where <NotesModel>(t => t.Id == id).FirstOrDefault(); tableModel.Title = sharedNotes.Title; tableModel.TakeANote = sharedNotes.TakeANote; tableModel.IsPin = sharedNotes.IsPin; tableModel.IsArchive = sharedNotes.IsArchive; tableModel.IsTrash = sharedNotes.IsTrash; tableModel.ColorCode = sharedNotes.ColorCode; tableModel.ImageUrl = sharedNotes.ImageUrl; tableModel.position = sharedNotes.position; int result = 0; result = this.context.SaveChanges(); return(result); } catch (Exception ex) { throw new Exception(ex.Message); } }
public int updateCollaborator(SharedNotes sharedNotes, int id) { return(Notes.updateCollaborator(sharedNotes, id)); }