예제 #1
0
        private void btnExit_Click(object sender, EventArgs e)
        {
            fLogin login = new fLogin();

            this.Hide();
            login.ShowDialog();
            this.Close();
        }
예제 #2
0
        //------------------------Nút------------------------//
        //Nút Trở về form đăng nhập
        private void lblfLogIn_Click(object sender, EventArgs e)
        {
            Form fLog = new fLogin();

            this.Hide();
            fLog.ShowDialog();
            this.Close();
        }
예제 #3
0
        //Nút đăng xuất
        private void mtsLogOut_Click(object sender, EventArgs e)
        {
            Account = ConnectSQL.ExcuteQuery("Update Account set Status = '0' where IDStaff = '" + ReturnIDAccount + "'");
            this.Hide();
            fLogin fLI = new fLogin();

            fLI.ShowDialog();
            this.Close();
        }
예제 #4
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (timer1.Interval == 2900)
            {
                timer1.Enabled = false;
                timer1.Stop();
                Connect   ConnectSQL = new Connect();
                DataTable Account    = new DataTable();
                Account = ConnectSQL.ExcuteQuery("Select IDStaff, Status from Account");
                bool CheckAccountOnline()
                {
                    bool Flag = false;

                    if (Account.Rows.Count >= 1)
                    {
                        for (int i = 0; i < Account.Rows.Count; i++)
                        {
                            if (Convert.ToInt32(Account.Rows[i][1]) == 1)
                            {
                                Flag = true;
                                break;
                            }
                        }
                    }
                    return(Flag);
                }

                if (CheckAccountOnline())
                {
                    string IDStaff = "";
                    for (int i = 0; i < Account.Rows.Count; i++)
                    {
                        if (Account.Rows[i][1].ToString() == "1")
                        {
                            IDStaff = Account.Rows[i][0].ToString();
                        }
                    }
                    this.Hide();
                    fHomePage fhp = new fHomePage();
                    fhp.ShowDialog();
                    this.Close();
                }
                else
                {
                    this.Hide();
                    fLogin flog = new fLogin();
                    flog.ShowDialog();
                    this.Close();
                }
            }
        }