From 29958c6a896290b74c9d40bee93608353ecb5974 Mon Sep 17 00:00:00 2001 From: gagan Date: Tue, 18 Aug 2020 06:48:10 +0000 Subject: [PATCH] --- Database/Sp/proc_customerInfo.sql | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Database/Sp/proc_customerInfo.sql diff --git a/Database/Sp/proc_customerInfo.sql b/Database/Sp/proc_customerInfo.sql new file mode 100644 index 0000000..b038c0e --- /dev/null +++ b/Database/Sp/proc_customerInfo.sql @@ -0,0 +1,34 @@ +ALTER proc proc_customerInfo + @flag VARCHAR(30) , + @customerId VARCHAR(20) = NULL, + @user VARCHAR(20) = NULL +AS +SET NOCOUNT ON; +SET XACT_ABORT ON; +BEGIN +IF @flag = 'getCustomerAndReceiverInfo' +BEGIN + DECLARE @customerIdNew BIGINT, @rowId BIGINT + select @customerIdNew = CUSTOMERID FROM CUSTOMERMASTER WHERE MEMBERSHIPID =@customerId + + IF len(@customerId) > 7 + BEGIN + select @customerIdNew = CUSTOMERID FROM CUSTOMERMASTER WHERE MEMBERSHIPID =@customerId + END + ELSE + BEGIN + SELECT @customerIdNew = CUSTOMERID FROM customerMaster WHERE postalCode = @CUSTOMERID + END + IF cast(@customerIdNew as varchar) IS NULL + BEGIN + SELECT '1' Error_Code,'Customer Doesnot Exists' Msg,@CUSTOMERID id + RETURN + END + SELECT fullname,membershipId FROM customerMaster WHERE CUSTOMERID = @customerIdNew + SELECT isnull(firstname,'') + isnull(' '+middleName,'') + isnull(' ' + lastname1,'') [fullname], + isnull(address,''), + isnull(mobile,''), + isnull(idType,''),isnull(idnumber,'') + FROM receiverInformation WHERE customerId = @customerIdNew +END +END