|
|
@@ -60,11 +60,15 @@ namespace UAS_MES.CustomControl
|
|
|
if (logout_confirm == "Yes")
|
|
|
{
|
|
|
this.FindForm().Close();
|
|
|
+ //杀死全部未关闭的进程
|
|
|
+ System.Environment.Exit(0);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
this.FindForm().Close();
|
|
|
+ //杀死全部未关闭的进程
|
|
|
+ System.Environment.Exit(0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -93,28 +97,28 @@ namespace UAS_MES.CustomControl
|
|
|
if (NeedConfirm.Contains(this.FindForm().Name))
|
|
|
{
|
|
|
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.AccordionMenu.OpenedFormName.Clear();
|
|
|
- //注销的时候将除了登陆窗口之外的全部窗口关闭
|
|
|
- for (int i = 0; i < Application.OpenForms.Count; i++)
|
|
|
+ if (logout_confirm == "Yes")
|
|
|
{
|
|
|
- if (Application.OpenForms[i].Name != "Login")
|
|
|
- Application.OpenForms[i].Close();
|
|
|
- }
|
|
|
- this.FindForm().Hide();
|
|
|
- Login login = new Login();
|
|
|
- login.ShowDialog();
|
|
|
- this.FindForm().Close();
|
|
|
+ //注销的时候切换回默认数据库
|
|
|
+ SystemInf.ConnectionString = Properties.Settings.Default.Properties["MES"].DefaultValue.ToString();
|
|
|
+ DataHelper.DBConnectionString = SystemInf.ConnectionString;
|
|
|
+ //清除上个用户的权限信息
|
|
|
+ SystemInf.Caller.Clear();
|
|
|
+ //清除已经打开过的窗口的信息
|
|
|
+ AccordionMenu.AccordionMenu.OpenedFormName.Clear();
|
|
|
+ //注销的时候将除了登陆窗口之外的全部窗口关闭
|
|
|
+ for (int i = 0; i < Application.OpenForms.Count; i++)
|
|
|
+ {
|
|
|
+ if (Application.OpenForms[i].Name != "Login")
|
|
|
+ Application.OpenForms[i].Close();
|
|
|
+ }
|
|
|
+ this.FindForm().Hide();
|
|
|
+ Login login = new Login();
|
|
|
+ login.ShowDialog();
|
|
|
+ this.FindForm().Close();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
private void LoginOut_MouseEnter(object sender, EventArgs e)
|
|
|
{
|