📄 classstu.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
namespace 学生与成绩
{
/// <summary>
/// ClassStu 的摘要说明。
/// </summary>
public class ClassStu : System.Windows.Forms.Form
{
private LinkDataBase link=new LinkDataBase();
private static int maxID=0;
private string sendStrSQL;
private string sendTableName="STU";
private DataSet ds=new DataSet();
private CurrencyManager cmOrders;
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtSex;
private System.Windows.Forms.TextBox txtName;
private System.Windows.Forms.TextBox txtID;
private System.Windows.Forms.TextBox txtDate;
private System.Windows.Forms.TextBox txtClass;
private System.Windows.Forms.TextBox txtAddress;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox txtPhone;
private System.Windows.Forms.TextBox txtCellPhone;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.Button btnAdd;
private System.Windows.Forms.Button btnRemove;
private System.Windows.Forms.Button btnChange;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public ClassStu()
{
//
// 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.dataGrid1 = new System.Windows.Forms.DataGrid();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.txtSex = new System.Windows.Forms.TextBox();
this.txtName = new System.Windows.Forms.TextBox();
this.txtID = new System.Windows.Forms.TextBox();
this.txtDate = new System.Windows.Forms.TextBox();
this.txtClass = new System.Windows.Forms.TextBox();
this.txtAddress = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.txtPhone = new System.Windows.Forms.TextBox();
this.txtCellPhone = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.btnCancel = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button();
this.btnAdd = new System.Windows.Forms.Button();
this.btnRemove = new System.Windows.Forms.Button();
this.btnChange = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.SuspendLayout();
//
// dataGrid1
//
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid1.Location = new System.Drawing.Point(4, 0);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.ReadOnly = true;
this.dataGrid1.Size = new System.Drawing.Size(608, 288);
this.dataGrid1.TabIndex = 0;
//
// label1
//
this.label1.Location = new System.Drawing.Point(431, 294);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(48, 23);
this.label1.TabIndex = 1;
this.label1.Text = "性别";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label2
//
this.label2.Location = new System.Drawing.Point(223, 294);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(64, 23);
this.label2.TabIndex = 2;
this.label2.Text = "姓名";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label3
//
this.label3.Location = new System.Drawing.Point(15, 294);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(64, 23);
this.label3.TabIndex = 3;
this.label3.Text = "学号";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// txtSex
//
this.txtSex.Location = new System.Drawing.Point(501, 296);
this.txtSex.Name = "txtSex";
this.txtSex.ReadOnly = true;
this.txtSex.TabIndex = 4;
this.txtSex.Text = "";
//
// txtName
//
this.txtName.Location = new System.Drawing.Point(312, 296);
this.txtName.Name = "txtName";
this.txtName.ReadOnly = true;
this.txtName.TabIndex = 5;
this.txtName.Text = "";
//
// txtID
//
this.txtID.Location = new System.Drawing.Point(96, 296);
this.txtID.Name = "txtID";
this.txtID.ReadOnly = true;
this.txtID.TabIndex = 6;
this.txtID.Text = "";
//
// txtDate
//
this.txtDate.Location = new System.Drawing.Point(96, 336);
this.txtDate.Name = "txtDate";
this.txtDate.ReadOnly = true;
this.txtDate.TabIndex = 12;
this.txtDate.Text = "";
//
// txtClass
//
this.txtClass.Location = new System.Drawing.Point(312, 336);
this.txtClass.Name = "txtClass";
this.txtClass.ReadOnly = true;
this.txtClass.TabIndex = 11;
this.txtClass.Text = "";
//
// txtAddress
//
this.txtAddress.Location = new System.Drawing.Point(501, 336);
this.txtAddress.Name = "txtAddress";
this.txtAddress.ReadOnly = true;
this.txtAddress.TabIndex = 10;
this.txtAddress.Text = "";
//
// label4
//
this.label4.Location = new System.Drawing.Point(15, 336);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(64, 23);
this.label4.TabIndex = 9;
this.label4.Text = "出生日期";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label5
//
this.label5.Location = new System.Drawing.Point(223, 336);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(64, 23);
this.label5.TabIndex = 8;
this.label5.Text = "班级";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label6
//
this.label6.Location = new System.Drawing.Point(431, 336);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(48, 23);
this.label6.TabIndex = 7;
this.label6.Text = "地址";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// txtPhone
//
this.txtPhone.Location = new System.Drawing.Point(96, 376);
this.txtPhone.Name = "txtPhone";
this.txtPhone.ReadOnly = true;
this.txtPhone.TabIndex = 16;
this.txtPhone.Text = "";
//
// txtCellPhone
//
this.txtCellPhone.Location = new System.Drawing.Point(312, 376);
this.txtCellPhone.Name = "txtCellPhone";
this.txtCellPhone.ReadOnly = true;
this.txtCellPhone.TabIndex = 15;
this.txtCellPhone.Text = "";
//
// label7
//
this.label7.Location = new System.Drawing.Point(16, 374);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(64, 23);
this.label7.TabIndex = 14;
this.label7.Text = "电话";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label8
//
this.label8.Location = new System.Drawing.Point(224, 374);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -