set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
/****** Shoping Mall Fixed by sandolkakos Website:
******/
ALTER Proc [dbo].[usp_Save_User_BuyPointItems_NCash]
@UserUID int,
@CharID int,
@UsePoint int,
@ProductCode varchar(20),
@textDate varchar(30)
AS
DECLARE @UseTime datetime
set @UseTime=CONVERT(datetime, @textDate, 120)
SET NOCOUNT ON
SET XACT_ABORT ON
DECLARE @UseType int
DECLARE @ReturnValue int
SET @UseType = 1 -- ??
BEGIN DISTRIBUTED TRANSACTION
EXEC @ReturnValue = PS_UserData.dbo.usp_Update_UserPoint @UserUID, @UsePoint
IF ( @ReturnValue < 0 )
BEGIN
GOTO ERROR
END
-- ??? ??(Old, ?? UPDATE? ???? ????? ?? ???)
--UPDATE PS_UserData.dbo.Users_Master SET Point=Point-@UsePoint WHERE UserUID=@UserUID
--IF( @@ERROR<>0 OR @@ROWCOUNT=0)
--BEGIN
-- GOTO ERROR
--END
-- ??? ?? ??
INSERT INTO PointLog(UseType,UserUID,CharID,UsePoint,ProductCo de,UseDate)
VALUES(@UseType,@UserUID,@CharID,@UsePoint,@Produc tCode,@UseTime)
IF( @@ERROR<>0)
BEGIN
GOTO ERROR
END
COMMIT TRAN
RETURN 1
ERROR:
ROLLBACK TRAN
RETURN -1
SET XACT_ABORT OFF
SET NOCOUNT OFF