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