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.

61 lines
3.9 KiB

9 months ago
9 months ago
9 months ago
  1. USE [FastMoneyPro_Remit]
  2. GO
  3. /****** Object: StoredProcedure [dbo].[proc_customerInfoWithPinNo] Script Date: 12/12/2023 1:10:41 PM ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. ALTER PROC [dbo].[proc_customerInfoWithPinNo]
  9. @flag varchar(40)
  10. ,@user varchar(20) = NULL
  11. ,@customerId BIGINT = NULL
  12. AS
  13. ---------------------------------------------------------------
  14. -- Set '111111' as default txnpin for now
  15. ---------------------------------------------------------------
  16. BEGIN
  17. IF @flag = 'getDetailsWithPin'
  18. BEGIN
  19. DECLARE @pinNo int,@userName varchar(50),@firstName varchar(20),@password varchar(10),@createdFrom char(1),@txnPin int
  20. SELECT @firstName = FIRSTNAME
  21. ,@createdFrom = createdFrom
  22. ,@txnPin = txnPin
  23. ,@userName = username
  24. ,@password = customerPassword
  25. FROM CUSTOMERMASTER WHERE CUSTOMERID =@customerId
  26. IF @userName IS NULL
  27. BEGIN
  28. SELECT @userName = DBO.GetRandomUsername(@firstName)
  29. update customerMaster set userName = @userName where customerId = @customerId
  30. END
  31. --IF @password IS NULL
  32. --BEGIN
  33. -- SELECT @password = DBO.FNAGetRandomPassword(6)
  34. -- update customerMaster set customerPassword = @password where customerId = @customerId
  35. --END
  36. IF @txnPin IS NULL OR @txnPin=''
  37. BEGIN
  38. SET @pinNo = DBO.FNAGetRandomTransactionPinNo(6)
  39. update customerMaster set txnPin = @pinNo where customerId = @customerId
  40. END
  41. SELECT FullName
  42. ,txnPin PinNo
  43. ,username UserName
  44. ,DBO.FNADECRYPTSTRING(customerPassword) Password
  45. ,[Address1] = ISNULL(address,'')
  46. ,[Address2] = ISNULL( cm.additionalAddress,'')
  47. ,[City] = ISNULL(city,'')
  48. ,[additionalAddress] = ISNULL( cm.additionalAddress,'')
  49. FROM customermaster CM (NOLOCK)
  50. LEFT JOIN tbl_japan_address_detail detail WITH (NOLOCK) ON detail.zip_code = CM.zipcode
  51. LEFT JOIN dbo.countryStateMaster SS(NOLOCK) ON cast(SS.stateId as int)= detail.state_Id
  52. WHERE customerId = @customerId
  53. END
  54. END