示例#1
0
 public void Add(Note entity)
 {
     using (DateBookDbEntities db = new DateBookDbEntities())
     {
         db.sp_InsertNote(entity.Tittle, entity.Description, entity.FinishDate, entity.PaymentAmount);
     }
 }
示例#2
0
 public List <Note> GetAll()
 {
     using (DateBookDbEntities db = new DateBookDbEntities())
     {
         List <Note> notes = new List <Note>();
         foreach (var item in db.sp_SelectNotes().ToList())
         {
             notes.Add(new Note
             {
                 Description   = item.Description,
                 FinishDate    = item.FinishDate,
                 Tittle        = item.Tittle,
                 PaymentAmount = item.PaymentAmount,
                 Status        = item.Status,
                 Deleted       = item.Deleted,
             });
         }
         return(notes);
     }
 }