Exemple #1
0
        public override Room GetItem()
        {
            Room New = new Room();

            try
            {
                // Fill out all the details
                New.RoomName        = RoomName;
                New.StandardSeats   = Convert.ToInt32(StandardSeats);
                New.SpecialSeatType = SpecialSeatType;
                New.SpecialSeats    = Convert.ToInt32(SpecialSeats);
                New.Id            = RoomId;
                New.Bookings      = Bookings;
                New.ComputerNames = ComputerLines.ToList();

                // Select the correct department
                using (DataRepository Repo = new DataRepository())
                    New.Department = Repo.Departments.Single(d => d.Name == Department);
            }
            catch
            {
                return(null);
            }

            return(New);
        }