Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/08/11 12:39:33 (13 years ago)
Author:
ascheibe
Message:

#1233 added Appointment/Schedule ws and dao methods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Convert.cs

    r5526 r5633  
    6464          target.StateLogs.Add(Convert.ToEntity(sl));
    6565        }
    66        
     66
    6767        //target.StateLogs.AddRange(source.StateLog.Select(x => Convert.ToEntity(x)).OrderBy(x => x.DateTime));
    6868        target.IsParentJob = source.IsParentJob;
     
    103103      if ((source != null) && (target != null)) {
    104104        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;
     105      }
     106    }
     107    #endregion
     108
     109    #region Appointment
     110    public static DT.Appointment ToDto(UptimeCalendar source) {
     111      if (source == null) return null;
     112      return new DT.Appointment { Id = source.UptimeCalendarId, AllDayEvent = source.AllDayEvent, EndDate = source.EndDate, Recurring = source.Recurring, RecurringId = source.RecurringId, ResourceId = source.ResourceId, StartDate = source.StartDate };
     113    }
     114    public static UptimeCalendar ToEntity(DT.Appointment source) {
     115      if (source == null) return null;
     116      var entity = new UptimeCalendar(); ToEntity(source, entity);
     117      return entity;
     118    }
     119    public static void ToEntity(DT.Appointment source, UptimeCalendar target) {
     120      if ((source != null) && (target != null)) {
     121        target.UptimeCalendarId = source.Id; target.AllDayEvent = source.AllDayEvent; target.EndDate = source.EndDate; target.Recurring = source.Recurring; target.RecurringId = source.RecurringId; target.ResourceId = source.ResourceId; target.StartDate = source.StartDate;
    105122      }
    106123    }
Note: See TracChangeset for help on using the changeset viewer.