-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathModel.cs
More file actions
51 lines (44 loc) · 1.82 KB
/
Model.cs
File metadata and controls
51 lines (44 loc) · 1.82 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
using System;
using System.Collections.ObjectModel;
namespace Scheduler_Reminders {
public class ReminderAppointment {
public int Id { get; set; }
public bool AllDay { get; set; }
public DateTime Start { get; set; }
public DateTime End { get; set; }
public string Subject { get; set; }
public int Label { get; set; }
public int Status { get; set; }
public string RecurrenceInfo { get; set; }
public string ReminderInfo { get; set; }
}
class AppointmentData {
static Random rnd = new Random();
void CreateAppointments() {
int appointmentId = 1;
DateTime start;
TimeSpan duration;
ObservableCollection<ReminderAppointment> result =
new ObservableCollection<ReminderAppointment>();
for (int i = 0; i < 5; i++) {
ReminderAppointment appointmentWithReminder = new ReminderAppointment();
start = DateTime.Now.AddMinutes(1);
duration = TimeSpan.FromMinutes(rnd.Next(30, 50));
appointmentWithReminder.Id = appointmentId;
appointmentWithReminder.Start = start;
appointmentWithReminder.End = start.Add(duration);
appointmentWithReminder.Subject = "Test Appointment";
appointmentWithReminder.Label = rnd.Next(1, 10);
appointmentWithReminder.Status = rnd.Next(0, 4);
result.Add(appointmentWithReminder);
appointmentId++;
}
AppointmentRepository = result;
}
public ObservableCollection<ReminderAppointment> AppointmentRepository { get; private set; }
public AppointmentData()
{
CreateAppointments();
}
}
}