Esempio n. 1
0
        public HttpResponseMessage UpdateAdmin(Administrator admin)
        {
            BootCampEntities   db      = new BootCampEntities();
            HttpRequestMessage Request = new HttpRequestMessage();
            int result = 0;

            try
            {
                db.Administrators.Attach(admin);
                db.Entry(admin).State = EntityState.Modified;
                db.SaveChanges();
                result = 1;
            }
            catch (Exception e)
            {
                result = 0;
            }

            return(Request.CreateResponse(HttpStatusCode.OK, result));
        }
Esempio n. 2
0
        /////////////////////////////////////////////AIRLINE ENDS////////////////////////////////////////////////////////
        /////////////////////////////////////////////FLIGHT STARTS////////////////////////////////////////////////////////
        public IEnumerable <Flight> GetAllFlights()
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Flights);
        }
Esempio n. 3
0
        public IEnumerable <Extra> GetAllExtras(int id)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Extras.Where(c => c.ExtrasId == id).Select(e => e));
        }
Esempio n. 4
0
        public IEnumerable <Location> GetLocationsByAdminId(int id)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Locations.Where(c => c.AdminId == id).Select(e => e));
        }
Esempio n. 5
0
        public IEnumerable <Car> GetAllCarsByLocationDate(string location, DateTime date)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Cars.Where(c => c.Location == location && c.Date == date).Select(e => e));
        }
Esempio n. 6
0
        public IEnumerable <Supplier> GetAllSuppliers(int id)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Suppliers.Where(c => c.SupplierId == id).Select(e => e));
        }
Esempio n. 7
0
        /////////////////////////////////////////////Supplier ENDS//////////////////////////////////////////////////
        /////////////////////////////////////////////CAR STARTS/////////////////////////////////////////////////////
        public IEnumerable <Car> GetAllCars()
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Cars);
        }
Esempio n. 8
0
        public IEnumerable <Residence> GetAllResidences(int id)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Residences.Where(c => c.LocationID == id).Select(e => e));
        }
Esempio n. 9
0
        /////////////////////////////////////////////Residence ENDS/////////////////////////////////////////////////
        /////////////////////////////////////////////HOTEL STARTS///////////////////////////////////////////////////
        public IEnumerable <Hotel> GetAllHotels()
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Hotels);
        }
Esempio n. 10
0
        ///////////////////////////////////////////////ADMINISTRATOR STARTS//////////////////////////////////////////////////
        public IQueryable <Administrator> GetLoginData(AdminModel admin)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Administrators.Where(c => c.Email == admin.Email && c.Password == admin.Password).Select(e => e));
        }
Esempio n. 11
0
        /////////////////////////////////////////////FLIGHT ENDS////////////////////////////////////////////////////
        /////////////////////////////////////////////Residence STARTS///////////////////////////////////////////////
        public IEnumerable <Residence> GetAllResidences()
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Residences);
        }
Esempio n. 12
0
        public IEnumerable <Flight> GetAllFlightsByLocation(string departureCity, string arrivalCity, DateTime date)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Flights.Where(c => c.DepartureLocation == departureCity & c.ArrivalLocation == arrivalCity & c.FlightDate == date).Select(e => e));
        }
Esempio n. 13
0
        public IEnumerable <Flight> GetFlightsByAdminId(int id)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Flights.Where(c => c.AdminID == id).Select(e => e));
        }
Esempio n. 14
0
        public IEnumerable <Flight> GetAllFlights(int id)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Flights.Where(c => c.FlightId == id).Select(e => e));
        }
Esempio n. 15
0
        public IEnumerable <Room> GetAllRoomsByHotelName(string HotelName)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Rooms.Where(c => c.Hotel.Name == HotelName).Select(e => e));
        }
Esempio n. 16
0
        public IEnumerable <Hotel> GetAllHotels(int id)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Hotels.Where(c => c.HotelID == id).Select(e => e));
        }
Esempio n. 17
0
        /////////////////////////////////////////////Room ENDS//////////////////////////////////////////////////////
        /////////////////////////////////////////////Supplier STARTS////////////////////////////////////////////////
        public IEnumerable <Supplier> GetAllSuppliers()
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Suppliers);
        }
Esempio n. 18
0
        public IEnumerable <Hotel> GetHotelsByAdminId(int id)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Hotels.Where(c => c.AdminID == id).Select(e => e));
        }
Esempio n. 19
0
        public IEnumerable <Supplier> GetSupplierByAdminId(int id)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Suppliers.Where(c => c.AdminID == id).Select(e => e));
        }
Esempio n. 20
0
        public IEnumerable <Hotel> GetAllHotelsByCity(string city)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Hotels.Where(c => c.Residence.City == city).Select(e => e));
        }
Esempio n. 21
0
        public IEnumerable <Car> GetAllCars(int id)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Cars.Where(c => c.CarId == id).Select(e => e));
        }
Esempio n. 22
0
        /////////////////////////////////////////////HOTEL ENDS/////////////////////////////////////////////////////
        /////////////////////////////////////////////Room STARTS////////////////////////////////////////////////////
        public IEnumerable <Room> GetAllRooms()
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Rooms);
        }
Esempio n. 23
0
        public IEnumerable <Administrator> GetAllAdmin(int id)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Administrators.Where(c => c.AdminId == id).Select(e => e));
        }
Esempio n. 24
0
        public IEnumerable <Room> GetAllRooms(int id)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Rooms.Where(c => c.RoomID == id).Select(e => e));
        }
Esempio n. 25
0
        /////////////////////////////////////////////ADMINISTRATOR ENDS///////////////////////////////////////////////////
        ///////////////////////////////////////////////LOCATION STARTS////////////////////////////////////////////////////
        public IEnumerable <Location> GetAllLocations()
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Locations);
        }
Esempio n. 26
0
        public IEnumerable <Administrator> GetAllAdmin()
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Administrators);
        }
Esempio n. 27
0
        /////////////////////////////////////////////LOCATION ENDS////////////////////////////////////////////////////////
        /////////////////////////////////////////////EXTRAS STARTS////////////////////////////////////////////////////////
        public IEnumerable <Extra> GetAllExtras()
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Extras);
        }
Esempio n. 28
0
        public IEnumerable <Room> GetRoomsByAdminId(int id)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Rooms.Where(c => c.AdminID == id).Select(e => e));
        }
Esempio n. 29
0
        public IEnumerable <Extra> GetExtrasByAdminId(int id)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Extras.Where(c => c.AdminID == id).Select(e => e));
        }
Esempio n. 30
0
        public IEnumerable <Airline> GetIATA(string airline, int id)
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Airlines.Where(c => c.AirlineName == airline & c.AdminID == id).Select(e => e));
        }