📄 mainform.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using WorkFlow.user;
using WorkFlow.flow;
using WorkFlow.util;
namespace WorkFlow
{
/// <summary>
/// MainForm 的摘要说明。
/// </summary>
public class MainForm : System.Windows.Forms.Form
{
private System.Windows.Forms.MainMenu mainMenu1;
private System.ComponentModel.IContainer components;
private static SqlConnection conn = null;
private static int userAutoID = 0;
private static string userid = null;
private static string realName = null;
private static string historyPath = System.Environment.CurrentDirectory+"\\history.dat";
private System.Windows.Forms.MenuItem FlowModelDef;
private System.Windows.Forms.MenuItem RelationDef;
private System.Windows.Forms.MenuItem StartFlow;
private System.Windows.Forms.MenuItem ModifyPass;
private System.Windows.Forms.MenuItem FlowManage;
private System.Windows.Forms.MenuItem UserManage;
private System.Windows.Forms.MenuItem FlowModelManage;
private System.Windows.Forms.MenuItem SystemManage;
private System.Windows.Forms.MenuItem ReLogin;
private System.Windows.Forms.MenuItem FinishStep;
private System.Windows.Forms.MenuItem QueryFlow;
private System.Windows.Forms.MenuItem EndFlow;
private System.Windows.Forms.MenuItem AddUser;
private System.Windows.Forms.MenuItem PowerManage;
private System.Windows.Forms.MenuItem DepManage;
private System.Windows.Forms.MenuItem ModifyUser;
private System.Windows.Forms.MenuItem ExitSys;
private System.Windows.Forms.MenuItem AboutSys;
public System.Windows.Forms.ToolBar toolBar1;
private System.Windows.Forms.ToolBarButton toolBarButton1;
private System.Windows.Forms.ToolBarButton toolBarButton2;
private System.Windows.Forms.ToolBarButton toolBarButton3;
private System.Windows.Forms.ToolBarButton toolBarButton4;
private System.Windows.Forms.ToolBarButton toolBarButton5;
private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.StatusBar statusBar1;
private System.Windows.Forms.StatusBarPanel statusBarPanel1;
private System.Windows.Forms.StatusBarPanel statusBarPanel2;
private System.Windows.Forms.ToolBarButton toolBarButton6;
private static UserRight ur = null;
public MainForm()
{
//
// 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.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MainForm));
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.FlowManage = new System.Windows.Forms.MenuItem();
this.StartFlow = new System.Windows.Forms.MenuItem();
this.FinishStep = new System.Windows.Forms.MenuItem();
this.QueryFlow = new System.Windows.Forms.MenuItem();
this.EndFlow = new System.Windows.Forms.MenuItem();
this.UserManage = new System.Windows.Forms.MenuItem();
this.AddUser = new System.Windows.Forms.MenuItem();
this.ModifyUser = new System.Windows.Forms.MenuItem();
this.PowerManage = new System.Windows.Forms.MenuItem();
this.DepManage = new System.Windows.Forms.MenuItem();
this.FlowModelManage = new System.Windows.Forms.MenuItem();
this.FlowModelDef = new System.Windows.Forms.MenuItem();
this.RelationDef = new System.Windows.Forms.MenuItem();
this.SystemManage = new System.Windows.Forms.MenuItem();
this.ModifyPass = new System.Windows.Forms.MenuItem();
this.ReLogin = new System.Windows.Forms.MenuItem();
this.ExitSys = new System.Windows.Forms.MenuItem();
this.AboutSys = new System.Windows.Forms.MenuItem();
this.toolBar1 = new System.Windows.Forms.ToolBar();
this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton2 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton3 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton4 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton5 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton6 = new System.Windows.Forms.ToolBarButton();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.statusBar1 = new System.Windows.Forms.StatusBar();
this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel();
this.statusBarPanel2 = new System.Windows.Forms.StatusBarPanel();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).BeginInit();
this.SuspendLayout();
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.FlowManage,
this.UserManage,
this.FlowModelManage,
this.SystemManage});
//
// FlowManage
//
this.FlowManage.Index = 0;
this.FlowManage.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.StartFlow,
this.FinishStep,
this.QueryFlow,
this.EndFlow});
this.FlowManage.Text = "流程管理";
//
// StartFlow
//
this.StartFlow.Index = 0;
this.StartFlow.Text = "开始一个流程";
this.StartFlow.Click += new System.EventHandler(this.StartFlow_Click);
//
// FinishStep
//
this.FinishStep.Index = 1;
this.FinishStep.Text = "填写流程步骤";
this.FinishStep.Click += new System.EventHandler(this.FinishFlow_Click);
//
// QueryFlow
//
this.QueryFlow.Index = 2;
this.QueryFlow.Text = "查询流程";
this.QueryFlow.Click += new System.EventHandler(this.QueryFlow_Click);
//
// EndFlow
//
this.EndFlow.Index = 3;
this.EndFlow.Text = "终止流程";
this.EndFlow.Click += new System.EventHandler(this.EndFlow_Click);
//
// UserManage
//
this.UserManage.Index = 1;
this.UserManage.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.AddUser,
this.ModifyUser,
this.PowerManage,
this.DepManage});
this.UserManage.Text = "用户管理";
//
// AddUser
//
this.AddUser.Index = 0;
this.AddUser.Text = "添加用户";
this.AddUser.Click += new System.EventHandler(this.AddUser_Click);
//
// ModifyUser
//
this.ModifyUser.Index = 1;
this.ModifyUser.Text = "用户管理";
this.ModifyUser.Click += new System.EventHandler(this.ModifyUser_Click_1);
//
// PowerManage
//
this.PowerManage.Index = 2;
this.PowerManage.Text = "权限管理";
this.PowerManage.Click += new System.EventHandler(this.PowerManage_Click);
//
// DepManage
//
this.DepManage.Index = 3;
this.DepManage.Text = "部门管理";
this.DepManage.Click += new System.EventHandler(this.DepManage_Click);
//
// FlowModelManage
//
this.FlowModelManage.Index = 2;
this.FlowModelManage.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.FlowModelDef,
this.RelationDef});
this.FlowModelManage.Text = "流程模板管理";
//
// FlowModelDef
//
this.FlowModelDef.Index = 0;
this.FlowModelDef.Text = "流程模板定义";
this.FlowModelDef.Click += new System.EventHandler(this.FlowModelDef_Click);
//
// RelationDef
//
this.RelationDef.Index = 1;
this.RelationDef.Text = "约束关系定义";
this.RelationDef.Click += new System.EventHandler(this.RelationDef_Click);
//
// SystemManage
//
this.SystemManage.Index = 3;
this.SystemManage.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.ModifyPass,
this.ReLogin,
this.ExitSys,
this.AboutSys});
this.SystemManage.Text = "系统";
//
// ModifyPass
//
this.ModifyPass.Index = 0;
this.ModifyPass.Text = "修改密码";
this.ModifyPass.Click += new System.EventHandler(this.ModifyPass_Click);
//
// ReLogin
//
this.ReLogin.Index = 1;
this.ReLogin.Text = "重新登录";
this.ReLogin.Click += new System.EventHandler(this.ReLogin_Click);
//
// ExitSys
//
this.ExitSys.Index = 2;
this.ExitSys.Text = "退出";
this.ExitSys.Click += new System.EventHandler(this.ExitSys_Click);
//
// AboutSys
//
this.AboutSys.Index = 3;
this.AboutSys.Text = "关于";
this.AboutSys.Click += new System.EventHandler(this.AboutSys_Click);
//
// toolBar1
//
this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.toolBarButton1,
this.toolBarButton2,
this.toolBarButton3,
this.toolBarButton4,
this.toolBarButton5,
this.toolBarButton6});
this.toolBar1.DropDownArrows = true;
this.toolBar1.ImageList = this.imageList1;
this.toolBar1.Location = new System.Drawing.Point(0, 0);
this.toolBar1.Name = "toolBar1";
this.toolBar1.ShowToolTips = true;
this.toolBar1.Size = new System.Drawing.Size(584, 41);
this.toolBar1.TabIndex = 1;
this.toolBar1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick);
//
// toolBarButton1
//
this.toolBarButton1.ImageIndex = 1;
this.toolBarButton1.Text = "开始一个流程";
//
// toolBarButton2
//
this.toolBarButton2.ImageIndex = 4;
this.toolBarButton2.Text = "填写流程步骤";
//
// toolBarButton3
//
this.toolBarButton3.ImageIndex = 0;
this.toolBarButton3.Text = "查询流程";
//
// toolBarButton4
//
this.toolBarButton4.ImageIndex = 3;
this.toolBarButton4.Text = "重新登录";
//
// toolBarButton5
//
this.toolBarButton5.ImageIndex = 2;
this.toolBarButton5.Text = "退出";
//
// toolBarButton6
//
this.toolBarButton6.ImageIndex = 5;
this.toolBarButton6.Text = "关于";
//
// imageList1
//
this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
//
// statusBar1
//
this.statusBar1.Location = new System.Drawing.Point(0, 227);
this.statusBar1.Name = "statusBar1";
this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
this.statusBarPanel1,
this.statusBarPanel2});
this.statusBar1.ShowPanels = true;
this.statusBar1.Size = new System.Drawing.Size(584, 22);
this.statusBar1.TabIndex = 2;
this.statusBar1.Text = "statusBar1";
//
// statusBarPanel1
//
this.statusBarPanel1.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Contents;
this.statusBarPanel1.Width = 10;
//
// statusBarPanel2
//
this.statusBarPanel2.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Contents;
this.statusBarPanel2.Text = "statusBarPanel2";
this.statusBarPanel2.Width = 107;
//
// MainForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackColor = System.Drawing.SystemColors.Control;
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = new System.Drawing.Size(584, 249);
this.Controls.Add(this.statusBar1);
this.Controls.Add(this.toolBar1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.IsMdiContainer = true;
this.Menu = this.mainMenu1;
this.Name = "MainForm";
this.Text = "MainForm";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Load += new System.EventHandler(this.MainForm_Load);
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new MainForm());
}
private void MainForm_Load(object sender, System.EventArgs e)
{
Console.WriteLine(StringUtils.Encrypt("1"));
this.statusBarPanel1.Text="欢迎使用工作流程管理系统演示版本!!!";
this.statusBarPanel2.Text="现在是:"+System.DateTime.Now.ToString();
this.Text = "流程管理系统 V"+util.UpdateUtil.GetLocalVersion();
Menu mainmenu = this.getMainMenu();
//窗体构造时候 设置所有菜单无效,当用户登录判定具有权限时 相应菜单才有效
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -