Exemple #1
0
        private void logOffToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Login frmLogin = new Login();

            frmLogin.init(dbFileName);
            frmLogin.ShowDialog();
            if (frmLogin.logined == false)
            {
                this.Close();
            }
            username = frmLogin.user;
            check_role(username);
        }
Exemple #2
0
        private void MainPoint_Load(object sender, EventArgs e)
        {
            string          sqlString;
            OleDbDataReader oleReader;

            config();
            userdb    = new db(dbFileName);
            sqlString = "SELECT * FROM QUANLYUSER WHERE [Username] = 'admin'";
            oleReader = userdb.genDataReader(sqlString);
            if (oleReader == null)
            {
                this.Close();
                Application.Exit();
                return;
            }
            if (!oleReader.Read())
            {
                CreateUser frmCreateUser = new CreateUser();
                frmCreateUser.Text = "Khoi tao user admin cho he thong";
                frmCreateUser.init(dbFileName, true);
                frmCreateUser.ShowDialog();
                if (frmCreateUser.created == false)
                {
                    this.Close();
                }
                return;
            }
            Login frmLogin = new Login();

            frmLogin.init(dbFileName);
            frmLogin.ShowDialog();
            if (frmLogin.logined == false)
            {
                this.Close();
            }
            username = frmLogin.user;
            check_role(username);
//            userdb.Batch_Process();
        }
 private void MainPoint_Load(object sender, EventArgs e)
 {
     string sqlString;
     OleDbDataReader oleReader;
     config();
     userdb = new db(dbFileName, dbuser, dbport);
     sqlString = "SELECT * FROM QUANLYUSER";
     oleReader = userdb.genDataReader(sqlString);
     if (oleReader == null)
     {
         this.Close();
         Application.Exit();
         return;
     }
     if (!oleReader.Read())
     {
         CreateUser frmCreateUser = new CreateUser();
         frmCreateUser.Text = "Khoi tao user admin cho he thong";
         frmCreateUser.init(dbFileName, dbuser, dbport, true);
         frmCreateUser.ShowDialog();
         if (frmCreateUser.created == false)
             this.Close();
         return;
     }
     Login frmLogin = new Login();
     frmLogin.init(dbFileName, dbuser, dbport);
     frmLogin.ShowDialog();
     if (frmLogin.logined == false)
         this.Close();
     username = frmLogin.user;
     check_role(username);
 }
 private void logOffToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Login frmLogin = new Login();
     frmLogin.init(dbFileName, dbuser, dbport);
     frmLogin.ShowDialog();
     if (frmLogin.logined == false)
         this.Close();
     username = frmLogin.user;
     check_role(username);
 }