Example #1
0
 public IQueryable<vehicleType> GetVehicles()
 {
     using (var db = new MuverDB())
     {
         return db.Set<vehicleType>();
     }
 }
Example #2
0
 public void AddMuve(muve newMuve)
 {
     using (var db = new MuverDB())
     {
         db.muves.Add(newMuve);
     }
 }
Example #3
0
 public Guid AddMuver(muver newMuver)
 {
     Guid muverId = new Guid();
     using (var db = new MuverDB())
     {
         db.muvers.Add(newMuver);
         db.SaveChanges();
         muverId = newMuver.id;
     }
     return muverId;
 }
Example #4
0
 public System.Guid AddDriver(driver newDriver, location newLocation)
 {
     System.Guid driverId;
     using (var db = new MuverDB())
     {
         db.locations.Add(newLocation);
         newDriver.location = newLocation;
         newDriver.locationId = newLocation.id;
         db.drivers.Add(newDriver);
         db.SaveChanges();
         driverId = newDriver.id;
     }
     return driverId;
 }
Example #5
0
 public void AddVehicles(Guid driverId, List<driverVehicle> vehicles)
 {
     using (var db = new MuverDB())
     {
         foreach (driverVehicle dv in vehicles)
         {
             driverVehicle drv = new driverVehicle();
             drv.vehicleType = dv.vehicleType;
             drv.driverId = driverId;
             drv.id = Guid.NewGuid();
             db.driverVehicles.Add(drv);
             db.SaveChanges();
         }
     }
 }