public int DeleteDriverById(int DriverId) { TicketBookingModelEntities db = new TicketBookingModelEntities(); Driver drv = new Driver(); drv.DriverId = DriverId; db.Entry(drv).State = EntityState.Deleted; int Retval = db.SaveChanges(); return(Retval); }
public int DeletePassengerById(int Id) { TicketBookingModelEntities db = new TicketBookingModelEntities(); Passenger p = new Passenger(); p.Id = Id; db.Entry(p).State = EntityState.Deleted; int Retval = db.SaveChanges(); return(Retval); }
public int UpdatePassenger(int Id, string Name, bool Blocked) { TicketBookingModelEntities db = new TicketBookingModelEntities(); Passenger p = new Passenger(); p.Id = Id; p.Name = Name; p.Blocked = Blocked; db.Entry(p).State = EntityState.Modified; int Retval = db.SaveChanges(); return(Retval); }
public int UpdateDriver(int DriverId, string Name, string SerialNumber, string DriverLicence, string PhoneNumber, string EmailAddress, bool IsAvailable) { TicketBookingModelEntities db = new TicketBookingModelEntities(); Driver drv = new Driver(); drv.DriverId = DriverId; drv.Name = Name; drv.SerialNumber = SerialNumber; drv.DriverLicence = DriverLicence; drv.PhoneNumber = PhoneNumber; drv.EmailAddress = EmailAddress; drv.IsAvailable = IsAvailable; db.Entry(drv).State = EntityState.Modified; int Retval = db.SaveChanges(); return(Retval); }
public void Update(Seat s) { _db.Entry(s).State = System.Data.Entity.EntityState.Modified; }
public void Update(Bus bus) { _db.Entry(bus).State = System.Data.Entity.EntityState.Modified; }
public void Update(Passenger p) { _db.Entry(p).State = System.Data.Entity.EntityState.Modified; }
public void Update(City city) { _db.Entry(city).State = System.Data.Entity.EntityState.Modified; }
public void Update(Driver driver) { _db.Entry(driver).State = System.Data.Entity.EntityState.Modified; }
public void Update(Tour tour) { _db.Entry(tour).State = System.Data.Entity.EntityState.Modified; }
public void Update(Reservation res) { _db.Entry(res).State = System.Data.Entity.EntityState.Modified; }
public void Update(Ticket t) { _db.Entry(t).State = System.Data.Entity.EntityState.Modified; }