Beispiel #1
0
 //实现后台ReceptionSchdeule和Appointment之间的装换
 public Appointment ConvertToAppointment(ReceptionScheduleDTO schedule)
 {
     var appointment = new Appointment
     {
         Subject = schedule.Subject,
         Body = schedule.Body,
         End = schedule.End,
         Start = schedule.Start,
         IsAllDayEvent = schedule.IsAllDayEvent,
         TimeMarker = GetTimeMarker(schedule.Importance),
         Category = GetCategory(schedule.Tempo),
         UniqueId = schedule.ReceptionScheduleId.ToString(CultureInfo.InvariantCulture),
     };
     appointment.Resources.Add(GetResource(schedule.Group));
     return appointment;
 }
Beispiel #2
0
 public ReceptionScheduleDTO ConvertToReceptionSchedule(Appointment appointment)
 {
     var schedule = new ReceptionScheduleDTO
     {
         Body = appointment.Body,
         Subject = appointment.Subject,
         Start = appointment.Start,
         End = appointment.End
     };
     if (appointment.TimeMarker != null)
         schedule.Importance = appointment.TimeMarker.TimeMarkerName;
     schedule.IsAllDayEvent = appointment.IsAllDayEvent;
     if (appointment.Category != null)
         schedule.Tempo = appointment.Category.CategoryName;
     ResourceCollection ar = appointment.Resources;
     schedule.Group = GetScheduleGroup(ar);//将对应的取过来
     return schedule;
 }