private void BtnAdd_Click(object sender, EventArgs e) { BetRuleAddForm betRuleAddForm = new BetRuleAddForm(); if (betRuleAddForm.ShowDialog() == DialogResult.OK) { String[] strItem = new String[] { CommonFunction.GameResultToString(betRuleAddForm.GetGameResult()), betRuleAddForm.GetBetValue().ToString() }; ListViewItem item = new ListViewItem(strItem); listView.Items.Add(item); } }
private void BtnMod_Click(object sender, EventArgs e) { if (listView.SelectedItems.Count > 0) { BetRuleAddForm betRuleAddForm = new BetRuleAddForm(); ListViewItem item = listView.SelectedItems[0]; betRuleAddForm.SetGameResult(CommonFunction.StringToGameResult(item.SubItems[0].Text)); betRuleAddForm.SetBetValue(Int32.Parse(item.SubItems[1].Text)); if (betRuleAddForm.ShowDialog() == DialogResult.OK) { item.SubItems[0].Text = CommonFunction.GameResultToString(betRuleAddForm.GetGameResult()); item.SubItems[1].Text = betRuleAddForm.GetBetValue().ToString(); } } }