📄 数据输入.cs
字号:
namespace 毕业设计
{
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace 软件系统
{
/// <summary>
/// InputData 的摘要说明。
/// </summary>
public class 数据输入 : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Button btnConfirm;
private System.Windows.Forms.Button btnCancel;
public System.Windows.Forms.Label lbCourse;
public string course;
public System.Windows.Forms.TextBox txtsno;
private System.Windows.Forms.TextBox txtgrade;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
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.label2 = new System.Windows.Forms.Label();
this.lbCourse = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.txtsno = new System.Windows.Forms.TextBox();
this.txtgrade = new System.Windows.Forms.TextBox();
this.btnConfirm = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(296, 72);
this.label1.TabIndex = 0;
this.label1.Text = "成绩输入系统";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label2
//
this.label2.Location = new System.Drawing.Point(72, 88);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(32, 16);
this.label2.TabIndex = 1;
this.label2.Text = "科目";
//
// lbCourse
//
this.lbCourse.Location = new System.Drawing.Point(128, 88);
this.lbCourse.Name = "lbCourse";
this.lbCourse.Size = new System.Drawing.Size(72, 16);
this.lbCourse.TabIndex = 2;
this.lbCourse.Text = "跳高";
//
// label4
//
this.label4.Location = new System.Drawing.Point(72, 120);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(32, 16);
this.label4.TabIndex = 3;
this.label4.Text = "学号";
//
// label6
//
this.label6.Location = new System.Drawing.Point(72, 160);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(32, 16);
this.label6.TabIndex = 5;
this.label6.Text = "成绩";
//
// txtsno
//
this.txtsno.Location = new System.Drawing.Point(128, 112);
this.txtsno.Name = "txtsno";
this.txtsno.TabIndex = 6;
this.txtsno.Text = "";
//
// txtgrade
//
this.txtgrade.Location = new System.Drawing.Point(128, 152);
this.txtgrade.Name = "txtgrade";
this.txtgrade.TabIndex = 8;
this.txtgrade.Text = "";
//
// btnConfirm
//
this.btnConfirm.Location = new System.Drawing.Point(56, 192);
this.btnConfirm.Name = "btnConfirm";
this.btnConfirm.TabIndex = 9;
this.btnConfirm.Text = "确定";
this.btnConfirm.Click += new System.EventHandler(this.btnConfirm_Click);
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(160, 192);
this.btnCancel.Name = "btnCancel";
this.btnCancel.TabIndex = 10;
this.btnCancel.Text = "取消";
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// 数据输入
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(292, 238);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnConfirm);
this.Controls.Add(this.txtgrade);
this.Controls.Add(this.txtsno);
this.Controls.Add(this.label6);
this.Controls.Add(this.label4);
this.Controls.Add(this.lbCourse);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Name = "数据输入";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "成绩输入";
this.Load += new System.EventHandler(this.InputData_Load);
this.ResumeLayout(false);
}
#endregion
private void InputData_Load(object sender, System.EventArgs e)
{
this.Text+="--"+this.course;
this.lbCourse.Text=this.course;
}
private void btnConfirm_Click(object sender, System.EventArgs e)
{
毕业设计.数据处理.数据处理 插入成绩=new 毕业设计.数据处理.数据处理();
if(插入成绩.InsertScore(this.txtsno.Text,this.course,this.txtgrade.Text))
{
MessageBox.Show("插入成绩成功!");
}
else
{
MessageBox.Show("插入成绩失败!");
}
}
private void btnCancel_Click(object sender, System.EventArgs e)
{
this.Dispose(true);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -