You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
2.2 KiB

1 year ago
  1. USE [FastMoneyPro_Remit]
  2. GO
  3. /****** Object: StoredProcedure [dbo].[ws_proc_VirtualAccountDepositNotification] Script Date: 9/27/2019 1:30:14 PM ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. CREATE PROC [dbo].[ws_proc_VirtualAccountDepositNotification]
  9. (
  10. @RequestJSon Nvarchar(500),
  11. @rowId int = null,
  12. @flag char(1),
  13. @methodName VARCHAR(50) = NULL
  14. )
  15. AS
  16. SET NOCOUNT ON
  17. SET XACT_ABORT ON
  18. ----ADDED COLUMN METHOD NAME
  19. --ALTER TABLE apiRequstLogVaccountDeposit ADD MethodName VARCHAR(50)
  20. BEGIN TRY
  21. if @flag='i'
  22. begin
  23. BEGIN TRANSACTION
  24. INSERT INTO apiRequstLogVaccountDeposit(RequestJSon,logDate,MethodName)
  25. values(@RequestJSon,GETDATE(),@methodName)
  26. set @rowId = @@IDENTITY
  27. IF @@TRANCOUNT > 0
  28. COMMIT TRANSACTION
  29. select 0 as code , 'Record saved successfully' message ,@rowId id
  30. end
  31. else if @flag='u'
  32. begin
  33. update apiRequstLogVaccountDeposit set ResponseMsg=@RequestJSon where id = @rowId
  34. end
  35. END TRY
  36. BEGIN CATCH
  37. IF @@TRANCOUNT > 0
  38. ROLLBACK TRAN
  39. SELECT '9001' code , 'Technical Error : ' + ERROR_MESSAGE() message,null id
  40. END CATCH
  41. GO