增加功能:Proc_SaveUsers新建用户增加事务处理
This commit is contained in:
parent
eb45837bda
commit
7bc98fb336
|
@ -192,8 +192,10 @@ BEGIN
|
|||
begin
|
||||
if(not exists (select 1 from Users Where UserName = @userName))
|
||||
begin
|
||||
Insert Into Users (UserName, [Password], PassSalt, DisplayName, RegisterTime, ApprovedBy, ApprovedTime, [Description]) values (@userName, @password, @passSalt, @displayName, GETDATE(), @approvedBy, @approvedTime, @description)
|
||||
insert into UserRole (UserID, RoleID) select @@IDENTITY, ID from Roles where RoleName = N'Default'
|
||||
begin tran
|
||||
Insert Into Users (UserName, [Password], PassSalt, DisplayName, RegisterTime, ApprovedBy, ApprovedTime, [Description]) values (@userName, @password, @passSalt, @displayName, GETDATE(), @approvedBy, @approvedTime, @description)
|
||||
insert into UserRole (UserID, RoleID) select @@IDENTITY, ID from Roles where RoleName = N'Default'
|
||||
commit tran
|
||||
end
|
||||
end
|
||||
END
|
||||
|
|
Loading…
Reference in New Issue