Beispiel #1
0
        /// <summary>
        /// 更新收货地址
        /// </summary>
        /// <param name="arg"></param>
        /// <returns></returns>
        public ActionResult Update(ConsigneeUpdateArgs arg)
        {
            ShippingAddress address = new ShippingAddress
            {
                Address_Id = arg.AddressId,
                Is_Default = arg.IsDefault,
                Is_Del     = 0,
                Tag_Name   = arg.TagName,
                Owner_Id   = arg.OwnerType == Address_Owner_Type.个人用户 ? Package.UserId : arg.OwnerId,
                Consignee  = new ConsigneeInfo
                {
                    Address        = arg.Address,
                    Mobile_No      = arg.MobileNo,
                    Post_Code      = arg.PostCode,
                    Region_Id      = arg.RegionId,
                    Consignee_Name = arg.ConsigneeName
                }
            };
            ConsigneeProvider provider = new ConsigneeProvider();

            if (!provider.Update(address))
            {
                return(FailResult(provider.PromptInfo.CustomMessage, (int)provider.PromptInfo.ResultType));
            }
            return(SuccessResult());
        }
Beispiel #2
0
        public void UpdateTest()
        {
            bool   isDefault    = false;
            string tagName      = "英雄会公司";
            string postCode     = null;
            string address      = null; //"a new address";
            string consigneName = null; // "张先生";
            string mobileno     = "18600001221";
            int    regionId     = 0;
            int    addressId    = 11;

            ConsigneeProvider provider = new ConsigneeProvider();
            bool res = provider.Update(addressId, isDefault, address, consigneName, mobileno, regionId, postCode, tagName);

            if (!res)
            {
                Debug.WriteLine(provider.PromptInfo.Message);
            }
            Assert.IsTrue(res);
        }