1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using Comal.Classes;
- using InABox.Core;
- using InABox.DynamicGrid;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace PRSDesktop
- {
- class DigitalFormSubscriptionsGrid : DynamicOneToManyGrid<Employee, EmployeeFormSubscription>
- {
- protected override void Init()
- {
- base.Init();
- HiddenColumns.Add(x => x.Form.ID);
- }
- protected override void DoAdd(bool OpenEditorOnDirectEdit = false)
- {
- var formIDs = Items.Select(x => x.Form.ID).ToArray();
- var dlg = new MultiSelectDialog<DigitalForm>(new Filter<DigitalForm>(x => x.ID).NotInList(formIDs), null, true);
- if (dlg.ShowDialog())
- {
- var items = dlg.Items(null);
- foreach(var item in items)
- {
- var newItem = CreateItem();
- newItem.Form.ID = item.ID;
- newItem.Form.Synchronise(item);
- SaveItem(newItem);
- }
- Refresh(false, true);
- }
- }
- }
- }
|