Beispiel #1
0
        public void Reflesh()
        {
            Manager_Msg glxx = (Manager_Msg)this.Owner;

            glxx.BindData();
            this.Close();
        }
Beispiel #2
0
        private void MenuClicked(object sender, EventArgs e)
        {
            DataTable dt = ora.GetDt("select distinct t.pos_tc  from b_devices t where t.pos_tc is not null");

            // string path = System.Environment.CurrentDirectory + "//config//Position.txt";      //读取Position文件中显示层
            if (dt.Rows.Count > 0)
            {
                //FileStream fs = new FileStream(path, FileMode.Open);
                //StreamReader sr = new StreamReader(fs, Encoding.Default);
                // string line = sr.ReadLine();
                //sr.Close();
                //fs.Close();
                // string[] str = File.ReadAllLines(path,Encoding.UTF8);
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (sender.ToString() == dt.Rows[i]["pos_tc"].ToString())
                    {
                        Name           = dt.Rows[i]["pos_tc"].ToString();
                        groupBox1.Text = "泸沽湖机场" + dt.Rows[i]["pos_tc"].ToString() + "航显监控";

                        DeleteButton();
                        AddbuttonInfo("images/" + dt.Rows[i]["pos_tc"].ToString() + ".jpg");
                        return;
                    }
                }
                // MessageBox.Show(line);
            }
            else
            {
                MessageBox.Show("菜单配置文件不存在,请检查!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            switch (sender.ToString())
            {
            //case "新增图层":
            //    新增图层 Frmxz = new 新增图层();
            //    Frmxz.ShowDialog();
            //    break;
            case "变更图层":
                //MessageBox.Show(Name);
                if (Name == "" || Name == "航显监控")
                {
                    //MessageBox.Show("请进入点位图层再进行此操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    DelPic Frmsc = new DelPic();
                    Frmsc.ShowDialog();
                }
                else
                {
                    MessageBox.Show("变更图层只能在主界面操作,请退回主界面!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                break;

            case "新增点位":
                if (Name == "" || Name == "航显监控")
                {
                    MessageBox.Show("请进入点位图层再进行此操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    AddPoint Frmxzdw = new AddPoint(Name);
                    Frmxzdw.Owner = this;
                    Frmxzdw.ShowDialog();
                }
                break;

            case "重启本程序":
                //DeleteButton();
                Application.Restart();
                break;

            case "重启全部终端":
                //string[] ip = checkedListBox3.Text.Split(',');
                foreach (string str in list)
                {
                    string[] line = str.Split(',');
                    sendata("RESTPC", line[1]);
                }
                MessageBox.Show("重启全部终端操作成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

                break;

            case "重启全部程序":
                foreach (string str in list)
                {
                    string[] line = str.Split(',');
                    sendata("RESTEXE", line[1]);
                }
                MessageBox.Show("重启全部程序操作成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                break;

            case "关闭全部终端":
                foreach (string str in list)
                {
                    string[] line = str.Split(',');
                    sendata("CLOSEPC", line[1]);
                }
                // sendata("CLOSEPC", ctrl.Text);
                MessageBox.Show("关闭终端操作成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                break;
            //case "发布消息":

            //    break;
            case "管理消息":
                Manager_Msg mfrm = new Manager_Msg();
                mfrm.Owner = this;
                mfrm.ShowDialog();
                break;
            }
        }