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.

63 lines
2.9 KiB

1 year ago
  1. USE [FastMoneyPro_Remit]
  2. GO
  3. /****** Object: StoredProcedure [dbo].[proc_SMSXRateData] Script Date: 9/27/2019 1:30:14 PM ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. /*
  9. EXEC proc_SMSData @flag = 'SMSToSender',@controlNo= '99266917270',@branchId = '4681', @user = 'admin',@sAgent ='4672'
  10. */
  11. CREATE proc [dbo].[proc_SMSXRateData]
  12. (
  13. @flag VARCHAR(50)
  14. ,@user VARCHAR(50) = NULL
  15. ,@branchId INT = NULL
  16. ,@agentId INT = NULL
  17. )
  18. AS
  19. SET NOCOUNT ON
  20. SET XACT_ABORT ON
  21. DECLARE @msg VARCHAR(MAX)--,@code varchar(10),@length int,@mobile varchar(50)
  22. declare @country varchar(50) = 'Nepal'
  23. select mobile from SystemEmailSetup with(nolock) where country = @country and isXRate = 'Yes'
  24. SELECT @msg = 'IME M, IME Nepal ExRate for 1 USD = 98.75 NPR as of date 10/9/2013 6:28:02 PM'
  25. insert into SMSQueue(mobileNo,msg,createdDate,createdBy,country,agentId,branchId)
  26. select mobile,@msg,getdate(),@user,@country,@agentId,@branchId
  27. from SystemEmailSetup with(nolock) where country = @country and isXRate = 'Yes'
  28. /*
  29. select
  30. @code = countryMobCode
  31. ,@length = countryMobLength
  32. from countryMaster with(nolock)
  33. where countryName = @country
  34. if @code is null or @length is null
  35. return;
  36. if len(@mobile) <> @length
  37. begin
  38. if left(@mobile,len(@code)) <> @code
  39. set @mobile = @code + @mobile
  40. end
  41. if len(@mobile)<> @length
  42. return;
  43. */
  44. GO