Example #1
0
 public ActionResult Update(Note note)
 {
     if (note != null)
     {
         dal.updateNote(note.Id, note.Text);
         return Json("Success");
     }
     else
     {
         return Json("Error NoteController/Remove/");
     }
 }
Example #2
0
 public ActionResult Restore(Note note)
 {
     if (note != null)
     {
         dal.restoreNote(note.Id);
         return Json("Success");
     }
     else
     {
         return Json("Error NoteController/Remove/");
     }
 }
Example #3
0
 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/");
     }
 }
Example #4
0
 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;
 }