private void btnSave_Click(object sender, EventArgs e)
{
MySQLRunner.ConnectionString = clsDBStrings.maindbcon;
MySqlConnection conAdd = new MySqlConnection(MySQLRunner.ConnectionString);
string sSQL = "";
bool flgReturn = false;
string banned = "";
string csr = "";
string ID = lsvAccounts.SelectedItems[0].Tag.ToString();
if (txtBanned.Text == "True")
{
banned = "1";
}
else
{
banned = "0";
}
if (txtCSR.Text == "True")
{
csr = "1";
}
else
{
csr = "0";
}
sSQL = "UPDATE account SET " +
"username='" + txtUserName.Text + "', " +
"email='" + txtEmail.Text + "', " +
"banned='" + banned + "', " +
"csr='" + csr + "', " +
"characters_allowed='" + txtChars.Text + "' " +
"WHERE account_id=" + ID.ToString();
if (MySQLRunner.ExecuteNonQuery(sSQL, conAdd) == false)
MessageBox.Show("Error creating Account.");
else
MessageBox.Show("Account Creation Successful.");
if (conAdd.State == ConnectionState.Open)
{
conAdd.Close();
}
}