示例#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();
        }
示例#2
0
 public static void LoadAssemblies()
 {
     ClassLoader.Init("bv_common.dll", null);
     ClassLoader.Init("bvwin_common.dll", null);
     ClassLoader.Init("bv.common.dll", null);
     ClassLoader.Init("bv.winclient.dll", null);
     ClassLoader.Init("eidss*.dll", null);
 }
示例#3
0
        public void MyTestInitialize()
        {
            DbManagerFactory.SetSqlFactory(new ConnectionCredentials(null, "AvrService").ConnectionString, DatabaseType.Avr);
            DbManagerFactory.SetSqlFactory(new ConnectionCredentials(null, "Archive").ConnectionString, DatabaseType.Archive);
            DbManagerFactory.SetSqlFactory(Config.GetSetting("EidssConnectionString"));

            BaseReportTests.InitDBAndLogin();
            ClassLoader.Init("eidss_common.dll", null);
            ClassLoader.Init("eidss_db.dll", null);
        }
示例#4
0
        public Server()
        {
            Debug.WriteLine("Entering Server ctor"); // Log not yet ready here

            _server = this;

            Config.Init();
            Log.Init();

            // Initialize World Details
            ClassLoader.Init();
            Log.Verbose("Leaving Server ctor");
        }
示例#5
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);
        }
