Пример #1
0
        internal static string CommunicateShopAddressUpdate(string UserID, int QID, int OID, string channelAccessToken)
        {
            // 先拿到存在ShopTemp裡面的ShopPhone
            ShopTemp shopTemp = new ShopTemp(UserID);

            shopTemp.SelectByUserID();

            // 拿到存在UserStatus裡的TempData,目前裡面是前一步輸入的ShopID
            UserStatus userStatus = new UserStatus(UserID);

            userStatus.SelectByUserID();

            ShopInfo shopInfo = new ShopInfo();
            int      result   = 0;

            // 分成MyShop跟ClubShop兩種update方法
            switch (QID)
            {
            case 193:
                shopInfo.ShopAddress = shopTemp.ShopAddress;
                result = shopInfo.UpdateMyShopAddressByShopID(shopTemp.ShopID);
                break;

            case 293:
                shopInfo.ShopAddress = shopTemp.ShopAddress;
                result = shopInfo.UpdateClubShopAddressByShopID(userStatus.TempData);
                break;

            default:
                break;
            }

            if (result > 0)
            {
                userStatus.InitializeUserStatusByUserID();
                shopTemp.InitializeShopTempByUserID();
                return("商店地址修改成功");
            }
            else
            {
                return("商店地址修改失敗");
            }
        }