AS
select * from com_user where cname=@cname
if @@rowcount<1
begin
set @reason='cname error'
end
else
begin
select * from com_user where cname= @cname and pwd=@pwd
if @@rowcount<1
begin
set @reason='pwd error'
end
else
begin
set @reason='access'
end
end
GO
public in flagqiandao(int userid)
{
int uid = userid;
int flag;
mycmd = new SqlCommand("flagqiandao",myConn);
mycmd.CommandType = Command.StoredProcedure;
mycmd.parameters.add("@userid",uid);
mycmd.parameters["@flag"].Direction = ParameterDirection.Output;
mycmd.executeNonQuery();
flag = int.Parse(mycmd.Parameters["@flag"].Value.Tostring());
return flag;
}
)
AS
if @userid is NULL
select top 40 kh.khdm,kh.khmc,kh.khjc,kh.xsry from crm_khxx kh
where kh.khmc like '%' + @userid + '%' and kh.khlx='代理公司'
else
select kh.khdm,kh.khmc,kh.khjc,kh.xsry from crm_khxx kh,crm_khdlgx gx,opp_archive_issue issue
where kh.khmc like '%' + @userid + '%' and kh.khlx='代理公司' and convert(varchar,kh.khdm)= gx.dlgskhdm
and gx.ggzkhdm = convert(varchar,issue.khdm) and issue.issueid=@issueid