Esempio n. 1
0
 private void btnExit_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Do you want to exit ?", "Warning !!!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
     {
         if (GlobalClass.UserID != -1)
         {
             FunctionSession1.Logout(GlobalClass.UserID, GlobalClass.LoginTime);
         }
         this.Close();
     }
 }
Esempio n. 2
0
 private void frmUser_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (isClose)
     {
         return;
     }
     if (MessageBox.Show("Do you want to exit ?", "Warning !!!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
     {
         e.Cancel = true;
     }
     else
     {
         if (GlobalClass.UserID != -1)
         {
             FunctionSession1.Logout(GlobalClass.UserID, GlobalClass.LoginTime);
         }
         this.Close();
     }
 }