private void cmdAdd_Click(object sender, EventArgs e) { CreateUser frmNewuser = new CreateUser(); frmNewuser.init(datafile, false); frmNewuser.ShowDialog(); refreshdata(); }
private void nhapThongTinNguoiDungToolStripMenuItem_Click(object sender, EventArgs e) { CreateUser frmNewuser = new CreateUser(); frmNewuser.init(dbFileName, false); frmNewuser.ShowDialog(); }
private void createUserToolStripMenuItem_Click(object sender, EventArgs e) { CreateUser frmCreateUser = new CreateUser(); frmCreateUser.Text = "Them nguoi dung"; frmCreateUser.init(dbFileName, false); frmCreateUser.ShowDialog(); if (frmCreateUser.created == false) { MessageBox.Show("Khong tao duoc nguoi dung!"); } return; }
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 createUserToolStripMenuItem_Click(object sender, EventArgs e) { CreateUser frmCreateUser = new CreateUser(); frmCreateUser.Text = "Them nguoi dung"; frmCreateUser.init(dbFileName, dbuser, dbport, false); frmCreateUser.ShowDialog(); if (frmCreateUser.created == false) MessageBox.Show("Khong tao duoc nguoi dung!"); return; }