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.

34 lines
1.1 KiB

4 years ago
  1. ALTER proc proc_customerInfo
  2. @flag VARCHAR(30) ,
  3. @customerId VARCHAR(20) = NULL,
  4. @user VARCHAR(20) = NULL
  5. AS
  6. SET NOCOUNT ON;
  7. SET XACT_ABORT ON;
  8. BEGIN
  9. IF @flag = 'getCustomerAndReceiverInfo'
  10. BEGIN
  11. DECLARE @customerIdNew BIGINT, @rowId BIGINT
  12. select @customerIdNew = CUSTOMERID FROM CUSTOMERMASTER WHERE MEMBERSHIPID =@customerId
  13. IF len(@customerId) > 7
  14. BEGIN
  15. select @customerIdNew = CUSTOMERID FROM CUSTOMERMASTER WHERE MEMBERSHIPID =@customerId
  16. END
  17. ELSE
  18. BEGIN
  19. SELECT @customerIdNew = CUSTOMERID FROM customerMaster WHERE postalCode = @CUSTOMERID
  20. END
  21. IF cast(@customerIdNew as varchar) IS NULL
  22. BEGIN
  23. SELECT '1' Error_Code,'Customer Doesnot Exists' Msg,@CUSTOMERID id
  24. RETURN
  25. END
  26. SELECT fullname,membershipId FROM customerMaster WHERE CUSTOMERID = @customerIdNew
  27. SELECT isnull(firstname,'') + isnull(' '+middleName,'') + isnull(' ' + lastname1,'') [fullname],
  28. isnull(address,''),
  29. isnull(mobile,''),
  30. isnull(idType,''),isnull(idnumber,'')
  31. FROM receiverInformation WHERE customerId = @customerIdNew
  32. END
  33. END