コード例 #1
0
    /// <summary>
    /// Sets the client select context.
    /// </summary>
    /// <param name="selectState">State of the select.</param>
    private void LoadClientSelects(IDictionary <string, bool> selectState)
    {
        ClientContextService clientContextService = PageWorkItem.Services.Get <ClientContextService>();

        if (clientContextService != null)
        {
            if (clientContextService.CurrentContext.ContainsKey("ct_selectedTargetsCtrlId"))
            {
                foreach (var value in Enumerable.Where(clientContextService.CurrentContext, value => value.Key == "ct_selectedTargetsCtrlId"))
                {
                    txtSelectedTargets.Value = value.Value;
                }
            }
            string clientContext = txtSelectedTargets.Value;
            if (!string.IsNullOrEmpty(clientContext))
            {
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.LoadXml(clientContext);
                XmlNodeList targetNodes = xmlDoc.DocumentElement.SelectNodes("//Targets/Target");
                foreach (XmlNode tn in targetNodes)
                {
                    string id       = tn.Attributes["Id"].Value;
                    string selected = tn.Attributes["Selected"].Value;
                    if (selectState.ContainsKey(id))
                    {
                        selectState.Remove(id);
                    }
                    selectState.Add(id, Convert.ToBoolean(selected));
                }
                txtSelectedTargets.Value = string.Empty;
            }
        }
    }
コード例 #2
0
    /// <summary>
    /// Override this method to add bindings to the currrently bound smart partmail
    /// </summary>
    protected override void OnAddEntityBindings()
    {
        BindingSource.Bindings.Add(new WebEntityBinding("CurrencyCode", lueCurrencyCode, "LookupResultValue"));
        BindingSource.Bindings.Add(new WebEntityBinding("Freight", curShipping, "Text"));
        BindingSource.Bindings.Add(new WebEntityBinding("Freight", curMyShipping, "Text"));
        BindingSource.Bindings.Add(new WebEntityBinding("Freight", curBaseShipping, "Text"));
        BindingSource.Bindings.Add(new WebEntityBinding("OrderTotal", curSubTotal, "Text"));
        BindingSource.Bindings.Add(new WebEntityBinding("OrderTotal", curMySubTotal, "Text"));
        BindingSource.Bindings.Add(new WebEntityBinding("ExchangeRate", numExchangeRateValue, "Text"));
        BindingSource.Bindings.Add(new WebEntityBinding("ExchangeRateDate", dtpExchangeRateDate, "DateTimeValue", String.Empty, null));

        ClientContextService clientcontext = PageWorkItem.Services.Get <ClientContextService>();

        if (clientcontext != null)
        {
            if (clientcontext.CurrentContext.ContainsKey(EntityPage.CONST_PREVIOUSENTITYIDKEY))
            {
                foreach (IEntityBinding binding in BindingSource.Bindings)
                {
                    WebEntityBinding pBinding = binding as WebEntityBinding;
                    if (pBinding != null)
                    {
                        pBinding.IgnoreControlChanges = true;
                    }
                }
            }
        }
    }
コード例 #3
0
    /// <summary>
    /// Override this method to add bindings to the currently bound smart part
    /// </summary>
    protected override void OnAddEntityBindings()
    {
        BindingSource.Bindings.Add(new WebEntityBinding("ExchangeRateCode", lueCurrencyCode, "LookupResultValue", String.Empty, null));
        BindingSource.Bindings.Add(new WebEntityBinding("Weighted", curBaseWeighted, "Text"));
        BindingSource.Bindings.Add(new WebEntityBinding("Weighted", curWeighted, "Text"));
        BindingSource.Bindings.Add(new WebEntityBinding("Weighted", curMyCurWeighted, "Text"));
        BindingSource.Bindings.Add(new WebEntityBinding("ExchangeRate", numExchangeRateValue, "Text"));
        BindingSource.Bindings.Add(new WebEntityBinding("ExchangeRateDate", dtpExchangeRateDate, "DateTimeValue", String.Empty, null));
        BindingSource.Bindings.Add(new WebEntityBinding("Type", pklType, "PickListValue"));
        BindingSource.Bindings.Add(new WebEntityBinding("LeadSource", lueLeadSourceOpen, "LookupResultValue"));
        BindingSource.Bindings.Add(new WebEntityBinding("ExchangeRateLocked", chkLockRate, "Checked"));

        //Open Opportunity
        BindingSource.Bindings.Add(new WebEntityBinding("SalesPotential", curOpenBaseSalesPotential, "Text"));
        BindingSource.Bindings.Add(new WebEntityBinding("SalesPotential", curOpenSalesPotential, "Text"));
        BindingSource.Bindings.Add(new WebEntityBinding("SalesPotential", curMyCurSalesPotential, "Text"));
        BindingSource.Bindings.Add(new WebEntityBinding("DateOpened", dtpDateOpened, "DateTimeValue", String.Empty, null));

        //Closed Won Opportunity
        BindingSource.Bindings.Add(new WebEntityBinding("ActualAmount", curActualWon, "Text"));
        BindingSource.Bindings.Add(new WebEntityBinding("ActualAmount", curMyCurActualWon, "Text"));
        BindingSource.Bindings.Add(new WebEntityBinding("ActualAmount", curBaseActualWon, "Text"));
        BindingSource.Bindings.Add(new WebEntityBinding("ActualClose", dtpClosedWonSummary, "DateTimeValue", String.Empty, null));
        BindingSource.Bindings.Add(new WebEntityBinding("Reason", pklReasonWon, "PickListValue"));

        //Closed Lost Opportunity
        BindingSource.Bindings.Add(new WebEntityBinding("ActualAmount", curPotentialLost, "Text"));
        BindingSource.Bindings.Add(new WebEntityBinding("ActualAmount", curMyCurPotentialLost, "Text"));
        BindingSource.Bindings.Add(new WebEntityBinding("ActualAmount", curBasePotentialLost, "Text"));
        BindingSource.Bindings.Add(new WebEntityBinding("ActualClose", dtpClosedLostSummary, "DateTimeValue", String.Empty, null));
        BindingSource.Bindings.Add(new WebEntityBinding("Reason", pklReasonLost, "PickListValue"));

        ClientContextService clientcontext = PageWorkItem.Services.Get <ClientContextService>();

        if (clientcontext != null)
        {
            if (clientcontext.CurrentContext.ContainsKey(EntityPage.CONST_PREVIOUSENTITYIDKEY))
            {
                foreach (IEntityBinding binding in BindingSource.Bindings)
                {
                    WebEntityBinding pBinding = binding as WebEntityBinding;
                    if (pBinding != null)
                    {
                        pBinding.IgnoreControlChanges = true;
                    }
                }
            }
        }
    }