Пример #1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            try
            {
                LogManager.WriteLog("Entering Cash Desk Operator Client Configuration EXE", LogManager.enumLogLevel.Debug);
                BMCRegistryHelper.ActiveInstallationType = BMCCategorizedInstallationTypes.Exchange;
                LogManager.WriteLog("BMCRegistryHelper.InstallationType is :" + BMCRegistryHelper.InstallationType, LogManager.enumLogLevel.Debug);

                CreateLogsFolder();

                LogManager.WriteLog("Inside Application_Startup", LogManager.enumLogLevel.Info);

                DataSet dsInitialSettings = DBSettings.GetInitialSettings(oCommonUtilities.CreateInstance().GetConnectionString());

                if (dsInitialSettings == null)
                {
                    Settings.OnScreenKeyboard = Convert.ToBoolean(ConfigurationManager.AppSettings.Get("OnScreenKeyboard"));
                }
                else
                {
                    Settings.OnScreenKeyboard = dsInitialSettings.Tables[0].Rows[0]["USE_ON_SCREEN_KEYBOARD"].ToString() != string.Empty ?
                                                Convert.ToBoolean(dsInitialSettings.Tables[0].Rows[0]["USE_ON_SCREEN_KEYBOARD"].ToString()) :
                                                Convert.ToBoolean(ConfigurationManager.AppSettings.Get("OnScreenKeyboard"));
                }
                try
                {
                    Settings.IsLoginRequired = true;
                    if (ConfigurationManager.AppSettings.Get("IsLoginRequired") != null)
                    {
                        Settings.IsLoginRequired = Convert.ToBoolean(ConfigurationManager.AppSettings.Get("IsLoginRequired"));
                    }
                }
                catch (Exception ex)
                {
                    ExceptionManager.Publish(ex);
                }
                if (Settings.IsLoginRequired)
                {
                    StartupUri = new Uri("Login.xaml", UriKind.Relative);
                }
                else
                {
                    StartupUri = new Uri("MainScreen.xaml", UriKind.Relative);
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
                MessageBox.ShowBox("MessageID33", BMC_Icon.Error);
            }
        }
Пример #2
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            try
            {
                LogManager.WriteLog("Entering Cash Desk Operator Configuration EXE", LogManager.enumLogLevel.Debug);
                BMCRegistryHelper.ActiveInstallationType = BMCCategorizedInstallationTypes.Exchange;
                LogManager.WriteLog("BMCRegistryHelper.InstallationType is :" + BMCRegistryHelper.InstallationType, LogManager.enumLogLevel.Debug);

                CreateLogsFolder();

                LogManager.WriteLog("Inside Application_Startup", LogManager.enumLogLevel.Info);
                string strConnectionString = "";
                try
                {
                    strConnectionString = BMC.Common.Utilities.DatabaseHelper.GetConnectionString();
                }
                catch
                {
                }

                DataSet dsInitialSettings = null;
                if (strConnectionString != "")
                {
                    DBSettings.GetInitialSettings(strConnectionString);
                }

                if (dsInitialSettings == null)
                {
                    Settings.OnScreenKeyboard = Convert.ToBoolean(ConfigurationManager.AppSettings.Get("OnScreenKeyboard"));
                }
                else
                {
                    Settings.OnScreenKeyboard = dsInitialSettings.Tables[0].Rows[0]["USE_ON_SCREEN_KEYBOARD"].ToString() != string.Empty ?
                                                Convert.ToBoolean(dsInitialSettings.Tables[0].Rows[0]["USE_ON_SCREEN_KEYBOARD"].ToString()) :
                                                Convert.ToBoolean(ConfigurationManager.AppSettings.Get("OnScreenKeyboard"));
                    try
                    {
                        Settings.CopyRightInfo = (dsInitialSettings.Tables[0].Rows[0]["COPYRIGTINFO"] != null) ? Convert.ToString(dsInitialSettings.Tables[0].Rows[0]["COPYRIGTINFO"]) : string.Empty;
                    }
                    catch
                    {
                        Settings.CopyRightInfo = string.Empty;
                    }
                }

                Settings.IsLoginRequired = ConfigurationManager.AppSettings.Get("IsLoginRequired") != string.Empty ?
                                           Convert.ToBoolean(ConfigurationManager.AppSettings.Get("IsLoginRequired")) : false;

                if (Settings.IsLoginRequired)
                {
                    StartupUri = new Uri("Login.xaml", UriKind.Relative);
                }
                else
                {
                    StartupUri = new Uri("MainScreen.xaml", UriKind.Relative);
                }

                LogManager.WriteLog("Application_Startup Success", LogManager.enumLogLevel.Info);
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
                MessageBox.ShowBox("MessageID74", BMC_Icon.Error);
            }
        }