/// <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; } } } } }
/// <summary> /// Create a new binding, add it to the binding source, and return it. /// </summary> protected WebEntityBinding AddBinding <TComponent, TProperty, TProperty2>(Expression <Func <TEntity, TProperty> > entityProperty, TComponent component, Expression <Func <TComponent, TProperty2> > componentProperty) { if (_bf == null) { _bf = new TypedWebEntityBindingGenerator <TEntity>(); } WebEntityBinding bdg = _bf.CreateBinding(entityProperty, component, componentProperty); BindingSource.Bindings.Add(bdg); return(bdg); }
/// <summary> /// Called when [add entity bindings]. /// </summary> protected override void OnAddEntityBindings() { WebEntityBinding lueLeadSourceLookupResultValueBinding = new WebEntityBinding("LeadSource", lueTargetLeadSource, "LookupResultValue", String.Empty, null); BindingSource.Bindings.Add(lueLeadSourceLookupResultValueBinding); WebEntityBinding lueContactValueBinding = new WebEntityBinding("Contact", lueContact, "LookupResultValue", String.Empty, null); BindingSource.Bindings.Add(lueContactValueBinding); WebEntityBinding lueLeadValueBinding = new WebEntityBinding("Lead", lueLead, "LookupResultValue", String.Empty, null); BindingSource.Bindings.Add(lueLeadValueBinding); WebEntityBinding lueCampaignLookupResultValueBinding = new WebEntityBinding("Campaign", lueCampaign, "LookupResultValue", String.Empty, null); BindingSource.Bindings.Add(lueCampaignLookupResultValueBinding); WebEntityBinding dtpResponseDateDateTimeValueBinding = new WebEntityBinding("ResponseDate", dtpResponseDate, "DateTimeValue", String.Empty, null); BindingSource.Bindings.Add(dtpResponseDateDateTimeValueBinding); WebEntityBinding lbxStagesTextBinding = new WebEntityBinding("Stage", lbxStages, "Text"); BindingSource.Bindings.Add(lbxStagesTextBinding); WebEntityBinding pklResponseStatusPickListValueBinding = new WebEntityBinding("Status", pklResponseStatus, "PickListValue"); BindingSource.Bindings.Add(pklResponseStatusPickListValueBinding); WebEntityBinding pklResponseMethodPickListValueBinding = new WebEntityBinding("ResponseMethod", pklResponseMethod, "PickListValue"); BindingSource.Bindings.Add(pklResponseMethodPickListValueBinding); WebEntityBinding pklInterestPickListValueBinding = new WebEntityBinding("Interest", pklInterest, "PickListValue"); BindingSource.Bindings.Add(pklInterestPickListValueBinding); WebEntityBinding pklInterestLevelPickListValueBinding = new WebEntityBinding("InterestLevel", pklInterestLevel, "PickListValue"); BindingSource.Bindings.Add(pklInterestLevelPickListValueBinding); WebEntityBinding txtCommentsTextBinding = new WebEntityBinding("Comments", txtComments, "Text"); BindingSource.Bindings.Add(txtCommentsTextBinding); //dtsProducts.Bindings.Add(new WebEntityListBinding("ResponseProducts", grdProducts)); //dtsProducts.BindFieldNames = new String[] { "Id", "Product.Name", "Product.Description", "Product.ActualId", "Product.Status" }; dtsClicks.Bindings.Add(new WebEntityListBinding("MarketingServiceRecipient.MarketingServiceClicks", grdClicks)); dtsClicks.BindFieldNames = new String[] { "Id", "LinkName", "LinkURL", "ClickDate" }; dtsOpens.Bindings.Add(new WebEntityListBinding("MarketingServiceRecipient.MarketingServiceOpens", grdOpens)); dtsOpens.BindFieldNames = new String[] { "Id", "OpenDate", "UnsubscribeDate", "UnsubscribeCampaignName" }; dtsUndeliverables.Bindings.Add(new WebEntityListBinding("MarketingServiceRecipient.MarketingServiceUndeliverables", grdUndeliverables)); dtsUndeliverables.BindFieldNames = new String[] { "Id", "BounceDate", "BounceCampaignName", "BounceCount", "BounceReason" }; BindingSource.OnCurrentEntitySet += dtsProducts_OnCurrentEntitySet; BindingSource.OnCurrentEntitySet += dtsOpens_OnCurrentEntitySet; BindingSource.OnCurrentEntitySet += dtsClicks_OnCurrentEntitySet; BindingSource.OnCurrentEntitySet += dtsUndeliverables_OnCurrentEntitySet; }
/// <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; } } } } }
protected override void OnAddEntityBindings() { //curOriginalTotalPrice binding WebEntityBinding curOriginalTotalPriceCurrentCodeBinding = new WebEntityBinding("CurrencyCode", curOriginalTotalPrice, "CurrentCode"); curOriginalTotalPriceCurrentCodeBinding.IgnoreFLSDisabling = true; BindingSource.Bindings.Add(curOriginalTotalPriceCurrentCodeBinding); WebEntityBinding curOriginalTotalPriceExchangeRateBinding = new WebEntityBinding("ExchangeRate", curOriginalTotalPrice, "ExchangeRate"); curOriginalTotalPriceExchangeRateBinding.IgnoreFLSDisabling = true; BindingSource.Bindings.Add(curOriginalTotalPriceExchangeRateBinding); WebEntityBinding curOriginalTotalPriceTextBinding = new WebEntityBinding("GrandTotal", curOriginalTotalPrice, "Text"); BindingSource.Bindings.Add(curOriginalTotalPriceTextBinding); //curNewTotalPrice binding WebEntityBinding curNewTotalPriceCurrentCodeBinding = new WebEntityBinding("CurrencyCode", curNewTotalPrice, "CurrentCode"); curNewTotalPriceCurrentCodeBinding.IgnoreFLSDisabling = true; BindingSource.Bindings.Add(curNewTotalPriceCurrentCodeBinding); }
/// <summary> /// Called when [add entity bindings]. /// </summary> protected override void OnAddEntityBindings() { WebEntityBinding lueLeadSourceLookupResultValueBinding = new WebEntityBinding("LeadSource", lueTargetLeadSource, "LookupResultValue"); BindingSource.Bindings.Add(lueLeadSourceLookupResultValueBinding); WebEntityBinding lueContactValueBinding = new WebEntityBinding("Contact", lueContact, "LookupResultValue", String.Empty, null); BindingSource.Bindings.Add(lueContactValueBinding); WebEntityBinding lueLeadValueBinding = new WebEntityBinding("Lead", lueLead, "LookupResultValue", String.Empty, null); BindingSource.Bindings.Add(lueLeadValueBinding); WebEntityBinding lueCampaignLookupResultValueBinding = new WebEntityBinding("Campaign", lueCampaign, "LookupResultValue", String.Empty, null); BindingSource.Bindings.Add(lueCampaignLookupResultValueBinding); WebEntityBinding dtpResponseDateDateTimeValueBinding = new WebEntityBinding("ResponseDate", dtpResponseDate, "DateTimeValue", String.Empty, null); BindingSource.Bindings.Add(dtpResponseDateDateTimeValueBinding); WebEntityBinding lbxStagesTextBinding = new WebEntityBinding("Stage", lbxStages, "Text"); BindingSource.Bindings.Add(lbxStagesTextBinding); WebEntityBinding pklResponseStatusPickListValueBinding = new WebEntityBinding("Status", pklResponseStatus, "PickListValue"); BindingSource.Bindings.Add(pklResponseStatusPickListValueBinding); WebEntityBinding pklResponseMethodPickListValueBinding = new WebEntityBinding("ResponseMethod", pklResponseMethod, "PickListValue"); BindingSource.Bindings.Add(pklResponseMethodPickListValueBinding); WebEntityBinding pklInterestPickListValueBinding = new WebEntityBinding("Interest", pklInterest, "PickListValue"); BindingSource.Bindings.Add(pklInterestPickListValueBinding); WebEntityBinding pklInterestLevelPickListValueBinding = new WebEntityBinding("InterestLevel", pklInterestLevel, "PickListValue"); BindingSource.Bindings.Add(pklInterestLevelPickListValueBinding); WebEntityBinding txtCommentsTextBinding = new WebEntityBinding("Comments", txtComments, "Text"); BindingSource.Bindings.Add(txtCommentsTextBinding); dtsClicks.Bindings.Add(new WebEntityListBinding("MarketingServiceRecipient.MarketingServiceClicks", grdClicks)); dtsClicks.BindFieldNames = new[] { "Id", "LinkName", "LinkURL", "ClickDate" }; dtsOpens.Bindings.Add(new WebEntityListBinding("MarketingServiceRecipient.MarketingServiceOpens", grdOpens)); dtsOpens.BindFieldNames = new[] { "Id", "OpenDate", "UnsubscribeDate", "UnsubscribeCampaignName" }; dtsUndeliverables.Bindings.Add(new WebEntityListBinding("MarketingServiceRecipient.MarketingServiceUndeliverables", grdUndeliverables)); dtsUndeliverables.BindFieldNames = new[] { "Id", "BounceDate", "BounceCampaignName", "BounceCount", "BounceReason" }; BindingSource.OnCurrentEntitySet += dtsProducts_OnCurrentEntitySet; BindingSource.OnCurrentEntitySet += dtsOpens_OnCurrentEntitySet; BindingSource.OnCurrentEntitySet += dtsClicks_OnCurrentEntitySet; BindingSource.OnCurrentEntitySet += dtsUndeliverables_OnCurrentEntitySet; }