public async Task <bool> InsertShuttleBus(ShuttleBus shuttleBus) { //delayed actual implementation due to this being out of scope for now _context.Add(shuttleBus); await _context.SaveChangesAsync(); return(true); }
public async Task <bool> InsertTaxiConRes(TaxiConBooking taxiConBooking) { _context.Add(taxiConBooking); //Check for successful changes to database //Successful if (await _context.SaveChangesAsync() > 0) { return(true); } //Fail else { return(false); } }
public async Task <bool> InsertShuttleBooking(ShuttleSchedule shuttleShedule) { Debug.WriteLine("DAO - Adding Shuttle Schedule..."); _context.Add(shuttleShedule); Debug.WriteLine("DAO - Added Shuttle Schedule."); //Check for successful changes to database //Successful if (await _context.SaveChangesAsync() > 0) { return(true); } //Fail else { return(false); } }
public async Task <bool> InsertShuttlePassenger(ShuttlePassenger shuttlePassenger) { Debug.WriteLine("[DAO] - Adding Shuttle Passenger..."); _context.Add(shuttlePassenger); //successful save after add if (await _context.SaveChangesAsync() > 0) { _context.Entry <ShuttlePassenger>(shuttlePassenger).State = EntityState.Detached; //detaches the object after adding. should solve? Debug.WriteLine("[DAO] - Added Shuttle Passenger."); return(true); } //Fail else { return(false); } }
public bool insert(PostCharge PostCharge) { _context.Add(PostCharge); return(_context.SaveChanges() > 0 ? true : false); }
public bool insert(ReservationInvoice reservationInvoice) { _context.Add(reservationInvoice); return(_context.SaveChanges() > 0 ? true : false); }