------------------------------------
--用途:增加一条记录
--项目名称:
--说明:
--时间:2012/7/28 17:28:40
------------------------------------
CREATE PROCEDURE Pur_UserMenu_ADD
@UserID nvarchar(50),
@ModuleID int
AS
INSERT INTO [Pur_UserMenu](
[UserID],[ModuleID]
)VALUES(
@UserID,@ModuleID
)
------------------------------------
--用途:删除一条记录
--项目名称:
--说明:
--时间:2012/7/28 17:29:18
------------------------------------
CREATE PROCEDURE Pur_UserInfo_Delete
@UserID nvarchar(50)
AS
DELETE [Pur_UserInfo]
WHERE UserID=@UserID
-- =============================================
-- Author: huangxuening
-- Create date: 2012-7-28
-- Description: 模糊查询用户信息
-- =============================================
create proc Pur_UserInfo_GetUserByIDSo
@UserID nvarchar(200),
@UsedStatus nvarchar(200),
@LockFlag nvarchar(200)
as
declare @sql varchar(2000)
begin
set @sql= 'select
UserID 用户ID,
[password] 密码,
(case when UsedStatus =1 then ''启用'' else ''停用'' end )as 状态 ,
(case when LockFlag =1 then ''未锁定'' else ''锁定'' end )as 锁定状态 ,
remark 备注,
LastLoginTime 最后一次登录
from
Pur_UserInfo where 1=1'
--判断编号
if @UserID <>''
set @sql=@sql+' and UserID like ''%'+@UserID+'%'''
--判断结账客户名称
if @UsedStatus<>''
set @sql=@sql+' and UsedStatus like ''%'+@UsedStatus+'%'''
--判断结账客户代码
if @LockFlag <>''
set @sql=@sql+'and LockFlag like ''%'+@LockFlag+'%'''
exec(@sql)
end
------------------------------------
--用途:修改一条记录
--项目名称:
--说明:
--时间:2012/7/28 17:29:18
------------------------------------
CREATE PROCEDURE Pur_UserInfo_Update
@UserID nvarchar(50),
@PassWord nvarchar(100),
@UsedStatus nchar(1),
@LockFlag nchar(1),
@Remark nvarchar(500),
@LastLoginTime datetime
AS
begin
delete from Pur_UserInfo where UserID=@UserID
INSERT INTO Pur_UserInfo(
UserID,
PassWord,
UsedStatus,
LockFlag,
Remark,
LastLoginTime
)VALUES(
@UserID,
@PassWord,
@UsedStatus,
@LockFlag,
@Remark,
@LastLoginTime
)
end
------------------------------------
--用途:修改一条记录
--项目名称:
--说明:
--时间:2012/7/28 17:29:18
------------------------------------
alter PROCEDURE Pur_UserInfo_Update
@UserID nvarchar(50),
@PassWord nvarchar(100),
@UsedStatus nchar(1),
@LockFlag nchar(1),
@Remark nvarchar(500),
@LastLoginTime datetime
AS
begin
begin
delete from Pur_UserMenu where UserID=@UserID
delete from Pur_UserInfo where UserID=@UserID
end
begin
INSERT INTO Pur_UserInfo(
UserID,
PassWord,
UsedStatus,
LockFlag,
Remark,
LastLoginTime
)VALUES(
@UserID,
@PassWord,
@UsedStatus,
@LockFlag,
@Remark,
@LastLoginTime
)
end
end
------------------------------------
--用途:增加一条记录
--项目名称:
--说明:
--时间:2012/7/28 17:28:40
------------------------------------
alter PROCEDURE Pur_UserMenu_Update
@UserID nvarchar(50),
@ModuleID int
AS
begin
INSERT INTO Pur_UserMenu(
UserID,
ModuleID
)VALUES(
@UserID,
@ModuleID
)
end