|
@@ -647,10 +647,37 @@ public class Module
|
|
|
MessageBox.Show("Please select a setout first.");
|
|
|
return;
|
|
|
}
|
|
|
- Document.Approved = !Document.Approved;
|
|
|
- new Client<StagingSetoutDocument>().Save(Document, "");
|
|
|
- refreshing = true;
|
|
|
- stagingSetoutGrid.Refresh(false, true);
|
|
|
+ if (selectedSetouts.Count > 1)
|
|
|
+ {
|
|
|
+ var msg = Document.Approved
|
|
|
+ ? "Bulk unapprove?"
|
|
|
+ : "Bulk approve? (Skip individual setout approval)";
|
|
|
+ if (MessageBox.Show(msg, "Continue?", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
|
|
|
+ {
|
|
|
+ Progress.Show("Approving Setouts..");
|
|
|
+ var documents = Client.Query(
|
|
|
+ new Filter<StagingSetoutDocument>(x => x.EntityLink.ID).InList(selectedSetouts.Select(x => x.ID).ToArray()),
|
|
|
+ new Columns<StagingSetoutDocument>(x => x.ID, x => x.Approved)
|
|
|
+ ).ToObjects<StagingSetoutDocument>().ToList();
|
|
|
+ foreach(var document in documents)
|
|
|
+ {
|
|
|
+ document.Approved = !Document.Approved;
|
|
|
+ }
|
|
|
+ Client.Save(documents, "Approved by user.");
|
|
|
+
|
|
|
+ Progress.Close();
|
|
|
+
|
|
|
+ refreshing = true;
|
|
|
+ stagingSetoutGrid.Refresh(false, true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Document.Approved = !Document.Approved;
|
|
|
+ new Client<StagingSetoutDocument>().Save(Document, "");
|
|
|
+ refreshing = true;
|
|
|
+ stagingSetoutGrid.Refresh(false, true);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void OnMarkupSelected()
|