protected override IList <AppointmentViewModel> FillAppointments() { var result = new List <AppointmentViewModel>(); var subjects = new List <string>() { "Webinar - Julian on JavaScript - Learning from reading: underscore.js", "Webinar - Advanced CodeRush Plug-ins – Working with the TextDocument and TextView", "Webinar - Rich data visualization with Pivot Grid and Charts", "Webinar - Ask the ASP.NET Team" }; int dayOffset = -2; foreach (var subject in subjects) { var appointment = AppointmentViewModel.Create(); appointment.EventType = 0; appointment.StartDate = DateTime.Today.Date.AddDays(dayOffset).AddHours(9); appointment.EndDate = DateTime.Today.Date.AddDays(dayOffset).AddHours(10); appointment.AllDay = false; appointment.Subject = subject; appointment.Status = 0; appointment.Label = 2; result.Add(appointment); dayOffset++; } return(result); }
static AppointmentViewModel CreateAppointment(DataRow row) { AppointmentViewModel appointment = AppointmentViewModel.Create(); appointment.EventType = (int?)row["EventType"]; appointment.StartDate = (DateTime?)row["StartDate"]; appointment.EndDate = (DateTime?)row["EndDate"]; appointment.AllDay = (bool?)row["AllDay"]; appointment.Subject = Convert.ToString(row["Subject"]); appointment.Location = Convert.ToString(row["Location"]); appointment.Description = Convert.ToString(row["Description"]); appointment.Status = (int?)row["Status"]; appointment.Label = (int?)row["Label"]; appointment.RecurrenceInfo = Convert.ToString(row["RecurrenceInfo"]); appointment.ReminderInfo = Convert.ToString(row["ReminderInfo"]); appointment.ContactInfo = Convert.ToString(row["ContactInfo"]); return(appointment); }