예제 #1
0
 public static bool SaveDeleteTrash(Trash note, ConfigureTrash configure)
 {
     try
     {
         fmNote._context.Notes.Add(new Note {
             UserID = note.UserID, NodeID = note.TrashID, Body = note.Body, Tittle = note.Title, SDate = note.SDate
         });
         fmNote._context.ConfigureNotes.Add(new ConfigureNote
         {
             NodeID       = configure.TrashID,
             FontNote     = configure.FontTrash,
             SizeNote     = configure.SizeTrash,
             Boldtxt      = configure.Boldtxt,
             Italictxt    = configure.Italictxt,
             Underlinwtxt = configure.Underlinetxt,
             Striketxt    = configure.Striketxt,
             Colortxt     = configure.Colortxt
         });
         fmNote._context.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
예제 #2
0
 public static bool DeleteTrash(Trash note, ConfigureTrash configure)
 {
     try
     {
         fmNote._context.ConfigureTrashes.Remove(configure);
         fmNote._context.Trashes.Remove(note);
         fmNote._context.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }