예제 #1
0
파일: Report.cs 프로젝트: zxl881203/src
        private static void Del(string reportId, pm2Entities context)
        {
            plus_report entity = (from m in context.plus_report
                                  where m.Id == reportId
                                  select m).FirstOrDefault <plus_report>();

            if (entity != null)
            {
                context.DeleteObject(entity);
            }
        }
예제 #2
0
 protected internal static void Add(plus_report report, List <ReportDetail> details, pm2Entities context)
 {
     if (details != null)
     {
         foreach (ReportDetail detail in details)
         {
             plus_reportDetail detail2 = new plus_reportDetail {
                 Id          = Guid.NewGuid().ToString(),
                 plus_report = report,
                 Start       = detail.Start,
                 Finish      = detail.Finish,
                 Completed   = new byte?(detail.Completed),
                 Note        = detail.Note,
                 TaskUID     = detail.TaskUID
             };
             context.AddToplus_reportDetail(detail2);
         }
     }
 }
예제 #3
0
파일: Report.cs 프로젝트: zxl881203/src
 public void Add(Report entity, List <ReportDetail> details)
 {
     using (pm2Entities entities = new pm2Entities())
     {
         if (entity != null)
         {
             plus_report _report = new plus_report {
                 Id           = entity.Id,
                 InputDate    = entity.InputDate,
                 InputUser    = entity.InputUser,
                 FlowState    = entity.FlowState,
                 Note         = entity.Note,
                 ProVersionId = entity.ProVersionId
             };
             entities.AddToplus_report(_report);
             ReportDetail.Add(_report, details, entities);
             entities.SaveChanges();
         }
     }
 }
예제 #4
0
파일: Report.cs 프로젝트: zxl881203/src
 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();
             }
         }
     }
 }