|
@@ -1,8 +1,6 @@
|
|
|
using System;
|
|
|
using System.Linq;
|
|
|
-using System.Windows.Controls;
|
|
|
using Comal.Classes;
|
|
|
-using InABox.Clients;
|
|
|
using InABox.Core;
|
|
|
using InABox.DynamicGrid;
|
|
|
using InABox.WPF;
|
|
@@ -26,6 +24,16 @@ namespace PRSDesktop
|
|
|
ActionColumns.Add(new DynamicImageColumn(PRSDesktop.Resources.pencil.AsBitmapImage(), EditAction));
|
|
|
}
|
|
|
|
|
|
+ protected override void DoReconfigure(FluentList<DynamicGridOption> options)
|
|
|
+ {
|
|
|
+ base.DoReconfigure(options);
|
|
|
+ options
|
|
|
+ .BeginUpdate()
|
|
|
+ .Add(DynamicGridOption.SelectColumns)
|
|
|
+ .Add(DynamicGridOption.FilterRows)
|
|
|
+ .EndUpdate();
|
|
|
+ }
|
|
|
+
|
|
|
public Job Job { get; set; }
|
|
|
|
|
|
public JobPanelSettings Settings { get; set; }
|
|
@@ -57,32 +65,4 @@ namespace PRSDesktop
|
|
|
return result;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- public class JobFormDefinitionGrid : DynamicManyToManyGrid<JobFormDefinition, Job>
|
|
|
- {
|
|
|
- public JobFormDefinitionGrid()
|
|
|
- {
|
|
|
- AddButton("Add All", null, AddAllClick);
|
|
|
- }
|
|
|
-
|
|
|
- private bool AddAllClick(Button arg1, CoreRow[] arg2)
|
|
|
- {
|
|
|
- var existingforms = ExtractValues(x => x.Form.ID, Selection.All).ToArray();
|
|
|
- var newforms = new Client<DigitalForm>().Query(
|
|
|
- new Filter<DigitalForm>(x => x.Active).IsEqualTo(true)
|
|
|
- .And(x => x.AppliesTo).IsEqualTo("Job")
|
|
|
- .And(x => x.ID).NotInList(existingforms)
|
|
|
- );
|
|
|
- foreach (var row in newforms.Rows)
|
|
|
- {
|
|
|
- var newitem = CreateItem();
|
|
|
- newitem.Job.ID = Item.ID;
|
|
|
- newitem.Form.ID = row.Get<DigitalForm, Guid>(x => x.ID);
|
|
|
- newitem.Form.Synchronise(row.ToObject<DigitalForm>());
|
|
|
- SaveItem(newitem);
|
|
|
- }
|
|
|
-
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
}
|