//实现后台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; }
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; }