private void FormUserManage_Load(object sender, EventArgs e) { DataSet myds = dataBase.RunProcReturn("select UserID,UserName,Name from users"); dgvInfo.AutoGenerateColumns = false; dgvInfo.DataSource = myds.Tables[0]; }
// private bool ValidateLogin(String Account, String Password) { Common.DataBase dataBase = new Common.DataBase(); try { DataSet myds = dataBase.RunProcReturn("select count(*) from users where UserName='******' and password='******'"); if (myds.Tables[0].Rows[0][0].ToString() == "1") { Common.CGlobal.userName = Account; } else { Common.CGlobal.userName = ""; } } catch { Common.CGlobal.userName = ""; } if (Common.CGlobal.userName == "") { return(false); } else { return(true); } }
private void FormUserInsert_Load(object sender, EventArgs e) { if (op == "Edit") { // DataSet vrds = dataBase.RunProcReturn("select * from Users where UserID=" + UserID); if (vrds.Tables[0].Rows.Count < 0) { Close(); } edtUserName.Text = vrds.Tables[0].Rows[0]["UserName"].ToString(); edtName.Text = vrds.Tables[0].Rows[0]["Name"].ToString(); } }