/// <summary> /// Saves data of edited source point from controls to edited object. /// </summary> /// <param name="validateData">Indicates whether form data should be validated prior to save</param> public void SaveData(bool validateData) { if (Visible && !StopProcessing) { if (!validateData || ValidateData()) { var graphName = QueryHelper.GetString("graph", String.Empty); if (CurrentSourcePoint == null) { // Create new source point SourcePoint sp = WorkflowHelper.CreateSourcePoint(CurrentWorkflow.WorkflowType, CurrentStepInfo.StepType); SetValues(sp); // AddSourcePoint saves the workflow step to database CurrentStepInfo.AddSourcePoint(sp); SourcePointGuid = sp.Guid; if (String.IsNullOrEmpty(AfterCreateRedirectURL)) { ShowChangesSaved(); } else { var queryString = $"?workflowstepid={CurrentStepInfo.StepID}&sourcepointGuid={SourcePointGuid}&graph={graphName}&saved=1"; URLHelper.Redirect(UrlResolver.ResolveUrl(URLHelper.AppendQuery(AfterCreateRedirectURL, queryString))); } } else { // Edit existing source point if (CurrentSourcePoint.Label != txtLabel.Text.Trim()) { // Refresh header ScriptHelper.RefreshTabHeader(Page); } SetValues(CurrentSourcePoint); WorkflowScriptHelper.RefreshDesignerFromDialog(Page, CurrentStepInfo.StepID, graphName); } } } }
/// <summary> /// Saves data of edited source point from controls to edited object. /// </summary> /// <param name="validateData">Indicates whether form data should be validated prior to save</param> public void SaveData(bool validateData) { if (Visible && !StopProcessing) { if (!validateData || ValidateData()) { if (CurrentSourcePoint == null) { // Create new source point SourcePoint sp = WorkflowHelper.CreateSourcePoint(CurrentStepInfo.StepType); SetValues(sp); // AddSourcePoint saves the workflow step to database CurrentStepInfo.AddSourcePoint(sp); SourcePointGuid = sp.Guid; if (String.IsNullOrEmpty(AfterCreateRedirectURL)) { ShowChangesSaved(); } else { URLHelper.Redirect(URLHelper.AppendQuery(AfterCreateRedirectURL, String.Format("?workflowstepid={0}&sourcepointguid={1}&saved=1", WorkflowStepId, SourcePointGuid))); } } else { // Edit existing source point if (CurrentSourcePoint.Label != txtLabel.Text.Trim()) { // Refresh header ScriptHelper.RefreshTabHeader(Page, null); } SetValues(CurrentSourcePoint); } } } }