Пример #1
0
        private void LogoutBtn_Click(object sender, EventArgs e)
        {
            this.Hide();
            Login_Screen form2 = new Login_Screen();

            form2.ShowDialog();
            this.Close();
        }
Пример #2
0
        private void Logoutbtn_Click(object sender, EventArgs e)
        {
            this.Hide();
            // show other form
            Login_Screen form2 = new Login_Screen();

            form2.ShowDialog();
            // close application
            this.Close();
        }
        private void LogoutBtn_Click(object sender, EventArgs e)
        {
            timer2.Stop();
            timer1.Stop();
            conn.Dispose();
            conn.Close();
            this.Hide();
            // show other form
            Login_Screen form2 = new Login_Screen();

            form2.ShowDialog();
            // close application
            this.Close();
        }
Пример #4
0
        private void LogoutBtn_Click(object sender, EventArgs e)
        {
            if (Login_Screen.Pflag == 1)
            {
                DialogResult dialog = MessageBox.Show("Are you sure you want to Logout", "Exit?", MessageBoxButtons.YesNo);
                if (dialog == DialogResult.Yes)
                {
                    Login_Screen.Pflag = 0;
                    this.Hide();
                    Login_Screen form2 = new Login_Screen();
                    form2.ShowDialog();
                    this.Close();
                }
            }
            else
            {
                DialogResult dialog2 = MessageBox.Show("Are you sure you want to Save Changes and Logout", "Save and Exit?", MessageBoxButtons.YesNoCancel);
                if (dialog2 == DialogResult.Yes)
                {
                    Login_Screen.Pflag = 0;

                    scb = new SqlCommandBuilder(adapt);
                    adapt.Update(dt);

                    this.Hide();
                    Login_Screen form2 = new Login_Screen();
                    form2.ShowDialog();
                    this.Close();
                }
                if (dialog2 == DialogResult.No)
                {
                    Login_Screen.Pflag = 0;
                    this.Hide();
                    Login_Screen form2 = new Login_Screen();
                    form2.ShowDialog();
                    this.Close();
                }
            }
        }