Exemplo n.º 1
0
 public bool AddDayBook(DayBook model)
 {
     try
     {
         entities.DayBooks.Add(model);
         entities.SaveChanges();
         return true;
     }
     catch (Exception x)
     {
         throw x;
     }
 }
Exemplo n.º 2
0
 public bool UpdateDayBook(DayBook model)
 {
     try
     {
         DayBook daybook = entities.DayBooks.Where(x => x.DayBookId == model.DayBookId).SingleOrDefault();
         if (daybook != null)
         {
             entities.Entry(daybook).CurrentValues.SetValues(model);
             entities.SaveChanges();
             return true;
         }
         else
         {
             return false;
         }
     }
     catch (Exception x)
     {
         throw x;
     }
 }