/// <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();
    }
Esempio n. 2
0
    /// <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();
        }
    }
    /// <summary>
    /// Handles the SelectedIndexChanged event of the ddlStages 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 ddlStages_SelectedIndexChanged(object sender, EventArgs e)
    {
        object manageStagesDialog = Page.Session["MANAGESTAGESACTIVE"];

        if (manageStagesDialog != null)
        {
            return;
        }

        string          stageId      = ddlStages.SelectedItem.Value;
        ISalesProcesses salesProcess = Helpers.GetSalesProcess(this.EntityContext.EntityID.ToString());
        string          result       = salesProcess.CanMoveToStage(stageId);

        if (result == string.Empty)
        {
            salesProcess.SetToCurrentStage(stageId);
            salesProcess.Save();
        }
        else
        {
            if (DialogService != null)
            {
                DialogService.ShowMessage(result);
            }
        }
        IPanelRefreshService refresher = PageWorkItem.Services.Get <IPanelRefreshService>();

        refresher.RefreshAll();
    }
    /// <summary>
    /// Handles the OnClick event of the cmdStartDate 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 cmdStartDate_OnClick(object sender, EventArgs e)
    {
        string[]        args         = startDateContext.Value.Split(':');
        string          spaid        = args[0];
        DateTime        startDate    = ResolveDateTime(args[1]);
        ISalesProcesses salesProcess = Helpers.GetSalesProcess(EntityContext.EntityID.ToString());

        salesProcess.StartStage(spaid, startDate);
        salesProcess.Save();
    }
Esempio n. 6
0
    /// <summary>
    /// Handles the OnClick event of the cmdStartDate 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 cmdStartDate_OnClick(object sender, EventArgs e)
    {
        string contextValue = Request.Form[ResolveClientId(startDateContext.ClientID)];

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

        salesProcess.StartStage(spaid, startDate);
        salesProcess.Save();
    }
    /// <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[]        args         = completeDateContext.Value.Split(new Char[] { ':' });
        string          spaid        = args[0];
        DateTime        completeDate = ResolveDateTime(args[1]);
        ISalesProcesses salesProcess = Sage.SalesLogix.SalesProcess.Helpers.GetSalesProcess(EntityContext.EntityID.ToString());
        string          result       = salesProcess.CanCompleteStage(spaid);

        if (result == string.Empty)
        {
            salesProcess.CompleteStage(spaid, completeDate);
            salesProcess.Save();
        }
        else
        {
            if (DialogService != null)
            {
                DialogService.ShowMessage(result);
            }
        }
    }
    /// <summary>
    /// Handles the OnClick event of the cmdSetCurrent 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 cmdSetCurrent_OnClick(object sender, EventArgs e)
    {
        string[]        args         = currentContext.Value.Split(':');
        string          spaid        = args[0];
        ISalesProcesses salesProcess = Helpers.GetSalesProcess(EntityContext.EntityID.ToString());

        if (args[1] == "False")
        {
            string result = salesProcess.CanMoveToStage(spaid);
            if (result == string.Empty)
            {
                salesProcess.SetToCurrentStage(spaid);
                salesProcess.Save();
            }
            else
            {
                if (DialogService != null)
                {
                    DialogService.ShowMessage(result);
                }
            }
        }
    }