private void btnCopyValueSet_Click(object sender, EventArgs e) { PxValueSet source = (PxValueSet)pxValueSetBindingSource.DataSource; PxValueSet copy = new PxValueSet() { Valueset = "Copy_of_" + source.Valueset, Elimination = source.Elimination, PresText = source.PresText, PresTextEnglish = source.PresTextEnglish, ValuePool = source.ValuePool, ValuePres = source.ValuePres, }; List <PxValue> values = (List <PxValue>)dgwValues.DataSource; foreach (var val in values) { copy.Values.Add(new PxValue() { ValueCode = val.ValueCode, ValueText = val.ValueText, ValueTextEnglish = val.ValueTextEnglish, Footnote = "N" }); } CreateValueSetDialog dlg = new CreateValueSetDialog(); dlg.SelectedValueSet = copy; dlg.ShowDialog(); }
private void btnNewValueSet_Click(object sender, EventArgs e) { CreateValueSetDialog dlg = new CreateValueSetDialog(); dlg.SelectedValueSet = new Model.PxValueSet(); dlg.ShowDialog(); }
private void btnCopyValueSet_Click(object sender, EventArgs e) { PxValueSet source = (PxValueSet)pxValueSetBindingSource.DataSource; PxValueSet copy = new PxValueSet() { Valueset = "Copy_of_" + source.Valueset, Elimination = source.Elimination, PresText = source.PresText, PresTextEnglish = source.PresTextEnglish, ValuePool = source.ValuePool, ValuePres = source.ValuePres, }; List<PxValue> values = (List<PxValue>)dgwValues.DataSource; foreach (var val in values) { copy.Values.Add(new PxValue() { ValueCode = val.ValueCode, ValueText = val.ValueText, ValueTextEnglish = val.ValueTextEnglish , Footnote = "N"}); } CreateValueSetDialog dlg = new CreateValueSetDialog(); dlg.SelectedValueSet = copy; dlg.ShowDialog(); }