Esempio n. 1
0
        public ApiReturnModel DeleteUserAddress([FromBody] ApiUserAddressModel apiUserAddressModel)
        {
            var userInfo = GetCurrentUserInfo();


            if (UserAddressBusiness.DeleteUserAddress(apiUserAddressModel.Id, userInfo.Id))
            {
                return(ApiReturnModel.ReturnOk());
            }
            return(ApiReturnModel.ReturnError());
        }
Esempio n. 2
0
        public ApiReturnModel AddUserAddress([FromBody] ApiUserAddressModel apiUserAddressModel)
        {
            var         userInfo    = GetCurrentUserInfo();
            UserAddress userAddress = new UserAddress()
            {
                Id              = Guid.NewGuid(),
                UserId          = userInfo.Id,
                City            = apiUserAddressModel.City,
                Province        = apiUserAddressModel.Province,
                DetailedAddress = apiUserAddressModel.DetailedAddress,
                ConsigneeName   = apiUserAddressModel.ConsigneeName,
                Flag            = 0,
                Phone           = apiUserAddressModel.Phone
            };

            userAddress = UserAddressBusiness.AddItem(userAddress);
            return(ApiReturnModel.ReturnOk("增加成功", userAddress));
        }
Esempio n. 3
0
        public ApiReturnModel UpdateUserAddress([FromBody] ApiUserAddressModel apiUserAddressModel)
        {
            var         userInfo    = GetCurrentUserInfo();
            UserAddress userAddress = new UserAddress()
            {
                Id              = apiUserAddressModel.Id,
                UserId          = userInfo.Id,
                City            = apiUserAddressModel.City,
                Province        = apiUserAddressModel.Province,
                DetailedAddress = apiUserAddressModel.DetailedAddress,
                ConsigneeName   = apiUserAddressModel.ConsigneeName,
                Flag            = 0,
                Phone           = apiUserAddressModel.Phone
            };

            if (UserAddressBusiness.UpdateUserAddress(userAddress))
            {
                return(ApiReturnModel.ReturnOk());
            }
            return(ApiReturnModel.ReturnError());
        }