示例#1
0
 /// <summary>
 /// Prevent window from closing before the data inputted is saved
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void TemplateEntryFrm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (_condition == FormCondition.Inputting)
     {
         if (DialogHelper.ExitDialog(this) != 0)
         {
             e.Cancel = false;
         }
         else
         {
             e.Cancel = true;
         }
     }
 }
 private void FrmMiniMenu_FormClosing(object sender, FormClosingEventArgs e)
 {
     //Check if user already logged
     if (Session.GetLoginStatus() != false)
     {
         if (DialogHelper.ExitDialog(this) != 0)
         {
             userRepo.Logout();
             Session.LogOut();
         }
         else
         {
             e.Cancel = true;
         }
     }
 }