Example #1
0
 public override void WriteToDb()
 {
     using (afmdbEntities ctx = new afmdbEntities())
     {
         tbtimerecorder timeRecorder = new tbtimerecorder();
         timeRecorder.workState = (int)this.workState;
         timeRecorder.startTime = this.StartTime;
         timeRecorder.endTime   = this.EndTime;
         timeRecorder.subType   = (int)this.abNormalType;
         ctx.tbtimerecorder.Add(timeRecorder);
     }
 }
Example #2
0
 public void WriteToDb()
 {
     try
     {
         using (afmdbEntities ctx = new afmdbEntities())
         {
             tbtimerecorder timeRecorder = new tbtimerecorder();
             timeRecorder.workState = (int)this.workState;
             timeRecorder.startTime = this.StartTime;
             timeRecorder.endTime   = this.EndTime;
             timeRecorder.span      = this.span;
             timeRecorder.subType   = (int)this.timeType;
             ctx.tbtimerecorder.Add(timeRecorder);
             ctx.SaveChangesAsync();
         }
     }
     catch
     {
     }
 }