Ejemplo n.º 1
0
        private Json GenerateDefaultDay(DateTime date)
        {
            var jobsCollection = db.GetCollection<Job>("jobs");

            // Todo: remove this in production
            if(jobsCollection.Count() == 0)
                GenerateDefaultJobs(jobsCollection);

            var jobsList = jobsCollection.AsQueryable();

            var day = new Day
                          {
                              Date = date,
                              Positions = new List<Position>
                                              {
                                                  new Position
                                                      {
                                                          Job = jobsList.SingleOrDefault(x => x.Name == "Commons Coordinator"),
                                                          MaximumPersons = 3,
                                                          Time = new TimeSpan(9, 0, 0)
                                                      },
                                                  new Position
                                                      {
                                                          Job = jobsList.SingleOrDefault(x => x.Name == "Sound & Light"),
                                                          MaximumPersons = 3,
                                                          Time = new TimeSpan(9, 0, 0)
                                                      },
                                                  new Position
                                                      {
                                                          Job = jobsList.SingleOrDefault(x => x.Name == "Sound & Light"),
                                                          MaximumPersons = 3,
                                                          Time = new TimeSpan(11, 0, 0)
                                                      },
                                                  new Position
                                                      {
                                                          Job = jobsList.SingleOrDefault(x => x.Name == "Greeters"),
                                                          MaximumPersons = 3,
                                                          Time = new TimeSpan(11, 0, 0)
                                                      },
                                                  new Position
                                                      {
                                                          Job = jobsList.SingleOrDefault(x => x.Name == "YRE Family Greeter"),
                                                          MaximumPersons = 3,
                                                          Time = new TimeSpan(9, 0, 0)
                                                      },
                                              }
                          };

            db.GetCollection<Day>("days").Save(day);
            return Json(day);
        }
Ejemplo n.º 2
0
 public void UpdateDay(Day day)
 {
     throw new NotImplementedException();
 }