예제 #1
0
        private void CreateAppointments()
        {
            Random rand = new Random(DateTime.Now.Millisecond);

            Appointments.Add(MedicalAppointment.Create(startTime: DateTime.Now.Date.AddHours(10), endTime: DateTime.Now.Date.AddHours(11.5), doctorId: 1, paymentStateId: 1, location: "101", patientName: "Dave Murrel", note: "Take care", fixedTime: true));
            Appointments.Add(MedicalAppointment.Create(startTime: DateTime.Now.Date.AddDays(2).AddHours(15), endTime: DateTime.Now.Date.AddDays(2).AddHours(16.5), doctorId: 1, paymentStateId: 1, location: "101", patientName: "Mike Roller", note: "Schedule next visit soon", fixedTime: true));

            Appointments.Add(MedicalAppointment.Create(startTime: DateTime.Now.Date.AddDays(1).AddHours(11), endTime: DateTime.Now.Date.AddDays(1).AddHours(12), doctorId: 2, paymentStateId: 1, location: "103", patientName: "Bert Parkins", note: "", fixedTime: true));
            Appointments.Add(MedicalAppointment.Create(startTime: DateTime.Now.Date.AddDays(2).AddHours(10), endTime: DateTime.Now.Date.AddDays(2).AddHours(12), doctorId: 2, paymentStateId: 0, location: "103", patientName: "Carl Lucas", note: "", fixedTime: false));

            Appointments.Add(MedicalAppointment.Create(startTime: DateTime.Now.Date.AddHours(12), endTime: DateTime.Now.Date.AddHours(13.5), doctorId: 3, paymentStateId: 0, location: "104", patientName: "Brad Barnes", note: "Tests are necessary", fixedTime: false));
            Appointments.Add(MedicalAppointment.Create(startTime: DateTime.Now.Date.AddDays(1).AddHours(14), endTime: DateTime.Now.Date.AddDays(1).AddHours(15), doctorId: 3, paymentStateId: 1, location: "104", patientName: "Richard Fisher", note: "", fixedTime: true));
        }
        internal static MedicalAppointment Create(DateTime startTime, DateTime endTime, int doctorId, int paymentStateId, string location, string patientName, string note, bool fixedTime)
        {
            MedicalAppointment apt = MedicalAppointment.Create();

            apt.StartTime      = startTime;
            apt.EndTime        = endTime;
            apt.DoctorId       = doctorId;
            apt.PaymentStateId = paymentStateId;
            apt.Note           = note;
            apt.Location       = location;
            apt.PatientName    = patientName;
            apt.FixedTime      = fixedTime;
            return(apt);
        }