public void GetAccountInfo(string id) { string acctLevel = ""; foreach (DataRow record in DBConnect.AQuery("SELECT accountName, role FROM account WHERE accountID=" + id).Rows) { usertextbox.Text = record[0].ToString(); acctLevel = record[1].ToString(); } switch (Int64.Parse(acctLevel)) { case 2: accountLevel.SelectedIndex = 4; break; case 8: accountLevel.SelectedIndex = 3; break; case 16: accountLevel.SelectedIndex = 2; break; case 32: accountLevel.SelectedIndex = 1; break; default: accountLevel.SelectedIndex = 0; break; } }
private void AddModifyStartingSkill_Load(object sender, EventArgs e) { foreach (DataRow record in DBConnect.AQuery("SELECT typeName from invTypes WHERE groupid in (SELECT groupid from invGroups WHERE categoryid = 16)").Rows) { skillName.Items.Add(record[0].ToString()); } }
private void skillName_SelectedIndexChanged(object sender, EventArgs e) { foreach (DataRow record in DBConnect.AQuery("SELECT typeID from invTypes WHERE groupid IN (SELECT groupid from invGroups WHERE categoryid = 16) AND typeName = '" + skillName.Text + "'").Rows) { skillID.Text = record[0].ToString(); } }
public void extractItemInfo(int itemID) { DataTable invTypesdata = DBConnect.AQuery("SELECT * FROM invTypes WHERE typeID=" + itemID); foreach (DataRow record in invTypesdata.Rows) { typeID1.Text = record["typeID"].ToString(); groupID.Text = record["GroupID"].ToString(); typeName.Text = record["typeName"].ToString(); description.Text = record["description"].ToString(); graphicID.Text = record["graphicID"].ToString(); radius.Text = record["radius"].ToString(); mass.Text = record["mass"].ToString(); volume.Text = record["volume"].ToString(); capacity.Text = record["capacity"].ToString(); portionSize.Text = record["portionSize"].ToString(); raceID.Text = record["RaceId"].ToString(); basePrice.Text = record["basePrice"].ToString(); published.Text = record["published"].ToString(); marketGroupID.Text = record["marketGroupID"].ToString(); chanceOfDuplicating.Text = record["chanceOfDuplicating"].ToString(); //Populate the Group ComboBox int groupIndex = groupSelector.FindString(groupID.Text + " -"); groupSelector.SelectedIndex = groupIndex; //Populate the MarketGroup ComboBox int marketIndex = marketGroupSelector.FindString(marketGroupID.Text + " -"); marketGroupSelector.SelectedIndex = marketIndex; itemAddEdit.ActiveForm.Text = typeName.Text; } }
private void attributeDescription_SelectedIndexChanged(object sender, EventArgs e) { foreach (DataRow record in DBConnect.AQuery("SELECT attributeID FROM dgmAttributeTypes WHERE attributeName = '" + attributeDescription.Text + "'").Rows) { attributeID.Text = record[0].ToString(); } }
private void effectDescription_SelectedIndexChanged(object sender, EventArgs e) { foreach (DataRow record in DBConnect.AQuery("SELECT effectID FROM dgmEffects WHERE effectName = '" + effectDescription.Text + "'").Rows) { effectID.Text = record[0].ToString(); } }
private void mineral_SelectedIndexChanged(object sender, EventArgs e) { foreach (DataRow record in DBConnect.AQuery("SELECT typeID from invTypes WHERE typeName = '" + mineral.Text + "'").Rows) { newmineralid = record[0].ToString(); } }
private void EditOre_Load(object sender, EventArgs e) { foreach (DataRow record in DBConnect.AQuery("SELECT typeName from invTypes WHERE groupid = 18").Rows) { mineral.Items.Add(record[0].ToString()); } }
public void loadOre(string loadOreID, string mineralID) { oldmineralid = mineralID; newmineralid = mineralID; oreID.Text = loadOreID; foreach (DataRow record in DBConnect.AQuery("SELECT typeName from invTypes WHERE typeID = " + loadOreID).Rows) { oreName.Text = record[0].ToString(); } string query; if (mineralID == "1") { query = "SELECT quantity from invTypeMaterials WHERE typeID = " + loadOreID + " and materialTypeID = " + mineralID; foreach (DataRow record in DBConnect.AQuery(query).Rows) { quantity.Text = record[0].ToString(); } } if (oldmineralid != "") { foreach (DataRow record in DBConnect.AQuery("SELECT typeName from invTypes WHERE typeID = " + oldmineralid).Rows) { mineral.Text = record[0].ToString(); } } }
private void itemAddEdit_Load(object sender, EventArgs e) { marketGroupSelector.Items.Clear(); foreach (DataRow record in DBConnect.AQuery("SELECT marketGroupID, parentGroupID AS parent, (SELECT marketGroupName FROM invMarketGroups WHERE marketGroupID = parent) as marketParentName, marketGroupName FROM invMarketGroups ORDER BY marketParentName").Rows) { marketGroupSelector.Items.Add(record[0].ToString() + " - " + record[2].ToString() + " - " + record[3].ToString()); } groupSelector.Items.Clear(); foreach (DataRow record in DBConnect.AQuery("SELECT groupID, groupName FROM invGroups ORDER BY groupName").Rows) { groupSelector.Items.Add(record[0].ToString() + " - " + record[1].ToString()); } }
private void tabPage3_Enter(object sender, EventArgs e) { itemEffects.Items.Clear(); foreach (DataRow record in DBConnect.AQuery("SELECT effectID AS effect, (SELECT effectname FROM dgmEffects WHERE effectID = effect) as effectName, isDefault FROM dgmTypeEffects WHERE typeID = " + typeID1.Text).Rows) { string[] attribute = new string[3]; attribute[0] = record[0].ToString(); attribute[1] = record[1].ToString(); attribute[2] = record[2].ToString(); ListViewItem attribute2 = new ListViewItem(attribute); itemEffects.Items.Add(attribute2); } foreach (DataRow record in DBConnect.AQuery("SELECT effectName FROM dgmEffects ORDER BY effectName").Rows) { effectDescription.Items.Add(record[0].ToString()); } }
private void tabPage2_Enter(object sender, EventArgs e) { itemAttributes.Items.Clear(); foreach (DataRow record in DBConnect.AQuery("SELECT dgmTypeAttributes.attributeID, attributeName, valueInt, valueFloat FROM dgmTypeAttributes LEFT JOIN dgmAttributeTypes ON dgmTypeAttributes.attributeID = dgmAttributeTypes.attributeID WHERE (((dgmTypeAttributes.typeID)= " + typeID1.Text + "))").Rows) { string[] attribute = new string[4]; attribute[0] = record[0].ToString(); attribute[1] = record[1].ToString(); attribute[2] = record[2].ToString(); attribute[3] = record[3].ToString(); ListViewItem attribute2 = new ListViewItem(attribute); itemAttributes.Items.Add(attribute2); } foreach (DataRow record in DBConnect.AQuery("SELECT attributeName FROM dgmAttributeTypes ORDER BY attributeName").Rows) { attributeDescription.Items.Add(record[0].ToString()); } }