Пример #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (this.textBox1.Text == "rpimscommpassword")
     {
         tx1 = 通讯.InstanceObject(this);
         tx1.Focus();
         tx1.Show();
         tx1.Visible = true;
         this.Close();
         this.Dispose();
     }
     else {
         this.textBox1.Text = "";
         MessageBox.Show("  密码错误,请重新输入!","警告");
     }
 }
        private void RPIMS数据采集及管理系统_Load(object sender, EventArgs e)
        {
            alarm_status = this.toolStripStatusLabel1;
            this.toolStripStatusLabel1.Text = "";
            asf.controllInitializeSize(this);
            this.WindowState = FormWindowState.Maximized;

            Tools.SetIsOpen();//读取配置文件,判断是否启动报警

               butt = this.button1;

            switch (login.OP)
            {
                case "普通用户":
                    this.系统设置ToolStripMenuItem.Enabled = false;
                    this.用户管理ToolStripMenuItem1.Enabled = false;
                    this.toolStripButton14.Enabled = false;
                    this.toolStripButton9.Enabled = false;
                    this.toolStripButton11.Enabled = false;
                    this.toolStripButton2.Enabled = false;
                    this.toolStripButton1.Enabled = false;
                    this.数据管理ToolStripMenuItem.Enabled = false;
                    break;
                case "超级管理员":
                    break;
                default:
                    MessageBox.Show("用户权限读取失败!请重新登录!");
                    System.Environment.Exit(0);
                    break;

            }

            //-------------实时曲线初始化-----------------------------
            //支柱压力
            zedGrahp_initializer(zedGraph_zzyldata1, ref list1, "支柱压力实时曲线图-前柱", "时 间", "压 力/ MPa", "");
            zedGrahp_initializer(zedGraph_zzyldata2, ref list2, "支柱压力实时曲线图-后柱", "时 间", "压 力/ MPa", "");
            zedGrahp_initializer(zedGraph_zzyldata3, ref list3, "支柱压力实时曲线图-前悬梁", "时 间", "压 力/ MPa", "");

            zedGrahp_initializer(zedGraph_zzyldata, ref list3, "支柱压力实时曲线图-前悬梁", "时 间", "压 力/ MPa", "");

            //顶板离层
            zedGrahp_initializer(zedGraph_dblcdata1, ref list4, "顶板离层实时曲线图-深基点", "时 间", "距 离/ mm", "");
            zedGrahp_initializer(zedGraph_dblcdata2, ref list5, "顶板离层实时曲线图-浅基点", "时 间", "距 离/ mm", "");
            zedGrahp_initializer(zedGraph_dblcdata, ref list5, "顶板离层实时曲线图-综合图", "时 间", "距 离/ mm", "");
            //锚杆锚索
            zedGrahp_initializer_mz(zedGraph_mgmsdata, ref list6, "锚杆(索)实时曲线图", "时 间", "压 力/ KN", "");
            //钻孔应力
            zedGrahp_initializer_mz(zedGraph_zkyldata, ref list7, "钻孔应力实时曲线图", "时 间", "压 力/ MPa", "");

            //------------实时曲线初始化-------------------------------
            //timer3.Enabled = true;
            tabControl1.TabPages[0].Show();
            tabControl1.TabPages[1].Show();
            tabControl1.TabPages[2].Show();
            tabControl1.TabPages[3].Show();

            loadFz();

              // comboBox1_S();
            //comboBox1_SelectedIndexChanged(new object(), new EventArgs());
            //comboBox4_SelectedIndexChanged(new object(), new EventArgs());
            //comboBox6_SelectedIndexChanged(new object(), new EventArgs());
            //comboBox8_SelectedIndexChanged(new object(), new EventArgs());

                //string sql_fzhan = "select 监测分站编号 from 监测分站信息表";
                //string  fenzhan_ss = (string)db.QueryScalar(sql_fzhan);
                try
                {
                    string sql_fzhan = "select count(监测分站编号) from 监测分站信息表";
                    int fenzhan_ss = (int)db.QueryScalar(sql_fzhan);
                    if (fenzhan_ss != 0)
                    {
                        tx1 = 通讯.InstanceObject(this);
                        tx1.Focus();
                        tx1.Show();
                        tx1.Visible = false;
                        tx1.buttonQDing_copy();

                    }

                }
                catch { }
            // comboBox1_SelectedIndexChanged(this, new EventArgs());
        }
Пример #3
0
        public void ExitMainForm2()
        {
            try
                  {
                      this.notifyIcon1.Visible = false;
                      this.Close();
                      comm.Close();

                      _instance = null;
                      this.Dispose();
                  }
                  catch { }
        }
Пример #4
0
        public void ExitMainForm()
        {
            if (MessageBox.Show("您确定要退出通信服务程序吗?", "退出", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK)
            {
                this.notifyIcon1.Visible = false;
                this.Close();
                comm.Close();

               _instance = null;
                this.Dispose();

            }
        }
Пример #5
0
 private void 通讯_FormClosing(object sender, FormClosingEventArgs e)
 {
     _instance = null;
 }
Пример #6
0
 public static 通讯 InstanceObject(密码框 m)
 {
     if (_instance == null)
         _instance = new 通讯(m);
     return _instance;
 }
Пример #7
0
 //创建窗体对象的静态方法
 public static 通讯 InstanceObject(RPIMS数据采集及管理系统 f)
 {
     if (_instance == null)
         _instance = new 通讯(f);
     return _instance;
 }
Пример #8
0
 public static 密码框 InstanceObject(通讯 txmm)
 {
     if (_instance == null)
         _instance = new 密码框(txmm);
     return _instance;
 }
Пример #9
0
 public 密码框(通讯 txm)
 {
     InitializeComponent();
     tx1 = txm;
 }