static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     frmLogin loginFrm = new frmLogin();
     loginFrm.Show();
     Application.Run();
 }
 private void frmClose(object sender, FormClosingEventArgs e)
 {
     if(isLogOut == true && isExit == false)
     {
         isExit = true;
         this.Close();
         frmLogin loginFrm = new frmLogin();
         loginFrm.Show();
     }
     if(isLogOut == false && isExit == false)
     {
         MessageBox.Show("Please log out.", "Warning");
         e.Cancel = true;
         btnLogout.Focus();
     }
 }
 private void btnLogout_Click(object sender, EventArgs e)
 {
     Console.WriteLine("Encrypting all tenants.");
     String[] fileList;
     fileList = Directory.GetFiles(CurrentPath + Database + currentLoad, "*.db");
     //Encrypt all user tenants
     foreach (string fileName in fileList)
     {
         string tenantName;
         tenantName = Path.GetFileNameWithoutExtension(fileName);
         share.EncryptFile(fileName, CurrentPath + Database + currentUser.Name + "\\" + tenantName + ".db", userPassword);
     }
     System.IO.File.Delete(CurrentPath + "\\currentload.db");
     isLogOut = true;
     frmMain Main = this;
     Main.Hide();
     frmLogin mainLogin = new frmLogin();
     mainLogin.Show();
 }
 private void properExit()
 {
     isClosed = true;
     this.Hide();
     frmLogin loginFrm = new frmLogin();
     loginFrm.Show();
 }
 private void frmClose(object sender, FormClosingEventArgs e)
 {
     if(isClosed == false)
     {
         isClosed = true;
         MessageBox.Show("You have been signed out.", "Warning");
         this.Hide();
         frmLogin loginFrm = new frmLogin();
         loginFrm.Show();
     }
 }