ALter PROC [Master].[usp_AccountPageView] 0,'false',0,10
@AgentID int,
@Status bit,
@PageNo smallint,
@Rows smallint
AS
BEGIN
SET @AgentID = CASE WHEN @AgentID= 0 THEN 'null' END
;with AdminStatus as (select lookupid,lookupdescription from config.lookup where LookupCategory='ADMINSTATUS')
SELECT Ac.[ID], Ac.[AgentID], Ac.[AccountName], Ac.[ContactPerson], Ac.[EmailID], Ac.[Password], Ac.[MobileNo], Ac.[AdminStatus], Ac.[Status], Ac.[CreatedOn], Ac.[CreatedBy],
ISNULL(b.LookupDescription,'') As AdminStatusDescription,Ag.AgencyName ,Ac.ProfileStatus
FROM [Master].[Account] Ac
left outer join AdminStatus b on
Ac.adminstatus = b.LookupID
Left Outer Join Master.Agent Ag ON
Ac.AgentID = Ag.ID
Where
Ac.AgentID = ISNULL(@AgentID, 0 )
And Ac.Status = @Status
ORDER BY Ac.[ID]
OFFSET @Rows * @PageNo ROWS
Fetch NEXT @Rows ROWS ONLY
END
No comments:
Post a Comment