Exemplo n.º 1
0
        void BindList()
        {
            IList <ShippingAddressInfo> shippingAddress = PersonalHelper.GetShippingAddress(HiContext.Current.User.UserId);

            this.dtlstRegionsSelect.DataSource = shippingAddress;
            this.dtlstRegionsSelect.DataBind();
        }
Exemplo n.º 2
0
        private void AddUserShippingAddress(HttpContext context)
        {
            context.Response.ContentType = "application/json";
            string erromsg = "";

            if (this.ValShippingAddress(context, ref erromsg))
            {
                if (PersonalHelper.CreateShippingAddress(this.GetShippingAddressInfo(context)))
                {
                    IList <ShippingAddressInfo> shippingAddress = PersonalHelper.GetShippingAddress(HiContext.Current.User.UserId);
                    ShippingAddressInfo         info            = shippingAddress[shippingAddress.Count - 1];
                    context.Response.Write(string.Concat(new object[] { "{\"Status\":\"OK\",\"Result\":{\"ShipTo\":\"", info.ShipTo, "\",\"RegionId\":\"", RegionHelper.GetFullRegion(info.RegionId, " "), "\",\"ShippingAddress\":\"", info.Address, "\",\"ShippingId\":\"", info.ShippingId, "\",\"CellPhone\":\"", info.CellPhone, "\"}}" }));
                }
                else
                {
                    context.Response.Write("{\"Status\":\"Error\",\"Result\":\"地址已经在,请重新输入一次再试\"}");
                }
            }
            else
            {
                context.Response.Write("{\"Status\":\"Error\",\"Result\":\"" + erromsg + "\"}");
            }
        }
Exemplo n.º 3
0
        private void AddUserShippingAddress(System.Web.HttpContext context)
        {
            context.Response.ContentType = "application/json";
            string str = "";

            if (this.ValShippingAddress(context, ref str))
            {
                ShippingAddressInfo shippingAddressInfo = this.GetShippingAddressInfo(context);
                if (PersonalHelper.CreateShippingAddress(shippingAddressInfo))
                {
                    System.Collections.Generic.IList <ShippingAddressInfo> shippingAddress = PersonalHelper.GetShippingAddress(Hidistro.Membership.Context.HiContext.Current.User.UserId);
                    shippingAddressInfo = shippingAddress[shippingAddress.Count - 1];
                    context.Response.Write(string.Concat(new object[]
                    {
                        "{\"Status\":\"OK\",\"Result\":{\"ShipTo\":\"",
                        shippingAddressInfo.ShipTo,
                        "\",\"RegionId\":\"",
                        RegionHelper.GetFullRegion(shippingAddressInfo.RegionId, " "),
                        "\",\"ShippingAddress\":\"",
                        shippingAddressInfo.Address,
                        "\",\"ShippingId\":\"",
                        shippingAddressInfo.ShippingId,
                        "\",\"CellPhone\":\"",
                        shippingAddressInfo.CellPhone,
                        "\"}}"
                    }));
                }
                else
                {
                    context.Response.Write("{\"Status\":\"Error\",\"Result\":\"地址已经在,请重新输入一次再试\"}");
                }
            }
            else
            {
                context.Response.Write("{\"Status\":\"Error\",\"Result\":\"" + str + "\"}");
            }
        }