/// <summary> /// Handles the OnClick event of the cmdCompleteStage 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 cmdCompleteStage_OnClick(object sender, EventArgs e) { string stageContextValue = Request.Form[ResolveClientId(stageContext.ClientID)]; string[] args = stageContextValue.Split(new Char[] { ':' }); string spaid = args[0]; ISalesProcesses salesProcess = Sage.SalesLogix.SalesProcess.Helpers.GetSalesProcess(this.EntityContext.EntityID.ToString()); if (args[1] == "False") { string result = salesProcess.CanCompleteStage(spaid); if (result == string.Empty) { salesProcess.CompleteStage(spaid, DateTime.Now); salesProcess.Save(); } else { if (DialogService != null) { DialogService.ShowMessage(result); } return; } } else { salesProcess.UnCompleteStage(spaid); salesProcess.Save(); } }
/// <summary> /// Handles the OnClick event of the cmdCompleteStage 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 cmdCompleteStage_OnClick(object sender, EventArgs e) { string[] args = stageContext.Value.Split(':'); string spaid = args[0]; ISalesProcesses salesProcess = Helpers.GetSalesProcess(EntityContext.EntityID.ToString()); if (args[1] == "False") { string result = salesProcess.CanCompleteStage(spaid); if (result == string.Empty) { salesProcess.CompleteStage(spaid, DateTime.Now); salesProcess.Save(); } else { if (DialogService != null) { DialogService.ShowMessage(result); } } } else { salesProcess.UnCompleteStage(spaid); salesProcess.Save(); } }