Esempio n. 1
0
 public static void ToEntity(DT.StateLog source, StateLog target)
 {
     if ((source != null) && (target != null))
     {
         target.StateLogId = source.Id; target.DateTime = source.DateTime; target.Exception = source.Exception; target.JobId = source.JobId; target.SlaveId = source.SlaveId; target.State = source.State; target.UserId = source.UserId;
     }
 }
Esempio n. 2
0
 public Guid AddStateLog(DT.StateLog dto)
 {
     using (var db = CreateContext()) {
         var entity = Convert.ToEntity(dto);
         db.StateLogs.InsertOnSubmit(entity);
         db.SubmitChanges();
         return(entity.StateLogId);
     }
 }
Esempio n. 3
0
        public static StateLog ToEntity(DT.StateLog source)
        {
            if (source == null)
            {
                return(null);
            }
            var entity = new StateLog(); ToEntity(source, entity);

            return(entity);
        }
Esempio n. 4
0
 public void UpdateStateLog(DT.StateLog dto)
 {
     using (var db = CreateContext()) {
         var entity = db.StateLogs.FirstOrDefault(x => x.StateLogId == dto.Id);
         if (entity == null)
         {
             db.StateLogs.InsertOnSubmit(Convert.ToEntity(dto));
         }
         else
         {
             Convert.ToEntity(dto, entity);
         }
         db.SubmitChanges();
     }
 }