Example #1
0
        public static void Main()
        {
            //if (System.Diagnostics.Process.GetCurrentProcess(). GetProcessesByName(System.Diagnostics.Process.GetCurrentProcess().ProcessName).Length > 1)
//        return;
            InitializeApp();
            //MainMenu mainMenu = new MainMenu();
            //Application.Run(mainMenu);
            //mainMenu.Dispose();
            //mainMenu = null;
            if (!DBIsReady)
            {
                //MessageBox.Show("База данных не готова к работе", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                return;
            }
            try
            {
                if (!Authorized())
                {
                    return;
                }
                OrderViewer orderView = new OrderViewer();
                Application.Run(orderView);
                orderView.Dispose();
                orderView = null;
            }
            catch (Exception e)
            {
                GlobalArea.Logger.Error("[Error][Ошибка чтения таблицы Сотрудников] " + e.ToString());
                throw;
            }
        }
Example #2
0
        public static DialogResult ShowDialog(string dialogName, object Arg)
        {
            DialogResult dialogResult = DialogResult.Cancel;

            switch (dialogName)
            {
            //case "SetupPlugin":
            //  using (PluginsSetup pluginSetup = new PluginsSetup())
            //  {
            //    dialogResult = pluginSetup.ShowDialog();
            //    pluginSetup.Close();
            //  }
            //  break;
            case "NewOrder":
                using (OrderViewer orderView = new OrderViewer())
                {
                    orderView.Text = "Сканер";
                    dialogResult   = orderView.ShowDialog();
                    orderView.Close();
                }
                break;

            case "SetupDatasource":
                using (ConfigurePlugin confPlugin = new ConfigurePlugin())
                {
                    dialogResult = confPlugin.ShowDialog();
                    confPlugin.Close();
                }
                break;

            case "Options":
                using (OptionsView optionsView = new OptionsView())
                {
                    optionsView.ShowDialog();
                    optionsView.Close();
                }
                break;
            }
            return(dialogResult);
        }