// SSI JKL 09/30/2011
 // Fix Praxi issue...also, did not rename Praxi control b/c it may be referenced in code elsewhere...
 // When a user edits an Opportunity Service (Product) and changes the Status, the Close Probability must be updated according the chart in the Requirements Document under 103.5.0 circa page 401...
 public static void QFTextBox_OnChangeStep(IEditOpportunityProduct form,  EventArgs args)
 {
     Sage.Entity.Interfaces.IOpportunityProduct objOpportunityProduct = form.CurrentEntity as Sage.Entity.Interfaces.IOpportunityProduct;
     if (objOpportunityProduct != null) {
         switch (objOpportunityProduct.Status.ToString().ToUpper().Trim()) {
             // Execution...
             case "EXECUTION":
                 objOpportunityProduct.CloseProbability = 100;
                 break;
             // Early Shopping...
             case "EARLY SHOPPING":
                 objOpportunityProduct.CloseProbability = 50;
                 break;
             // Satisfaction...
             case "SATISFACTION":
                 objOpportunityProduct.CloseProbability = 20;
                 break;
             // Late Shopping...
             case "LATE SHOPPING":
                 objOpportunityProduct.CloseProbability = 80;
                 break;
             // Apprehension...
             case "APPREHENSION":
                 objOpportunityProduct.CloseProbability = 95;
                 break;
             // Closed - Lost...
             case "CLOSED - LOST":
                 objOpportunityProduct.CloseProbability = 0;
                 break;
         }
         objOpportunityProduct.Save();
     }
 }
 /// <summary>
 /// Updates the opportunity products price based on a change of the multi currency pricing value.
 /// The updated is based on the value changed divided by the exchange rate. This event is only
 /// called when multi-currency is enabled.
 /// </summary>
 /// <param name="form">the instance of the EditOpportunityProduct dialog</param>
 /// <param name="args">empty</param>		
 public static void curMCCalcPrice_OnChangeStep(IEditOpportunityProduct form, EventArgs args)
 {
     IOpportunityProduct opportunityProduct = form.CurrentEntity as IOpportunityProduct;
     if (opportunityProduct != null)
     {
         double exchangeRate = opportunityProduct.Opportunity.ExchangeRate.HasValue
                                   ? opportunityProduct.Opportunity.ExchangeRate.Value
                                   : 1;
         form.curMCCalcPrice.CurrentCode = opportunityProduct.Opportunity.ExchangeRateCode;
         string price = String.IsNullOrEmpty(form.curMCCalcPrice.Text) ? "0" : form.curMCCalcPrice.Text;
         opportunityProduct.CalculatedPrice = (decimal?) (Convert.ToDouble(price)/exchangeRate);
         opportunityProduct.CalculateCalcPrice();
     }
 }
Beispiel #3
0
        /// <summary>
        /// Updates the opportunity products price based on a change of the multi currency pricing value.
        /// The updated is based on the value changed divided by the exchange rate. This event is only
        /// called when multi-currency is enabled.
        /// </summary>
        /// <param name="form">the instance of the EditOpportunityProduct dialog</param>
        /// <param name="args">empty</param>
        public static void curMCCalcPrice_OnChangeStep(IEditOpportunityProduct form, EventArgs args)
        {
            IOpportunityProduct opportunityProduct = form.CurrentEntity as IOpportunityProduct;

            if (opportunityProduct != null)
            {
                double exchangeRate = opportunityProduct.Opportunity.ExchangeRate.HasValue
                                          ? opportunityProduct.Opportunity.ExchangeRate.Value
                                          : 1;
                form.curMCCalcPrice.CurrentCode = opportunityProduct.Opportunity.ExchangeRateCode;
                string price = String.IsNullOrEmpty(form.curMCCalcPrice.Text) ? "0" : form.curMCCalcPrice.Text;
                opportunityProduct.CalculatedPrice = (decimal?)(Convert.ToDouble(price) / exchangeRate);
                opportunityProduct.CalculateCalcPrice();
            }
        }