/// <summary> /// Handles the OnClick event of the cmdCompleteStep control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void cmdCompleteStep_OnClick(object sender, EventArgs e) { string stepContextValue = stepContext.Value; string[] args = stepContextValue.Split(new Char[] { ':' }); string spaid = args[0]; ISalesProcesses salesProcess = Helpers.GetSalesProcess(this.EntityContext.EntityID.ToString()); if (args[1] == "False") { string result = salesProcess.CanCompleteStep(spaid); if (result == string.Empty) { salesProcess.CompleteStep(spaid, DateTime.Now); salesProcess.Save(); } else { if (DialogService != null) { DialogService.ShowMessage(result); } return; } } else { salesProcess.UnCompleteStep(spaid); salesProcess.Save(); } IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>(); refresher.RefreshAll(); }