📄 frmteacherinfo.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using DataAccess;
using BusinessRule;
namespace Forms
{
/// <summary>
/// frmTeacherInfo 的摘要说明。
/// 1. 如果是修改教师信息,实例化时传入被修改的教师编号
/// 2. 如果是新建教师信息,实例化时传入模拟教师编号(10000),系统自动新建教师编号
/// 2. 如果是新建教师信息,本窗体实例化时,必须以模式方式显示,以免同一个编号被多次使用
/// </summary>
public class frmTeacherInfo : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox txtTeaName;
private System.Windows.Forms.TextBox txtTeaOrigin;
private System.Windows.Forms.TextBox txtTeaTelephone;
private System.Windows.Forms.TextBox txtTeaAddress;
private System.Windows.Forms.TextBox txtTeaPostcode;
private System.Windows.Forms.TextBox txtTeaPicture;
private System.Windows.Forms.TextBox txtTeaRemark;
private System.Windows.Forms.Button btnAdd;
private System.Windows.Forms.ComboBox cboTeaNation;
private System.Windows.Forms.Button btnExit;
private System.Windows.Forms.RadioButton radMale;
private System.Windows.Forms.RadioButton radFemale;
private System.Windows.Forms.RadioButton radNo;
private System.Windows.Forms.RadioButton radYes;
private System.Windows.Forms.Label lblTeacherID;
private System.Windows.Forms.Label lblTeaName;
private System.Windows.Forms.Label lblTeaSex;
private System.Windows.Forms.Label lblTeaOrigin;
private System.Windows.Forms.Label lblTeaNation;
private System.Windows.Forms.Label lblTeaTelephone;
private System.Windows.Forms.Label lblTeaAddress;
private System.Windows.Forms.Label labTeaPostcode;
private System.Windows.Forms.Label lblTeaPicture;
private System.Windows.Forms.Label lblTeaIn_Service;
private System.Windows.Forms.Label lblTeaRemark;
private System.Windows.Forms.Label lblTeaID;
private System.Windows.Forms.Button btnUpdate;
private System.Windows.Forms.Button btnReStart;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
private System.Windows.Forms.Button btnOpen;
private System.Windows.Forms.OpenFileDialog openFileDialog;
private System.Windows.Forms.GroupBox grpTeaSex;
private System.Windows.Forms.GroupBox grpTeaIn_Service;
private System.Windows.Forms.GroupBox grpTeacherInfo;
private System.Windows.Forms.Label lblTeaLimit;
private System.Windows.Forms.ComboBox cboTeaLimit;
//存放教师基本信息
private Teacher teacher;
private int teaID;
private AdminTeacher Ateacher = null;
private PrelectTeacher Pteacher = null;
private MasterTeacher Mteacher = null;
public frmTeacherInfo()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
Post.EventSendLoginedID += new DataAccess.Post.SendMsgDelegate(Post_EventSendLoginedID);
}
/// <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.lblTeacherID = new System.Windows.Forms.Label();
this.lblTeaName = new System.Windows.Forms.Label();
this.lblTeaSex = new System.Windows.Forms.Label();
this.lblTeaOrigin = new System.Windows.Forms.Label();
this.lblTeaNation = new System.Windows.Forms.Label();
this.lblTeaTelephone = new System.Windows.Forms.Label();
this.lblTeaAddress = new System.Windows.Forms.Label();
this.labTeaPostcode = new System.Windows.Forms.Label();
this.lblTeaPicture = new System.Windows.Forms.Label();
this.lblTeaIn_Service = new System.Windows.Forms.Label();
this.lblTeaRemark = new System.Windows.Forms.Label();
this.txtTeaName = new System.Windows.Forms.TextBox();
this.txtTeaOrigin = new System.Windows.Forms.TextBox();
this.txtTeaTelephone = new System.Windows.Forms.TextBox();
this.txtTeaAddress = new System.Windows.Forms.TextBox();
this.txtTeaPostcode = new System.Windows.Forms.TextBox();
this.txtTeaPicture = new System.Windows.Forms.TextBox();
this.txtTeaRemark = new System.Windows.Forms.TextBox();
this.btnAdd = new System.Windows.Forms.Button();
this.btnExit = new System.Windows.Forms.Button();
this.radMale = new System.Windows.Forms.RadioButton();
this.radFemale = new System.Windows.Forms.RadioButton();
this.cboTeaNation = new System.Windows.Forms.ComboBox();
this.grpTeaSex = new System.Windows.Forms.GroupBox();
this.grpTeaIn_Service = new System.Windows.Forms.GroupBox();
this.radNo = new System.Windows.Forms.RadioButton();
this.radYes = new System.Windows.Forms.RadioButton();
this.lblTeaID = new System.Windows.Forms.Label();
this.btnUpdate = new System.Windows.Forms.Button();
this.btnReStart = new System.Windows.Forms.Button();
this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
this.btnOpen = new System.Windows.Forms.Button();
this.grpTeacherInfo = new System.Windows.Forms.GroupBox();
this.cboTeaLimit = new System.Windows.Forms.ComboBox();
this.lblTeaLimit = new System.Windows.Forms.Label();
this.grpTeaSex.SuspendLayout();
this.grpTeaIn_Service.SuspendLayout();
this.grpTeacherInfo.SuspendLayout();
this.SuspendLayout();
//
// lblTeacherID
//
this.lblTeacherID.Location = new System.Drawing.Point(24, 24);
this.lblTeacherID.Name = "lblTeacherID";
this.lblTeacherID.Size = new System.Drawing.Size(72, 23);
this.lblTeacherID.TabIndex = 0;
this.lblTeacherID.Text = "教师编号:";
//
// lblTeaName
//
this.lblTeaName.Location = new System.Drawing.Point(24, 112);
this.lblTeaName.Name = "lblTeaName";
this.lblTeaName.Size = new System.Drawing.Size(72, 23);
this.lblTeaName.TabIndex = 1;
this.lblTeaName.Text = "姓名:";
//
// lblTeaSex
//
this.lblTeaSex.Location = new System.Drawing.Point(24, 152);
this.lblTeaSex.Name = "lblTeaSex";
this.lblTeaSex.Size = new System.Drawing.Size(72, 23);
this.lblTeaSex.TabIndex = 2;
this.lblTeaSex.Text = "性别: ";
//
// lblTeaOrigin
//
this.lblTeaOrigin.Location = new System.Drawing.Point(24, 200);
this.lblTeaOrigin.Name = "lblTeaOrigin";
this.lblTeaOrigin.Size = new System.Drawing.Size(72, 23);
this.lblTeaOrigin.TabIndex = 3;
this.lblTeaOrigin.Text = "籍贯:";
//
// lblTeaNation
//
this.lblTeaNation.Location = new System.Drawing.Point(24, 240);
this.lblTeaNation.Name = "lblTeaNation";
this.lblTeaNation.Size = new System.Drawing.Size(72, 23);
this.lblTeaNation.TabIndex = 4;
this.lblTeaNation.Text = "民族:";
//
// lblTeaTelephone
//
this.lblTeaTelephone.Location = new System.Drawing.Point(304, 32);
this.lblTeaTelephone.Name = "lblTeaTelephone";
this.lblTeaTelephone.Size = new System.Drawing.Size(80, 23);
this.lblTeaTelephone.TabIndex = 5;
this.lblTeaTelephone.Text = "电话:";
//
// lblTeaAddress
//
this.lblTeaAddress.Location = new System.Drawing.Point(304, 64);
this.lblTeaAddress.Name = "lblTeaAddress";
this.lblTeaAddress.Size = new System.Drawing.Size(80, 23);
this.lblTeaAddress.TabIndex = 6;
this.lblTeaAddress.Text = "地址:";
//
// labTeaPostcode
//
this.labTeaPostcode.Location = new System.Drawing.Point(304, 111);
this.labTeaPostcode.Name = "labTeaPostcode";
this.labTeaPostcode.Size = new System.Drawing.Size(80, 23);
this.labTeaPostcode.TabIndex = 7;
this.labTeaPostcode.Text = "邮政编码:";
//
// lblTeaPicture
//
this.lblTeaPicture.Location = new System.Drawing.Point(304, 152);
this.lblTeaPicture.Name = "lblTeaPicture";
this.lblTeaPicture.Size = new System.Drawing.Size(80, 23);
this.lblTeaPicture.TabIndex = 8;
this.lblTeaPicture.Text = "照片目录:";
//
// lblTeaIn_Service
//
this.lblTeaIn_Service.Location = new System.Drawing.Point(304, 192);
this.lblTeaIn_Service.Name = "lblTeaIn_Service";
this.lblTeaIn_Service.Size = new System.Drawing.Size(80, 23);
this.lblTeaIn_Service.TabIndex = 9;
this.lblTeaIn_Service.Text = "是否在职:";
//
// lblTeaRemark
//
this.lblTeaRemark.Location = new System.Drawing.Point(304, 240);
this.lblTeaRemark.Name = "lblTeaRemark";
this.lblTeaRemark.Size = new System.Drawing.Size(80, 23);
this.lblTeaRemark.TabIndex = 10;
this.lblTeaRemark.Text = "备注:";
//
// txtTeaName
//
this.txtTeaName.Location = new System.Drawing.Point(112, 112);
this.txtTeaName.Name = "txtTeaName";
this.txtTeaName.Size = new System.Drawing.Size(168, 21);
this.txtTeaName.TabIndex = 12;
this.txtTeaName.Text = "";
//
// txtTeaOrigin
//
this.txtTeaOrigin.Location = new System.Drawing.Point(112, 200);
this.txtTeaOrigin.Name = "txtTeaOrigin";
this.txtTeaOrigin.Size = new System.Drawing.Size(168, 21);
this.txtTeaOrigin.TabIndex = 14;
this.txtTeaOrigin.Text = "";
//
// txtTeaTelephone
//
this.txtTeaTelephone.Location = new System.Drawing.Point(392, 24);
this.txtTeaTelephone.Name = "txtTeaTelephone";
this.txtTeaTelephone.Size = new System.Drawing.Size(184, 21);
this.txtTeaTelephone.TabIndex = 16;
this.txtTeaTelephone.Text = "";
//
// txtTeaAddress
//
this.txtTeaAddress.Location = new System.Drawing.Point(392, 64);
this.txtTeaAddress.Name = "txtTeaAddress";
this.txtTeaAddress.Size = new System.Drawing.Size(184, 21);
this.txtTeaAddress.TabIndex = 17;
this.txtTeaAddress.Text = "";
//
// txtTeaPostcode
//
this.txtTeaPostcode.Location = new System.Drawing.Point(392, 112);
this.txtTeaPostcode.Name = "txtTeaPostcode";
this.txtTeaPostcode.Size = new System.Drawing.Size(184, 21);
this.txtTeaPostcode.TabIndex = 18;
this.txtTeaPostcode.Text = "";
//
// txtTeaPicture
//
this.txtTeaPicture.Location = new System.Drawing.Point(392, 152);
this.txtTeaPicture.Name = "txtTeaPicture";
this.txtTeaPicture.Size = new System.Drawing.Size(144, 21);
this.txtTeaPicture.TabIndex = 19;
this.txtTeaPicture.Text = "";
//
// txtTeaRemark
//
this.txtTeaRemark.Location = new System.Drawing.Point(392, 232);
this.txtTeaRemark.Multiline = true;
this.txtTeaRemark.Name = "txtTeaRemark";
this.txtTeaRemark.Size = new System.Drawing.Size(184, 48);
this.txtTeaRemark.TabIndex = 21;
this.txtTeaRemark.Text = "";
//
// btnAdd
//
this.btnAdd.Location = new System.Drawing.Point(200, 352);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(104, 32);
this.btnAdd.TabIndex = 22;
this.btnAdd.Text = "添加(&A)";
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// btnExit
//
this.btnExit.Location = new System.Drawing.Point(464, 352);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(104, 32);
this.btnExit.TabIndex = 23;
this.btnExit.Text = "取消(&E)";
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
//
// radMale
//
this.radMale.Checked = true;
this.radMale.Location = new System.Drawing.Point(16, 16);
this.radMale.Name = "radMale";
this.radMale.Size = new System.Drawing.Size(48, 24);
this.radMale.TabIndex = 24;
this.radMale.TabStop = true;
this.radMale.Text = "男";
//
// radFemale
//
this.radFemale.Location = new System.Drawing.Point(80, 16);
this.radFemale.Name = "radFemale";
this.radFemale.Size = new System.Drawing.Size(48, 24);
this.radFemale.TabIndex = 25;
this.radFemale.Text = "女";
//
// cboTeaNation
//
this.cboTeaNation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboTeaNation.Items.AddRange(new object[] {
"汉族",
"回族",
"蒙古族",
"藏族",
"维吾尔族",
"苗族",
"壮族",
"彝族",
"布依族",
"朝鲜族",
"满族",
"侗族",
"瑶族",
"土家族",
"哈尼族",
"哈萨克族",
"傣族",
"黎族",
"僳僳族",
"佤族",
"畲族",
"高山族",
"拉祜族",
"水族",
"东乡族",
"纳西族",
"景颇族",
"柯尔克孜族",
"土族",
"达斡尔族",
"仫佬族",
"羌族",
"布朗族",
"撒拉族",
"毛南族",
"仡佬族",
"锡伯族",
"阿昌族",
"普米族",
"塔吉克族",
"怒族",
"乌孜别克族",
"俄罗斯族",
"鄂温克族",
"德昂族",
"保安族",
"裕固族",
"京族",
"塔塔尔族",
"独龙族",
"鄂伦春族",
"赫哲族",
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -