示例#1
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;
 }
示例#2
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;
 }
示例#3
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();
         }
     }
 }