private void button_EditDetails_Click(object sender, EventArgs e) { var dataIndex = -1; if (dataGridView_Details.SelectedRows.Count != 0 || dataGridView_Details.SelectedCells.Count != 0) { dataIndex = dataGridView_Details.CurrentCell.RowIndex; } if (dataIndex == -1) { return; } var detailID = Int32.Parse(dataGridView_Details.Rows[dataIndex].Cells["DetailID"].Value.ToString()); var results = DatabaseManager.GetDetail(detailID).Rows[0]; var activeEntity = Convert.ToString(results["ActiveEntity"]); var passiveEntity = Convert.ToString(results["PassiveEntity"]); var amount = Convert.ToString(results["Amount"]); var timer = Convert.ToString(results["Timer"]); var action = Convert.ToInt32(results["Action"]); DetailForm detailForm = new DetailForm(activeEntity, action, passiveEntity, amount, timer, String.Empty); if (detailForm.ShowDialog() == DialogResult.OK) { EditDetail(GetQuestID(), detailID, detailForm.ActiveEntity, detailForm.Action, detailForm.Amount, detailForm.Timer, detailForm.PassiveEntity); } }
private void button_AddDetails_Click(object sender, EventArgs e) { DetailForm detailForm = new DetailForm(); if (detailForm.ShowDialog() == DialogResult.OK) { CreateDetail(GetStepID(), detailForm.ActiveEntity, detailForm.Action, detailForm.Amount, detailForm.Timer, detailForm.PassiveEntity); } }