Beispiel #1
0
        /// <summary>
        /// 更新收货地址
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string Update(HttpContext context)
        {
            string addressId     = context.Request["address_id"];
            string consigneeName = context.Request["consigneename"];
            string address       = context.Request["address"];
            string phone         = context.Request["phone"];
            string isDefault     = context.Request["isdefault"];
            string province      = context.Request["province"];
            string provinceCode  = context.Request["province_code"];

            string city     = context.Request["city"];
            string cityCode = context.Request["city_code"];

            string dist     = context.Request["dist"];
            string distCode = context.Request["dist_code"];
            string zipCode  = context.Request["zip_code"];
            string msg      = "";

            if (bllMall.EditConsigneeAddress(addressId, currentUserInfo.UserID, consigneeName, address, phone, isDefault, province, provinceCode, city, cityCode, dist, distCode, zipCode, out msg))
            {
                WebsiteInfo websiteModel = bllWebsite.GetWebsiteInfo(bllWebsite.WebsiteOwner);

                //if (websiteModel.IsSynchronizationData == 1 && websiteModel.IsSynchronizationData!=null)
                //{


                //    CurrentUserInfo.TrueName = consigneeName;
                //    CurrentUserInfo.Phone = phone;

                //    bllWebsite.Update(CurrentUserInfo);

                //}


                if (string.IsNullOrWhiteSpace(currentUserInfo.TrueName))
                {
                    currentUserInfo.TrueName = consigneeName;
                    bllMall.Update(currentUserInfo, string.Format(" TrueName = '{0}' ", consigneeName), string.Format(" AutoID = {0} ", currentUserInfo.AutoID));
                }

                if (string.IsNullOrWhiteSpace(currentUserInfo.Phone) && ZentCloud.Common.MyRegex.PhoneNumLogicJudge(phone))
                {
                    currentUserInfo.Phone = phone;
                    bllMall.Update(currentUserInfo, string.Format(" Phone = '{0}' ", phone), string.Format(" AutoID = {0} ", currentUserInfo.AutoID));
                }


                resp.errmsg = "ok";
            }
            else
            {
                resp.errcode = 1;
                resp.errmsg  = msg;
            }

            return(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
        }