Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/Simplic.FileStructure.Workflow.UI/ForwardWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ namespace Simplic.FileStructure.Workflow.UI
/// </summary>
public partial class ForwardWindow : DefaultRibbonWindow
{
/// <summary>
/// Gets or sets a boolean
/// It's true when the forward window will be saved, otherwise always false.
/// </summary>
public bool IsSave { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a property, wich should not be placed above the constructor.
Also the naming is kinda weird.
And it feels weird that this is even required. Should'nt the save logig be executed in the on save?


/// <summary>
/// Create multi-itembox.
/// </summary>
Expand All @@ -19,5 +25,15 @@ public ForwardWindow(Dictionary<string, string> dictParams)
InitializeComponent();
DataContext = new ForwardViewModel(dictParams);
}

/// <summary>
/// Saves the window and set a boolean is save to true.
/// </summary>
/// <param name="e"></param>
public override void OnSave(WindowSaveEventArg e)
{
IsSave = true;
base.OnSave(e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public static GridInvokeMethodResult ForwardCopyTo(GridFunctionParameter paramet
private static IList<WorkflowOperation> WorkflowOperationsGet(GridFunctionParameter parameter)
{
IList<WorkflowOperation> workflowOperations = new List<WorkflowOperation>();
Checkout(parameter);


if (parameter.SelectedRows.Count == 0)
return null;
Expand All @@ -175,6 +175,9 @@ private static IList<WorkflowOperation> WorkflowOperationsGet(GridFunctionParame
ObservableCollection<IMultiSelectionComboBoxItem> itemList = null;
var commentText = "";

if (!win.IsSave)
return null;

if (windowDataContext is ForwardViewModel forwardViewModel)
{
itemList = forwardViewModel.MultiItemboxItems;
Expand Down Expand Up @@ -246,13 +249,14 @@ private static IList<WorkflowOperation> WorkflowOperationsGet(GridFunctionParame
}
}
}
Checkout(parameter);
return workflowOperations;
}

private static IList<WorkflowOperation> WorkflowOperationsItemBoxGet(GridFunctionParameter parameter)
{
IList<WorkflowOperation> workflowOperations = new List<WorkflowOperation>();
Checkout(parameter);


Guid? workflowOrganizationId = null;
int targetUserId = 0;
Expand Down Expand Up @@ -316,6 +320,7 @@ private static IList<WorkflowOperation> WorkflowOperationsItemBoxGet(GridFunctio
Framework.Extension.InstanceDataComment.Singleton.Create(comment);
}
}
Checkout(parameter);
return workflowOperations;
}

Expand Down