Exemplo n.º 1
0
 public void Update(Report entity, List <ReportDetail> details)
 {
     using (pm2Entities entities = new pm2Entities())
     {
         if (entity != null)
         {
             plus_report report = (from m in entities.plus_report
                                   where m.Id == entity.Id
                                   select m).FirstOrDefault <plus_report>();
             if (report != null)
             {
                 report.InputUser = entity.InputUser;
                 report.InputDate = entity.InputDate;
                 report.Note      = entity.Note;
                 ReportDetail.Del(report.Id, entities);
                 ReportDetail.Add(report, details, entities);
                 entities.SaveChanges();
             }
         }
     }
 }