private void butAdd_Click(object sender, System.EventArgs e) { RxDef RxDefCur = new RxDef(); RxDefs.Insert(RxDefCur); //It gets deleted if user clicks cancel FormRxDefEdit FormE = new FormRxDefEdit(RxDefCur); FormE.IsNew = true; FormE.ShowDialog(); FillGrid(); }
private void butAdd2_Click(object sender, System.EventArgs e) { if (gridMain.GetSelectedIndex() == -1) { MessageBox.Show(Lan.g(this, "Please select item first")); return; } RxDef RxDefCur = RxDefList[gridMain.GetSelectedIndex()].Copy(); RxDefs.Insert(RxDefCur); //Now it has a new id. It gets deleted if user clicks cancel. Alerts not copied. FormRxDefEdit FormE = new FormRxDefEdit(RxDefCur); FormE.IsNew = true; FormE.ShowDialog(); FillGrid(); }