示例#6
0
        static void Main(string[] args)
        {
            Config.DefaultGlobalConfigFileName = Constants.GlobalEidssConfigName;
            bool showMessage = true;

            if (!OneInstanceApp.Run(true, ref showMessage))
            {
                if (showMessage)
                {
                    ErrorForm.ShowMessage("msgEIDSSRunning", "You can\'t run multiple EIDSS instances simultaneously. Other instance of EIDSS is running already");
                }
                return;
            }

            //Application.SetCompatibleTextRenderingDefault(False)

            var eh = new UnhandledExceptionHandler();

            // Adds the event handler to the event.
            Application.ThreadException += eh.OnThreadException;
            try
            {
                DbManagerFactory.SetSqlFactory(new ConnectionCredentials().ConnectionString);
                EidssUserContext.Init(
                    () =>
                    EidssSiteContext.Instance.SiteType != SiteType.CDR &&
                    WinUtils.ConfirmMessage(BvMessages.Get("msgReplicationPrompt", "Start the replication to transfer data on other sites?"),
                                            BvMessages.Get("msgREplicationPromptCaption", "Confirm Replication")),
                    () =>
                {
                    EidssEventLog.Instance.CheckNotificationService();
                    EidssEventLog.Instance.StartReplication();
                }
                    );
                ClassLoader.Init("bv_common.dll", null);
                ClassLoader.Init("bvwin_common.dll", null);
                ClassLoader.Init("bv.common.dll", null);
                ClassLoader.Init("bv.winclient.dll", null);
                ClassLoader.Init("eidss*.dll", null);
                Localizer.MenuMessages              = EidssMenu.Instance;
                TranslationToolHelper.RootPath      = Directory.GetParent(Application.CommonAppDataPath).FullName;
                WinClientContext.ApplicationCaption = EidssMessages.Get("EIDSS_Caption", "Electronic Integrated Disease Surveillance System");
                WinClientContext.Init();
                //DevExpress.Skins.SkinManager.Default.RegisterAssembly(typeof(DevExpress.UserSkins.eidssmoneyskin).Assembly);
                if (!string.IsNullOrEmpty(BaseSettings.SkinAssembly) && File.Exists(BaseSettings.SkinAssembly))
                {
                    DevExpress.Skins.SkinManager.Default.RegisterAssembly(
                        Assembly.LoadFrom(BaseSettings.SkinAssembly));
                }
                else
                {
                    DevExpress.Skins.SkinManager.Default.RegisterAssembly(
                        typeof(DevExpress.UserSkins.eidssskin).Assembly);
                }
                //DevExpress.UserSkins.BonusSkins.Register();
                //Application.EnableVisualStyles();
                //Application.SetCompatibleTextRenderingDefault(False)
                DevExpress.Skins.SkinManager.EnableFormSkins();
                Application.DoEvents();
                Splash.ShowSplash();
                //BV.common.db.Core.ConnectionManager.DefaultInstance.ConfigFilesToSave = new string[] {"EIDSS_ClientAgent.exe.config"};

                //string appdir = System.IO.Path.GetDirectoryName(Application.ExecutablePath);
                //var defHelpName = Config.GetSetting("HelpUrl", "file:///" + appdir.Replace("\\", "/") + "/WebHelp_EIDSS_with_Search/");

                var defHelpName = Config.GetSetting("HelpUrl");
                WinClientContext.HelpNames.Add(Localizer.lngEn, Config.GetSetting("HelpUrl." + Localizer.lngEn, defHelpName));
                WinClientContext.HelpNames.Add(Localizer.lngRu, Config.GetSetting("HelpUrl." + Localizer.lngRu, defHelpName));
                WinClientContext.HelpNames.Add(Localizer.lngGe, Config.GetSetting("HelpUrl." + Localizer.lngGe, defHelpName));
                WinClientContext.HelpNames.Add(Localizer.lngKz, Config.GetSetting("HelpUrl." + Localizer.lngKz, defHelpName));
                WinClientContext.HelpNames.Add(Localizer.lngUzCyr, Config.GetSetting("HelpUrl." + Localizer.lngUzCyr, defHelpName));
                WinClientContext.HelpNames.Add(Localizer.lngUzLat, Config.GetSetting("HelpUrl." + Localizer.lngUzLat, defHelpName));
                WinClientContext.HelpNames.Add(Localizer.lngAzLat, Config.GetSetting("HelpUrl." + Localizer.lngAzLat, defHelpName));
                WinClientContext.HelpNames.Add(Localizer.lngUk, Config.GetSetting("HelpUrl." + Localizer.lngUk, defHelpName));
                WinClientContext.HelpNames.Add(Localizer.lngAr, Config.GetSetting("HelpUrl." + Localizer.lngAr, defHelpName));
                WinClientContext.HelpNames.Add(Localizer.lngThai, Config.GetSetting("HelpUrl." + Localizer.lngThai, defHelpName));

                //DevXLocalizer.ForceResourceAdding();
                DevXLocalizer.Init();
                WinClientContext.FieldCaptions   = EidssFields.Instance;
                BaseFieldValidator.FieldCaptions = EidssFields.Instance;
                ErrorForm.Messages                      = EidssMessages.Instance;
                BaseActionPanel.Messages                = EidssMessages.Instance;
                ErrorMessage.Messages                   = EidssMessages.Instance;
                BvLookupColumnInfo.Messages             = EidssMessages.Instance;
                bv.common.win.BaseValidator.Messages    = EidssMessages.Instance;
                bv.common.win.BaseForm.EventLog         = EidssEventLog.Instance;
                bv.common.win.BaseDetailForm.cancelMode = bv.common.win.BaseDetailForm.CancelCloseMode.CallPost;
                //CheckHelpRegistration();
                //LayoutHelper.Init();
                Application.EnableVisualStyles();
                //DevExpress.Data.CurrencyDataController.DisableThreadingProblemsDetection = true;
                //Application.SetCompatibleTextRenderingDefault(false);

                ActionLocker.ShowWaitDialog  = WaitDialog.ShowWaitDialog;
                ActionLocker.CloseWaitDialog = WaitDialog.CloseWaitDialog;

                Application.Idle += ApplicationOnIdle;

                SecurityLog.WriteToEventLogDB(null, SecurityAuditEvent.ProcessStart, true, null, null, "EIDSS is started", SecurityAuditProcessType.Eidss);
                Dbg.Debug("EIDSS is started with ClientID {0}", ModelUserContext.ClientID);
                Application.Run(new MainForm());
                Utils.SaveUsedXtraResource();
            }
            catch (Exception ex)
            {
                MessageForm.Show(ex.ToString(), "Application Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                MainForm.ExitApp(true);
            }
        }