Beispiel #1
0
        static void Main()
        {
            // BasisPlatform:应用程序初始化
            Basiser basiser = Basiser.GetInstance();

            basiser.Init(ADGSAppConfig.GetInstance().AppIdentifier, PlatformType.Winform, IPAddress.Parse("127.0.0.1"), 0);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);

            bool notRun;

            using (Mutex mutex = new Mutex(true, Application.ProductName, out notRun))
            {
                if (notRun)
                {
                    Application.Run(new Form1());
                }
                else
                {
                    MessageBox.Show("程序正在运行", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
        /// <summary>
        /// 初始化
        /// </summary>
        void InitPerformer()
        {
            _ADGSAppConfig = ADGSAppConfig.GetInstance();

            OracleSqlBuilder.OracleKeywords = this._ADGSAppConfig.OracleKeywords.Split('|');

            timer1.Interval = 5000;
            timer1.Elapsed += new System.Timers.ElapsedEventHandler(timer1_Elapsed);
        }
Beispiel #3
0
        private void Form1_Shown(object sender, EventArgs e)
        {
            try
            {
#if DEBUG
#else
                // 添加、取消开机启动
                if (ADGSAppConfig.GetInstance().Startup)
                {
                    StartUpUtil.InsertStartUp(Application.ProductName, Application.ExecutablePath);
                }
                else
                {
                    StartUpUtil.DeleteStartUp(Application.ProductName);
                }
#endif
            }
            catch { }
        }
Beispiel #4
0
        static void Main()
        {
            // BasisPlatform:应用程序初始化
            Basiser basiser = Basiser.GetInstance();

            basiser.EnabledEbiaSupport = true;
            basiser.InitBasisPlatform(ADGSAppConfig.GetInstance().AppIdentifier, PlatformType.Winform);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            bool notRunning;

            using (Mutex mutex = new Mutex(true, Application.ProductName, out notRunning))
            {
                if (notRunning)
                {
                    Application.Run(new Form1());
                }
            }
        }
Beispiel #5
0
        private void Form1_Shown(object sender, EventArgs e)
        {
            //timer1.Interval = (double)ClientConfiguration.Instance.GrabInterval * 60 * 1000;
            //timer1.Elapsed += new System.Timers.ElapsedEventHandler(timer1_Elapsed);
            //timer1_Elapsed(null, null);
            try
            {
#if DEBUG
#else
                // 添加、取消开机启动
                if (ADGSAppConfig.GetInstance().Startup)
                {
                    StartUpUtil.InsertStartUp(Application.ProductName, Application.ExecutablePath);
                }
                else
                {
                    StartUpUtil.DeleteStartUp(Application.ProductName);
                }
#endif
            }
            catch { }
        }
Beispiel #6
0
        private EquAssayDeviceDAO()
        {
            _ADGSAppConfig = ADGSAppConfig.GetInstance();

            selfDber = new OracleDapperDber(this._ADGSAppConfig.SelfConnStr);
        }
Beispiel #7
0
        private void btnSaveAssay_Click(object sender, EventArgs e)
        {
            String valid = ValidateInput();

            if (!String.IsNullOrWhiteSpace(valid))
            {
                MessageBox.Show(valid);
                return;
            }
            int index = this.Instruments.SelectedIndex;

            appConfig.AssayGrabers[index].MachineCode = this.txtMachineCode.Text.Trim();
            appConfig.AssayGrabers[index].TableName   = this.txtTableName.Text.Trim();
            appConfig.AssayGrabers[index].PrimaryKeys = this.txtPrimaryKeys.Text.Trim();
            appConfig.AssayGrabers[index].ConnStr     = this.txtConnStr.Text.Trim();
            appConfig.AssayGrabers[index].Enabled     = ckEnabled.Checked;
            if (sysGraber.Checked)
            {
                if (appConfig.AssayGrabers[index].Parameters.Keys.Contains("GaberType"))
                {
                    appConfig.AssayGrabers[index].Parameters.Remove("GaberType");
                }
                if (appConfig.AssayGrabers[index].Parameters.Keys.Contains("DayRange"))
                {
                    appConfig.AssayGrabers[index].Parameters.Remove("DayRange");
                }
                if (appConfig.AssayGrabers[index].Parameters.Keys.Contains("DbType"))
                {
                    appConfig.AssayGrabers[index].Parameters.Remove("DbType");
                }
                if (appConfig.AssayGrabers[index].Parameters.Keys.Contains("SQL"))
                {
                    appConfig.AssayGrabers[index].Parameters.Remove("SQL");
                }

                appConfig.AssayGrabers[index].Parameters.Add("DbType", ddlDbType.SelectedItem.ToString());
                appConfig.AssayGrabers[index].Parameters.Add("SQL", txtSQL.Text.Trim());
            }
            else if (selfDefineGraber.Checked)
            {
                if (appConfig.AssayGrabers[index].Parameters.Keys.Contains("GaberType"))
                {
                    appConfig.AssayGrabers[index].Parameters.Remove("GaberType");
                }
                if (appConfig.AssayGrabers[index].Parameters.Keys.Contains("DayRange"))
                {
                    appConfig.AssayGrabers[index].Parameters.Remove("DayRange");
                }
                if (appConfig.AssayGrabers[index].Parameters.Keys.Contains("DbType"))
                {
                    appConfig.AssayGrabers[index].Parameters.Remove("DbType");
                }
                if (appConfig.AssayGrabers[index].Parameters.Keys.Contains("SQL"))
                {
                    appConfig.AssayGrabers[index].Parameters.Remove("SQL");
                }

                appConfig.AssayGrabers[index].Parameters.Add("GaberType", txtGaberType.Text.Trim());
                appConfig.AssayGrabers[index].Parameters.Add("DayRange", txtDayRange.Value.ToString());
            }
            try
            {
                SaveAssayInstruments();
                appConfig = ADGSAppConfig.GetInstance();
                FillUIFromConfig();
                MessageBox.Show("保存成功!");
            }
            catch (Exception ex)
            {
                MessageBox.Show("保存失败!原因:" + ex.Message);
            }
        }
Beispiel #8
0
 private void initPage()
 {
     appConfig = ADGSAppConfig.GetInstance();
     FillUIFromConfig();
 }