增加批复人字段
This commit is contained in:
parent
676bf963e6
commit
3e465ca0d8
|
@ -67,6 +67,7 @@ namespace Bootstrap.Admin.Controllers
|
||||||
{
|
{
|
||||||
value.ApprovedTime = DateTime.Now;
|
value.ApprovedTime = DateTime.Now;
|
||||||
value.Description = string.Format("管理员{0}创建用户", User.Identity.Name);
|
value.Description = string.Format("管理员{0}创建用户", User.Identity.Name);
|
||||||
|
value.ApprovedBy = User.Identity.Name;
|
||||||
return UserHelper.SaveUser(value);
|
return UserHelper.SaveUser(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,10 @@ namespace Bootstrap.DataAccess
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime ApprovedTime { get; set; }
|
public DateTime ApprovedTime { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 获得/设置 用户批复人
|
||||||
|
/// </summary>
|
||||||
|
public string ApprovedBy { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// 获得/设置 用户的申请理由
|
/// 获得/设置 用户的申请理由
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
|
|
|
@ -141,6 +141,7 @@ namespace Bootstrap.DataAccess
|
||||||
cmd.Parameters.Add(DBAccessManager.SqlDBAccess.CreateParameter("@passSalt", p.PassSalt, ParameterDirection.Input));
|
cmd.Parameters.Add(DBAccessManager.SqlDBAccess.CreateParameter("@passSalt", p.PassSalt, ParameterDirection.Input));
|
||||||
cmd.Parameters.Add(DBAccessManager.SqlDBAccess.CreateParameter("@displayName", p.DisplayName, ParameterDirection.Input));
|
cmd.Parameters.Add(DBAccessManager.SqlDBAccess.CreateParameter("@displayName", p.DisplayName, ParameterDirection.Input));
|
||||||
cmd.Parameters.Add(DBAccessManager.SqlDBAccess.CreateParameter("@description", DBAccess.ToDBValue(p.Description), ParameterDirection.Input));
|
cmd.Parameters.Add(DBAccessManager.SqlDBAccess.CreateParameter("@description", DBAccess.ToDBValue(p.Description), ParameterDirection.Input));
|
||||||
|
cmd.Parameters.Add(DBAccessManager.SqlDBAccess.CreateParameter("@approvedBy", DBAccess.ToDBValue(p.ApprovedBy), ParameterDirection.Input));
|
||||||
cmd.Parameters.Add(DBAccessManager.SqlDBAccess.CreateParameter("@userStatus", p.UserStatus, ParameterDirection.Input));
|
cmd.Parameters.Add(DBAccessManager.SqlDBAccess.CreateParameter("@userStatus", p.UserStatus, ParameterDirection.Input));
|
||||||
DBAccessManager.SqlDBAccess.ExecuteNonQuery(cmd);
|
DBAccessManager.SqlDBAccess.ExecuteNonQuery(cmd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ CREATE TABLE [dbo].[Users](
|
||||||
[DisplayName] [nvarchar](50) NOT NULL,
|
[DisplayName] [nvarchar](50) NOT NULL,
|
||||||
[RegisterTime] [datetime] NOT NULL,
|
[RegisterTime] [datetime] NOT NULL,
|
||||||
[ApprovedTime] [datetime] NULL,
|
[ApprovedTime] [datetime] NULL,
|
||||||
|
[ApprovedBy] [nvarchar](50) NULL,
|
||||||
[Description] [nvarchar](500) NOT NULL,
|
[Description] [nvarchar](500) NOT NULL,
|
||||||
CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED
|
CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED
|
||||||
(
|
(
|
||||||
|
|
|
@ -176,6 +176,7 @@ CREATE PROCEDURE [dbo].[Proc_SaveUsers]
|
||||||
@password varchar(50),
|
@password varchar(50),
|
||||||
@passSalt varchar(50),
|
@passSalt varchar(50),
|
||||||
@displayName nvarchar(50),
|
@displayName nvarchar(50),
|
||||||
|
@approvedBy varchar(50),
|
||||||
@description nvarchar(500),
|
@description nvarchar(500),
|
||||||
@userStatus int = 0 --0表示管理员创建 1标示用户注册 2标示管理员批复
|
@userStatus int = 0 --0表示管理员创建 1标示用户注册 2标示管理员批复
|
||||||
WITH ENCRYPTION
|
WITH ENCRYPTION
|
||||||
|
@ -194,7 +195,7 @@ BEGIN
|
||||||
begin
|
begin
|
||||||
declare @approveTime datetime = null
|
declare @approveTime datetime = null
|
||||||
if @userStatus = 0 set @approveTime = GETDATE()
|
if @userStatus = 0 set @approveTime = GETDATE()
|
||||||
Insert Into Users (UserName, [Password], PassSalt, DisplayName, RegisterTime, ApprovedTime, [Description]) values (@userName, @password, @passSalt, @displayName, GETDATE(), @approveTime, @description)
|
Insert Into Users (UserName, [Password], PassSalt, DisplayName, RegisterTime, ApprovedTime, ApprovedBy, [Description]) values (@userName, @password, @passSalt, @displayName, GETDATE(), @approveTime, @approvedBy, @description)
|
||||||
end
|
end
|
||||||
END
|
END
|
||||||
GO
|
GO
|
||||||
|
|
Loading…
Reference in New Issue