|
|
@@ -45,7 +45,7 @@ namespace UAS_MES
|
|
|
DoubleBuffered = true;
|
|
|
SetStyle(ControlStyles.UserPaint, true);
|
|
|
SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.
|
|
|
- SetStyle(ControlStyles.DoubleBuffer, true); // 双缓冲
|
|
|
+ SetStyle(ControlStyles.DoubleBuffer, true); // 双缓冲
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -103,6 +103,8 @@ namespace UAS_MES
|
|
|
Width = ScreenArea.Width;
|
|
|
Height = ScreenArea.Height;
|
|
|
SetForm();
|
|
|
+ //设置导航栏宽度
|
|
|
+ SystemInf.NavWidth = Menu.Width;
|
|
|
}
|
|
|
|
|
|
private void RefreshDB(object sender, EventArgs e)
|
|
|
@@ -234,5 +236,31 @@ namespace UAS_MES
|
|
|
}
|
|
|
catch (Exception) { }
|
|
|
}
|
|
|
+
|
|
|
+ private void LoginOut_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
|
|
+ {
|
|
|
+ string logout_confirm = MessageBox.Show(this.ParentForm, "退出登录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
|
|
|
+ if (logout_confirm == "Yes")
|
|
|
+ {
|
|
|
+ //注销的时候切换回默认数据库
|
|
|
+ SystemInf.ConnectionString = Properties.Settings.Default.Properties["MES"].DefaultValue.ToString();
|
|
|
+ DataHelper.DBConnectionString = SystemInf.ConnectionString;
|
|
|
+ //清除上个用户的权限信息
|
|
|
+ SystemInf.Caller.Clear();
|
|
|
+ //清除已经打开过的窗口的信息
|
|
|
+ AccordionMenu.OpenedFormName.Clear();
|
|
|
+ //注销的时候将除了登陆窗口之外的全部窗口关闭
|
|
|
+ for (int i = 0; i < Application.OpenForms.Count; i++)
|
|
|
+ {
|
|
|
+ if (Application.OpenForms[i].Name != "Login")
|
|
|
+ Application.OpenForms[i].Close();
|
|
|
+ }
|
|
|
+ this.Hide();
|
|
|
+ Login login = new Login();
|
|
|
+ login.ShowDialog();
|
|
|
+ RefreshDBConnect.Stop();
|
|
|
+ this.Close();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|