Beispiel #1
0
 public static string NoteUpdate(NoteViews note)
 {
     try
     {
         using (WebdeNotEntities db = new WebdeNotEntities())
         {
             TblNote upnote = db.TblNote.Find(note.ID);
             if (upnote != null)
             {
                 upnote.Title            = note.Title;
                 upnote.Description      = note.Description;
                 upnote.ReminderDate     = note.ReminderDate;
                 upnote.İmportantyDegree = note.İmportantyDegree;
                 db.SaveChanges();
                 return("+ note guncellendi.");
             }
             else
             {
                 return("- note bulunamadi.");
             }
         }
     }
     catch (Exception ex)
     {
         return("- " + ex.Message);
     }
 }
Beispiel #2
0
 public static string NoteAdd(NoteViews newnote)
 {
     try
     {
         using (WebdeNotEntities db = new WebdeNotEntities())
         {
             TblNote new_note = new TblNote
             {
                 Title            = newnote.Title,
                 Description      = newnote.Description,
                 ReminderDate     = newnote.ReminderDate,
                 İmportantyDegree = newnote.İmportantyDegree,
             };
             db.TblNote.Add(new_note);
             db.SaveChanges();
             return("+ Note eklendi");
         }
     }
     catch (Exception ex)
     {
         return("- " + ex.Message);
     }
 }
 public JsonResult updateNote(NoteViews note)
 {
     return(Json(DataLogic.Notes.NoteUpdate(note)));
 }
 public JsonResult addNote(NoteViews note)
 {
     return(Json(DataLogic.Notes.NoteAdd(note)));
 }