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

📄 frmquestionsearch.cs

📁 本论文叙述了联机考试系统的现状以及C#语言的概况。重点介绍了联机考试系统的实现过程:包括系统分析、 系统调查、 数据流程分析、功能设计、 数据库设计、 系统物理配置方案、 系统实现、 系统测试和调试。
💻 CS
📖 第 1 页 / 共 2 页
字号:
			this.btnClose.Location = new System.Drawing.Point(499, 439);
			this.btnClose.Name = "btnClose";
			this.btnClose.Size = new System.Drawing.Size(96, 26);
			this.btnClose.TabIndex = 49;
			this.btnClose.Text = "关闭(&O)";
			this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
			// 
			// dbgQuestionDetails
			// 
			this.dbgQuestionDetails.BackgroundColor = System.Drawing.Color.LightSteelBlue;
			this.dbgQuestionDetails.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.dbgQuestionDetails.DataMember = "";
			this.dbgQuestionDetails.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dbgQuestionDetails.Location = new System.Drawing.Point(115, 224);
			this.dbgQuestionDetails.Name = "dbgQuestionDetails";
			this.dbgQuestionDetails.ReadOnly = true;
			this.dbgQuestionDetails.Size = new System.Drawing.Size(605, 207);
			this.dbgQuestionDetails.TabIndex = 48;
			this.dbgQuestionDetails.DoubleClick += new System.EventHandler(this.dbgQuestionDetails_DoubleClick);
			// 
			// btnHelp
			// 
			this.btnHelp.BackColor = System.Drawing.Color.Transparent;
			this.btnHelp.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.btnHelp.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.btnHelp.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
			this.btnHelp.Location = new System.Drawing.Point(696, 52);
			this.btnHelp.Name = "btnHelp";
			this.btnHelp.Size = new System.Drawing.Size(72, 26);
			this.btnHelp.TabIndex = 55;
			this.btnHelp.Text = "帮助(&H)";
			this.btnHelp.Click += new System.EventHandler(this.btnHelp_Click);
			// 
			// frmQuestionSearch
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
			this.ClientSize = new System.Drawing.Size(783, 482);
			this.Controls.Add(this.btnHelp);
			this.Controls.Add(this.lblTitle);
			this.Controls.Add(this.lblHeading);
			this.Controls.Add(this.btnSave);
			this.Controls.Add(this.grpSearch);
			this.Controls.Add(this.btnClose);
			this.Controls.Add(this.dbgQuestionDetails);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
			this.Location = new System.Drawing.Point(146, 115);
			this.Name = "frmQuestionSearch";
			this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
			this.Text = "QuestionSearch";
			this.Load += new System.EventHandler(this.frmQuestionSearch_Load);
			this.Paint += new System.Windows.Forms.PaintEventHandler(this.frmQuestionSearch_Paint);
			this.grpSearch.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dbgQuestionDetails)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private void dbgQuestionDetails_DoubleClick(object sender, System.EventArgs e)
		{
			index++;
			this.Hide();
			
			dtQuestion=(DataTable)dbgQuestionDetails.DataSource;
			DataRow drQuestion=dtQuestion.Rows[dbgQuestionDetails.CurrentRowIndex];
			 
			this.QNumber=(int)drQuestion[0];

			//添加的代码
			objfrmQuestion = null;
			//
		
			objfrmQuestion=new frmQuestion(3,this, this.QNumber); 
            
			objfrmQuestion.btnNewSave.Text ="确认(&O)";

			if ((index==1) && (frmQuestion.dtUpdate!=null))
				frmQuestion.dtUpdate.Clear();
			
			objfrmQuestion.ShowDialog();
			
		
		}


		/// //修改情况:部门:ACCP产品开发培训部   修改人:王文  时间:2004-12-26
		private void btnClose_Click(object sender, System.EventArgs e)
		{
			if (frmQuestion.dtUpdate != null)
				frmQuestion.dtUpdate.Clear(); //所添加的CODES
			this.Close();
		}

		/// <summary>
		/// //修改情况:部门:ACCP产品开发培训部   修改人:王文  时间:2004-12-25
		/// 所添加的CODES
		/// </summary>
		void emptySearchValue()
		{
			for (int i = 0; i<searchValue.Length; i++)
				searchValue.SetValue(string.Empty, i);
		}

		///修改情况:部门:ACCP产品开发培训部   修改人:王文  时间:2004-12-25
		private void btnSearch_Click(object sender, System.EventArgs e)
		{
			try
			{
				/////所添加的CODES
				emptySearchValue();
				/////
				///
				if(this.cboSubject.SelectedIndex !=-1) //if subject name is not null
				{
					 searchValue[0]=this.cboSubject.Text;
				}
				if(this.txtKeywords.Text.Length >0)			
				{
							
					searchValue[1] =  this.txtKeywords.Text;
				}
				////所添加的CODES
				if (searchValue[0] == string.Empty&&searchValue[1]==string.Empty)
				{
					MessageBox.Show("问题的主题或问题的关键字不可以同时为空");
					return;
				}
				////
				objQuestion=new Question();

				DataTable dtQuestion = objQuestion.FetchQuestions(searchValue);
				if (dtQuestion.Rows.Count<=0)
				{
					this.dbgQuestionDetails.DataSource = null;//;//除去dtQuestion;
					////除去MessageBox.Show("0 Records matched the Search Criteria");
					return ;
				}
				else
					this.dbgQuestionDetails.DataSource = dtQuestion;
			}
			catch(Exception myException)
			{
				Console.WriteLine(myException.Message);
				
			}
		}


		private void frmQuestionSearch_Load(object sender, System.EventArgs e)
		{
			cboSubject.Items.Add("Java");
			cboSubject.Items.Add("C#");
			cboSubject.Items.Add("HTML");
			cboSubject.Items.Add("SQL Server");
			cboSubject.SelectedIndex=0;
			this.btnSave.Enabled=false;
		}


		//修改情况:部门:ACCP产品开发培训部   修改人:王文  时间:2004-12-26
		private void btnSave_Click(object sender, System.EventArgs e)
		{
			this.btnSave.Enabled=false;
			if (frmQuestion.dtUpdate!=null)
			{
				objQuestion.UpdateQuestions(frmQuestion.dtUpdate);

				frmQuestion.dtUpdate.Clear();//所添加的CODES
			    
				//after updation, refresh the datagrid by retrieving records again
	
				MessageBox.Show ("问题详细信息已成功更新");
			}

			////除去DataAccess objDA=DataAccess.GetInstance();
				
			////除去objQuestion=new Question();

			////除去DataTable dtQuestion = objQuestion.FetchQuestions(searchValue);
			////除去dbgQuestionDetails.DataSource =dtQuestion;

			
		}


		//修改情况:部门:ACCP产品开发培训部   修改人:王文  时间:2004-12-25
		private void frmQuestionSearch_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
		{
			//除去if (updateflag) //check if update was performed in the frmQuestion form and data was modified there
						
	         
			//	除去this.btnSave.Enabled =true;
		}


		private void btnHelp_Click(object sender, System.EventArgs e)
		{
			Help.ShowHelp(this,Environment.CurrentDirectory +@"\\OES_Help\OES_Help.chm");
		}
		

	

		
	}
}

⌨️ 快捷键说明

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