public ActionResult Delete(int id) { BusdbEntities db = new BusdbEntities(); Buses find = new Buses(); var xx = db.buses.Where(x => x.bid == id).FirstOrDefault(); db.buses.Remove(xx); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Delete(int id) { BusdbEntities db = new BusdbEntities(); RbScheduleM find = new RbScheduleM(); var xx = db.rbschedules.Where(x => x.sid == id).FirstOrDefault(); db.rbschedules.Remove(xx); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Delete(int id) { BusdbEntities db = new BusdbEntities(); ReserveM find = new ReserveM(); var xx = db.reserves.Where(x => x.ticket_no == id).FirstOrDefault(); db.reserves.Remove(xx); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create(RouteM xx) { BusdbEntities db = new BusdbEntities(); route r = new route(); r.rid = xx.Routeid; r.from_location = xx.FromLocation; r.to_location = xx.ToLocation; db.routes.Add(r); db.SaveChanges(); return(RedirectToAction("index")); }
public ActionResult Edit(RouteM xx) { BusdbEntities db = new BusdbEntities(); var find = db.routes.Where(x => x.rid == xx.Routeid).FirstOrDefault(); find.rid = xx.Routeid; find.from_location = xx.FromLocation; find.to_location = xx.ToLocation; db.Entry(find).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("index")); }
public ActionResult Create(Buses xx) { BusdbEntities db = new BusdbEntities(); bus r = new bus(); r.bid = xx.Busid; r.bname = xx.BusName; r.btype = xx.BusType; r.max_seats = xx.MaxSeat; db.buses.Add(r); db.SaveChanges(); return(RedirectToAction("index")); }
public ActionResult Edit(Buses xx) { BusdbEntities db = new BusdbEntities(); var find = db.buses.Where(x => x.bid == xx.Busid).FirstOrDefault(); find.bid = xx.Busid; find.bname = xx.BusName; find.btype = xx.BusType; find.max_seats = xx.MaxSeat; db.Entry(find).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("index")); }
public ActionResult Create(RbScheduleM xx) { BusdbEntities db = new BusdbEntities(); rbschedule r = new rbschedule(); r.sid = xx.sid; r.rid = xx.rid; r.bid = xx.bid; r.fare = xx.fare; r.departure_date = xx.departure_date; r.departure_time = xx.departure_time; db.rbschedules.Add(r); db.SaveChanges(); return(RedirectToAction("index")); }
public ActionResult Edit(RbScheduleM xx) { BusdbEntities db = new BusdbEntities(); var find = db.rbschedules.Where(x => x.sid == xx.sid).FirstOrDefault(); find.sid = xx.sid; find.rid = xx.rid; find.bid = xx.bid; find.fare = xx.fare; find.departure_date = xx.departure_date; find.departure_time = xx.departure_time; db.Entry(find).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("index")); }
public ActionResult Edit(ReserveM xx) { BusdbEntities db = new BusdbEntities(); var find = db.reserves.Where(x => x.ticket_no == xx.ticket_no).FirstOrDefault(); find.email = xx.email; find.gender = xx.gender; find.name = xx.name; find.phone_no = xx.phone_no; find.rid = xx.routeId; find.sid = xx.scheduleId; find.seat_no = xx.seat_no; find.ticket_no = xx.ticket_no; db.Entry(find).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("index")); }