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.

80 lines
1.5 KiB

1 year ago
  1. USE [FastMoneyPro_Remit]
  2. GO
  3. /****** Object: StoredProcedure [dbo].[proc_tranViewHistory] Script Date: 7/4/2019 11:35:48 AM ******/
  4. DROP PROCEDURE [dbo].[proc_tranViewHistory]
  5. GO
  6. /****** Object: StoredProcedure [dbo].[proc_tranViewHistory] Script Date: 7/4/2019 11:35:48 AM ******/
  7. SET ANSI_NULLS ON
  8. GO
  9. SET QUOTED_IDENTIFIER ON
  10. GO
  11. CREATE proc [dbo].[proc_tranViewHistory]
  12. @flag VARCHAR(50)
  13. ,@user VARCHAR(30) = NULL
  14. ,@tranId VARCHAR(30) = NULL
  15. ,@controlNo VARCHAR(50) = NULL
  16. ,@agentId VARCHAR(30) = NULL
  17. ,@tranViewType VARCHAR(50) = NULL
  18. ,@remarks VARCHAR(MAX) = NULL
  19. ,@rowId INT = NULL
  20. ,@sortBy VARCHAR(50) = NULL
  21. ,@sortOrder VARCHAR(5) = NULL
  22. ,@pageSize INT = NULL
  23. ,@pageNumber INT = NULL
  24. AS
  25. IF @tranId IS NULL
  26. SELECT @tranId=id FROM remitTran WHERE controlNo=dbo.FNAEncryptString(LTRIM(RTRIM(@controlNo)))
  27. IF @flag = 'i'
  28. BEGIN
  29. INSERT INTO tranViewHistory (
  30. agentId
  31. ,tranViewType
  32. ,createdBy
  33. ,createdDate
  34. ,tranId
  35. ,remarks
  36. ,controlnumber
  37. )
  38. SELECT
  39. @agentId
  40. ,@tranViewType
  41. ,@user
  42. ,GETDATE()
  43. ,@tranId
  44. ,@remarks
  45. ,@controlNo
  46. END
  47. IF @flag = 'i1'
  48. BEGIN
  49. INSERT INTO tranViewHistory (
  50. agentId
  51. ,tranViewType
  52. ,createdBy
  53. ,createdDate
  54. ,tranId
  55. ,remarks
  56. ,controlnumber
  57. )
  58. SELECT
  59. @agentId
  60. ,@tranViewType
  61. ,@user
  62. ,GETDATE()
  63. ,@tranId
  64. ,@remarks
  65. ,@controlNo
  66. SET @rowId = SCOPE_IDENTITY()
  67. EXEC proc_errorHandler 0, 'Success.', @rowId
  68. END
  69. GO