Example #1
0
 private void GetData()
 {
     FleetModels.Clear();
     try
     {
         vmsLinqDataContext datacontext = new vmsLinqDataContext();
         var query = from f in datacontext.Fleets
                     select f;
         FleetModel model;
         foreach (var data in query)
         {
             model = new FleetModel();
             model.ID = data.ID;
             model.Name = data.Name;
             FleetModels.Add(model);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Example #2
0
 private void GetAllVehicle()
 {
     _vehilces.Clear();
     try
     {
         vmsLinqDataContext datacontext = new vmsLinqDataContext();
         var query = from v in datacontext.Vehicles
                     select v;
         VehicleModel model;
         foreach (var data in query)
         {
             model = new VehicleModel();
             model.NumPlate = data.NumPlate;
             model.EIN = data.EIN;
             model.VIN = data.VIN;
             _vehilces.Add(model);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Example #3
0
 private void GetAllDriver()
 {
     _drivers.Clear();
     try
     {
         vmsLinqDataContext datacontext = new vmsLinqDataContext();
         var query = from d in datacontext.Drivers
                      select d;
         DriverModel model;
         foreach (Driver data in query)
         {
             model = new DriverModel();
             model.ID = data.ID;
             model.FirstName = data.FirstName;
             model.LastName = data.LastName;
             model.BirthDay = Convert.ToDateTime(data.BirthDay);
             _drivers.Add(model);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }