Code
//返回select * from m3_user where u_mask=@MASK 和 @RET
CREATE proc m3_user_login
@MASK varchar(64),
@PASSWORD varchar(64),
@RET int output
as
set nocount on
declare @DBPWD varchar(64)
if not exists (select 1 from m3_user where u_mask=@MASK)
set @RET = -1
else
begin
select @DBPWD = isnull(u_passwd,'') from m3_user where u_mask=@MASK
if @DBPWD <> @PASSWORD
set @RET=0
else
begin
select * from m3_user where u_mask=@MASK
set @RET = 1
end
end
GO
Code
UserData ud = (new BLL.User()).Login(strAccount, WebHelper.PutPwd(strPwd), out nRet);
public UserData Login(String strMask, String strPassword, out Int32 nRet)
{
// check account is card no
//检查 错误类型 0,-1
UserData userdata = dal.Login(strMask, strPassword, out nRet);
//即返回了UserData userdata 也得到了 out nRet
if (nRet == (Int32)ENUM_RET_LOGIN.RET_SUCCESS)//根据nRet判断
{
}
else
{
return null;
}
}
发表于
2009-01-14 18:00
小昊
阅读( 1551)
评论()
编辑
收藏
举报
|
|