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

            if (!provider.Create(address))
            {
                return(FailResult(provider.PromptInfo.CustomMessage, (int)provider.PromptInfo.ResultType));
            }
            return(SuccessResult());
        }
Beispiel #2
0
        public void CreateTest()
        {
            int ownerId = 3999999;
            Address_Owner_Type ownerType     = Address_Owner_Type.个人用户;
            string             address       = "新安街道留仙一路高新奇科技园";
            string             consigneeName = "Jason";
            string             mobileno      = "18600001111";
            int regionId = 2334;
            ConsigneeProvider provider = new ConsigneeProvider();
            bool res = provider.Create(ownerId, ownerType, false, address, consigneeName, mobileno, regionId);

            Assert.IsTrue(res);
        }