コード例 #1
0
        private void LoadDataUser()
        {
            // Insert existing values
            MySqlDataReader getValues = DBGetData.GetUserData(adminid);

            if (getValues.Read())
            {
                textBoxUsername.Text  = Convert.ToString(getValues[0]);
                textBoxFirstname.Text = Convert.ToString(getValues[1]);
                textBoxLastname.Text  = Convert.ToString(getValues[2]);
                int superuser = Convert.ToInt32(getValues[3]);
                int active    = Convert.ToInt32(getValues[4]);
                if (superuser == 1)
                {
                    checkBoxSuperuser.Checked = true;
                }
                if (active == 1)
                {
                    checkBoxActive.Checked = true;
                }
            }

            getValues.Dispose();
        }