コード例 #1
0
        private void MakeGroup(FacilityDownTimeRepository repo, InsertReservationArgs args)
        {
            if (args.Tools.Count() > 0)
            {
                ValidateDateRange(args);

                var reservations = repo.GetReservationsByDateRange(args.Start, args.End, false);

                // 2009-07-19 make a reservation group
                int groupId = repo.CreateNewFacilityDownTime(args.ClientID, args.Start, args.End);

                // If we ever want to allow notes for FDT reservations, do it here.
                string notes = args.Notes;

                // Loop through each selected tool and make reservation and delete other people's reservation
                foreach (int resourceId in args.Tools)
                {
                    // Find and Remove any un-started reservations made during time of repair
                    var existing = reservations.Where(x => x.ResourceID == resourceId).ToList();
                    HandleExistingReservations(repo, existing, args.ClientID, args.End);
                    repo.InsertFacilityDownTimeReservation(resourceId, args.ClientID, groupId, args.Start, args.End, notes);
                }
            }
            else
            {
                throw new Exception("No tools selected, so no reservations were made.");
            }
        }
コード例 #2
0
 public IReservationItem InsertReservation(InsertReservationArgs args)
 {
     throw new NotImplementedException();
 }