📄 控制中心.cs
字号:
namespace 毕业设计
{
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace 软件系统
{
/// <summary>
/// ControlCenter 的摘要说明。
/// </summary>
public class 主界面 : System.Windows.Forms.Form
{
private System.Windows.Forms.MenuItem Query;
private System.Windows.Forms.MenuItem QueryOne;
private System.Windows.Forms.MenuItem InData;
private System.Windows.Forms.MenuItem DataInput;
private System.Windows.Forms.MenuItem GradeStandard;
private System.Windows.Forms.MenuItem ChangeStandard;
private System.Windows.Forms.MenuItem Logout;
private System.Windows.Forms.MenuItem Exit;
private System.Windows.Forms.MenuItem StudentQuery;
public string EditCourse;
private System.Windows.Forms.PictureBox pictureBox1;
public System.Windows.Forms.MainMenu TeacherMenu;
public System.Windows.Forms.MainMenu StudentMenu;
private System.Windows.Forms.MenuItem StuSystem;
private System.Windows.Forms.MenuItem StuLogout;
private System.Windows.Forms.MenuItem StuExit;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem TeaSystem;
private System.Windows.Forms.MenuItem QuerySno;
private System.Windows.Forms.MenuItem item;
private System.Windows.Forms.MenuItem AddItem;
private System.Windows.Forms.MenuItem DeleteItem;
public string userid="";
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public 主界面()
{
//
// 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()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(主界面));
this.TeacherMenu = new System.Windows.Forms.MainMenu();
this.TeaSystem = new System.Windows.Forms.MenuItem();
this.Logout = new System.Windows.Forms.MenuItem();
this.Exit = new System.Windows.Forms.MenuItem();
this.Query = new System.Windows.Forms.MenuItem();
this.QueryOne = new System.Windows.Forms.MenuItem();
this.StudentQuery = new System.Windows.Forms.MenuItem();
this.InData = new System.Windows.Forms.MenuItem();
this.DataInput = new System.Windows.Forms.MenuItem();
this.item = new System.Windows.Forms.MenuItem();
this.AddItem = new System.Windows.Forms.MenuItem();
this.DeleteItem = new System.Windows.Forms.MenuItem();
this.GradeStandard = new System.Windows.Forms.MenuItem();
this.ChangeStandard = new System.Windows.Forms.MenuItem();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.StudentMenu = new System.Windows.Forms.MainMenu();
this.StuSystem = new System.Windows.Forms.MenuItem();
this.StuLogout = new System.Windows.Forms.MenuItem();
this.StuExit = new System.Windows.Forms.MenuItem();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.QuerySno = new System.Windows.Forms.MenuItem();
this.SuspendLayout();
//
// TeacherMenu
//
this.TeacherMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.TeaSystem,
this.Query,
this.InData,
this.item,
this.GradeStandard});
//
// TeaSystem
//
this.TeaSystem.Index = 0;
this.TeaSystem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.Logout,
this.Exit});
this.TeaSystem.Text = "系统";
//
// Logout
//
this.Logout.Index = 0;
this.Logout.Text = "注销";
this.Logout.Click += new System.EventHandler(this.Logout_Click);
//
// Exit
//
this.Exit.Index = 1;
this.Exit.Text = "退出";
this.Exit.Click += new System.EventHandler(this.Exit_Click);
//
// Query
//
this.Query.Index = 1;
this.Query.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.QueryOne,
this.StudentQuery});
this.Query.Text = "查询";
//
// QueryOne
//
this.QueryOne.Index = 0;
this.QueryOne.Text = "成绩查询";
this.QueryOne.Click += new System.EventHandler(this.QueryOne_Click);
//
// StudentQuery
//
this.StudentQuery.Index = 1;
this.StudentQuery.Text = "学生查询";
this.StudentQuery.Click += new System.EventHandler(this.StudentQuery_Click);
//
// InData
//
this.InData.Index = 2;
this.InData.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.DataInput});
this.InData.Text = "录入";
//
// DataInput
//
this.DataInput.Index = 0;
this.DataInput.Text = "数据录入";
this.DataInput.Click += new System.EventHandler(this.DataInput_Click);
//
// item
//
this.item.Index = 3;
this.item.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.AddItem,
this.DeleteItem});
this.item.Text = "科目设置";
//
// AddItem
//
this.AddItem.Index = 0;
this.AddItem.Text = "添加科目";
this.AddItem.Click += new System.EventHandler(this.AddItem_Click);
//
// DeleteItem
//
this.DeleteItem.Index = 1;
this.DeleteItem.Text = "删除科目";
this.DeleteItem.Click += new System.EventHandler(this.DeleteItem_Click);
//
// GradeStandard
//
this.GradeStandard.Index = 4;
this.GradeStandard.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.ChangeStandard});
this.GradeStandard.Text = "评分标准";
//
// ChangeStandard
//
this.ChangeStandard.Index = 0;
this.ChangeStandard.Text = "修改标准";
this.ChangeStandard.Click += new System.EventHandler(this.ChangeStandard_Click);
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(168, 96);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(104, 104);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// StudentMenu
//
this.StudentMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.StuSystem,
this.menuItem1});
//
// StuSystem
//
this.StuSystem.Index = 0;
this.StuSystem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.StuLogout,
this.StuExit});
this.StuSystem.Text = "系统";
//
// StuLogout
//
this.StuLogout.Index = 0;
this.StuLogout.Text = "注销";
this.StuLogout.Click += new System.EventHandler(this.Logout_Click);
//
// StuExit
//
this.StuExit.Index = 1;
this.StuExit.Text = "退出";
this.StuExit.Click += new System.EventHandler(this.Exit_Click);
//
// menuItem1
//
this.menuItem1.Index = 1;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.QuerySno});
this.menuItem1.Text = "查询";
//
// QuerySno
//
this.QuerySno.Index = 0;
this.QuerySno.Text = "成绩查询";
this.QuerySno.Click += new System.EventHandler(this.QuerySno_Click);
//
// 主界面
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(456, 306);
this.Controls.Add(this.pictureBox1);
this.HelpButton = true;
this.Menu = this.TeacherMenu;
this.Name = "主界面";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "学生体育锻炼信息管理系统";
this.Load += new System.EventHandler(this.ControlCenter_Load);
this.ResumeLayout(false);
}
#endregion
private void ControlCenter_Load(object sender, System.EventArgs e)
{
毕业设计.数据处理.数据处理 o=new 毕业设计.数据处理.数据处理();
int result=o.GetUserType(this.userid);
if(result==0)
{
this.Menu=this.StudentMenu;
}
if(result==1)
{
this.Menu=this.TeacherMenu;
}
}
private void ChangeStandard_Click(object sender, System.EventArgs e)
{
this.Hide();
毕业设计.软件系统.项目选择 o=new 毕业设计.软件系统.项目选择();
o.type=0;
o.Opration=3;
o.ShowDialog(this);
this.Show();
}
private void DataInput_Click(object sender, System.EventArgs e)
{
this.Hide();
毕业设计.软件系统.项目选择 o=new 毕业设计.软件系统.项目选择();
o.type=0;
o.Opration=4;
o.ShowDialog(this);
this.Show();
}
private void QueryOne_Click(object sender, System.EventArgs e)
{
this.Hide();
毕业设计.软件系统.项目选择 o=new 毕业设计.软件系统.项目选择();
o.type=0;
o.Opration=2;
o.ShowDialog(this.Parent);
this.Show();
}
private void Logout_Click(object sender, System.EventArgs e)
{
this.Close();
}
private void StudentQuery_Click(object sender, System.EventArgs e)
{
this.Hide();
毕业设计.软件系统.查询条件 o=new 毕业设计.软件系统.查询条件();
o.ShowDialog(this);
this.Show();
}
private void Exit_Click(object sender, System.EventArgs e)
{
Application.Exit();
}
private void QuerySno_Click(object sender, System.EventArgs e)
{
毕业设计.软件系统.查询结果 o=new 查询结果();
o.type="QuerySno";
o.querys=this.userid;
this.Dispose(true);
o.ShowDialog(this.Parent);
}
private void AddItem_Click(object sender, System.EventArgs e)
{
毕业设计.软件系统.添加科目 o=new 添加科目();
this.Hide();
o.ShowDialog(this);
this.Show();
}
private void DeleteItem_Click(object sender, System.EventArgs e)
{
毕业设计.软件系统.项目选择 o=new 项目选择();
this.Hide();
o.Opration=5;
o.ShowDialog(this);
this.Show();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -