📄 查询结果.cs
字号:
namespace 毕业设计
{
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace 软件系统
{
/// <summary>
/// DataView 的摘要说明。
/// </summary>
public class 查询结果 : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
private System.Windows.Forms.DataGrid dgdGrade;
public string querys;
public string type;
public 查询结果()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.dgdGrade = new System.Windows.Forms.DataGrid();
((System.ComponentModel.ISupportInitialize)(this.dgdGrade)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(464, 40);
this.label1.TabIndex = 0;
this.label1.Text = "成绩查询系统";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// dgdGrade
//
this.dgdGrade.BackgroundColor = System.Drawing.Color.WhiteSmoke;
this.dgdGrade.CaptionVisible = false;
this.dgdGrade.DataMember = "";
this.dgdGrade.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dgdGrade.Location = new System.Drawing.Point(0, 40);
this.dgdGrade.Name = "dgdGrade";
this.dgdGrade.ReadOnly = true;
this.dgdGrade.Size = new System.Drawing.Size(512, 248);
this.dgdGrade.TabIndex = 1;
//
// 查询结果
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(464, 266);
this.Controls.Add(this.dgdGrade);
this.Controls.Add(this.label1);
this.Name = "查询结果";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "成绩查询";
this.Load += new System.EventHandler(this.ViewData_Load);
((System.ComponentModel.ISupportInitialize)(this.dgdGrade)).EndInit();
this.ResumeLayout(false);
}
#endregion
private void ViewData_Load(object sender, System.EventArgs e)
{
毕业设计.数据处理.数据处理 o=new 毕业设计.数据处理.数据处理();
if(this.type=="QueryCourse")
this.dgdGrade.DataSource=o.GetCourseGrade(this.querys).Tables[0];
if(this.type=="QuerySno")
this.dgdGrade.DataSource=o.GetAsSno(this.querys).Tables[0];
if(this.type=="QuerySname")
this.dgdGrade.DataSource=o.GetAsSname(this.querys).Tables[0];
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -