private void butAdd_Click(object sender,EventArgs e) { FormFormularyEdit FormF=new FormFormularyEdit(); FormF.FormularyCur=new Formulary(); Formularies.Insert(FormF.FormularyCur); FormF.IsNew=true; FormF.ShowDialog(); if(FormF.DialogResult!=DialogResult.OK) { FormularyMeds.DeleteMedsForFormulary(FormF.FormularyCur.FormularyNum); Formularies.Delete(FormF.FormularyCur.FormularyNum); return; } FillList(); }
private void butAdd_Click(object sender, EventArgs e) { FormFormularyEdit FormF = new FormFormularyEdit(); FormF.FormularyCur = new Formulary(); Formularies.Insert(FormF.FormularyCur); FormF.IsNew = true; FormF.ShowDialog(); if (FormF.DialogResult != DialogResult.OK) { FormularyMeds.DeleteMedsForFormulary(FormF.FormularyCur.FormularyNum); Formularies.Delete(FormF.FormularyCur.FormularyNum); return; } FillList(); }
private void listMain_DoubleClick(object sender, EventArgs e) { if (listMain.SelectedIndex == -1) { return; } if (IsSelectionMode) { SelectedFormularyNum = ListFormularies[listMain.SelectedIndex].FormularyNum; DialogResult = DialogResult.OK; return; } FormFormularyEdit FormF = new FormFormularyEdit(); FormF.FormularyCur = ListFormularies[listMain.SelectedIndex]; FormF.ShowDialog(); if (FormF.DialogResult != DialogResult.OK) { return; } FillList(); }
private void listMain_DoubleClick(object sender,EventArgs e) { if(listMain.SelectedIndex==-1) { return; } if(IsSelectionMode) { SelectedFormularyNum=ListFormularies[listMain.SelectedIndex].FormularyNum; DialogResult=DialogResult.OK; return; } FormFormularyEdit FormF=new FormFormularyEdit(); FormF.FormularyCur=ListFormularies[listMain.SelectedIndex]; FormF.ShowDialog(); if(FormF.DialogResult!=DialogResult.OK) { return; } FillList(); }