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

📄 frmexamschedule.cs

📁 本论文叙述了联机考试系统的现状以及C#语言的概况。重点介绍了联机考试系统的实现过程:包括系统分析、 系统调查、 数据流程分析、功能设计、 数据库设计、 系统物理配置方案、 系统实现、 系统测试和调试。
💻 CS
📖 第 1 页 / 共 2 页
字号:
			this.lblExamTopic.Location = new System.Drawing.Point(496, 256);
			this.lblExamTopic.Name = "lblExamTopic";
			this.lblExamTopic.Size = new System.Drawing.Size(0, 18);
			this.lblExamTopic.TabIndex = 18;
			// 
			// grpExamDetails
			// 
			this.grpExamDetails.BackColor = System.Drawing.Color.Transparent;
			this.grpExamDetails.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.grpExamDetails.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.grpExamDetails.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
			this.grpExamDetails.Location = new System.Drawing.Point(163, 284);
			this.grpExamDetails.Name = "grpExamDetails";
			this.grpExamDetails.Size = new System.Drawing.Size(595, 69);
			this.grpExamDetails.TabIndex = 27;
			this.grpExamDetails.TabStop = false;
			this.grpExamDetails.Text = "考试详细信息";
			// 
			// 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, 17);
			this.btnHelp.Name = "btnHelp";
			this.btnHelp.Size = new System.Drawing.Size(72, 26);
			this.btnHelp.TabIndex = 28;
			this.btnHelp.Text = "帮助(&H)";
			this.btnHelp.Click += new System.EventHandler(this.btnHelp_Click);
			// 
			// lblExamList
			// 
			this.lblExamList.AutoSize = true;
			this.lblExamList.BackColor = System.Drawing.Color.Transparent;
			this.lblExamList.Font = new System.Drawing.Font("Century Gothic", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.lblExamList.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
			this.lblExamList.Location = new System.Drawing.Point(384, 78);
			this.lblExamList.Name = "lblExamList";
			this.lblExamList.Size = new System.Drawing.Size(113, 18);
			this.lblExamList.TabIndex = 30;
			this.lblExamList.Text = "已安排的考试列表";
			// 
			// dbgExamDetails
			// 
			this.dbgExamDetails.BackgroundColor = System.Drawing.Color.LightSteelBlue;
			this.dbgExamDetails.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.dbgExamDetails.DataMember = "";
			this.dbgExamDetails.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dbgExamDetails.Location = new System.Drawing.Point(163, 103);
			this.dbgExamDetails.Name = "dbgExamDetails";
			this.dbgExamDetails.ReadOnly = true;
			this.dbgExamDetails.Size = new System.Drawing.Size(595, 138);
			this.dbgExamDetails.TabIndex = 31;
			this.dbgExamDetails.Click += new System.EventHandler(this.dbgExamDetails_Click);
			this.dbgExamDetails.Paint += new System.Windows.Forms.PaintEventHandler(this.dbgExamDetails_Paint);
			// 
			// frmExamSchedule
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
			this.ClientSize = new System.Drawing.Size(783, 520);
			this.ControlBox = false;
			this.Controls.Add(this.lblExamList);
			this.Controls.Add(this.lblPassMarks);
			this.Controls.Add(this.lblNoOfQuestions);
			this.Controls.Add(this.lblDuration);
			this.Controls.Add(this.lblMessage);
			this.Controls.Add(this.lblMarks);
			this.Controls.Add(this.lblDurationValue);
			this.Controls.Add(this.lblExamTopic);
			this.Controls.Add(this.lblNoOfQtsValue);
			this.Controls.Add(this.lblMarksValue);
			this.Controls.Add(this.lblPassMarksValue);
			this.Controls.Add(this.dbgExamDetails);
			this.Controls.Add(this.btnHelp);
			this.Controls.Add(this.btnExit);
			this.Controls.Add(this.btnStart);
			this.Controls.Add(this.lblHeading);
			this.Controls.Add(this.grpExamDetails);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
			this.Location = new System.Drawing.Point(146, 115);
			this.Name = "frmExamSchedule";
			this.ShowInTaskbar = false;
			this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
			this.Text = "frmExamSchedule";
			this.TopMost = true;
			this.Load += new System.EventHandler(this.frmExamSchedule_Load);
			((System.ComponentModel.ISupportInitialize)(this.dbgExamDetails)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

	
		private void btnExit_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		//modify date:2004-12-26
		private void btnStart_Click(object sender, System.EventArgs e)
		{
			if (!validateExam()) return;
			//Close();
			frmRules rule=new frmRules();
			//rule.ShowDialog();
			rule.Show();
			//objStudent.btnLogout.Enabled =false;
			//objStudent.btnViewResults.Enabled =false;
		}


		private void btnStart_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
		{
			//if (declinedflag)
			{
			//	objStudent.btnLogout.Enabled =true;
			//	objStudent.btnViewResults.Enabled =true;
			}
		}

		//修改情况:部门:ACCP产品开发培训部   修改人:王文  时间:2004-12-25
		private void frmExamSchedule_Load(object sender, System.EventArgs e)
		{
			//populate the datagrid with scheduled exams of present and future
			try
			{
				//除去DataAccess objDA=DataAccess.GetInstance ();
			
				Exam objExam = new Exam();
				searchValue[0]=DateTime.Today.ToShortDateString(); 
				searchValue[1]="";
				searchValue[2]="";
				searchValue[3]="";
				searchValue[4]=frmLogin.userid; //所添加的CODES

				dtExam = objExam.FetchExamDetails(searchValue);
				if (dtExam.Rows.Count == 0)
					dbgExamDetails.DataSource = null;
				else
				{
					dbgExamDetails.DataSource =dtExam; 
					dbgExamDetails.CurrentRowIndex = 0;
					dbgExamDetails.Select(0);

				}
			}
			catch(Exception excep)
			{
				MessageBox.Show (excep.Message.ToString()); 
			}
		}

		
		private void dbgExamDetails_Click(object sender, System.EventArgs e)
		{
		
		}
		////除去所有的代码

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

		//修改情况:部门:ACCP产品开发培训部   修改人:王文  时间:2004-12-25
		//所添加的CODES
		private bool validateExam()
		{
			if (dbgExamDetails.DataSource == null)
				return false;

			rowid = this.dbgExamDetails.CurrentRowIndex; 
			
			string examdate = (string)dtExam.Rows[rowid]["ScheduledOn"];

			try
			{
				if (DateTime.Today.ToString("dd/MM/yyyy").CompareTo(examdate)==0)
				{
					string examtime = (string)dtExam.Rows[rowid]["ScheduledTime"];

					DateTime nowTime = DateTime.Now;
					
					DateTime scheduledOn = DateTime.Parse(examtime);

					if (nowTime < scheduledOn )
					{
						MessageBox.Show("考试的时间还没有到");
						return false;
					}

		
					duration = Convert.ToInt32(dtExam.Rows[rowid]["Duration"]);
					DateTime endTime  = scheduledOn.AddMinutes(duration) ;

					if (endTime > nowTime) 							
					{
						examcode     = dtExam.Rows[rowid]["ExamCode"].ToString ();
						durationtext = dtExam.Rows[rowid]["Duration"].ToString ();
					}
					else
					{
						MessageBox.Show("这个考试的时间已经超时");
						return false;
					}
				}
				else
				{
					MessageBox.Show("不是今天的考试");
					return false;
				}
			}
			catch(Exception e)
			{
				MessageBox.Show(e.Message);
				return false;
			}
			return true;
		}

		void displayTestPaperInfo()
		{
			try
			{
				if (dbgExamDetails.DataSource == null)
					return;

				int currentRow = dbgExamDetails.CurrentRowIndex; 			
				
				lblDurationValue.Text= dtExam.Rows[currentRow]["Duration"].ToString ()+" 分";
				lblNoOfQtsValue.Text = dtExam.Rows[currentRow]["TotalQuest"].ToString ();
				lblExamTopic.Text    = dtExam.Rows[currentRow]["ExamTitle"].ToString ();
				lblMarksValue.Text   = "100" ;
				lblPassMarksValue.Text="60"; 				
				
			}
			catch(Exception excep)
			{
				MessageBox.Show(excep.StackTrace.ToString());
			}
		
		}

		private void dbgExamDetails_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
		{
			displayTestPaperInfo();
		}

			
	//以上所添加的CODES
			
	}
}

⌨️ 快捷键说明

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