客户端的账户支持了注销功能。[Client support account logout]

This commit is contained in:
hsl
2017-03-31 20:23:48 +08:00
parent e46283c6dd
commit 3ec6cae582
3 changed files with 41 additions and 8 deletions

View File

@@ -35,6 +35,7 @@
this.toolStripStatusLabel3 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel_status = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel4 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel_time = new System.Windows.Forms.ToolStripStatusLabel();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -66,7 +67,7 @@
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.label_Announcement = new System.Windows.Forms.Label();
this.toolStripStatusLabel_time = new System.Windows.Forms.ToolStripStatusLabel();
this.linkLabel_logout = new System.Windows.Forms.LinkLabel();
this.statusStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.panel1.SuspendLayout();
@@ -126,6 +127,13 @@
this.toolStripStatusLabel4.Size = new System.Drawing.Size(84, 17);
this.toolStripStatusLabel4.Text = " 温馨提示:";
//
// toolStripStatusLabel_time
//
this.toolStripStatusLabel_time.ForeColor = System.Drawing.Color.Green;
this.toolStripStatusLabel_time.Name = "toolStripStatusLabel_time";
this.toolStripStatusLabel_time.Size = new System.Drawing.Size(44, 17);
this.toolStripStatusLabel_time.Text = "时间:";
//
// menuStrip1
//
this.menuStrip1.BackColor = System.Drawing.SystemColors.Control;
@@ -236,6 +244,7 @@
// panel1
//
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel1.Controls.Add(this.linkLabel_logout);
this.panel1.Controls.Add(this.label_factory);
this.panel1.Controls.Add(this.label9);
this.panel1.Controls.Add(this.label7);
@@ -421,12 +430,16 @@
this.label_Announcement.Text = "[公告]";
this.label_Announcement.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// toolStripStatusLabel_time
// linkLabel_logout
//
this.toolStripStatusLabel_time.ForeColor = System.Drawing.Color.Green;
this.toolStripStatusLabel_time.Name = "toolStripStatusLabel_time";
this.toolStripStatusLabel_time.Size = new System.Drawing.Size(44, 17);
this.toolStripStatusLabel_time.Text = "时间:";
this.linkLabel_logout.AutoSize = true;
this.linkLabel_logout.Location = new System.Drawing.Point(188, 1);
this.linkLabel_logout.Name = "linkLabel_logout";
this.linkLabel_logout.Size = new System.Drawing.Size(32, 17);
this.linkLabel_logout.TabIndex = 16;
this.linkLabel_logout.TabStop = true;
this.linkLabel_logout.Text = "注销";
this.linkLabel_logout.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel_logout_LinkClicked);
//
// FormMainWindow
//
@@ -497,6 +510,7 @@
private System.Windows.Forms.Label label9;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel_time;
private System.Windows.Forms.LinkLabel linkLabel_logout;
}
}

View File

@@ -208,6 +208,12 @@ namespace 软件系统客户端模版
}
}
private void linkLabel_logout_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Program.QuitCode = 1;
Close();
}
#endregion
#region
@@ -318,6 +324,7 @@ namespace 软件系统客户端模版
}));
}
#endregion

View File

@@ -9,6 +9,10 @@ namespace 软件系统客户端模版
{
static class Program
{
/// <summary>
/// 指示了应用程序退出时的代码
/// </summary>
public static int QuitCode { get; set; } = 0;
/// <summary>
/// 应用程序的主入口点。
/// </summary>
@@ -39,11 +43,19 @@ namespace 软件系统客户端模版
//===================================================================
//运行主窗口之前先进行账户的验证
P1:
FormLogin login = new FormLogin();
if (login.ShowDialog() == DialogResult.OK)
{
login.Dispose();
Application.Run(new FormMainWindow());
FormMainWindow fmw = new FormMainWindow();
Application.Run(fmw);
if (QuitCode == 1)
{
//继续显示登录窗口
goto P1;
}
}
else
{