private void copyItemRClkBtn_Click(object sender, EventArgs e) { DataTable FindNewID = DBConnect.AQuery("SELECT max(typeID) from invTypes"); int newid = 0; foreach (DataRow record in FindNewID.Rows) { newid = Convert.ToInt16(record[0].ToString()) + 1; } foreach (ListViewItem SelectedItem in ItemList.SelectedItems) { int typeID = Convert.ToInt16(SelectedItem.SubItems[0].Text); DBConnect.SQuery("INSERT INTO invTypes(typeID, groupID, typeName, description, graphicID, radius, mass, volume, capacity, portionSize, raceID, basePrice, published, marketGroupID, chanceOfDuplicating) SELECT '" + newid + "', groupID, concat('Copy of ', typeName), description, graphicID, radius, mass, volume, capacity, portionSize, raceID, basePrice, published, marketGroupID, chanceOfDuplicating from invTypes WHERE typeID = '" + typeID + "'"); DBConnect.SQuery("INSERT INTO dgmTypeAttributes SELECT '" + newid + "', attributeID, valueInt, valueFloat from dgmTypeAttributes WHERE typeID = '" + typeID + "'"); DBConnect.SQuery("INSERT INTO invShipTypes SELECT '" + newid + "', weapontypeID, miningtypeID, skilltypeID from invShipTypes WHERE shiptypeID = '" + typeID + "'"); DBConnect.SQuery("INSERT INTO dgmTypeEffects SELECT '" + newid + "', effectID, isDefault from dgmTypeEffects WHERE typeID = '" + typeID + "'"); } CategoryDropdown_SelectedIndexChanged(null, null); itemAddEdit add = new itemAddEdit(); add.Show(); add.extractItemInfo(newid); }
private void button7_Click(object sender, EventArgs e) { if (SelectedOretypeID.Text != "") { itemAddEdit add = new itemAddEdit(); add.Show(); add.extractItemInfo(Convert.ToInt16(SelectedOretypeID.Text)); } }
private void editItemBtn_Click(object sender, EventArgs e) { itemAddEdit add = new itemAddEdit(); add.Show(); add.extractItemInfo(int.Parse(ItemList.SelectedItems[0].SubItems[0].Text)); }
private void ItemList_DblClick(object sender, EventArgs e) { foreach (ListViewItem SelectedItem in ItemList.SelectedItems) { itemAddEdit add = new itemAddEdit(); add.Show(); add.extractItemInfo(int.Parse(ItemList.SelectedItems[0].SubItems[0].Text)); } }
private void button4_Click(object sender, EventArgs e) { itemAddEdit add = new itemAddEdit(); add.Show(); add.extractItemInfo(int.Parse(itemID.Text)); }