IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'user_OffLineBank_FlowforMoneyRight')
BEGIN
DROP Procedure user_OffLineBank_FlowforMoneyRight
END
GO
CREATE Procedure user_OffLineBank_FlowforMoneyRight
(
@id int
)
AS
declare @iErrorCode int
Select @iErrorCode = 0
declare @bill_id int
declare @bill_list varchar(20)
Select @bill_id=0
Select @bill_list = ''
Select
@bill_id = bill_id
from
user_OffLineBank_Flow
where
id=@id
Select @bill_list=bill_list from Bill_Orders Where ID=@bill_id
Begin TRANSACTION
if @iErrorCode = 0
Begin
Update
Ticket_Bookings
Set
PaymentStat='0002'
Where
ID=Convert(int,substring(@bill_list,4,7))
Select @iErrorCode = @@Error
End
If @iErrorCode = 0
Begin
Commit TRANSACTION
End
Else
Begin
ROLLBACK TRANSACTION
End
GO