|
@@ -26,8 +26,25 @@ namespace PRSDesktop
|
|
|
{
|
|
|
base.DoReconfigure(options);
|
|
|
options.AddRange(DynamicGridOption.RecordCount, DynamicGridOption.SelectColumns, DynamicGridOption.FilterRows);
|
|
|
-
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
+ protected override void DeleteItems(params CoreRow[] rows)
|
|
|
+ {
|
|
|
+ base.DeleteItems(rows);
|
|
|
+
|
|
|
+ var row = rows.FirstOrDefault(x => x.Get<JobScope, Guid>(x => x.Job.DefaultScope.ID) == x.Get<JobScope, Guid>(x => x.ID));
|
|
|
+ if (row is not null)
|
|
|
+ {
|
|
|
+ var job = Client.Query(
|
|
|
+ new Filter<Job>(x => x.ID).IsEqualTo(row.Get<JobScope, Guid>(x => x.Job.ID)),
|
|
|
+ new Columns<Job>(x => x.ID).Add(x => x.DefaultScope.ID)
|
|
|
+ ).Rows.FirstOrDefault()?.ToObject<Job>();
|
|
|
+ if (job != null)
|
|
|
+ {
|
|
|
+ job.DefaultScope.ID = row.Get<JobScope, Guid>(x => x.ID);
|
|
|
+ Client.Save(job, "Updated Default Scope");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private BitmapImage? IsDefaultImage(CoreRow? row)
|