Beispiel #1
0
 public static void ToEntity(DT.JobData source, JobData target)
 {
     if ((source != null) && (target != null))
     {
         target.JobId = source.JobId; target.Data = new Binary(source.Data); target.LastUpdate = source.LastUpdate;
     }
 }
Beispiel #2
0
 public Guid AddJobData(DT.JobData dto)
 {
     using (var db = CreateContext(true)) {
         var entity = Convert.ToEntity(dto);
         db.JobDatas.InsertOnSubmit(entity);
         db.SubmitChanges();
         return(entity.JobId);
     }
 }
Beispiel #3
0
        public static JobData ToEntity(DT.JobData source)
        {
            if (source == null)
            {
                return(null);
            }
            var entity = new JobData(); ToEntity(source, entity);

            return(entity);
        }
Beispiel #4
0
 public void UpdateJobData(DT.JobData dto)
 {
     using (var db = CreateContext(true)) {
         var entity = db.JobDatas.FirstOrDefault(x => x.JobId == dto.JobId);
         if (entity == null)
         {
             db.JobDatas.InsertOnSubmit(Convert.ToEntity(dto));
         }
         else
         {
             Convert.ToEntity(dto, entity);
         }
         db.SubmitChanges();
     }
 }