Exemple #1
0
        private void btnLogInOut_Click(object sender, EventArgs e)
        {
            switch (btnLogInOut.Text)
            {
            case "Login":
                GUI.FormLogin formLogin = new GUI.FormLogin();
                formLogin.ShowDialog();
                break;

            case "Logout":
                AuthorityUpdate.UpdateLogoutInfo();
                //disable authroity function
                AuthorityUpdate.UpdateFuncGroupEnable("INIT");
                ((TabControl)formSystem.Controls["tbcSystemSetting"]).SelectTab(0);
                break;
            }
        }
Exemple #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Int32 oldWidth  = this.Width;
            Int32 oldHeight = this.Height;

            this.WindowState = FormWindowState.Normal;
            this.Width       = 1;
            this.Height      = 1;

            Control[] ctrlForm = new Control[] { formMonitoring, formTestMode };

            try
            {
                for (int i = 0; i < ctrlForm.Length; i++)
                {
                    ((Form)ctrlForm[i]).TopLevel = false;
                    tbcMian.TabPages[i].Controls.Add(((Form)ctrlForm[i]));
                    ((Form)ctrlForm[i]).Show();
                    tbcMian.SelectTab(i);
                }

                tbcMian.SelectTab(0);

                alarmFrom.Show();
                //alarmFrom.SendToBack();
                alarmFrom.Hide();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString());
            }
            //Thread.Sleep(2000);

            if (SplashScreen.Instance != null)
            {
                SplashScreen.Instance.BeginInvoke(new MethodInvoker(SplashScreen.Instance.Dispose));
                SplashScreen.Instance = null;
            }
            this.Width       = oldWidth;
            this.Height      = oldHeight;
            this.WindowState = FormWindowState.Maximized;

            RouteCtrl.ConnectAll();
            AuthorityUpdate.UpdateFuncGroupEnable("INIT");//init 權限
            //RouteCtrl.ConnectAll();

            this.Width         = oldWidth;
            this.Height        = oldHeight;
            this.WindowState   = FormWindowState.Maximized;
            HostControl.Events = new ReportEvent();
            Dictionary <string, string> param = new Dictionary <string, string>();

            param.Add("RED", "False");
            param.Add("ORANGE", "False");
            param.Add("GREEN", "False");
            param.Add("BLUE", "False");
            param.Add("BUZZER1", "False");
            param.Add("BUZZER2", "False");
            RouteCtrl.DIO.SetIO(param);


            ThreadPool.QueueUserWorkItem(new WaitCallback(UpdateCheckBox));
        }