Пример #1
0
 protected void grdReseller_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         IOpportunity opportunity = (IOpportunity)e.Row.DataItem;
         //Sales Potential
         Sage.SalesLogix.Web.Controls.Currency curr = (Sage.SalesLogix.Web.Controls.Currency)e.Row.Cells[2].Controls[1];
         curr.ExchangeRate = opportunity.ExchangeRate.GetValueOrDefault(1);
         curr.CurrentCode  = opportunity.ExchangeRateCode;
     }
 }
Пример #2
0
    protected void grdProducts_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        string oppCurrencyCode;

        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            // added for automation testing
            e.Row.Attributes.Add("id", string.Format("node_{0}", ((IProduct)((IOpportunityProduct)e.Row.DataItem).Product).Id));

            IUserOptionsService userOption = ApplicationContext.Current.Services.Get <IUserOptionsService>();
            if (userOption != null)
            {
                oppCurrencyCode = userOption.GetCommonOption("lveCurrency", "OpportunityDefaults");
                if (string.IsNullOrEmpty(oppCurrencyCode))
                {
                    oppCurrencyCode = "USD";
                }
                IExchangeRate rate = EntityFactory.GetById <IExchangeRate>(oppCurrencyCode);

                // Calculated Price
                Sage.SalesLogix.Web.Controls.Currency curr =
                    (Sage.SalesLogix.Web.Controls.Currency)e.Row.FindControl("curCalcPriceMC");
                if (curr != null)
                {
                    curr.ExchangeRate = rate.Rate.GetValueOrDefault(1);
                    curr.CurrentCode  = rate.Id.ToString();
                }

                //Extended Price
                Sage.SalesLogix.Web.Controls.Currency curExtPriceMC = (Sage.SalesLogix.Web.Controls.Currency)e.Row.FindControl("curExtPriceMC");
                if (curExtPriceMC != null)
                {
                    curExtPriceMC.ExchangeRate = rate.Rate.GetValueOrDefault(1);
                    curExtPriceMC.CurrentCode  = rate.Id.ToString();
                }
            }
        }
    }