📄 frmteacherinfoselect.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using DataAccess;
using BusinessRule;
using System.Data;
using System.Data.SqlClient;
namespace Forms
{
/// <summary>
/// Form3 的摘要说明。
/// </summary>
public class frmTeacherInfoSelect : System.Windows.Forms.Form
{
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button btnSelect;
private System.Windows.Forms.DataGrid dbgTeacherInfo;
private System.Windows.Forms.Button btnUpdate;
private System.Windows.Forms.Button btnExit;
private System.Windows.Forms.Button btnAdd;
private System.Windows.Forms.Button btnPicture;
private System.Windows.Forms.RadioButton radTeaID;
private System.Windows.Forms.RadioButton radCourse;
private System.Windows.Forms.RadioButton radTeaName;
private System.Windows.Forms.TextBox txtCourse;
private System.Windows.Forms.RadioButton radClaID;
private System.Windows.Forms.ComboBox cboTeaID;
private System.Windows.Forms.ComboBox cboTeaName;
private System.Windows.Forms.ComboBox cboClaID;
private System.ComponentModel.IContainer components;
//定义DataGrid空间的数据源
private DataTable myDt;
private System.Windows.Forms.ContextMenu mnuCon;
private System.Windows.Forms.MenuItem menuItem6;
private System.Windows.Forms.MenuItem menuItem7;
private System.Windows.Forms.MenuItem menuItem8;
private System.Windows.Forms.MenuItem mnuConSelect;
private System.Windows.Forms.MenuItem mnuConTeaPicture;
private System.Windows.Forms.MenuItem mnuConChance;
private System.Windows.Forms.MenuItem mnuConNewTeacher;
private System.Windows.Forms.MenuItem mnuConClose;
int first = 0;
//储存鼠标点击DtatGrid控件时的坐标
private Point pointDbgTeacherInfo;
private AdminTeacher Ateacher = null;
private MasterTeacher Mteacher = null;
private PrelectTeacher Pteacher = null;
public frmTeacherInfoSelect()
{
//
// 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.radTeaID = new System.Windows.Forms.RadioButton();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.cboClaID = new System.Windows.Forms.ComboBox();
this.cboTeaName = new System.Windows.Forms.ComboBox();
this.cboTeaID = new System.Windows.Forms.ComboBox();
this.radClaID = new System.Windows.Forms.RadioButton();
this.txtCourse = new System.Windows.Forms.TextBox();
this.radCourse = new System.Windows.Forms.RadioButton();
this.radTeaName = new System.Windows.Forms.RadioButton();
this.btnSelect = new System.Windows.Forms.Button();
this.dbgTeacherInfo = new System.Windows.Forms.DataGrid();
this.btnUpdate = new System.Windows.Forms.Button();
this.btnExit = new System.Windows.Forms.Button();
this.mnuCon = new System.Windows.Forms.ContextMenu();
this.mnuConSelect = new System.Windows.Forms.MenuItem();
this.menuItem6 = new System.Windows.Forms.MenuItem();
this.mnuConTeaPicture = new System.Windows.Forms.MenuItem();
this.mnuConChance = new System.Windows.Forms.MenuItem();
this.menuItem7 = new System.Windows.Forms.MenuItem();
this.mnuConNewTeacher = new System.Windows.Forms.MenuItem();
this.menuItem8 = new System.Windows.Forms.MenuItem();
this.mnuConClose = new System.Windows.Forms.MenuItem();
this.btnAdd = new System.Windows.Forms.Button();
this.btnPicture = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dbgTeacherInfo)).BeginInit();
this.SuspendLayout();
//
// radTeaID
//
this.radTeaID.Checked = true;
this.radTeaID.Location = new System.Drawing.Point(8, 16);
this.radTeaID.Name = "radTeaID";
this.radTeaID.Size = new System.Drawing.Size(72, 24);
this.radTeaID.TabIndex = 3;
this.radTeaID.TabStop = true;
this.radTeaID.Text = "教师编号";
this.radTeaID.CheckedChanged += new System.EventHandler(this.radTeaID_CheckedChanged);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.cboClaID);
this.groupBox1.Controls.Add(this.cboTeaName);
this.groupBox1.Controls.Add(this.cboTeaID);
this.groupBox1.Controls.Add(this.radClaID);
this.groupBox1.Controls.Add(this.txtCourse);
this.groupBox1.Controls.Add(this.radTeaID);
this.groupBox1.Controls.Add(this.radCourse);
this.groupBox1.Controls.Add(this.radTeaName);
this.groupBox1.Location = new System.Drawing.Point(32, 32);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(688, 56);
this.groupBox1.TabIndex = 4;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "查询条件";
//
// cboClaID
//
this.cboClaID.Enabled = false;
this.cboClaID.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.cboClaID.Location = new System.Drawing.Point(398, 17);
this.cboClaID.Name = "cboClaID";
this.cboClaID.Size = new System.Drawing.Size(88, 22);
this.cboClaID.TabIndex = 16;
this.cboClaID.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cboClaID_KeyPress);
//
// cboTeaName
//
this.cboTeaName.Enabled = false;
this.cboTeaName.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.cboTeaName.Location = new System.Drawing.Point(242, 17);
this.cboTeaName.Name = "cboTeaName";
this.cboTeaName.Size = new System.Drawing.Size(88, 22);
this.cboTeaName.TabIndex = 15;
this.cboTeaName.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cboTeaName_KeyPress);
//
// cboTeaID
//
this.cboTeaID.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.cboTeaID.Location = new System.Drawing.Point(86, 17);
this.cboTeaID.Name = "cboTeaID";
this.cboTeaID.Size = new System.Drawing.Size(88, 22);
this.cboTeaID.TabIndex = 14;
this.cboTeaID.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cboTeaID_KeyPress);
//
// radClaID
//
this.radClaID.Location = new System.Drawing.Point(336, 16);
this.radClaID.Name = "radClaID";
this.radClaID.Size = new System.Drawing.Size(56, 24);
this.radClaID.TabIndex = 12;
this.radClaID.Text = "班级";
this.radClaID.CheckedChanged += new System.EventHandler(this.radClaID_CheckedChanged);
//
// txtCourse
//
this.txtCourse.Enabled = false;
this.txtCourse.Location = new System.Drawing.Point(574, 18);
this.txtCourse.Name = "txtCourse";
this.txtCourse.TabIndex = 11;
this.txtCourse.Text = "";
this.txtCourse.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtCourse_KeyPress);
//
// radCourse
//
this.radCourse.Location = new System.Drawing.Point(492, 16);
this.radCourse.Name = "radCourse";
this.radCourse.Size = new System.Drawing.Size(76, 24);
this.radCourse.TabIndex = 4;
this.radCourse.Text = "所授课程";
this.radCourse.CheckedChanged += new System.EventHandler(this.radCourse_CheckedChanged);
//
// radTeaName
//
this.radTeaName.Location = new System.Drawing.Point(180, 16);
this.radTeaName.Name = "radTeaName";
this.radTeaName.Size = new System.Drawing.Size(56, 24);
this.radTeaName.TabIndex = 9;
this.radTeaName.Text = "姓名";
this.radTeaName.CheckedChanged += new System.EventHandler(this.radTeaName_CheckedChanged);
//
// btnSelect
//
this.btnSelect.Location = new System.Drawing.Point(744, 40);
this.btnSelect.Name = "btnSelect";
this.btnSelect.Size = new System.Drawing.Size(72, 40);
this.btnSelect.TabIndex = 7;
this.btnSelect.Text = "查询(&S)";
this.btnSelect.Click += new System.EventHandler(this.btnSelect_Click);
//
// dbgTeacherInfo
//
this.dbgTeacherInfo.AllowSorting = false;
this.dbgTeacherInfo.CaptionText = "教师基本信息";
this.dbgTeacherInfo.DataMember = "";
this.dbgTeacherInfo.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dbgTeacherInfo.Location = new System.Drawing.Point(32, 112);
this.dbgTeacherInfo.Name = "dbgTeacherInfo";
this.dbgTeacherInfo.ReadOnly = true;
this.dbgTeacherInfo.Size = new System.Drawing.Size(808, 192);
this.dbgTeacherInfo.TabIndex = 5;
this.dbgTeacherInfo.MouseDown += new System.Windows.Forms.MouseEventHandler(this.dbgTeacherInfo_MouseDown);
this.dbgTeacherInfo.DoubleClick += new System.EventHandler(this.dbgTeacherInfo_DoubleClick);
//
// btnUpdate
//
this.btnUpdate.Enabled = false;
this.btnUpdate.ImageAlign = System.Drawing.ContentAlignment.TopLeft;
this.btnUpdate.Location = new System.Drawing.Point(112, 336);
this.btnUpdate.Name = "btnUpdate";
this.btnUpdate.Size = new System.Drawing.Size(120, 40);
this.btnUpdate.TabIndex = 6;
this.btnUpdate.Text = "修改教师信息(&U)";
this.btnUpdate.Click += new System.EventHandler(this.btnUpdate_Click);
//
// btnExit
//
this.btnExit.Location = new System.Drawing.Point(631, 336);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(104, 40);
this.btnExit.TabIndex = 8;
this.btnExit.Text = "退出(&C)";
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
//
// mnuCon
//
this.mnuCon.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.mnuConSelect,
this.menuItem6,
this.mnuConTeaPicture,
this.mnuConChance,
this.menuItem7,
this.mnuConNewTeacher,
this.menuItem8,
this.mnuConClose});
//
// mnuConSelect
//
this.mnuConSelect.Index = 0;
this.mnuConSelect.Text = "搜索教师信息";
this.mnuConSelect.Click += new System.EventHandler(this.mnuConSelect_Click);
//
// menuItem6
//
this.menuItem6.Index = 1;
this.menuItem6.Text = "-";
//
// mnuConTeaPicture
//
this.mnuConTeaPicture.Index = 2;
this.mnuConTeaPicture.Text = "查看教师图片";
this.mnuConTeaPicture.Click += new System.EventHandler(this.mnuConTeaPicture_Click);
//
// mnuConChance
//
this.mnuConChance.Index = 3;
this.mnuConChance.Text = "修改教师信息";
this.mnuConChance.Click += new System.EventHandler(this.mnuConChance_Click);
//
// menuItem7
//
this.menuItem7.Index = 4;
this.menuItem7.Text = "-";
//
// mnuConNewTeacher
//
this.mnuConNewTeacher.Index = 5;
this.mnuConNewTeacher.Text = "新建教师信息";
this.mnuConNewTeacher.Click += new System.EventHandler(this.mnuConNewTeacher_Click);
//
// menuItem8
//
this.menuItem8.Index = 6;
this.menuItem8.Text = "-";
//
// mnuConClose
//
this.mnuConClose.Index = 7;
this.mnuConClose.Text = "关闭";
this.mnuConClose.Click += new System.EventHandler(this.mnuConClose_Click);
//
// btnAdd
//
this.btnAdd.ImageAlign = System.Drawing.ContentAlignment.TopLeft;
this.btnAdd.Location = new System.Drawing.Point(285, 336);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(120, 40);
this.btnAdd.TabIndex = 9;
this.btnAdd.Text = "添加教师信息(&A)";
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// btnPicture
//
this.btnPicture.ImageAlign = System.Drawing.ContentAlignment.TopLeft;
this.btnPicture.Location = new System.Drawing.Point(458, 336);
this.btnPicture.Name = "btnPicture";
this.btnPicture.Size = new System.Drawing.Size(120, 40);
this.btnPicture.TabIndex = 10;
this.btnPicture.Text = "查看教师图片(&P)";
this.btnPicture.Click += new System.EventHandler(this.btnPicture_Click);
//
// frmTeacherInfoSelect
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(874, 406);
this.Controls.Add(this.btnPicture);
this.Controls.Add(this.btnAdd);
this.Controls.Add(this.btnExit);
this.Controls.Add(this.btnUpdate);
this.Controls.Add(this.dbgTeacherInfo);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.btnSelect);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.Name = "frmTeacherInfoSelect";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "教师信息浏览";
this.Load += new System.EventHandler(this.frmTeacherInfoSelect_Load);
this.Activated += new System.EventHandler(this.frmTeacherInfoSelect_Activated);
this.groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dbgTeacherInfo)).EndInit();
this.ResumeLayout(false);
}
#endregion
//获得实例化好的用户实例
public Teacher User
{
get
{
if(Ateacher != null)
{
return Ateacher;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -