Exemplo n.º 1
0
        protected void Application_Start()
        {
            var connectionCredentials = new ConnectionCredentials();

            TranslationToolHelper.SetDefaultTranslationPath();
            DbManagerFactory.SetSqlFactory(connectionCredentials.ConnectionString);
            EidssUserContext.Init();
            CustomCultureHelper.CurrentCountry = EidssSiteContext.Instance.CountryID;

            EIDSS_LookupCacheHelper.Init();
            LookupCacheListener.Cleanup();
            LookupCacheListener.Listen();
            Localizer.MenuMessages = EidssMenu.Instance;

            ClassLoader.Init("eidss_db.dll", bv.common.Core.Utils.GetDesktopExecutingPath());

            //AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            InputBuilder.BootStrap();

            BaseFieldValidator.FieldCaptions = EidssFields.Instance;

            ModelBinders.Binders.DefaultBinder = new DevExpressEditorsBinder();

            SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath("~/bin"));
            XtraWebLocalizer.Activate();
        }
Exemplo n.º 2
0
 private static void Init()
 {
     Config.DefaultGlobalConfigFileName = Constants.GlobalEidssConfigName;
     DbManagerFactory.SetSqlFactory(new ConnectionCredentials().ConnectionString);
     EidssUserContext.Init();
     EIDSS_LookupCacheHelper.Init();
 }
Exemplo n.º 3
0
 public override void MyTestInitialize()
 {
     base.MyTestInitialize();
     DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString"));
     manager = DbManagerFactory.Factory.Create(context);
     manager.BeginTransaction();
 }
Exemplo n.º 4
0
        protected void Application_Start(object sender, EventArgs e)
        {
            var connectionCredentials = new ConnectionCredentials();

            DbManagerFactory.SetSqlFactory(connectionCredentials.ConnectionString);
            EidssUserContext.Init();
        }
Exemplo n.º 5
0
 private bool ValidateArchiveConnection()
 {
     if (TabControlMain.TabPages.IndexOf(TabPageArchive) < 0)
     {
         return(true);
     }
     if (!chkAllowArchiveConnection.Checked)
     {
         if (!string.IsNullOrEmpty(m_ArchiveConnectionCredentials.SQLDatabase) ||
             !string.IsNullOrEmpty(m_ArchiveConnectionCredentials.SQLServer) ||
             !string.IsNullOrEmpty(m_ArchiveConnectionCredentials.SQLUser) ||
             !string.IsNullOrEmpty(m_ArchiveConnectionCredentials.SQLPassword))
         {
             m_ArchiveConnectionCredentials.Clear();
         }
         return(true);
     }
     m_ArchiveConnectionCredentials.SetCredentials(BaseSettings.ConnectionString, txtArchiveServer.Text, txtArchiveDatabase.Text, txtArchiveUser.Text, txtArchivePassword.Text, "Archive");
     if (m_ArchiveConnectionCredentials.IsCorrect)
     {
         DbManagerFactory.SetSqlFactory(m_ArchiveConnectionCredentials.ConnectionString);
         using (var manager = DbManagerFactory.Factory.Create(ModelUserContext.Instance))
         {
             if (manager.TestConnection())
             {
                 m_ArchiveConnectionCredentials.Save();
                 return(true);
             }
             ErrorForm.ShowError("errArchiveConnectionError");
             return(false);
         }
     }
     ErrorForm.ShowError("errArchiveConnectionError");
     return(false);
 }
Exemplo n.º 6
0
        private QueryFilterControl CreateFilterControl(string lang = "en")
        {
            DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString"));
            ConnectionManager.DefaultInstance.SetCredentials(Config.GetSetting("EidssConnectionString"));
            EidssUserContext.Init();
            context  = ModelUserContext.Instance as EidssUserContext;
            Security = new EidssSecurityManager();
            int result = Security.LogIn(Organizaton, Admin, AdminPassword);

            Assert.AreEqual(0, result);
            EIDSS_LookupCacheHelper.Init();
            EidssUserContext.CurrentLanguage = lang;
            var     queryDb             = new Query_DB();
            var     querySearchObjectDb = new QuerySearchObject_DB();
            var     queryDs             = queryDb.LoadDetailData(QueryId);
            DataRow row             = queryDs.Tables[Query_DB.TasQueryObjectTree].Rows[0];
            var     searchObjectsDs = querySearchObjectDb.LoadDetailData(row["idfQuerySearchObject"]);

            var form   = new Form();
            var filter = new QueryFilterControl {
                Parent = form, Dock = DockStyle.Fill
            };

            filter.Init();
            filter.Bind((long)queryDs.Tables[1].Rows[0]["idfQuerySearchObject"], searchObjectsDs);
            return(filter);
        }
Exemplo n.º 7
0
 public void MyTestInitialize()
 {
     BaseReportTests.InitDBAndLogin();
     DbManagerFactory.SetSqlFactory(new ConnectionCredentials(null, "AvrService").ConnectionString, DatabaseType.Avr);
     DbManagerFactory.SetSqlFactory(new ConnectionCredentials(null, "Archive").ConnectionString, DatabaseType.Archive);
     DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString"));
 }
Exemplo n.º 8
0
 public static void InitSqlFactory()
 {
     if (DbManagerFactory.Factory[DatabaseType.Archive] == null)
     {
         DbManagerFactory.SetSqlFactory(GetCredentials().ConnectionString, DatabaseType.Archive);
     }
 }
Exemplo n.º 9
0
 public static void MyClassInitialize(TestContext testContext)
 {
     DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString", null));
     //EidssUserContext.Init();
     //EidssUserContext.ApplicationName = "test";
     ////ScriptLoader.RunScript(PathToTestFolder.Get(TestFolders.Db) + "Data\\DeleteTestAccount.sql", Config.GetSetting("EidssConnectionString", null));
     ////ScriptLoader.RunScript(PathToTestFolder.Get(TestFolders.Db) + "Data\\CreateTestAccount.sql", Config.GetSetting("EidssConnectionString", null));
     using (DbManager manager = DbManagerFactory.Factory.Create())
     {
         object  dbVersion  = manager.SetCommand("select strDatabaseVersion from tstVersionCompare where strModuleName = 'MainDatabaseVersion'").ExecuteScalar();
         Version ver        = Version.Parse(EidssUserContext.Version);
         string  appVersion = string.Format("{0}.{1}.{2}", ver.Major, ver.Minor, ver.Build);
         string  cmdText    = string.Format("if exists (select strModuleName from tstVersionCompare where strModuleName = 'test') " +
                                            " begin " +
                                            " update tstVersionCompare set strDatabaseVersion = '{0}', strModuleVersion = '{1}' where strModuleName = 'test' " +
                                            " end " +
                                            " else " +
                                            " begin " +
                                            " insert into tstVersionCompare (strModuleName, strDatabaseVersion, strModuleVersion) values ('test', '{0}', '{1}') " +
                                            " end "
                                            , dbVersion.ToString(), appVersion);
         manager.SetCommand(cmdText).ExecuteNonQuery();
         object org = manager.SetCommand("select	top 1 left(Inst.name, 186) from	tstSite " +
                                         " inner join		dbo.fnInstitution('en') Inst "+
                                         " on				Inst.idfOffice = tstSite.idfOffice "+
                                         "				and Inst.intRowStatus = 0 "+
                                         " where			tstSite.idfsSite= dbo.fnSiteID() "+
                                         "				and tstSite.intRowStatus = 0 "+
                                         " order by		tstSite.idfsSite asc").ExecuteScalar();
         Organizaton = org.ToString();
     }
 }
Exemplo n.º 10
0
        public void TestMethod1()
        {
            DbManagerFactory.SetSqlFactory(Config.GetSetting("TestConnectionString", ""));
            long?id = null;

            BaseFormManager.ShowNormal(typeof(TestPanelUI), ref id);
        }
Exemplo n.º 11
0
        public static void InitEidssCore()
        {
            DbManagerFactory.SetSqlFactory(new ConnectionCredentials().ConnectionString);
            EidssUserContext.Init();

            Localizer.MenuMessages           = EidssMenu.Instance;
            BaseFieldValidator.FieldCaptions = EidssFields.Instance;
        }
Exemplo n.º 12
0
        public void MyTestInitialize()
        {
            DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString"));

            WinClientContext.FieldCaptions  = EidssFields.Instance;
            RequiredValidator.FieldCaptions = EidssFields.Instance;
            ErrorForm.Messages = EidssMessages.Instance;
        }
Exemplo n.º 13
0
        public static void Init(TestContext testContext)
        {
            m_Container = StructureMapContainerInit();

            DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString"));
            m_FieldCount = DataHelper.GetQueryFieldsCount(49539640000000);
            EIDSS_LookupCacheHelper.Init();
        }
Exemplo n.º 14
0
 public void MyTestInitialize()
 {
     lock (m_Lock)
     {
         DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString", null));
         EidssUserContext.Init();
         EidssUserContext.ApplicationName = "test";
     }
 }
Exemplo n.º 15
0
        public static void InitDBAndLogin()
        {
            InitSupportedLanguages();
            EIDSS_LookupCacheHelper.Init();
            EidssUserContext.Init();
            DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString"));
            var target = new EidssSecurityManager();
            int result = target.LogIn(Organizaton, Admin, AdminPassword);

            Assert.AreEqual(0, result);
        }
Exemplo n.º 16
0
        public void TestFarmPanel()
        {
            DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString", ""));
            using (DbManagerProxy manager = DbManagerFactory.Factory.Create())
            {
                FarmPanel.Accessor acc  = FarmPanel.Accessor.Instance(null);
                FarmPanel          farm = acc.CreateNewT(manager);

                Assert.IsNotNull(farm.Location);
            }
        }
Exemplo n.º 17
0
        private void ConnectToStanadardDatabase()
        {
            var credentials = new ConnectionCredentials();

            ConnectionManager.DefaultInstance.SetCredentials();
            DbManagerFactory.SetSqlFactory(credentials.ConnectionString);
            BaseFormManager.ArchiveMode = false;
            if (m_StoredUserPermissions != null)
            {
                EidssUserContext.User.Permissions = m_StoredUserPermissions;
            }
        }
Exemplo n.º 18
0
        public static void InitEidssCore()
        {
            EidssServiceInitializer.InitEidssCore();

            DbManagerFactory.SetSqlFactory(new ConnectionCredentials(null, "AvrService").ConnectionString, DatabaseType.Avr);
            DbManagerFactory.SetSqlFactory(new ConnectionCredentials(null, "Archive").ConnectionString, DatabaseType.Archive);

            EIDSS_LookupCacheHelper.Init();

            m_LanguageProcessor = new BaseLanguageProcessor();
            m_LanguageProcessor.InitLanguages();
        }
Exemplo n.º 19
0
        private bool ConnectToArchiveDatabase()
        {
            try
            {
                if (m_StoredUserPermissions == null)
                {
                    m_StoredUserPermissions = EidssUserContext.User.Permissions;
                }
                var credentials = new ConnectionCredentials(null, "Archive");
                ConnectionManager.DefaultInstance.SetCredentials(null, null, null, null, null, "Archive");
                DbManagerFactory.SetSqlFactory(credentials.ConnectionString);
                if (credentials.IsCorrect)
                {
                    using (var manager = DbManagerFactory.Factory.Create(ModelUserContext.Instance))
                    {
                        if (!manager.TestConnection())
                        {
                            ErrorForm.ShowError("errArchiveConnectionError");
                            return(false);
                        }
                    }
                }
                else
                {
                    ErrorForm.ShowError("errArchiveConnectionError");
                    return(false);
                }

                var readOnlyPermissions = new Dictionary <string, bool>();
                foreach (string key in m_StoredUserPermissions.Keys)
                {
                    if (key.StartsWith(EIDSSPermissionObject.HumanCaseDeduplication.ToString()) ||
                        key.StartsWith(EIDSSPermissionObject.NotificationSubscription.ToString())
                        )
                    {
                        continue;
                    }
                    readOnlyPermissions.Add(key, key.EndsWith(".Select") ? m_StoredUserPermissions[key] : false);
                }
                EidssUserContext.User.Permissions = readOnlyPermissions;
                BaseFormManager.ArchiveMode       = true;
                return(true);
            }
            catch (Exception e)
            {
                if (!SqlExceptionHandler.Handle(e))
                {
                    ErrorForm.ShowError("errArchiveConnectionError", e);
                }
                return(false);
            }
        }
Exemplo n.º 20
0
        private void Form1_Load(object sender, EventArgs e)
        {
            DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString"));
            using (DbManagerProxy manager = DbManagerFactory.Factory.Create())
            {
                m_Address         = Address.Accessor.Instance(null).CreateNewT(manager, null);
                m_Address.Country = m_Address.CountryLookup[0];
            }

            lookUpEdit1.Properties.DataSource    = m_Address.CountryLookup;
            lookUpEdit1.Properties.DisplayMember = "strCountryName";
            lookUpEdit1.Properties.ValueMember   = null;
            lookUpEdit1.DataBindings.Add("EditValue", m_Address, "Country", false, DataSourceUpdateMode.OnPropertyChanged);
        }
Exemplo n.º 21
0
        protected void Application_Start(object sender, EventArgs e)
        {
            var connectionCredentials = new ConnectionCredentials();

            DbManagerFactory.SetSqlFactory(connectionCredentials.ConnectionString);
            EidssUserContext.Init();
            LookupCacheListener.Cleanup();
            LookupCacheListener.Listen();
            Localizer.MenuMessages = EidssMenu.Instance;

            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);
        }
Exemplo n.º 22
0
        public void TestInitialize()
        {
            DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString"));
            ConnectionManager.DefaultInstance.SetCredentials(Config.GetSetting("EidssConnectionString"));
            EidssUserContext.Init();
            context    = ModelUserContext.Instance as EidssUserContext;
            m_Security = new EidssSecurityManager();
            int result = m_Security.LogIn(Organizaton, Admin, AdminPassword);

            Assert.AreEqual(0, result);
            EIDSS_LookupCacheHelper.Init();
            //while(!LookupCache.Filled)
            //    Thread.Sleep(500);
            ModelUserContext.CurrentLanguage = "en";
        }
Exemplo n.º 23
0
        public void AsSessionSample()
        {
            DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString"));
            using (var context = ModelUserContext.Instance as EidssUserContext)
            {
                using (var manager = DbManagerFactory.Factory.Create(context))
                {
                    var acc = AsSession.Accessor.Instance(null);

                    var session = (AsSession)acc.CreateNew(manager);
                    //mandatory field
                    session.Region = session.RegionLookup.FirstOrDefault();

                    var rootFarm = FarmRootPanel.Accessor.Instance(null).CreateNewT(manager);
                }
            }
        }
Exemplo n.º 24
0
 public void GetInnerExceptionDescriptionTest()
 {
     try
     {
         DbManagerFactory.SetSqlFactory("Persist Security Info=true;Initial Catalog=xxx;Data Source=xxx;");
         using (DbManagerProxy manager = DbManagerFactory.Factory.Create())
         {
             manager.SetCommand("select 1;");
             manager.ExecuteNonQuery();
         }
     }
     catch (Exception ex)
     {
         string description = SqlExceptionHandler.GetExceptionDescription(ex);
         Assert.AreNotEqual(string.Empty, description);
     }
 }
Exemplo n.º 25
0
        public void FarmPanelCollection()
        {
            EidssUserContext.Init();
            DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString"));
            using (var context = ModelUserContext.Instance as EidssUserContext)
            {
                var target = new EidssSecurityManager();

                int result = target.LogIn(Organizaton, Admin, AdminPassword);
                Assert.AreEqual(0, result);

                using (var manager = DbManagerFactory.Factory.Create(context))
                {
                    var acc     = VetCase.Accessor.Instance(null);
                    var vetcase = (VetCase)acc.CreateNew(manager, null, (int)HACode.Livestock);

                    var panel = vetcase.Farm;

                    var         herdaccessor = VetFarmTree.Accessor.Instance(null);
                    VetFarmTree farm         = panel.FarmTree[0];
                    VetFarmTree herd         = herdaccessor.CreateHerd(manager, panel, farm);
                    VetFarmTree spec         = herdaccessor.CreateSpecies(manager, panel, herd);
                    spec.SpeciesType = spec.SpeciesTypeLookup.FirstOrDefault(c => c.idfsBaseReference == 837790000000);
                    //spec.idfsSpeciesTypeReference = 837790000000;
                    panel.FarmTree.Add(herd);
                    panel.FarmTree.Add(spec);

                    panel.Address.Region     = panel.Address.RegionLookup.FirstOrDefault();
                    panel.Address.Rayon      = panel.Address.RayonLookup.FirstOrDefault();
                    panel.Address.Settlement = panel.Address.SettlementLookup.FirstOrDefault();

                    var animal = (AnimalListItem)AnimalListItem.Accessor.Instance(null).CreateNew(manager, vetcase, (int)HACode.Livestock);
                    animal.idfSpecies = spec.idfParty;
                    animal.idfHerd    = herd.idfParty;
                    animal.idfCase    = vetcase.idfCase;

                    vetcase.AnimalList.Add(animal);
                    //vetcase.Validation += new ValidationEvent(panel_Validation);


                    //acc.Post(manager, vetcase);
                    //vetcase.Validation -= panel_Validation;
                }
            }
        }
Exemplo n.º 26
0
 private void InitConnection()
 {
     if (TabControlMain.TabPages.IndexOf(TabPageSQL) > 0)
     {
         m_ConnectionCredentials.SetCredentials(BaseSettings.ConnectionString, txtSQLServer.Text, txtSQLDatabase.Text, txtSQLUser.Text, txtSQLPassword.Text);
         ConnectionManager.DefaultInstance.SetCredentials(BaseSettings.ConnectionString, txtSQLServer.Text, txtSQLDatabase.Text, txtSQLUser.Text, txtSQLPassword.Text);
         DbManagerFactory.SetSqlFactory(m_ConnectionCredentials.ConnectionString);
         if (m_ConnectionCredentials.IsCorrect)
         {
             using (var manager = DbManagerFactory.Factory.Create(ModelUserContext.Instance))
             {
                 if (manager.TestConnection())
                 {
                     m_ConnectionCredentials.Save();
                 }
             }
         }
     }
 }
Exemplo n.º 27
0
        public void MyTestInitialize()
        {
            //DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString", ""));
            //ClassLoader.Init("eidss*.dll", Environment.MachineName.Equals("LEONOV") ? @"c:\Projects\EIDSS4\eidss.main\bin\Debug\" : null);
            ClassLoader.Init("eidss*.dll", null);
            DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString", ""));
            EidssUserContext.Init();
            var target = new EidssSecurityManager();

            const string organizaton = "NCDC&PH";
            const string admin       = "test_admin";
            //const string User = "******";
            const string adminPassword = "******";
            //const string UserPassword = "******";

            int result = target.LogIn(organizaton, admin, adminPassword);

            Assert.AreEqual(0, result);
        }
Exemplo n.º 28
0
        public void RootFarmCollection()
        {
            DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString"));
            using (var context = ModelUserContext.Instance as EidssUserContext)
            {
                using (var manager = DbManagerFactory.Factory.Create(context))
                {
                    var acc = FarmRootPanel.Accessor.Instance(null);

                    var panel = acc.Create(manager, null, HACode: null);

                    var          herdaccessor = RootFarmTree.Accessor.Instance(null);
                    RootFarmTree farm         = panel.FarmLivestockTree[0];
                    RootFarmTree herd         = herdaccessor.CreateHerd(manager, panel, farm);
                    RootFarmTree spec         = herdaccessor.CreateSpecies(manager, panel, herd);
                    spec.SpeciesType = spec.SpeciesTypeLookup.FirstOrDefault(c => c.idfsBaseReference == 837790000000);
                    //spec.idfsSpeciesTypeReference = 837790000000;
                    panel.FarmLivestockTree.Add(herd);
                    panel.FarmLivestockTree.Add(spec);

                    panel.Address.Region     = panel.Address.RegionLookup.FirstOrDefault();
                    panel.Address.Rayon      = panel.Address.RayonLookup.FirstOrDefault();
                    panel.Address.Settlement = panel.Address.SettlementLookup.FirstOrDefault();
                    //panel.Location.CopyAddressValues(panel.Address);

                    //panel.Validation += new ValidationEvent(panel_Validation);
                    //panel.blnIsLivestock = true;
                    //acc.Post(manager, panel);

                    //panel.Validation -= panel_Validation;

                    //var savedpanel = acc.SelectByKey(manager, panel.idfFarm);

                    //Assert.AreEqual(panel.FarmLivestockTree.Count, savedpanel.FarmLivestockTree.Count);
                    //Assert.AreNotEqual(savedpanel.FarmLivestockTree.Count, savedpanel.FarmAvianTree.Count);
                    //Assert.AreEqual(panel.FarmAvianTree.Count, 1);
                    //Assert.AreEqual(farm._HACode, (int)HACode.Livestock);
                    //Assert.AreEqual(herd._HACode, (int)HACode.Livestock);
                    //Assert.AreEqual(spec._HACode, (int)HACode.Livestock);
                    //Assert.AreNotEqual(spec.SpeciesTypeLookup.Count, 1);
                }
            }
        }
Exemplo n.º 29
0
            public string CreateTicket(long userId)
            {
                var dbType = DatabaseType.Main;
                var connectionCredentials = new ConnectionCredentials(null, "Avr");

                if (connectionCredentials.IsCorrect)
                {
                    DbManagerFactory.SetSqlFactory(connectionCredentials.ConnectionString, DatabaseType.AvrTicket);
                    using (var avrManager = DbManagerFactory.Factory[DatabaseType.AvrTicket].Create())
                    {
                        if (avrManager.TestConnection())
                        {
                            dbType = DatabaseType.AvrTicket;
                        }
                    }
                }
                using (DbManagerProxy manager = DbManagerFactory.Factory[dbType].Create(ModelUserContext.Instance))
                {
                    try
                    {
                        manager.SetSpCommand("dbo.spLoginCreateTicket",
                                             manager.Parameter("@idfUserID", userId),
                                             manager.Parameter(ParameterDirection.Output, "@strTicket", ""),
                                             manager.Parameter(ParameterDirection.Output, "@Result", 0)
                                             ).ExecuteNonQuery();
                        int res = Convert.ToInt32(manager.Parameter("@Result").Value);
                        if (res == 0)
                        {
                            return(Utils.Str(manager.Parameter("@strTicket").Value));
                        }
                        return(null);
                    }
                    catch (DataException e)
                    {
                        throw DbModelException.Create(null, e);
                    }
                }
            }
Exemplo n.º 30
0
        public static void MyClassInitialize(TestContext testContext)
        {
            m_Container = StructureMapContainerInit();
            m_Trace     = new TraceHelper(TraceHelper.AVRCategory);

            SetFreePortToAvrAndReport();

            DbManagerFactory.SetSqlFactory(new ConnectionCredentials(null, "AvrService").ConnectionString, DatabaseType.Avr);
            DbManagerFactory.SetSqlFactory(new ConnectionCredentials(null, "Archive").ConnectionString, DatabaseType.Archive);
            DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString"));
            m_HumanFieldCount = DataHelper.GetQueryFieldsCount(49539640000000);
            m_VetFieldCount   = DataHelper.GetQueryFieldsCount(49542020000000);

            m_HostKeeper = new AvrHostKeeper(m_Container);

            m_HostKeeper.Open();

            Assembly asm         = Assembly.GetExecutingAssembly();
            string   exeLocation = Path.GetDirectoryName(Utils.ConvertFileName(asm.Location)) ?? string.Empty;

            if (!Directory.Exists(exeLocation))
            {
                int index = exeLocation.IndexOf("EIDSSTrunk", StringComparison.OrdinalIgnoreCase);
                if (index > 0)
                {
                    Directory.CreateDirectory(exeLocation);
                    string realPath = exeLocation.Substring(0, index) +
                                      @"EIDSSTrunk\EIDSS\eidss.main\bin\Debug\eidss.avr.export.x86.exe";
                    File.Copy(realPath, exeLocation + @"\eidss.avr.export.x86.exe");
                }
            }

            m_ExportUtilFilePath = Utils.GetFilePathNearAssembly(asm, @"eidss.avr.export.x86.exe");

            DbManagerFactory.SetSqlFactory(new ConnectionCredentials(null, "AvrService").ConnectionString, DatabaseType.Avr);
            DbManagerFactory.SetSqlFactory(new ConnectionCredentials(null, "Archive").ConnectionString, DatabaseType.Archive);
            DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString"));
        }