コード例 #1
0
 public ActionResult ModifyRoute(String routeId)
 {
     DatabaseInterface db = new DatabaseInterface();
     Route route = db.GetRouteByRouteId(int.Parse(routeId));
     AddRouteModel model = new AddRouteModel()
     {
         AvailableBuses = db.GetAvailableBuses(),
         AvailableStops = db.GetAvailableStops(),
         AvailableDrivers = db.GetAvailableDrivers(),
         Bus = route.Bus,
         Driver = route.Driver,
         Name = route.Name,
         RouteId = routeId,
         Stops = route.Stops,
         UpdatingRoute = true
     };
     return PartialView("AddRoute", model);
 }
コード例 #2
0
 public ActionResult AddRoute()
 {
     DatabaseInterface db = new DatabaseInterface();
     AddRouteModel model = new AddRouteModel()
     {
         AvailableBuses = db.GetAvailableBuses(),
         AvailableStops = db.GetAvailableStops(),
         AvailableDrivers = db.GetAvailableDrivers(),
         Bus = null,
         Driver = null,
         Name = "",
         RouteId = "",
         Stops = { },
         UpdatingRoute = false
     };
     return PartialView("AddRoute", model);
 }