Exemplo n.º 1
0
 public IQueryable<Models.AvailableExLocations_Result> AvailableExLocations(int id)
 {
     var output = new List<Models.AvailableExLocations_Result>();
     using (var context = new Models.VtcContext()) {
         output.AddRange(context.AvailableExLocations(id));
     }
     return output.AsQueryable();
 }
Exemplo n.º 2
0
 public IQueryable<Models.AvailablePeople_Result> AvailableEmails(int id)
 {
     var output = new List<Models.AvailablePeople_Result>();
     using (var context = new Models.VtcContext()) {
         output.AddRange(context.AvailablePeople(id).Where(p => !string.IsNullOrEmpty(p.Email)));
     }
     return output.AsQueryable();
 }
Exemplo n.º 3
0
 public IQueryable<Models.AvailableRooms_Result> AvailableRooms(int meetingId, int buildingId)
 {
     var output = new List<Models.AvailableRooms_Result>();
     using (var context = new Models.VtcContext()) {
         output.AddRange(context.AvailableRooms(meetingId, buildingId));
     }
     return output.AsQueryable();
 }
Exemplo n.º 4
0
 // GET api/event/5
 public Event Get(int id)
 {
     using (var context = new Models.VtcContext()) {
         var result = context.Meetings.Find(id);
         if (result == null) { throw new HttpResponseException(HttpStatusCode.NotFound); }
         return new Event(result);
     }
     return null;
 }
Exemplo n.º 5
0
 // GET api/kemtahtech/5
 public KemtahTech Get(int id)
 {
     using (var context = new Models.VtcContext()) {
         var result = context.KemtahTeches.Find(id);
         if (result == null) { throw new HttpResponseException(HttpStatusCode.NotFound); }
         return KemtahTech.GetKemtahTech(result);
     }
     return null;
 }
        // POST api/values
        public HttpResponseMessage Post([FromBody] AvailableBadgeNumbersRequest request)
        {
            var output = new List<Models.AvailableBadgeNumbers_Result>();
            using (var context = new Models.VtcContext()) {
                output.AddRange(context.AvailableBadgeNumbers(request.id,request.search,request.maxResults).AsEnumerable());
            }

            return Request.CreateResponse(System.Net.HttpStatusCode.Created, output.AsQueryable());
        }
Exemplo n.º 7
0
 // GET api/building/5
 public State Get(int id)
 {
     using (var context = new Models.VtcContext()) {
         var result = context.Ref_State.Find(id);
         if (result == null) { throw new HttpResponseException(HttpStatusCode.NotFound); }
         return State.GetState(result);
     }
     return null;
 }
Exemplo n.º 8
0
 // GET api/location/5
 public Location Get(int id)
 {
     using (var context = new Models.VtcContext()) {
         var result = context.Locations.Find(id);
         if (result == null) { throw new HttpResponseException(HttpStatusCode.NotFound); }
         return Location.GetLocation(result);
     }
     return null;
 }
Exemplo n.º 9
0
 // GET api/building/5
 public Building Get(int id)
 {
     using (var context = new Models.VtcContext()) {
         var result = context.Buildings.Find(id);
         if (result == null) { throw new HttpResponseException(HttpStatusCode.NotFound); }
         return Building.GetBuilding(result);
     }
     return null;
 }
Exemplo n.º 10
0
        // GET api/room
        public IQueryable<Room> Get()
        {
            var output = new List<Room>();

            using (var context = new Models.VtcContext()) {
                foreach (var item in context.Rooms.OrderBy(r => r.Name)) {
                    output.Add(Room.GetRoom(item));
                }
            }
            return output.AsQueryable();
        }
Exemplo n.º 11
0
        // GET api/building
        public IQueryable<State> Get()
        {
            var output = new List<State>();

            using (var context = new Models.VtcContext()) {
                foreach (var item in context.Ref_State.OrderBy(b => b.Abbreviation)) {
                    output.Add(State.GetState(item));
                }
            }
            return output.AsQueryable();
        }
Exemplo n.º 12
0
        // GET api/location
        public IQueryable<Location> Get()
        {
            var output = new List<Location>();

            using (var context = new Models.VtcContext()) {
                foreach (var item in context.Locations) {
                    output.Add(Location.GetLocation(item));
                }
            }
            return output.AsQueryable();
        }
Exemplo n.º 13
0
        // GET api/MeetingSeries
        public IQueryable<Series> Get()
        {
            var output = new List<Series>();

            using (var context = new Models.VtcContext()) {
                foreach (var item in context.Series) {
                    output.Add(Series.GetSeries(item));
                }
            }
            return output.AsQueryable();
        }
Exemplo n.º 14
0
        // GET api/building
        public IQueryable<Building> Get()
        {
            var output = new List<Building>();

            using (var context = new Models.VtcContext()) {
                foreach (var item in context.Buildings.OrderBy(b => b.Name)) {
                    output.Add(Building.GetBuilding(item));
                }
            }
            return output.AsQueryable();
        }
Exemplo n.º 15
0
        // GET api/person
        public IQueryable<Person> Get()
        {
            var output = new List<Person>();

            using (var context = new Models.VtcContext()) {
                foreach (var item in context.People) {
                    output.Add(Person.GetPerson(item));
                }
            }
            return output.AsQueryable();
        }
Exemplo n.º 16
0
        // GET api/kemtahtech
        public IQueryable<KemtahTech> Get()
        {
            var output = new List<KemtahTech>();

            using (var context = new Models.VtcContext()) {
                foreach (var item in context.KemtahTeches) {
                    output.Add(KemtahTech.GetKemtahTech(item));
                }
            }
            return output.AsQueryable();
        }
Exemplo n.º 17
0
        // GET api/meeting
        public IQueryable<Meeting> Get()
        {
            var output = new List<Meeting>();

            using (var context = new Models.VtcContext()) {
                foreach (var item in context.Meetings) {
                    output.Add(Meeting.GetMeeting(item));
                }
            }
            return output.AsQueryable();
        }