public ActionResult Update(Note note) { if (note != null) { dal.updateNote(note.Id, note.Text); return Json("Success"); } else { return Json("Error NoteController/Remove/"); } }
public ActionResult Restore(Note note) { if (note != null) { dal.restoreNote(note.Id); return Json("Success"); } else { return Json("Error NoteController/Remove/"); } }
public ActionResult Add(Note note) { if (note != null) { Note noteReturn = dal.addNote(note.FridgeId, note.Text, note.Type); return Json(noteReturn); } else { return Json("Error NoteController/Add/"); } }
public Note addNote(int fridgeId, string text, string type) { Note note = new Note { FridgeId = fridgeId, Text = text, Type = type, Display = true }; bdd.Notes.Add(note); bdd.SaveChanges(); //Update note to add Id this.updateNote(note.Id, note.Text + note.Id); return note; }