示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
 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;
 }
示例#7
0
 public void Update(Passenger p)
 {
     _db.Entry(p).State = System.Data.Entity.EntityState.Modified;
 }
示例#8
0
 public void Update(City city)
 {
     _db.Entry(city).State = System.Data.Entity.EntityState.Modified;
 }
示例#9
0
 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;
 }
示例#11
0
 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;
 }