📄 frmadminwelcome.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace OES
{
/// <summary>
/// Summary description for frmAdminWelcome.
/// </summary>
public class frmAdminWelcome : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Button btnCreateUser;
private System.Windows.Forms.Button btnLogout;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
static int flag=0;
private frmUserSearch user;
private frmUser u;
private System.Windows.Forms.Button btnModifyUser;
private System.Windows.Forms.Button btnHelp;
private System.Windows.Forms.HelpProvider hlpOES;
frmLogin objLogin;
public frmAdminWelcome(frmLogin login)
{
// Required for Windows Form Designer support
//
InitializeComponent();
objLogin = login;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmAdminWelcome));
this.btnCreateUser = new System.Windows.Forms.Button();
this.btnModifyUser = new System.Windows.Forms.Button();
this.btnLogout = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.btnHelp = new System.Windows.Forms.Button();
this.label9 = new System.Windows.Forms.Label();
this.hlpOES = new System.Windows.Forms.HelpProvider();
this.SuspendLayout();
//
// btnCreateUser
//
this.btnCreateUser.BackColor = System.Drawing.Color.Transparent;
this.btnCreateUser.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnCreateUser.Font = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnCreateUser.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.btnCreateUser.Location = new System.Drawing.Point(19, 155);
this.btnCreateUser.Name = "btnCreateUser";
this.btnCreateUser.Size = new System.Drawing.Size(144, 43);
this.btnCreateUser.TabIndex = 53;
this.btnCreateUser.Text = "创建新用户(&N)";
this.btnCreateUser.Click += new System.EventHandler(this.btnCreateUser_Click);
//
// btnModifyUser
//
this.btnModifyUser.AllowDrop = true;
this.btnModifyUser.BackColor = System.Drawing.Color.Transparent;
this.btnModifyUser.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnModifyUser.Font = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnModifyUser.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.btnModifyUser.Location = new System.Drawing.Point(19, 243);
this.btnModifyUser.Name = "btnModifyUser";
this.btnModifyUser.Size = new System.Drawing.Size(144, 35);
this.btnModifyUser.TabIndex = 56;
this.btnModifyUser.Text = "修改用户(&M)";
this.btnModifyUser.Click += new System.EventHandler(this.btnModifyUser_Click);
//
// btnLogout
//
this.btnLogout.BackColor = System.Drawing.Color.Transparent;
this.btnLogout.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnLogout.Font = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnLogout.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.btnLogout.Location = new System.Drawing.Point(29, 323);
this.btnLogout.Name = "btnLogout";
this.btnLogout.Size = new System.Drawing.Size(105, 26);
this.btnLogout.TabIndex = 57;
this.btnLogout.Text = "退出(&O)";
this.btnLogout.Click += new System.EventHandler(this.btnLogout_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.Font = new System.Drawing.Font("Century Gothic", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label1.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(255)));
this.label1.Location = new System.Drawing.Point(298, 43);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(307, 49);
this.label1.TabIndex = 58;
this.label1.Text = "欢 迎 管 理 员";
//
// label8
//
this.label8.AutoSize = true;
this.label8.BackColor = System.Drawing.Color.Transparent;
this.label8.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label8.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(255)));
this.label8.Location = new System.Drawing.Point(230, 334);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(241, 22);
this.label8.TabIndex = 63;
this.label8.Text = "要退出系统,请点击“退出”选项";
//
// label6
//
this.label6.AutoSize = true;
this.label6.BackColor = System.Drawing.Color.Transparent;
this.label6.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label6.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(255)));
this.label6.Location = new System.Drawing.Point(230, 258);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(0, 22);
this.label6.TabIndex = 62;
//
// label5
//
this.label5.BackColor = System.Drawing.Color.Transparent;
this.label5.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label5.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(255)));
this.label5.Location = new System.Drawing.Point(230, 155);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(615, 43);
this.label5.TabIndex = 59;
this.label5.Text = "要创建新的用户,请点击本窗口左边的“创建新用户”选项";
//
// label3
//
this.label3.AutoSize = true;
this.label3.BackColor = System.Drawing.Color.Transparent;
this.label3.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label3.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(255)));
this.label3.Location = new System.Drawing.Point(230, 345);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(0, 22);
this.label3.TabIndex = 65;
//
// label4
//
this.label4.BackColor = System.Drawing.Color.Transparent;
this.label4.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label4.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(255)));
this.label4.Location = new System.Drawing.Point(230, 244);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(624, 44);
this.label4.TabIndex = 64;
this.label4.Text = "要查看或修改用户信息,请点击本窗口左边的“修改用户”选项";
//
// btnHelp
//
this.btnHelp.BackColor = System.Drawing.Color.Transparent;
this.btnHelp.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnHelp.Font = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.btnHelp.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.btnHelp.Location = new System.Drawing.Point(38, 394);
this.btnHelp.Name = "btnHelp";
this.btnHelp.Size = new System.Drawing.Size(87, 26);
this.btnHelp.TabIndex = 67;
this.btnHelp.Text = "帮助(&H)";
this.btnHelp.Click += new System.EventHandler(this.btnHelp_Click);
//
// label9
//
this.label9.AutoSize = true;
this.label9.BackColor = System.Drawing.Color.Transparent;
this.label9.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.label9.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(255)));
this.label9.Location = new System.Drawing.Point(230, 404);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(224, 22);
this.label9.TabIndex = 68;
this.label9.Text = "要获得帮助请点击“帮助”选项";
//
// frmAdminWelcome
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = new System.Drawing.Size(902, 568);
this.Controls.Add(this.label9);
this.Controls.Add(this.label8);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnHelp);
this.Controls.Add(this.label3);
this.Controls.Add(this.label4);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
this.Controls.Add(this.btnLogout);
this.Controls.Add(this.btnModifyUser);
this.Controls.Add(this.btnCreateUser);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "frmAdminWelcome";
this.Text = "frmAdminWelcome";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.ResumeLayout(false);
}
#endregion
// [STAThread]
// static void Main()
// {
// Application.Run(new frmAdminWelcome());
// }
private void btnCreateUser_Click(object sender, System.EventArgs e)
{
this.btnCreateUser.ForeColor=Color.Khaki;
this.btnModifyUser.ForeColor=SystemColors.ActiveCaptionText;
this.btnHelp.ForeColor=SystemColors.ActiveCaptionText;
//flag check is done to close the other forms that may be open in the background
if(flag==2)
{
user.Close();//close the Edit User form
}
flag=1;
//call frmUser form passing the flag variable as a parameter to indicate that create user version is being called
u=new frmUser(flag,this);
u.ShowDialog();//modify by dongping 2004-12-25
}
// private void btnEditUser_Click(object sender, System.EventArgs e)
// {
// //flag check is done to close the other forms that may be open in the background
// if(flag==1)
// {
// u.Close();//close the Create user form
// }
// if(flag==3)
// {
// user.Close();//close the Search form
// }
// flag=2;
// //call frmUser form passing the flag variable as a parameter to indicate that modify version is being called
// u=new frmUser(flag,this);
//
// u.cboUserType.Enabled=false;
//
// u.Show();
// }
private void btnLogout_Click(object sender, System.EventArgs e)
{
this.Close();//close the current form - AdminWelcome
if(flag==1)
{
u.Close();//close frmUser if open
}
if(flag==2)
{
user.Close();//close frmUser if open (modify)
}
objLogin.txtUsername.Text="";
objLogin.txtPassword.Text="";
objLogin.Show();//show the existing instance of the login form
objLogin.txtUsername.Focus();
objLogin.lblLogin.Text="";
frmLogin.ctr=1;
}
private void btnModifyUser_Click(object sender, System.EventArgs e)
{
this.btnCreateUser.ForeColor=SystemColors.ActiveCaptionText;
this.btnHelp.ForeColor=SystemColors.ActiveCaptionText;
this.btnModifyUser.ForeColor=Color.Khaki;
//flag check is done to close the other forms that may be open in the background
if(flag !=2)//check if other forms are open
{
if(u != null)//check if frmUser instance is not active
{
u.Close();//if active - close the form
}
}
//set flag value to indicate that the frmUserSearch form is being called
flag=2;
user=new frmUserSearch();
user.ShowDialog();//modify by dongping 2004-12-25
/*flag check is done to close the other forms that may be open in the background
if(flag==1)
{
u.Close();//close the Create user form
}
if(flag==2)
{
user.Close();//close the Search form
}
flag=2;
//call frmUser form passing the flag variable as a parameter to indicate that modify version is being called
u=new frmUser(flag,this);
u.cboUserType.Enabled=false;
u.Show(); */
}
private void btnHelp_Click(object sender, System.EventArgs e)
{
this.btnHelp.ForeColor=Color.Khaki;
this.btnModifyUser.ForeColor=SystemColors.ActiveCaptionText;
this.btnCreateUser.ForeColor=SystemColors.ActiveCaptionText;
//Help.ShowPopup(
Help.ShowHelp(this,Environment.CurrentDirectory +@"\\OES_Help\OES_Help.chm");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -