Exemple #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));
        }
Exemple #2
0
        /////////////////////////////////////////////AIRLINE ENDS////////////////////////////////////////////////////////
        /////////////////////////////////////////////FLIGHT STARTS////////////////////////////////////////////////////////
        public IEnumerable <Flight> GetAllFlights()
        {
            BootCampEntities ctx = new BootCampEntities();

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

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

            return(ctx.Locations.Where(c => c.AdminId == id).Select(e => e));
        }
Exemple #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));
        }
Exemple #6
0
        public IEnumerable <Supplier> GetAllSuppliers(int id)
        {
            BootCampEntities ctx = new BootCampEntities();

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

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

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

            return(ctx.Hotels);
        }
Exemple #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));
        }
Exemple #11
0
        /////////////////////////////////////////////FLIGHT ENDS////////////////////////////////////////////////////
        /////////////////////////////////////////////Residence STARTS///////////////////////////////////////////////
        public IEnumerable <Residence> GetAllResidences()
        {
            BootCampEntities ctx = new BootCampEntities();

            return(ctx.Residences);
        }
Exemple #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));
        }
Exemple #13
0
        public IEnumerable <Flight> GetFlightsByAdminId(int id)
        {
            BootCampEntities ctx = new BootCampEntities();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            return(ctx.Extras.Where(c => c.AdminID == id).Select(e => e));
        }
Exemple #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));
        }