Exemplo n.º 1
0
        public void RejectSchedule(long scheduleId)
        {
            var sch = Schedules.Find(scheduleId);

            sch.Decided          = true;
            sch.ActivationDate   = null;
            sch.DeactivationDate = null;
        }
Exemplo n.º 2
0
        private void AddSchedule(int id, ScheduleType type, int gid, DateTime start, DateTime end, string description, int subId)
        {
            var sched = new Schedule {
                Id = id, Type = type, Group_Id = gid, DateStart = start, DateEnd = end, Description = description
            };

            if (Schedules.Find(id) != null)
            {
                return;
            }
            Schedules.Add(sched);
            Subjects.Find(subId).Schedules.Add(sched);
        }
Exemplo n.º 3
0
        public void ApproveSchedule(long scheduleId)
        {
            var sch    = Schedules.Find(scheduleId);
            var userId = sch.UserId;

            foreach (var schedule in Schedules.Where(p => p.UserId == userId && p.ActivationDate != null && p.ScheduleId != scheduleId).ToList())
            {
                schedule.DeactivationDate = DateTime.Now;
            }

            sch.Decided        = true;
            sch.ActivationDate = DateTime.Now.AddDays(1);
        }
 public async Task <BsuirScheduleResponse> GetSchedule(int group)
 {
     return(await Schedules.Find(new BsonDocument("_id", group)).FirstOrDefaultAsync());
 }