protected void btnEditAddress_Click(object sender, EventArgs e) { if (this.ValShippingAddress()) { ShippingAddressInfo shippingAddressInfo = this.GetShippingAddressInfo(); shippingAddressInfo.ShippingId = Convert.ToInt32(this.ViewState["shippingId"]); if (PersonalHelper.UpdateShippingAddress(shippingAddressInfo)) { this.ShowMessage("成功的修改了一个收货地址", true); this.Reset(); } else { this.ShowMessage("地址已经在,请重新输入一次再试", false); } this.btnEditAddress.Visible = false; this.btnAddAddress.Visible = true; this.BindList(); } }
private void UpdateShippingAddress(System.Web.HttpContext context) { context.Response.ContentType = "application/json"; string str = ""; str = "请选择要修改的收货地址"; if (this.ValShippingAddress(context, ref str) || string.IsNullOrEmpty(context.Request.Params["ShippingId"]) || System.Convert.ToInt32(context.Request.Params["ShippingId"]) > 0) { ShippingAddressInfo shippingAddressInfo = this.GetShippingAddressInfo(context); shippingAddressInfo.ShippingId = System.Convert.ToInt32(context.Request.Params["ShippingId"]); if (PersonalHelper.UpdateShippingAddress(shippingAddressInfo)) { 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 + "\"}"); } }