コード例 #1
0
 public ConverterAppointment(int id, ConverterAppointmentType apt, ConverterTimeSlot ts, long expectedDate)
 {
     this.id           = id;
     this.expectedDate = expectedDate;
     type     = apt;
     timeSlot = ts;
     //     type = new ConverterAppointmentType(apt.GetID(), apt.GetDescription(), apt.GetCost()); // { cost = apt.GetCost(), description = apt.GetDescription(), id = apt.GetID() };
     //     var den = ts.GetDentist();
     //     var dentist = new ConverterDentist(den.GetID(), den.GetName(), den.GetEmail(), den.GetPhone()); // {email = den.GetEmail(), id = den.GetID(), name = den.GetName(), phone = den.GetPhone()};
     //     timeSlot = new ConverterTimeSlot(ts.GetID(), dentist, ts.GetHour(), ts.GetMin(), ts.GetDay()); // { day = ts.GetDay(), dentist = cDentist, hour = ts.GetHour(), id = ts.GetID(), minute = ts.GetMin() };
 }
コード例 #2
0
        public override string GetJson(object o)
        {
            var a = o as Appointment;

            CheckNull(a);
            var at   = a.GetAppointmentType();
            var cat  = new ConverterAppointmentType(at.GetID(), at.GetDescription(), at.GetCost());
            var ts   = a.GetTimeSlot();
            var den  = ts.GetDentist();
            var cDen = new ConverterDentist(den.GetID(), den.GetName(), den.GetEmail(), den.GetPhone());
            var cts  = new ConverterTimeSlot(ts.GetID(), cDen, ts.GetHour(), ts.GetMin(), ts.GetDay());

            return(JsonConvert.SerializeObject(new ConverterAppointment(a.GetID(), cat, cts, a.GetExpectedDate())));
        }