📄 项目选择.cs
字号:
namespace 毕业设计
{
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace 软件系统
{
/// <summary>
/// 项目选择 的摘要说明。
/// </summary>
public class 项目选择 : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox ItemList;
private System.Windows.Forms.Button btnConfirm;
private System.Windows.Forms.Button btnCancel;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public int type=0;
public int Opration=0;
/*
Opration 1 = 记分
2 = 查询
3 = 设置标准
4 = 老师输入
5 = 删除科目
*/
private string[] Oprations={"","记分","查询","设置标准","输入成绩","删除科目",""};
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()
{
this.label1 = new System.Windows.Forms.Label();
this.ItemList = new System.Windows.Forms.ComboBox();
this.btnConfirm = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.Location = new System.Drawing.Point(24, 32);
this.label1.Name = "label1";
this.label1.TabIndex = 0;
this.label1.Text = "项目";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// ItemList
//
this.ItemList.Location = new System.Drawing.Point(136, 32);
this.ItemList.Name = "ItemList";
this.ItemList.Size = new System.Drawing.Size(121, 20);
this.ItemList.TabIndex = 1;
//
// btnConfirm
//
this.btnConfirm.Location = new System.Drawing.Point(48, 80);
this.btnConfirm.Name = "btnConfirm";
this.btnConfirm.TabIndex = 2;
this.btnConfirm.Text = "确定";
this.btnConfirm.Click += new System.EventHandler(this.btnConfirm_Click);
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(152, 80);
this.btnCancel.Name = "btnCancel";
this.btnCancel.TabIndex = 3;
this.btnCancel.Text = "取消";
//
// 项目选择
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(292, 118);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnConfirm);
this.Controls.Add(this.ItemList);
this.Controls.Add(this.label1);
this.Name = "项目选择";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "项目选择";
this.Load += new System.EventHandler(this.项目选择_Load);
this.ResumeLayout(false);
}
#endregion
private void btnConfirm_Click(object sender, System.EventArgs e)
{
if(this.Opration==1)
{
毕业设计.射频卡.记分系统 o=new 毕业设计.射频卡.记分系统();
o.course=this.ItemList.Text;
this.Dispose(true);
o.ShowDialog(this.Parent);
}
if(this.Opration==2)
{
毕业设计.软件系统.查询结果 o=new 查询结果();
o.type="QueryCourse";
o.querys=this.ItemList.Text;
this.Dispose(true);
o.ShowDialog(this.Parent);
}
if(this.Opration==3)
{
毕业设计.软件系统.规则设定 o=new 规则设定();
o.Course=this.ItemList.Text;
this.Dispose(true);
o.ShowDialog(this.Parent);
}
if(this.Opration==4)
{
毕业设计.软件系统.数据输入 o=new 数据输入();
o.course=this.ItemList.Text;
this.Dispose(true);
o.ShowDialog(this.Parent);
}
if(this.Opration==5)
{
毕业设计.数据处理.数据处理 o=new 毕业设计.数据处理.数据处理();
if(o.DeleteCourse(this.ItemList.Text))
{
this.Dispose(true);
MessageBox.Show("科目删除成功!");
}
else
MessageBox.Show("科目删除失败!");
}
}
private void 项目选择_Load(object sender, System.EventArgs e)
{
毕业设计.数据处理.数据处理 o=new 毕业设计.数据处理.数据处理();
this.ItemList.DataSource=o.GetCourse(type).Tables[0];
this.ItemList.DisplayMember="item";
this.ItemList.ValueMember="item";
this.Text+="--"+Oprations[this.Opration];
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -