private void frmWaterSys_Load(object sender, System.EventArgs e) { try { string strSql=string.Format("select softName,userName,version,image from tbAdInfo where userid='{0}'",BengZhan.CDBConnection.m_strUserID); DataTable dtAdInfo=new DataTable(); BengZhan.CDBConnection.getDataTable(ref dtAdInfo,strSql,"dt"); XmlDocument xDocInfo=new XmlDocument(); xDocInfo.Load(@"ini/sysIni.xml"); xDocInfo.DocumentElement.SelectSingleNode("./abort/softName").Attributes.GetNamedItem("val").Value=dtAdInfo.Rows[0]["softName"].ToString().Trim(); xDocInfo.DocumentElement.SelectSingleNode("./abort/version").Attributes.GetNamedItem("val").Value=dtAdInfo.Rows[0]["version"].ToString().Trim(); xDocInfo.DocumentElement.SelectSingleNode("./abort/user").Attributes.GetNamedItem("val").Value=dtAdInfo.Rows[0]["userName"].ToString().Trim(); xDocInfo.Save(@"ini/sysIni.xml"); System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmWaterSys)); // if(dtAdInfo.Rows[0]["image"].ToString().Trim()=="frm1") // { // // BengZhan.frm1 frm=new frm1(); // System.Drawing.Image im=frm.BackgroundImage; // this.BackgroundImage=im; // // } // // if(dtAdInfo.Rows[0]["image"].ToString().Trim()=="frmWaterSys1") // { // BengZhan.frm2 frm=new frm2(); // System.Drawing.Image im=frm.BackgroundImage; // this.BackgroundImage=im; // } // // if(dtAdInfo.Rows[0]["image"].ToString().Trim()=="th") // { // this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage"))); // } //System.Drawing.Image im=frm.BackgroundImage; // string strSql=string.Format("delete from tbcmd insert into tbCmd values('start')"); // BengZhan.CDBConnection.ExecuteSql(strSql); // this.pictureBox1.Location=new Point((this.toolBar1.Location.Y+this.toolBar1.Height),this.toolBar1.Location.X); // this.pictureBox1.Height=this.Height-this.pictureBox1.Location.Y; // this.pictureBox1.Width=this.Width; //this.pictureBox1.Image=((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage"))); //this.errorProvider2.SetError(this.toolBar1.b,"warn"); //��ʼһ����ͼ iniWellAmount(); CInsertMenu cInsertM=new CInsertMenu(); cInsertM.EnableMenu(this.mainMenu1); cInsertM.enableToolbar(this.toolBar1,this.mainMenu1); //this.enableToolBar(); this.iniFrm(); //*******************************ϵͳ��ʼ��********************************************** //New.laidianDisplay.GDBConnection GDBC=new New.laidianDisplay.GDBConnection(); //GDBC.initialCDB(); BengZhan.CDBConnection cdb=new CDBConnection(); cdb.initialCon(); //��ʼ��remotingϵͳ�� GprsSoft.serverMonitor.CServer csObj=new GprsSoft.serverMonitor.CServer(); csObj.InitialCServer(); CDBConnection.refreshHis(); //*************************************************************************************** if(BengZhan.CDBConnection.m_bClient==true) { this.Text=this.Text+"[�ͻ���]"; } if(BengZhan.CDBConnection.m_bServer==true) { this.Text=this.Text+"[������]"; } if(m_softName!=null) { if(m_softName.Trim()!="") { this.Text=m_softName; //this.Text=m_softName+string.Format(" [��ǰ�û���{0}]",CDBConnection.m_strUserName); } } //this.BackgroundImage=null; //�Զ��������ݿ� //this.startFrm(); autoBackup(); this.startTimer(); this.regCom(); this.disToolBar(); this.BackColor=Color.White; this.Text=this.Text+"[�°�]"; this.Text="��������ϵͳ"; XmlDocument xDoc=new XmlDocument(); xDoc.Load("Server.xml"); string strTitle=xDoc.DocumentElement.SelectSingleNode("./abort/softName").Attributes.GetNamedItem("val").Value.Trim(); this.Text=strTitle; } catch(Exception ex) { MessageBox.Show(ex.ToString()); } }
private void mnuReset_Click(object sender, System.EventArgs e) { if(this.ActiveMdiChild!=null) { MessageBox.Show("���ȹر��Ѵ���!"); return; this.ActiveMdiChild.Close(); } Form1 frm1=new Form1(); frm1.ShowDialog(); CInsertMenu cInsertM=new CInsertMenu(); cInsertM.EnableMenu(this.mainMenu1); //cInsertM.enableToolbar(this.toolBar1,this.mainMenu1); //this.enableToolBar(); }