--GetUserDetails Alter PROCEDURE GetUserDetails @MobileNo bigint, @Password Nvarchar(100) AS BEGIN SET NOCOUNT ON;
IF EXISTS (SELECT 1 FROM Users WHERE MobileNo = @MobileNo AND Password=@Password AND KycStatus = 1) BEGIN
SELECT U.UserID, U.MobileNo, U.Firstname, U.Lastname, U.KycStatus, U.CratedDate, U.Password, R.RoleName FROM Users U INNER JOIN UserCredential C ON U.UserID = C.UserID INNER JOIN Roles R ON U.RoleID = R.RoleID WHERE U.MobileNo = @MobileNo; END ELSE BEGIN
SELECT 'Error: KYC status is not valid.' AS ErrorMessage; END END;