⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmclassinfo.cs

📁 学生类:Student 教师类:Teacher 主任:AdminTeacher 班主任:MasterTeacher 授课老师: PrelectTeacher 班级类:classTeam 班
💻 CS
字号:
using System;
using System.Data;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using DataAccess;
using BusinessRule;

namespace Forms
{
	/// <summary>
	/// frmClassInfo 的摘要说明。
	/// </summary>
	public class frmClassInfo : System.Windows.Forms.Form
	{
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.DataGrid dbgClassInfo;
		private System.Windows.Forms.Button btnSelect;
		private System.Windows.Forms.Button btnExit;
		private System.Windows.Forms.Label lblClaID;
		private System.Windows.Forms.ComboBox cboClaID;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		private AdminTeacher Ateacher = null;
		private PrelectTeacher Pteacher = null;
		private MasterTeacher Mteacher = null;

		private DataTable myDt;

		public frmClassInfo()
		{
			//
			// 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.groupBox1 = new System.Windows.Forms.GroupBox();
			this.cboClaID = new System.Windows.Forms.ComboBox();
			this.lblClaID = new System.Windows.Forms.Label();
			this.dbgClassInfo = new System.Windows.Forms.DataGrid();
			this.btnSelect = new System.Windows.Forms.Button();
			this.btnExit = new System.Windows.Forms.Button();
			this.groupBox1.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.dbgClassInfo)).BeginInit();
			this.SuspendLayout();
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.Add(this.cboClaID);
			this.groupBox1.Controls.Add(this.lblClaID);
			this.groupBox1.Location = new System.Drawing.Point(16, 0);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(232, 56);
			this.groupBox1.TabIndex = 0;
			this.groupBox1.TabStop = false;
			// 
			// cboClaID
			// 
			this.cboClaID.Location = new System.Drawing.Point(88, 22);
			this.cboClaID.Name = "cboClaID";
			this.cboClaID.Size = new System.Drawing.Size(112, 20);
			this.cboClaID.TabIndex = 1;
			this.cboClaID.Text = "全部班级";
			// 
			// lblClaID
			// 
			this.lblClaID.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.lblClaID.Location = new System.Drawing.Point(16, 24);
			this.lblClaID.Name = "lblClaID";
			this.lblClaID.Size = new System.Drawing.Size(64, 16);
			this.lblClaID.TabIndex = 0;
			this.lblClaID.Text = "班级编号";
			// 
			// dbgClassInfo
			// 
			this.dbgClassInfo.DataMember = "";
			this.dbgClassInfo.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dbgClassInfo.Location = new System.Drawing.Point(0, 64);
			this.dbgClassInfo.Name = "dbgClassInfo";
			this.dbgClassInfo.Size = new System.Drawing.Size(632, 232);
			this.dbgClassInfo.TabIndex = 1;
			// 
			// btnSelect
			// 
			this.btnSelect.Location = new System.Drawing.Point(216, 312);
			this.btnSelect.Name = "btnSelect";
			this.btnSelect.Size = new System.Drawing.Size(96, 32);
			this.btnSelect.TabIndex = 2;
			this.btnSelect.Text = "查询(&S)";
			this.btnSelect.Click += new System.EventHandler(this.btnSelect_Click);
			// 
			// btnExit
			// 
			this.btnExit.Location = new System.Drawing.Point(312, 312);
			this.btnExit.Name = "btnExit";
			this.btnExit.Size = new System.Drawing.Size(96, 32);
			this.btnExit.TabIndex = 3;
			this.btnExit.Text = "取消(&E)";
			// 
			// frmClassInfo
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(632, 358);
			this.Controls.Add(this.btnExit);
			this.Controls.Add(this.btnSelect);
			this.Controls.Add(this.dbgClassInfo);
			this.Controls.Add(this.groupBox1);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.MaximizeBox = false;
			this.Name = "frmClassInfo";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "班级信息查询";
			this.Load += new System.EventHandler(this.frmClassInfo_Load);
			this.groupBox1.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dbgClassInfo)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		//获得实例化好的用户实例
		public Teacher User
		{
			get
			{
				if(Ateacher != null)
				{
					return Ateacher;
				}
				else if(Mteacher != null)
				{
					return Mteacher;
				}
				else
				{
					return Pteacher;
				}
			}
		}

		//窗体加载事件
		private void frmClassInfo_Load(object sender, System.EventArgs e)
		{
			cboClaID.Items.Add("全部学生");
			for(int i= 0 ;i<this.User.TeaClasses.Count;i++)
			{
				cboClaID.Items.Add(this.User.TeaClasses[i].ToString());
			}
			cboClaID.SelectedIndex = 0;
			myDt = jimmy.GetClassesInfoTableByArrayList(this.User.TeaClasses);
			dbgClassInfo.DataSource = myDt;
			jimmy.CreateClassInfoStyle(dbgClassInfo,myDt.TableName);
			dbgClassInfo.CaptionText = "班级基本信息      共搜索到 " + myDt.Rows.Count.ToString() + " 条记录";
		}

		

		//订阅“邮递员”
		private void Post_EventSendLoginedID(object obj, object teacher, string formName)
		{
			if(teacher.GetType().ToString().Equals("BusinessRule.AdminTeacher"))
			{
				this.Ateacher = (AdminTeacher)teacher;
			}
			else if(teacher.GetType().ToString().Equals("BusinessRule.MasterTeacher"))
			{
				this.Mteacher = (MasterTeacher)teacher;
			}
			else
			{
				this.Pteacher = (PrelectTeacher)teacher;
			}
			Post.EventSendLoginedID -= new DataAccess.Post.SendMsgDelegate(Post_EventSendLoginedID);
		}

		private void btnSelect_Click(object sender, System.EventArgs e)
		{

		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -