private void tsmiAddDiscountCard_Click(object sender, EventArgs e) { System.Data.DataRow new_crd = this.cards.NewRow(); EditDiscountCardForm edcf = new EditDiscountCardForm(this.cConnection, ref new_crd); if (edcf.ShowDialog() == DialogResult.OK){ this.cards.Rows.Add(new_crd); this.AddNewRow(this.lvDiscountCards.Items.Count, new_crd); } return; }
private void EditDiscountCard() { if (this.lvDiscountCards.SelectedItems.Count > 0){ int idx = this.lvDiscountCards.SelectedIndices[0]; System.Data.DataRow crd = this.cards.Rows[idx]; if (crd != null){ EditDiscountCardForm edcf = new EditDiscountCardForm(this.cConnection, ref crd); if (edcf.ShowDialog() == DialogResult.OK) { } }else{ MessageBox.Show("Ошибка, карта не найдена!"); } } return; }