Exemplo n.º 1
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            LocalizeView();

            AddHighlightColors(lstHighlights);
            PopulateLists();
            LoadZones();
            LoadData();

            var sourceAddress = HccApp.ContactServices.Addresses.FindStoreContactAddress();

            SourceAddress.LoadFromAddress(sourceAddress);

            var destinationAdress = new Address();

            destinationAdress.CountryBvin = Country.UnitedStatesCountryBvin;
            destinationAdress.Line1       = "319 N. Clematis St.";
            destinationAdress.Line2       = "Suite 500";
            destinationAdress.RegionBvin  = "FL";
            destinationAdress.City        = "West Palm Beach";
            destinationAdress.PostalCode  = "33401";
            DestinationAddress.LoadFromAddress(destinationAdress);
        }
Exemplo n.º 2
0
        private void RenderUser(CustomerAccount u)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            int totalCount = 0;
            List <OrderSnapshot> orders = HccApp.OrderServices.Orders.FindByUserId(u.Bvin, 1, int.MaxValue, ref totalCount);

            if (orders == null)
            {
                orders = new List <OrderSnapshot>();
            }

            sb.Append(AddString(u.Email));
            //If Contacts.MailingList.CheckMembership("8858e25b-d9a0-4ae7-b74b-bdecd0c77a8d", u.Email) Then
            //    sb.Append(AddString("YES"))
            //Else
            //    sb.Append(AddString("NO"))
            //End If

            sb.Append(AddString(u.LastName));
            sb.Append(AddString(u.FirstName));

            bool renderEmpty = false;

            if ((u.Addresses != null))
            {
                if (u.Addresses.Count > 0)
                {
                    sb.Append(AddString(u.Addresses[u.Addresses.Count - 1].Line1 + u.Addresses[u.Addresses.Count - 1].Line2));
                    sb.Append(AddString(u.Addresses[u.Addresses.Count - 1].RegionName));
                    sb.Append(AddString(u.Addresses[u.Addresses.Count - 1].City));
                    sb.Append(AddString(u.Addresses[u.Addresses.Count - 1].PostalCode));
                }
                else
                {
                    renderEmpty = true;
                }
            }
            else
            {
                if (orders.Count > 0)
                {
                    if (orders[0].ShippingAddress != null)
                    {
                        sb.Append(AddString(orders[0].ShippingAddress.Line1 + orders[0].ShippingAddress.Line2));
                        sb.Append(AddString(orders[0].ShippingAddress.RegionName));
                        sb.Append(AddString(orders[0].ShippingAddress.City));
                        sb.Append(AddString(orders[0].ShippingAddress.PostalCode));
                    }
                    else
                    {
                        renderEmpty = true;
                    }
                }
                else
                {
                    Hotcakes.Commerce.Contacts.Address ship = u.ShippingAddress;
                    if (ship != null)
                    {
                        if (ship.Line1.Trim().Length > 0)
                        {
                            sb.Append(AddString(ship.Line1 + ship.Line2));
                            sb.Append(AddString(ship.RegionName));
                            sb.Append(AddString(ship.City));
                            sb.Append(AddString(ship.PostalCode));
                        }
                        else
                        {
                            renderEmpty = true;
                        }
                    }
                    else
                    {
                        renderEmpty = true;
                    }
                }

                if (renderEmpty)
                {
                    sb.Append(AddString(" "));
                    sb.Append(AddString(" "));
                    sb.Append(AddString(" "));
                    sb.Append(AddString(" "));
                }
            }


            foreach (Product p in _SelectedProducts)
            {
                sb.Append(AddString(CountPurchases(u.Bvin, p.Bvin, orders)));
            }

            sb.Append(System.Environment.NewLine);
            this.txtResults.Text += sb.ToString();
        }