public static bool InsertFlightServicePassenger( string givenName, string middleName, string surname, string gender, string birthDate, string passportOrIDNo, string passportOrIDExpiryDate, string email, string mobileNo) { using (var db = new OTADBContext()) { var newTuple = new FlightServicePassenger() { GivenName = givenName, MiddleName = middleName, Surname = surname, Gender = gender, Birthdate = birthDate, PassportOrIdNo = passportOrIDNo, PassportOrIdExpiryDate = passportOrIDExpiryDate, Email = email, MobileNo = mobileNo }; db.FlightServicePassengers.Add(newTuple); var affected = db.SaveChanges(); return(affected == 1); } }
public static List <FlightServicePassenger> GetAllFlightServicePassenger() { using (var db = new OTADBContext()) { var passengers = db.FlightServicePassengers.ToList(); return(passengers); } }
public static FlightService GetFlightService(int fsId) { using (var db = new OTADBContext()) { var newTuple = db.FlightServices. ToList(). Where(x => x.FsId == fsId). First(); return(newTuple); } }
public static BaggageInformation GetNewBaggageInformation() { using (var db = new OTADBContext()) { var newTuple = db.BaggageInformations. ToList(). OrderByDescending(x => x.BiId). Take(1). First(); return(newTuple); } }
public static BookedFlightService GetNewBookedFlightService() { using (var db = new OTADBContext()) { var newTuple = db.BookedFlightServices. ToList(). OrderByDescending(x => x.BookingId). Take(1). First(); return(newTuple); } }
public static FlightServicePassenger GetNewFlightServicePassenger() { using (var db = new OTADBContext()) { var newPassenger = db.FlightServicePassengers. ToList(). OrderByDescending(x => x.PassengerId). Take(1). First(); return(newPassenger); } }
public static bool InsertBookedFlightService(int fsId, string date) { using (var db = new OTADBContext()) { var newTuple = new BookedFlightService() { FsId = fsId, Date = date }; db.BookedFlightServices.Add(newTuple); var affected = db.SaveChanges(); return(affected == 1); } }
public static bool InsertBookedPassenger(int bookedId, int passengerId) { using (var db = new OTADBContext()) { var newTuple = new BookedPassenger() { BookedId = bookedId, PassengerId = passengerId }; db.BookedPassengers.Add(newTuple); var affected = db.SaveChanges(); return(affected == 1); } }
public static bool InsertBaggageInformation(int passengerId, int cabinBagCount, int checkedBagCount) { using (var db = new OTADBContext()) { var newTuple = new BaggageInformation() { PassengerId = passengerId, CabinBagCount = cabinBagCount, CheckedBagCount = checkedBagCount }; db.BaggageInformations.Add(newTuple); var affected = db.SaveChanges(); return(affected == 1); } }
public static bool InsertBillBaggage(int biId, decimal cabinBagPrice, decimal checkedBagPrice ) { using (var db = new OTADBContext()) { var newTuple = new BillBaggage() { BiId = biId, CabinBagPrice = cabinBagPrice, CheckedBagPrice = checkedBagPrice }; db.BillBaggages.Add(newTuple); var affected = db.SaveChanges(); return(affected == 1); } }
public static bool InsertBilledBookedFlightService( int bookingId, string method, decimal totalPrice ) { using (var db = new OTADBContext()) { var newTuple = new BilledBookedFlightService() { BookingId = bookingId, Method = method, TotalPrice = totalPrice }; db.BilledBookedFlightServices.Add(newTuple); var affected = db.SaveChanges(); return(affected == 1); } }