📄 menumanage.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using CallCenter.BusinessLayer;
using CallCenter.DALFactory;
using CallCenter.IDAL;
using CallCenter.Modules;
using CallCenter.OracleDAL;
using System.Data;
namespace CallCenter.BusinessInterfaces.MainForms
{
/// <summary>
/// MenuManage 的摘要说明。
/// </summary>
public class MenuManage : System.Windows.Forms.Form
{
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.StatusBar statusBar1;
private System.Windows.Forms.Label name;
private System.Windows.Forms.TextBox txtName;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtDescript;
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.Button btInsert;
private System.Windows.Forms.Button btDelete;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label title;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public MenuManage()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
public static void Main()
{
Application.Run(new MenuManage());
}
/// <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.panel1 = new System.Windows.Forms.Panel();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.btDelete = new System.Windows.Forms.Button();
this.btInsert = new System.Windows.Forms.Button();
this.txtDescript = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.txtName = new System.Windows.Forms.TextBox();
this.name = new System.Windows.Forms.Label();
this.title = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.statusBar1 = new System.Windows.Forms.StatusBar();
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this.button4);
this.panel1.Controls.Add(this.button3);
this.panel1.Controls.Add(this.button2);
this.panel1.Controls.Add(this.button1);
this.panel1.Controls.Add(this.btDelete);
this.panel1.Controls.Add(this.btInsert);
this.panel1.Controls.Add(this.txtDescript);
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.txtName);
this.panel1.Controls.Add(this.name);
this.panel1.Controls.Add(this.title);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(568, 128);
this.panel1.TabIndex = 0;
//
// button2
//
this.button2.Location = new System.Drawing.Point(464, 40);
this.button2.Name = "button2";
this.button2.TabIndex = 8;
this.button2.Text = "button2";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button1
//
this.button1.Location = new System.Drawing.Point(448, 96);
this.button1.Name = "button1";
this.button1.TabIndex = 7;
this.button1.Text = "关闭";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// btDelete
//
this.btDelete.Location = new System.Drawing.Point(232, 96);
this.btDelete.Name = "btDelete";
this.btDelete.TabIndex = 6;
this.btDelete.Text = "删除";
//
// btInsert
//
this.btInsert.Location = new System.Drawing.Point(32, 96);
this.btInsert.Name = "btInsert";
this.btInsert.TabIndex = 5;
this.btInsert.Text = "添加";
this.btInsert.Click += new System.EventHandler(this.btInsert_Click);
//
// txtDescript
//
this.txtDescript.Location = new System.Drawing.Point(80, 64);
this.txtDescript.Name = "txtDescript";
this.txtDescript.Size = new System.Drawing.Size(328, 21);
this.txtDescript.TabIndex = 4;
this.txtDescript.Text = "";
//
// label1
//
this.label1.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label1.Location = new System.Drawing.Point(8, 64);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(72, 23);
this.label1.TabIndex = 3;
this.label1.Text = "菜单描述";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtName
//
this.txtName.Location = new System.Drawing.Point(80, 32);
this.txtName.Name = "txtName";
this.txtName.Size = new System.Drawing.Size(104, 21);
this.txtName.TabIndex = 2;
this.txtName.Text = "";
//
// name
//
this.name.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.name.Location = new System.Drawing.Point(8, 32);
this.name.Name = "name";
this.name.Size = new System.Drawing.Size(72, 23);
this.name.TabIndex = 1;
this.name.Text = "菜单名称";
this.name.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// title
//
this.title.Dock = System.Windows.Forms.DockStyle.Top;
this.title.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.title.Location = new System.Drawing.Point(0, 0);
this.title.Name = "title";
this.title.Size = new System.Drawing.Size(568, 23);
this.title.TabIndex = 0;
this.title.Text = "菜单管理";
this.title.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// panel2
//
this.panel2.Controls.Add(this.dataGrid1);
this.panel2.Controls.Add(this.statusBar1);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 128);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(568, 365);
this.panel2.TabIndex = 1;
//
// dataGrid1
//
this.dataGrid1.CaptionVisible = false;
this.dataGrid1.DataMember = "";
this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid1.Location = new System.Drawing.Point(0, 0);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.Size = new System.Drawing.Size(568, 343);
this.dataGrid1.TabIndex = 1;
//
// statusBar1
//
this.statusBar1.Location = new System.Drawing.Point(0, 343);
this.statusBar1.Name = "statusBar1";
this.statusBar1.Size = new System.Drawing.Size(568, 22);
this.statusBar1.TabIndex = 0;
this.statusBar1.Text = "statusBar1";
//
// button3
//
this.button3.Location = new System.Drawing.Point(128, 96);
this.button3.Name = "button3";
this.button3.TabIndex = 9;
this.button3.Text = "修改";
//
// button4
//
this.button4.Location = new System.Drawing.Point(336, 96);
this.button4.Name = "button4";
this.button4.TabIndex = 10;
this.button4.Text = "清空";
//
// MenuManage
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(568, 493);
this.Controls.Add(this.panel2);
this.Controls.Add(this.panel1);
this.Name = "MenuManage";
this.Text = "MenuManage";
this.Load += new System.EventHandler(this.MenuManage_Load);
this.panel1.ResumeLayout(false);
this.panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private void button1_Click(object sender, System.EventArgs e)
{
this.Close();
}
private void button2_Click(object sender, System.EventArgs e)
{
UserManage um=new UserManage();
um.Show();
}
private void MenuManage_Load(object sender, System.EventArgs e)
{
DataSet ds=new DataSet();
SysMenuBLL sysmenu=new SysMenuBLL();
ds=sysmenu.getSysmenu();
this.dataGrid1.DataSource=ds.Tables["sysmenu"].DefaultView;
}
private void btInsert_Click(object sender, System.EventArgs e)
{
// try
// {
// SysMenuInfo sysinfo=new SysMenuInfo();
// sysinfo=getData();
// SysMenuBLL sysbll=new SysMenuBLL();
// if(sysbll(sysinfo)==1)
// {
// MessageBox.Show("添加成功");
// getDataBind();
// ClearData();
// }
// else
// {
// MessageBox.Show("登陆名重复请重新添加!");
// }
// }
// catch(Exception ex)
// {
// MessageBox.Show(ex.Message);
// }
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -