Example #1
0
        private void btn_OK_Click(object sender, EventArgs e)
        {
            if (cb_UpdateUserData.Checked)
            {
                if (!UpdateUserData())
                {
                    return;
                }
            }
            string    sql = string.Format("select rightstr from myUsers where name='{0}' and pwd = '{1}'", txt_User.Text.Trim(), txt_Pwd.Text.Trim());
            DataTable dt  = SqliteDbFactory.GetSqliteDbOperator().SelectFromSql(sql);

            if (dt.Rows.Count == 0)
            {
                MessageBox.Show("登陆失败,请检查用户名和密码!");
                return;
            }
            string[] functions = dt.Rows[0]["rightstr"].ToString().Split(",".ToCharArray());
            Program.UserID = this.txt_User.Text;
            Function_List fl = new Function_List(functions);

            fl.Show();
            fl.Closed += new EventHandler(fl_Closed);
            this.Hide();
        }
Example #2
0
 private void btn_OK_Click(object sender, EventArgs e)
 {
     if (cb_UpdateUserData.Checked)
     {
         if (!UpdateUserData()) { return; }
     }
     string sql = string.Format("select rightstr from myUsers where name='{0}' and pwd = '{1}'", txt_User.Text.Trim(), txt_Pwd.Text.Trim());
     DataTable dt = SqliteDbFactory.GetSqliteDbOperator().SelectFromSql(sql);
     if (dt.Rows.Count == 0)
     {
         MessageBox.Show("登陆失败,请检查用户名和密码!");
         return;
     }
     string[] functions = dt.Rows[0]["rightstr"].ToString().Split(",".ToCharArray());
     Program.UserID = this.txt_User.Text;
     Function_List fl = new Function_List(functions);
     fl.Show();
     fl.Closed += new EventHandler(fl_Closed);
     this.Hide();
 }