protected void setAddress() { if (linkedOrganization == null) { return; } msEntityAddress entityAddress = linkedOrganization.Addresses.Where(x => x.Type == linkedOrganization.PreferredAddressType).FirstOrDefault(); if (entityAddress != null) { sectionAddress = entityAddress.Address; } }
protected Address getBillingAddress() { if (targetIndividual == null) { return(null); } msEntityAddress entityAddress = targetIndividual.Addresses.Where(x => x.Type == targetIndividual.PreferredAddressType). FirstOrDefault(); if (entityAddress == null) { return(null); } return(entityAddress.Address); }
protected void rptBillingAddress_OnItemDataBound(object sender, RepeaterItemEventArgs e) { msEntityAddress address = (msEntityAddress)e.Item.DataItem; if (Page.IsPostBack) { return; // only do this if there's a postback - otherwise, preserve ViewState } switch (e.Item.ItemType) { case ListItemType.Header: break; case ListItemType.Footer: break; case ListItemType.AlternatingItem: goto case ListItemType.Item; case ListItemType.Item: RadioButton rbAddress = (RadioButton)e.Item.FindControl("rbAddress"); Literal lAddress = (Literal)e.Item.FindControl("lAddress"); if (address == null || address.Address == null) { rbAddress.Visible = false; return; } lAddress.Text = address.Address.ToHtmlString(); rbAddress.Attributes["value"] = e.Item.ItemIndex.ToString(); break; } }
private void bindFields() { using (var api = GetServiceAPIProxy()) { lblPublication.Text = api.GetName(targetSubscription.Publication).ResultValue; lblOwner.Text = api.GetName(targetSubscription.Owner).ResultValue; lblProduct.Text = api.GetName(targetSubscription.Fee).ResultValue; if (targetSubscription.SavedPaymentMethod != null) { string paymentInfo = api.GetName(targetSubscription.SavedPaymentMethod).ResultValue; if (paymentInfo != null) { lblPaymentInfo.Text = paymentInfo; } } if (targetSubscription.StartDate != null) { lblStartDate.Text = targetSubscription.StartDate.Value.ToShortDateString(); } if (targetSubscription.ExpirationDate != null) { lblExpirationDate.Text = targetSubscription.ExpirationDate.Value.ToShortDateString(); } if (targetSubscription.TerminationDate != null) { trTermination.Visible = true; lblTerminationDate.Text = targetSubscription.TerminationDate.Value.ToShortDateString(); if (targetSubscription.TerminationReason != null) { lblTerminationReason.Text = api.GetName(targetSubscription.TerminationReason).ResultValue; } } if (targetSubscription.OriginalOrder != null) { hlOriginalOrder.Text = api.GetName(targetSubscription.OriginalOrder).ResultValue; hlOriginalOrder.NavigateUrl = "/orders/ViewOrder.aspx?contextID=" + targetSubscription.OriginalOrder; } if (targetSubscription.LastOrder != null) { hlRenewalOrder.Text = api.GetName(targetSubscription.LastOrder).ResultValue; hlRenewalOrder.NavigateUrl = "/orders/ViewOrder.aspx?contextID=" + targetSubscription.LastOrder; } if (!string.IsNullOrWhiteSpace(targetSubscription.OverrideShipToName)) { lblShipTo.Text = targetSubscription.OverrideShipToName; } else { lblShipTo.Text = api.GetName(targetSubscription.Owner).ResultValue; } if (targetSubscription.OverrideShipToAddress) { lblShippingAddress.Text = targetSubscription.Address.ToHtmlString(); } else { msEntityAddress ea = Utils.GetEntityPreferredAddress(targetEntity); if (ea != null && ea.Address != null) { lblShippingAddress.Text = ea.Address.ToHtmlString(); } } } }