Exemple #1
0
        /// <summary>
        /// Converts this instance of <see cref="AutomationJob"/> to an instance of <see cref="AutomationJobDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="AutomationJob"/> to convert.</param>
        public static AutomationJobDTO ToDTO(this AutomationJob entity)
        {
            if (entity == null) return null;

            var dto = new AutomationJobDTO();

            dto.JobId = entity.JobId;
            dto.Name = entity.Name;
            dto.Type = entity.Type;
            dto.Priority = entity.Priority;
            dto.Status = entity.Status;
            dto.RetryTimes = entity.RetryTimes;
            dto.CreateDate = entity.CreateDate;
            dto.CreateBy = entity.CreateBy;
            dto.ModifyDate = entity.ModifyDate;
            dto.ModifyBy = entity.ModifyBy;
            dto.SUTEnvironmentId = entity.SUTEnvironmentId == null ? 0 : entity.SUTEnvironmentId.Value;
            dto.TestAgentEnvironmentId = entity.TestAgentEnvironmentId == null ? 0 : entity.TestAgentEnvironmentId.Value;
            dto.Timeout = entity.Timeout.Value;
            dto.Description = entity.Description;

            entity.OnDTO(dto);

            return dto;
        }
Exemple #2
0
 public AutomationJobDTO Create(AutomationJobDTO instance)
 {
     return AutomationJob.CreateJob(instance.ToEntity()).ToDTO();
 }
Exemple #3
0
 public AutomationJobDTO Update(string jobId, AutomationJobDTO instance)
 {
     instance.JobId = int.Parse(jobId);
     instance.ModifyDate = System.DateTime.UtcNow;
     return AutomationJob.UpdateAutomationJob(int.Parse(jobId), instance).ToDTO();
 }
Exemple #4
0
        /// <summary>
        /// Invoked when <see cref="ToDTO"/> operation is about to return.
        /// </summary>
        /// <param name="dto"><see cref="AutomationJobDTO"/> converted from <see cref="AutomationJob"/>.</param>
partial         static void OnDTO(this AutomationJob entity, AutomationJobDTO dto);