CREATE PROC [dbo].[LoadData] ( @mode int=NULL, @id int=null ) AS BEGIN IF(@mode=1) BEGIN IF(@id>0) BEGIN SELECT * FROM tbl_user Where pk_userid=@id and bActive=1 END ELSE BEGIN SELECT usr1.pk_userid, usr1.username, case usr1.roleid when 1 then 'Admin' when 2 then 'User' when 3 then 'Sub User' WHEN 4 then 'Partner' else 'Super Admin' END as UserRole, ISNULL(usr2.username,'') As Head FROM tbl_user usr1 LEFT JOIN tbl_user usr2 ON usr1.headuserid=usr2.pk_userid WHERE usr1.bActive=1 AND usr1.roleid IN (1) --WHERE usr1.bActive=1 AND usr1.roleid NOT IN (5) END END END
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)