/// <summary>
 /// Sets the snap shot.
 /// </summary>
 /// <param name="stage">The stage.</param>
 private void SetSnapShot(ISalesProcessAudit stage)
 {
     if (stage != null)
     {
         valueCurrnetStage.Text    = stage.StageName;
         valueProbabilty.Text      = stage.Probability + "%";
         valueDaysInStage.Text     = Convert.ToString(_salesProcess.DaysInStage(stage.Id.ToString()));
         valueEstDays.Text         = Convert.ToString(_salesProcess.EstimatedDaysToClose());
         dtpEstClose.DateTimeValue = _salesProcess.EstimatedCloseDate();
     }
     else
     {
         valueCurrnetStage.Text    = "''";
         valueProbabilty.Text      = "0%";
         valueDaysInStage.Text     = "0";
         valueEstDays.Text         = "0";
         dtpEstClose.DateTimeValue = DateTime.MinValue;
         dtpEstClose.Text          = string.Empty;
     }
 }
Ejemplo n.º 2
0
        public static OpportunityRepresentation from(IOpportunity opp)
        {
            OpportunityRepresentation or = new OpportunityRepresentation();

            or.ID                    = opp.Id.ToString();
            or.Description           = opp.Description;
            or.EstimatedClose        = opp.EstimatedClose ?? DateTime.Now;
            or.Potential             = opp.SalesPotential ?? 0;
            or.Probability           = opp.CloseProbability ?? 0;
            or.Stage                 = opp.Stage;
            or.NextStep              = opp.NextStep;
            or.DaysSinceLastActivity = opp.DaysSinceLastActivity;
            IActivity act = getNextActivity(opp.Id.ToString());

            if (act != null)
            {
                or.NextActivityId   = act.Id.ToString();
                or.NextActivityName = String.Format("{0} &lt;{1}&gt;", (act.Description ?? ""), act.StartDate.ToShortDateString());
            }
            ISalesProcesses sp = Sage.SalesLogix.SalesProcess.Helpers.GetSalesProcess(opp.Id.ToString());

            if (sp != null)
            {
                IList <ISalesProcessAudit> list = sp.GetSalesProcessAudits();
                foreach (ISalesProcessAudit spa in list)
                {
                    if ((spa.ProcessType == "STAGE") && (spa.IsCurrent != null) && ((bool)spa.IsCurrent))
                    {
                        or.DaysInStage = sp.DaysInStage(spa.StageId);
                        //break;
                    }
                    if ((spa.ProcessType == "STEP") && (spa.IsCurrent != null) && ((bool)spa.IsCurrent))
                    {
                        or.NextStep = spa.StepName;
                    }
                }
            }
            return(or);
        }