Ejemplo n.º 1
0
        private MainPageViewModel GetMainPage()
        {
            IConnectionsService connservice    = new ConnectionsService();
            ICommandService     commandservice = new CommandService_NAV2013_R2();

            INavisionObjectsRepository objectsrepository = new NavisionObjectsRepository_2013_R2();
            INavObjectService          objservice        = new NavObjectService(objectsrepository);
            IScriptService             scriptservice     = new ScriptsService();

            return(new MainPageViewModel(connservice, objservice, commandservice, scriptservice));
        }
Ejemplo n.º 2
0
 private int GetLocationsAmmountFromDb()
 {
     using (var connection = new SqlConnection(ConfigurationService.GetTestDbConnectionString()))
     {
         connection.Open();
         using (var command = new SqlCommand(ScriptsService.GetScript("GetLocationsAmmount"), connection))
         {
             return((int)command.ExecuteScalar());
         }
     }
 }
Ejemplo n.º 3
0
 private static void PrepareTestData()
 {
     using (var sqlConnection = new SqlConnection(ConfigurationService.GetTestDbConnectionString()))
     {
         sqlConnection.Open();
         using (var sqlCommand = new SqlCommand(ScriptsService.GetScript("PrepareTestData"), sqlConnection))
         {
             sqlCommand.CommandTimeout = 60;
             sqlCommand.ExecuteNonQuery();
         }
     }
 }
Ejemplo n.º 4
0
 public void SpatialDatabase_PerformanceTest()
 {
     using (var connection = new SqlConnection(ConfigurationService.GetTestDbConnectionString()))
     {
         connection.Open();
         using (var command = new SqlCommand(ScriptsService.GetScript("GetNearestLocations"), connection))
         {
             GC.Collect();
             GC.WaitForFullGCComplete();
             var watch = new Stopwatch();
             watch.Start();
             for (int i = 0; i < 100; i++)
             {
                 command.ExecuteReader().Close();
             }
             watch.Stop();
             Trace.WriteLine(string.Format("SQL Server - For {0} spatial points it took {1} ms to found {2} nearest points", GetLocationsAmmountFromDb(), watch.ElapsedMilliseconds / 100, 5));
         }
     }
 }
 public PowerShellProvider()
 {
     _scriptsService = new ScriptsService();
 }