-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathReceptionDeskData.cs
More file actions
72 lines (63 loc) · 3.3 KB
/
ReceptionDeskData.cs
File metadata and controls
72 lines (63 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System;
using System.Collections.ObjectModel;
namespace Scheduler_CustomAppearance {
public class MedicalAppointment {
public int Id { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
public string Subject { get; set; }
public int LabelId { get; set; }
public string Location { get; set; }
}
public class ReceptionDeskData {
public static DateTime BaseDate = DateTime.Today;
public static string[] PatientNames = { "Andrew Glover", "Mark Oliver",
"Taylor Riley", "Addison Davis",
"Benjamin Hughes", "Lucas Smith",
"Robert King", "Laura Callahan",
"Miguel Simmons", "Isabella Carter",
"Andrew Fuller", "Madeleine Russell",
"Steven Buchanan", "Nancy Davolio",
"Michael Suyama", "Margaret Peacock",
"Janet Leverling", "Ariana Alexander",
"Brad Farkus", "Bart Arnaz",
"Arnie Schwartz", "Billy Zimmer"};
static Random rnd = new Random();
void CreateMedicalAppointments() {
int appointmentId = 1;
int patientIndex = 0;
DateTime start;
TimeSpan duration;
ObservableCollection<MedicalAppointment> result =
new ObservableCollection<MedicalAppointment>();
for (int i = -20; i < 20; i++)
for (int j = 0; j < 7; j++) {
int room = rnd.Next(1, 100);
start = BaseDate.AddDays(i).AddHours(rnd.Next(8, 17)).AddMinutes(rnd.Next(0, 40));
duration = TimeSpan.FromMinutes(rnd.Next(20, 30));
result.Add(CreateMedicAppointment(appointmentId, PatientNames[patientIndex],
start, duration, room));
appointmentId++;
patientIndex++;
if (patientIndex >= PatientNames.Length - 1)
patientIndex = 1;
}
MedicalAppointments = result;
}
MedicalAppointment CreateMedicAppointment(int appointmentId, string patientName,
DateTime start, TimeSpan duration, int room) {
MedicalAppointment medicalAppointment = new MedicalAppointment();
medicalAppointment.Id = appointmentId;
medicalAppointment.StartTime = start;
medicalAppointment.EndTime = start.Add(duration);
medicalAppointment.Subject = patientName;
medicalAppointment.LabelId = rnd.Next(1, 10);
medicalAppointment.Location = String.Format("{0}", room);
return medicalAppointment;
}
public ObservableCollection<MedicalAppointment> MedicalAppointments { get; private set; }
public ReceptionDeskData() {
CreateMedicalAppointments();
}
}
}