/// <summary>
    /// Handles the OnClick event of the cmdCompleteDate 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 cmdCompleteDate_OnClick(object sender, EventArgs e)
    {
        string contextValue = completeDateContext.Value;

        string[]        args         = contextValue.Split(new Char[] { ':' });
        string          spaid        = args[0];
        DateTime        completeDate = ResolveDateTime(args[1]);
        ISalesProcesses salesProcess = Helpers.GetSalesProcess(this.EntityContext.EntityID.ToString());

        string result = salesProcess.CanCompleteStep(spaid);

        if (result == string.Empty)
        {
            salesProcess.CompleteStep(spaid, completeDate);
            salesProcess.Save();
        }
        else
        {
            if (DialogService != null)
            {
                DialogService.ShowMessage(result);
            }
            return;
        }
        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        refresher.RefreshAll();
    }
    /// <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();
        }

        if (ddlStages.SelectedItem != null)
        {
            if (ddlStages.SelectedItem.Value != salesProcess.CurrentStageId)
            {
                ddlStages.SelectedIndex = ddlStages.Items.IndexOf(ddlStages.Items.FindByValue(salesProcess.CurrentStageId));
            }
        }

        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        refresher.RefreshAll();

        this.UpdateSnapShot();
    }