增加批复人字段

This commit is contained in:
Argo-Lenovo 2016-11-11 14:47:54 +08:00
parent 676bf963e6
commit 3e465ca0d8
5 changed files with 9 additions and 1 deletions

View File

@ -67,6 +67,7 @@ namespace Bootstrap.Admin.Controllers
{
value.ApprovedTime = DateTime.Now;
value.Description = string.Format("管理员{0}创建用户", User.Identity.Name);
value.ApprovedBy = User.Identity.Name;
return UserHelper.SaveUser(value);
}

View File

@ -32,6 +32,10 @@ namespace Bootstrap.DataAccess
/// </summary>
public DateTime ApprovedTime { get; set; }
/// <summary>
/// 获得/设置 用户批复人
/// </summary>
public string ApprovedBy { get; set; }
/// <summary>
/// 获得/设置 用户的申请理由
/// </summary>
public string Description { get; set; }

View File

@ -141,6 +141,7 @@ namespace Bootstrap.DataAccess
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("@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));
DBAccessManager.SqlDBAccess.ExecuteNonQuery(cmd);
}

View File

@ -23,6 +23,7 @@ CREATE TABLE [dbo].[Users](
[DisplayName] [nvarchar](50) NOT NULL,
[RegisterTime] [datetime] NOT NULL,
[ApprovedTime] [datetime] NULL,
[ApprovedBy] [nvarchar](50) NULL,
[Description] [nvarchar](500) NOT NULL,
CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED
(

View File

@ -176,6 +176,7 @@ CREATE PROCEDURE [dbo].[Proc_SaveUsers]
@password varchar(50),
@passSalt varchar(50),
@displayName nvarchar(50),
@approvedBy varchar(50),
@description nvarchar(500),
@userStatus int = 0 --0 1 2
WITH ENCRYPTION
@ -194,7 +195,7 @@ BEGIN
begin
declare @approveTime datetime = null
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
GO