protected void ShippingAddress_AddressUpdate(object sender, AddressEventArgs e) { e.Address.User = _user; e.Address.Save(); if (!_user.Addresses.Contains(e.Address)) { _user.Addresses.Add(e.Address); } BindShippingMethods(e.Address, true); if (e.Address.IsValid) { FormattedShippingAddress.Text = GetFormattedAddressString(e.Address); ShippingAddressTextPanel.Visible = true; trShippingAddress.Visible = false; UseExistingAddress.Checked = true; _SelectUseExistingAddr = true; trUseExistingAddress.Visible = true; trNewAddress.Visible = true; trAddressList.Visible = true; BindShippingAddreses(); } else { ShippingAddressTextPanel.Visible = false; trShippingAddress.Visible = true; } }
void ipi_AddressAdded(object sender, AddressEventArgs args) { lLocalAdresses.Add(args.IP); RoutingEntry reEntry = new RoutingEntry(args.IP, args.IP, 0, args.Netmask, RoutingEntryOwner.Interface); reEntry.NextHopInterface = args.Interface; rtRoutingtable.AddRoute(reEntry); }
protected void BillingAddress_AddressUpdate(object sender, AddressEventArgs e) { // update the user instance, user instance might be changed if a new account is registered _user = AbleContext.Current.User; _basket = _user.Basket; if (e.Address.IsValid) { // if anonymous user or guest checkout then validate email address, check if it is not already registerd string email = e.Address.Email; if (_user.IsAnonymousOrGuest && UserDataSource.IsEmailRegistered(email)) { EmailRegisteredPanel.Visible = true; } else { // Update user primary address Address address = _user.PrimaryAddress; if (address.Id != e.Address.Id) { address.FirstName = e.Address.FirstName; address.LastName = e.Address.LastName; address.Nickname = e.Address.Nickname; address.FullName = e.Address.FullName; address.Address1 = e.Address.Address1; address.Address2 = e.Address.Address2; address.City = e.Address.City; address.Company = e.Address.Company; address.Country = e.Address.Country; address.Email = e.Address.Email; address.Fax = e.Address.Fax; address.IsBilling = e.Address.IsBilling; address.Phone = e.Address.Phone; address.PostalCode = e.Address.PostalCode; address.Province = e.Address.Province; } address.Save(); BillingAddressTextPanel.Visible = true; FormattedBillingAddress.Text = GetFormattedAddressString(e.Address); BillingAddress.Visible = false; _basketService.Package(_basket, true); BasketShipment shipment = _basket.Shipments.FirstOrDefault(); if (shipment != null) { if (shipment.Address == null || shipment.Address.Id == address.Id) { BindShippingMethods(address, true); } } IntializeEmailLists(); } } }
private void LocatorTask_LocationToAddressCompleted(object sender, AddressEventArgs args) { Address address = args.Address; Dictionary <string, object> attributes = address.Attributes; string locAddress = string.Format("{0}\n{1}, {2} {3}", attributes["Address"], attributes["City"], attributes["Region"], attributes["Postal"]); AddressText.Text = locAddress; AddressBorder.Visibility = Visibility.Visible; }
private void LocatorTask_LocationToAddressCompleted(object sender, AddressEventArgs args) { Address address = args.Address; Dictionary<string, object> attributes = address.Attributes; string locAddress = string.Format("{0}\n{1}, {2} {3}",attributes["Address"],attributes["City"], attributes["Region"], attributes["Postal"]); AddressText.Text = locAddress; AddressBorder.Visibility = Visibility.Visible; }
private void LocatorTask_LocationToAddressCompleted(object sender, AddressEventArgs args) { Address address = args.Address; Dictionary <string, object> attributes = address.Attributes; Graphic graphic = new Graphic() { Geometry = args.UserState as MapPoint }; // Parameter names of address candidates may differ between geocode services string latlon = String.Format("{0}, {1}", address.Location.X, address.Location.Y); string address1 = attributes["Address"].ToString(); string address2 = String.Format("{0}, {1} {2}", attributes["City"], attributes["Region"], attributes["Postal"]); graphic.Attributes.Add("LatLon", latlon); graphic.Attributes.Add("Address1", address1); graphic.Attributes.Add("Address2", address2); _locationGraphicsLayer.Graphics.Add(graphic); }
private void LocatorTask_LocationToAddressCompleted(object sender, AddressEventArgs args) { Address address = args.Address; Dictionary <string, object> attributes = address.Attributes; Graphic graphic = new Graphic() { Symbol = LayoutRoot.Resources["DefaultMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol, Geometry = args.UserState as MapPoint }; string latlon = String.Format("{0}, {1}", address.Location.X, address.Location.Y); string address1 = attributes["Street"].ToString(); string address2 = String.Format("{0}, {1} {2}", attributes["City"], attributes["State"], attributes["ZIP"]); graphic.Attributes.Add("LatLon", latlon); graphic.Attributes.Add("Address1", address1); graphic.Attributes.Add("Address2", address2); _locationGraphicsLayer.Graphics.Add(graphic); }
private void LocatorTask_LocationToAddressCompleted(object sender, AddressEventArgs args) { Address address = args.Address; Dictionary<string, object> attributes = address.Attributes; Graphic graphic = new Graphic() { Geometry = args.UserState as MapPoint }; // Parameter names of address candidates may differ between geocode services string latlon = String.Format("{0}, {1}", address.Location.X, address.Location.Y); string address1 = attributes["Address"].ToString(); string address2 = String.Format("{0}, {1} {2}", attributes["City"], attributes["Region"], attributes["Postal"]); graphic.Attributes.Add("LatLon", latlon); graphic.Attributes.Add("Address1", address1); graphic.Attributes.Add("Address2", address2); _locationGraphicsLayer.Graphics.Add(graphic); }
private void LocatorTask_LocationToAddressCompleted(object sender, AddressEventArgs args) { Address address = args.Address; Dictionary<string, object> attributes = address.Attributes; Graphic graphic = new Graphic() { Symbol = LayoutRoot.Resources["DefaultMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol, Geometry = args.UserState as MapPoint }; string latlon = String.Format("{0}, {1}", address.Location.X, address.Location.Y); string address1 = attributes["Street"].ToString(); string address2 = String.Format("{0}, {1} {2}", attributes["City"], attributes["State"], attributes["ZIP"]); graphic.Attributes.Add("LatLon", latlon); graphic.Attributes.Add("Address1", address1); graphic.Attributes.Add("Address2", address2); _locationGraphicsLayer.Graphics.Add(graphic); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void locatorTask_LocationToAddressCompleted(object sender, AddressEventArgs e) { try { locatorTask.LocationToAddressCompleted -= locatorTask_LocationToAddressCompleted; Address address = e.Address; Dictionary<string, object> attributes = e.Address.Attributes; IList<GeoLocatorDetail> result = new List<GeoLocatorDetail>(); WebMercator webMercator = new WebMercator(); result.Add(new GeoLocatorDetail() { Location = address.Location, Match = 100.0, Title = string.Format("{0} {1},{2}", attributes["Address"], attributes["City"], attributes["Postcode"]), Attributes = attributes }); ResultsGeoLocatorEventArgs resultEventArgs = new ResultsGeoLocatorEventArgs(result); OnGeoLocatorSearchComplete(resultEventArgs); } catch (Exception ex) { messageBoxCustom.Show(String.Format("locatorTask_LocationToAddressCompleted /{0}", ex.Message), GisTexts.SevereError, MessageBoxCustomEnum.MessageBoxButtonCustom.Ok); } }
/// <summary> /// Addresses the created. /// </summary> /// <param name="source">The source.</param> /// <param name="args">The <see cref="Mediachase.Commerce.Profile.Events.AddressEventArgs"/> instance containing the event data.</param> public void AddressCreated(object source, AddressEventArgs args) { Record((CustomerAddress)source); }