public static ScheduleDTO GetAsync(int key) { Schedule sched = ScheduleData.Get(key); if (sched == null) { return(null); } ScheduleDTO dto = TransformToDTO(sched); return(dto); }
/// <summary> /// Finds the next day with clinic hours for the current department. Searches 30 days into the future /// and then throws an InvalidOperationException. /// </summary> /// <param name="context"></param> protected override void DoWork(CodeActivityContext context) { var scheduleData = ScheduleData.Get(context); var pairs = scheduleData.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries); foreach (var pair in pairs) { var tuple = pair.Split(new[] { '=' }, StringSplitOptions.RemoveEmptyEntries); if (tuple.Length != 2) { continue; } var name = tuple[0].Trim().ToLower(); var value = tuple[1].Trim(); switch (name) { case "pat_id1": PatId1.Set(context, Int32.Parse(value)); break; case "appt_dttm": AppDtTm.Set(context, DateTime.Parse(value)); break; case "activity": Activity.Set(context, value); break; case "staff_id": StaffId.Set(context, Int32.Parse(value)); break; case "private": // TODO: should we call the IsAppointmentPrivate logic from the Schedule BOM entity? Private.Set(context, Int16.Parse(value) != 0); break; case "create_id": CreateId.Set(context, Int32.Parse(value)); break; case "create_dttm": CreateDtTm.Set(context, DateTime.Parse(value)); break; } } }