示例#1
0
        public IEnumerable<object> EditElements(IEnumerable<object> elementsToEdit)
        {
            List<object> result = new List<object>();
            foreach (var dto in elementsToEdit.Cast<ObjectView<ClaimDTO>>().Select(v => v.Object))
            {
                try
                {
                    var dialog = new AddOrEditClaimForm(this, dto);
                    dialog.ShowDialog(_parent);
                    if(dialog.AddedObject!=null)
                        result.Add(dialog.AddedObject);
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            return result;
        }
示例#2
0
 public object AddElement()
 {
     var dialog = new AddOrEditClaimForm(this, null);
     dialog.ShowDialog(_parent);
     return dialog.AddedObject;
 }