コード例 #1
0
ファイル: SQLCommunicator.cs プロジェクト: OTL90104/OrderBOT
        internal static string CommunicateDeleteShop(string UserID, int QID, int OID, string channelAccessToken)
        {
            // 先從ShopTemp取得ClubID和ShopID
            ShopTemp shopTemp = new ShopTemp(UserID);

            shopTemp.SelectByUserID();

            ShopInfo   shopInfo;
            UserStatus userStatus = new UserStatus(UserID);
            int        result     = 0;

            // 分成MyShop跟ClubShop兩種delete方法
            switch (QID)
            {
            case 182:
                shopInfo = new ShopInfo(UserID);
                result   = shopInfo.DeleteMyShopByUserIDandShopID(shopTemp.ShopID);
                break;

            case 282:
                shopInfo = new ShopInfo(shopTemp.ClubID);
                result   = shopInfo.DeleteClubShopByClubIDandShopID(shopTemp.ShopID);
                break;

            default:
                break;
            }
            if (result > 0)
            {
                userStatus.InitializeUserStatusByUserID();
                shopTemp.InitializeShopTempByUserID();
                return("商店刪除成功");
            }
            else
            {
                return("商店刪除失敗");
            }
        }