📄 newstu.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
namespace StudentManagementsystem
{
/// <summary>
/// NewStu 的摘要说明。
/// </summary>
public class NewStu : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox Stu_name;
private System.Windows.Forms.TextBox Stu_sex;
private System.Windows.Forms.TextBox Stu_age;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.TextBox Stu_home;
private System.Windows.Forms.TextBox Stu_nation;
private System.Windows.Forms.TextBox Stu_specialty;
private System.Windows.Forms.TextBox Stu_position;
private System.Windows.Forms.TextBox Stu_idnum;
private System.Windows.Forms.TextBox Stu_politic;
private System.Windows.Forms.Button ExitNStu;
private System.Windows.Forms.Button drawbackbutt;
private System.Windows.Forms.Button InputnewStu;
/// <summary>
/// 必需的设计器变量。
/// </summary>
///
private SqlConnection NewStuConn;
private SqlCommand NewStuComd;
private string NewStuStrConn="workstation id=localhost;Integrated Security=SSPI;database=StuMagSys";
private string NewStuStrComd;
private SqlDataAdapter NewStusqlda;
private System.Windows.Forms.ComboBox Class;
private System.Windows.Forms.DateTimePicker ERdateTime;
private System.Windows.Forms.DateTimePicker BirthdateTime;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.ComponentModel.Container components = null;
public NewStu()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
this.NewStu_Load();
//
// 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.label3 = new System.Windows.Forms.Label();
this.Stu_name = new System.Windows.Forms.TextBox();
this.Stu_sex = new System.Windows.Forms.TextBox();
this.Stu_age = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.Stu_home = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.Stu_nation = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.Stu_specialty = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.Stu_position = new System.Windows.Forms.TextBox();
this.Stu_idnum = new System.Windows.Forms.TextBox();
this.Stu_politic = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.InputnewStu = new System.Windows.Forms.Button();
this.ExitNStu = new System.Windows.Forms.Button();
this.drawbackbutt = new System.Windows.Forms.Button();
this.Class = new System.Windows.Forms.ComboBox();
this.ERdateTime = new System.Windows.Forms.DateTimePicker();
this.BirthdateTime = new System.Windows.Forms.DateTimePicker();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.SuspendLayout();
//
// label1
//
this.label1.Location = new System.Drawing.Point(40, 32);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(48, 23);
this.label1.TabIndex = 0;
this.label1.Text = "姓名:";
//
// label2
//
this.label2.Location = new System.Drawing.Point(240, 32);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(48, 23);
this.label2.TabIndex = 1;
this.label2.Text = "性别:";
//
// label3
//
this.label3.Location = new System.Drawing.Point(40, 64);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(48, 23);
this.label3.TabIndex = 2;
this.label3.Text = "年龄:";
//
// Stu_name
//
this.Stu_name.Location = new System.Drawing.Point(104, 32);
this.Stu_name.Name = "Stu_name";
this.Stu_name.Size = new System.Drawing.Size(112, 21);
this.Stu_name.TabIndex = 3;
this.Stu_name.Text = "";
//
// Stu_sex
//
this.Stu_sex.Location = new System.Drawing.Point(304, 32);
this.Stu_sex.Name = "Stu_sex";
this.Stu_sex.Size = new System.Drawing.Size(104, 21);
this.Stu_sex.TabIndex = 4;
this.Stu_sex.Text = "";
//
// Stu_age
//
this.Stu_age.Location = new System.Drawing.Point(104, 64);
this.Stu_age.Name = "Stu_age";
this.Stu_age.Size = new System.Drawing.Size(112, 21);
this.Stu_age.TabIndex = 5;
this.Stu_age.Text = "";
//
// label4
//
this.label4.Location = new System.Drawing.Point(232, 64);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(72, 16);
this.label4.TabIndex = 6;
this.label4.Text = "出生年月:";
//
// Stu_home
//
this.Stu_home.Location = new System.Drawing.Point(304, 96);
this.Stu_home.Multiline = true;
this.Stu_home.Name = "Stu_home";
this.Stu_home.Size = new System.Drawing.Size(104, 21);
this.Stu_home.TabIndex = 15;
this.Stu_home.Text = "";
//
// label5
//
this.label5.Location = new System.Drawing.Point(232, 96);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(56, 16);
this.label5.TabIndex = 14;
this.label5.Text = "籍贯:";
//
// Stu_nation
//
this.Stu_nation.Location = new System.Drawing.Point(104, 96);
this.Stu_nation.Name = "Stu_nation";
this.Stu_nation.Size = new System.Drawing.Size(112, 21);
this.Stu_nation.TabIndex = 11;
this.Stu_nation.Text = "";
//
// label6
//
this.label6.Location = new System.Drawing.Point(32, 128);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(72, 23);
this.label6.TabIndex = 10;
this.label6.Text = "入学日期:";
//
// label7
//
this.label7.Location = new System.Drawing.Point(240, 128);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(48, 23);
this.label7.TabIndex = 9;
this.label7.Text = "班级:";
//
// label8
//
this.label8.Location = new System.Drawing.Point(40, 96);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(48, 23);
this.label8.TabIndex = 8;
this.label8.Text = "民族:";
//
// Stu_specialty
//
this.Stu_specialty.Location = new System.Drawing.Point(304, 192);
this.Stu_specialty.Name = "Stu_specialty";
this.Stu_specialty.Size = new System.Drawing.Size(104, 21);
this.Stu_specialty.TabIndex = 23;
this.Stu_specialty.Text = "";
//
// label9
//
this.label9.Location = new System.Drawing.Point(224, 192);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(72, 16);
this.label9.TabIndex = 22;
this.label9.Text = "所学专业:";
//
// Stu_position
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -