⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xuqiuchaxunform.cs

📁 怎样的图象处理的
💻 CS
📖 第 1 页 / 共 2 页
字号:
			this.ResumeLayout(false);

		}

		/// <summary>
		/// 销毁控制器
		/// </summary>
		private void XiaoHui() 
		{
			//销毁控制器
			if(	jiemianKongZhi != null) 
			{
				try 
				{
					jiemianKongZhi.XiaoHui(); 
					
				}
				catch(Exception e) 
				{
					clsRiZhiChuLi.JiLuRiZhi(e.Message);  
				}
				finally
				{
					this.jiemianKongZhi = null;
				}
			}
		}

		
		#region 事件响应区域
		/// <summary>
		/// 上线菜单条单击事件响应
		/// </summary>
		private void MMI_ShangXian_Click(object sender, System.EventArgs e)
		{
			this.jiemianKongZhi.QiangZhiShangXian(); 
		}
		/// <summary>
		/// 离线菜单条单击事件响应
		/// </summary>
		private void MMI_LiXian_Click(object sender, System.EventArgs e)
		{
			this.jiemianKongZhi.QiangZhiLiXian();
		}

		/// <summary>
		/// 窗体关闭
		/// </summary>		
		private void XuQiuChaXunForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
		{
			if(DialogResult.Yes != MessageBox.Show(this,
				"您确认退出系统?","提示信息",MessageBoxButtons.YesNo))
				e.Cancel=true;				
		}

		/// <summary>
		/// 刷新按钮单击响应事件
		/// </summary>
		private void BT_ShuanXin_Click(object sender, System.EventArgs e)
		{
			this.jiemianKongZhi.ShuJuChaXun(); 
		}		
		/// <summary>
		/// 刷新菜单项目单击响应事件
		/// </summary>
		private void MMI_ShuaXin_Click(object sender, System.EventArgs e)
		{
			this.jiemianKongZhi.ShuJuChaXun(); 
		}
		/// <summary>
		/// 需求录入按钮单击响应事件
		/// </summary>
		private void BT_XuQiuLuRu_Click(object sender, System.EventArgs e)
		{
			if(!this.jiemianKongZhi.ShiFouXuYaoXiaZai()) 
			{ 
				(new XuQiuLuRuForm (jiemianKongZhi,0,null)).ShowDialog() ;
			}
			else 
			{
				MessageBox.Show(this,"请单击刷新按钮下载基本数据!","提示信息");
			}
		}
		/// <summary>
		/// 需求录入菜单项目单击响应事件
		/// </summary>
		private void MMI_XuQiuLuRu_Click(object sender, System.EventArgs e)
		{
			BT_XuQiuLuRu_Click(sender,e);		
		}

		/// <summary>
		/// 退出按钮单击响应事件
		/// </summary>
		private void MMI_TuiChu_Click(object sender, System.EventArgs e)
		{			
				this.Close();			
		}
		/// <summary>
		/// 调看按钮单击响应事件
		/// </summary>
		private void BT_DiaoKan_Click(object sender, System.EventArgs e)
		{
			//服务器端传回的查询结果
			int hang = this.DG_XuQiu.CurrentRowIndex;
			XuQiuLuRuForm xinChuanTi = null;
			if(hang >= 0 ) 
			{
				DataSet ds = jiemianKongZhi.HuoDeShuJu(clsChangLiang.SHUJU_XUQIU,hang);
				xinChuanTi = new XuQiuLuRuForm(this.jiemianKongZhi,2,ds);
				xinChuanTi.Show() ;
			}
		}
		/// <summary>
		/// 双击事件
		/// </summary>		
		private void DG_XuQiu_DoubleClick(object sender, System.EventArgs e)
		{
			//服务器端传回的查询结果
			int hang = this.DG_XuQiu.CurrentRowIndex;
			XuQiuLuRuForm xinChuanTi = null;
			if(hang >= 0 ) 
			{
				DataSet ds = jiemianKongZhi.HuoDeShuJu(clsChangLiang.SHUJU_XUQIU,hang);
				xinChuanTi = new XuQiuLuRuForm(this.jiemianKongZhi,2,ds);
				xinChuanTi.Show() ;
			}
		}
		/// <summary>
		/// 打开帮助窗体
		/// </summary>
		private void MMI_BangZhu_Click(object sender, System.EventArgs e)
		{
			BangZhuForm xinChuangTi = new BangZhuForm();
			xinChuangTi.ShowDialog();
		}
		/// <summary>
		/// 打开关于窗体
		/// </summary>
		private void MMI_GuanYu_Click(object sender, System.EventArgs e)
		{
			GuanYuForm xinChuangTi = new GuanYuForm();
			xinChuangTi.ShowDialog();
		}		

		/// <summary>
		/// 时钟时间处理,根据时钟的Interval定时执行
		/// </summary>
		private void TM_ShuJuGengXin_Tick(object sender, System.EventArgs e)
		{
			//clsRiZhiChuLi.JiLuRiZhi(DateTime.Now.ToString());
			this.jiemianKongZhi.DingShiShuJuChaXun();
		}
		/// <summary>
		/// 主视图关闭
		/// </summary>
		private void XuQiuChaXunForm_Closed(object sender, System.EventArgs e)
		{
			this.XiaoHui(); 
		}

		/// <summary>
		/// 当前应用程序退出
		/// </summary>
		private void CurrentDomain_ProcessExit(object sender, EventArgs e)
		{
			
			this.XiaoHui(); 
		}


		#endregion

		#endregion

		#region 保护方法区域
		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			//销毁界面元素
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}
		
		#endregion

		#region 公共方法区域
		public XuQiuChaXunForm()
		{			
			//初始化界面元素
			InitializeComponent();
			//注册AppDomain退出事件响应
			AppDomain.CurrentDomain.ProcessExit +=new EventHandler(CurrentDomain_ProcessExit);
			//初始化控制器			
			try 
			{
				jiemianKongZhi =  new clsXuQiuChaXunKongZhi(this);
				jiemianKongZhi.YunXin(); 
			}
			catch(Exception e) 
			{
				clsRiZhiChuLi.JiLuRiZhi(e.Message) ;
				jiemianKongZhi = null;
			}
			
		}
		/// <summary>
		/// 是否构造成功
		/// </summary>
		/// <returns>true构造成功,false构造失败</returns>

		public bool GouZaoChengGong() 
		{
			return jiemianKongZhi == null? false:true;
		}
		
		// <summary>
		/// 连接状态变化
		/// </summary>
		/// <param name="shifouLianJie">是否连接</param>
		public void LianJieZhuangTai(bool shifouLianJie) 
		{			
			//设置界面显示
			if(shifouLianJie) 
			{
				ShiZhiZhuangTai("网络已经接通!"); 
				this.MMI_LiXian.Enabled=true;
				this.MMI_ShangXian.Enabled=false;
			}
			else 
			{
				ShiZhiZhuangTai("网络已经断开!"); 
				this.MMI_LiXian.Enabled=false;
				this.MMI_ShangXian.Enabled=true;
			}
			
		}

		/// <summary>
		/// 设置状态条显示
		/// </summary>
		/// <param name="Zhi">显示值</param>
		public void ShiZhiZhuangTai(String Zhi) 
		{
			SB_ZhuangTai.Text = Zhi; 
		}

		/// <summary>
		/// 更新需求查询网格
		/// </summary>
		/// <param name="ShuJu"></param>
		public void GengXinXuQiu(DataSet ShuJu) 
		{
			xuqiuChaXun = ShuJu;
			MethodInvoker	fangfa  = new MethodInvoker(this.ShuaXinWangGe);
			this.BeginInvoke(fangfa);
		}
		
		/// <summary>
		/// 刷新网格
		/// </summary>
		public void ShuaXinWangGe() 
		{
			DataSet xinShuJu = null;
			System.Data.DataView xinShuJuShiTu= null;
			
			if(xuqiuChaXun.Tables.Count > 0) 
			{  
				xinShuJu = xuqiuChaXun;
				xinShuJuShiTu = xuqiuChaXun.Tables[0].DefaultView; 
			}
			this.DG_XuQiu.DataSource = xinShuJuShiTu;
			//this.DG_XuQiu.Refresh(); 
		}

		/// <summary>
		/// 设置数据源
		/// </summary>
		/// <param name="ShuJu"></param>
		public void  SheZhiShuJuYuan(DataSet ShuJu) 
		{			
			if(ShuJu !=null && ShuJu.Tables.Count != 0 ) 
			{
				this.DG_XuQiu.DataSource = ShuJu;			
				this.DG_XuQiu.DataMember =ShuJu.Tables[0].TableName;
			}
		}

		/// <summary>
		/// 开始下载
		/// </summary>
		public void XiaZaiKaiShi(object sender, UpdaterActionEventArgs e) 
		{		
			this.SB_ZhuangTai.Text = "应用程序开始下载......";  
		}

		/// <summary>
		/// 下载结束
		/// </summary>
		public void XiaZaiJieShu(object sender, UpdaterActionEventArgs e) 
		{		
			this.SB_ZhuangTai.Text = "应用程序下载结束......";
		}

		/// <summary>
		/// 是否开始运行新的版本程序
		/// </summary>
		/// <param name="e"></param>
		/// <returns></returns>
		public bool YunXinChengXu(UpdaterActionEventArgs e) 
		{
			DialogResult dialog = 
				MessageBox.Show(this,"你是否现在就要运行最新的程序?", "程序提示", MessageBoxButtons.YesNo );
			if( DialogResult.Yes == dialog )
			{
				return true;
			}
			else 
			{
				return false;
			}

		}
		
		/// <summary>
		/// 设置时钟的运行状态
		/// </summary>
		/// <param name="ShiFouYunXing"></param>
		public void SheZhiTimer(bool ShiFouYunXing) 
		{
			this.TM_ShuJuGengXin.Enabled=ShiFouYunXing;
		}
		#endregion

		#region Main方法区域
		/// <summary>
		/// 应用程序的主入口点。
		/// </summary>
		[STAThread]
		static void Main() 
		{	
			try 
			{
				XuQiuChaXunForm jieMian = 	new XuQiuChaXunForm();
				if(jieMian.GouZaoChengGong())
				{
					Application.Run(jieMian);
				}
				else 
				{
					jieMian.Close(); 
					jieMian = null;
					MessageBox.Show("系统初始化错误,请查看应用程序输出日志获得更多信息");
				}
			}
			catch(Exception genException ) 
			{
				Console.WriteLine(genException.Message);
			}
		}

		
		#endregion
	
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -