20220726 修改密码策略
This commit is contained in:
parent
0f7638febc
commit
31efa1eac9
|
@ -0,0 +1,4 @@
|
|||
ALTER TABLE SitePerson_Person ADD RawPassword NVARCHAR(100) NULL
|
||||
GO
|
||||
ALTER TABLE Sys_user ADD RawPassword NVARCHAR(100) NULL
|
||||
GO
|
|
@ -22,8 +22,7 @@ namespace BLL
|
|||
{
|
||||
var getUser = from x in db.SitePerson_Person
|
||||
where (x.Telephone == userInfo.Account || x.PersonName == userInfo.Account)
|
||||
&& (x.Password == Funs.EncryptionPassword(userInfo.Password)
|
||||
|| (x.IdentityCard != null && x.IdentityCard.Substring(x.IdentityCard.Length - 4) == userInfo.Password))
|
||||
&& x.Password == Funs.EncryptionPassword(userInfo.Password)
|
||||
&& x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime >= DateTime.Now) && x.IsUsed == true
|
||||
select new Model.UserItem
|
||||
{
|
||||
|
@ -812,7 +811,8 @@ namespace BLL
|
|||
{
|
||||
newPerson.IsUsed = false;
|
||||
}
|
||||
newPerson.Password = PersonService.GetPersonPassWord(person.IdentityCard);
|
||||
newPerson.RawPassword = Funs.getInitialPassword(person.UnitId, person.IdentityCard);
|
||||
newPerson.Password = Funs.EncryptionPassword(newPerson.RawPassword);
|
||||
string rootUrl = ConfigurationManager.AppSettings["localRoot"];
|
||||
if (!string.IsNullOrEmpty(rootUrl) && !string.IsNullOrEmpty(person.PhotoUrl))
|
||||
{
|
||||
|
|
|
@ -4,8 +4,8 @@ namespace BLL
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.Linq;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
|
@ -146,6 +146,7 @@ namespace BLL
|
|||
//}
|
||||
|
||||
private static object locker = new object();
|
||||
|
||||
/// <summary>
|
||||
/// 数据库上下文。
|
||||
/// </summary>
|
||||
|
@ -195,6 +196,76 @@ namespace BLL
|
|||
//return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(password, "MD5");
|
||||
}
|
||||
|
||||
#region 获取用户初始密码
|
||||
/// <summary>
|
||||
/// 获取用户初始密码
|
||||
/// </summary>
|
||||
/// <param name="password"></param>
|
||||
/// <returns></returns>
|
||||
public static string getInitialPassword(string unitId, string idCard)
|
||||
{
|
||||
string prefixValue = "CWCEC";
|
||||
string suffixValue = "1234";
|
||||
//var getUnit = UnitService.GetUnitByUnitId(unitId);
|
||||
//if (getUnit != null)
|
||||
//{
|
||||
// if (!string.IsNullOrEmpty(getUnit.UnitCode))
|
||||
// {
|
||||
// if (getUnit.UnitCode.Length > 10)
|
||||
// {
|
||||
// prefixValue = getUnit.UnitCode.Substring(getUnit.UnitCode.Length - 10);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// prefixValue = getUnit.UnitCode;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
if (!string.IsNullOrEmpty(idCard))
|
||||
{
|
||||
if (idCard.Length > 4)
|
||||
{
|
||||
suffixValue = idCard.Substring(idCard.Length - 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
suffixValue = idCard;
|
||||
}
|
||||
}
|
||||
return prefixValue + "." + suffixValue;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 验证密码
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="c"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsLetter(char c)
|
||||
{
|
||||
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
|
||||
}
|
||||
|
||||
public static bool IsDigit(char c)
|
||||
{
|
||||
return c >= '0' && c <= '9';
|
||||
}
|
||||
|
||||
static bool IsSymbol(char c)
|
||||
{
|
||||
return c > 32 && c < 127 && !IsDigit(c) && !IsLetter(c);
|
||||
}
|
||||
|
||||
public static bool IsValIDPassword(string password)
|
||||
{
|
||||
return
|
||||
password.Any(c => IsLetter(c)) &&
|
||||
password.Any(c => IsDigit(c)) &&
|
||||
password.Any(c => IsSymbol(c));
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 为目标下拉框加上 "请选择" 项
|
||||
/// </summary>
|
||||
|
|
|
@ -437,7 +437,8 @@ namespace BLL
|
|||
ProvinceCode = person.ProvinceCode,
|
||||
IsCardNoOK=IDCardValid.CheckIDCard(person.IdentityCard),
|
||||
};
|
||||
|
||||
newPerson.RawPassword = Funs.getInitialPassword(person.UnitId, person.IdentityCard);
|
||||
newPerson.Password = Funs.EncryptionPassword(newPerson.RawPassword);
|
||||
if (person.InTime.HasValue)
|
||||
{
|
||||
newPerson.InTime = person.InTime;
|
||||
|
@ -532,11 +533,30 @@ namespace BLL
|
|||
newPerson.CountryCode = person.CountryCode;
|
||||
newPerson.ProvinceCode = person.ProvinceCode;
|
||||
newPerson.IsCardNoOK = IDCardValid.CheckIDCard(person.IdentityCard);
|
||||
|
||||
newPerson.RawPassword = Funs.getInitialPassword(person.UnitId, person.IdentityCard);
|
||||
newPerson.Password = Funs.EncryptionPassword(newPerson.RawPassword);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改密码
|
||||
/// </summary>
|
||||
/// <param name="personId"></param>
|
||||
/// <param name="password"></param>
|
||||
public static void UpdateSitePersonPassword(string personId, string password)
|
||||
{
|
||||
var m = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.PersonId == personId);
|
||||
if (m != null)
|
||||
{
|
||||
m.RawPassword = password;
|
||||
m.Password = Funs.EncryptionPassword(password);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 人员离岗
|
||||
/// </summary>
|
||||
|
|
|
@ -176,12 +176,12 @@ namespace BLL
|
|||
/// <param name="password"></param>
|
||||
public static void UpdatePassword(string userId, string password)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Sys_User m = db.Sys_User.FirstOrDefault(e => e.UserId == userId);
|
||||
Model.Sys_User m = Funs.DB.Sys_User.FirstOrDefault(e => e.UserId == userId);
|
||||
if (m != null)
|
||||
{
|
||||
m.RawPassword = password;
|
||||
m.Password = Funs.EncryptionPassword(password);
|
||||
db.SubmitChanges();
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -199,6 +199,7 @@ namespace BLL
|
|||
Account = user.Account,
|
||||
UserName = user.UserName,
|
||||
UserCode = user.UserCode,
|
||||
RawPassword = user.RawPassword,
|
||||
Password = user.Password,
|
||||
UnitId = user.UnitId,
|
||||
RoleId = user.RoleId,
|
||||
|
|
|
@ -40,6 +40,9 @@
|
|||
<f:Button ID="btnCustomQuery" Text="自定义查询" Icon="SystemSearch" runat="server"
|
||||
OnClick="btnCustomQuery_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnPassRefresh" Icon="TableRefresh" runat="server" Text="重置所有人密码" ToolTip="重置所有人密码"
|
||||
OnClick="btnPassRefresh_Click" Hidden="true">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
|
|
|
@ -43,7 +43,15 @@ namespace FineUIPro.Web.Personal
|
|||
this.btnCustomQuery.Hidden = false;
|
||||
this.lbSystemVersion.Hidden = false;
|
||||
this.lbSystemVersion.Text = Funs.SystemVersion;
|
||||
this.btnPassRefresh.Hidden = false;
|
||||
}
|
||||
if (this.CurrUser.UserId == Const.sysglyId)
|
||||
{
|
||||
this.lbSystemVersion.Hidden = false;
|
||||
this.lbSystemVersion.Text = Funs.SystemVersion;
|
||||
this.btnPassRefresh.Hidden = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -154,5 +162,34 @@ namespace FineUIPro.Web.Personal
|
|||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../SysManage/CustomQuery.aspx"), "查询"));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnPassRefresh_Click(object sender, EventArgs e)
|
||||
{
|
||||
var getUsers = from x in Funs.DB.Sys_User
|
||||
where x.RawPassword == null
|
||||
select x;
|
||||
foreach (var item in getUsers)
|
||||
{
|
||||
string password = Funs.getInitialPassword(item.UnitId, item.IdentityCard);
|
||||
UserService.UpdatePassword(item.UserId, password);
|
||||
}
|
||||
|
||||
var getPersons = from x in Funs.DB.SitePerson_Person
|
||||
where x.RawPassword == null
|
||||
select x;
|
||||
foreach (var item in getPersons)
|
||||
{
|
||||
string password = Funs.getInitialPassword(item.UnitId, item.IdentityCard);
|
||||
PersonService.UpdateSitePersonPassword(item.PersonId, password);
|
||||
}
|
||||
|
||||
ShowNotify("重置成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,11 +7,13 @@
|
|||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.Personal {
|
||||
|
||||
|
||||
public partial class PersonalInfo {
|
||||
|
||||
namespace FineUIPro.Web.Personal
|
||||
{
|
||||
|
||||
|
||||
public partial class PersonalInfo
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
|
@ -20,7 +22,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
|
@ -29,7 +31,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Panel2 控件。
|
||||
/// </summary>
|
||||
|
@ -38,7 +40,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel2;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// TabStrip1 控件。
|
||||
/// </summary>
|
||||
|
@ -47,7 +49,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TabStrip TabStrip1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Tab1 控件。
|
||||
/// </summary>
|
||||
|
@ -56,7 +58,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Tab Tab1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
|
@ -65,7 +67,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// lbSystemVersion 控件。
|
||||
/// </summary>
|
||||
|
@ -74,7 +76,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lbSystemVersion;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
|
@ -83,7 +85,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnCustomQuery 控件。
|
||||
/// </summary>
|
||||
|
@ -92,7 +94,16 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnCustomQuery;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnPassRefresh 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnPassRefresh;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
|
@ -101,7 +112,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Panel3 控件。
|
||||
/// </summary>
|
||||
|
@ -110,7 +121,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel3;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
|
@ -119,7 +130,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtUserName 控件。
|
||||
/// </summary>
|
||||
|
@ -128,7 +139,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtUserName;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtUserCode 控件。
|
||||
/// </summary>
|
||||
|
@ -137,7 +148,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtUserCode;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// drpSex 控件。
|
||||
/// </summary>
|
||||
|
@ -146,7 +157,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox drpSex;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// dpBirthDay 控件。
|
||||
/// </summary>
|
||||
|
@ -155,7 +166,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox dpBirthDay;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// drpMarriage 控件。
|
||||
/// </summary>
|
||||
|
@ -164,7 +175,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox drpMarriage;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// drpNation 控件。
|
||||
/// </summary>
|
||||
|
@ -173,7 +184,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox drpNation;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// drpUnit 控件。
|
||||
/// </summary>
|
||||
|
@ -182,7 +193,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox drpUnit;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Panel4 控件。
|
||||
/// </summary>
|
||||
|
@ -191,7 +202,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel4;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtAccount 控件。
|
||||
/// </summary>
|
||||
|
@ -200,7 +211,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtAccount;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtIdentityCard 控件。
|
||||
/// </summary>
|
||||
|
@ -209,7 +220,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtIdentityCard;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtEmail 控件。
|
||||
/// </summary>
|
||||
|
@ -218,7 +229,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtEmail;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtTelephone 控件。
|
||||
/// </summary>
|
||||
|
@ -227,7 +238,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtTelephone;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// drpEducation 控件。
|
||||
/// </summary>
|
||||
|
@ -236,7 +247,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox drpEducation;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtHometown 控件。
|
||||
/// </summary>
|
||||
|
@ -245,7 +256,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtHometown;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// drpPosition 控件。
|
||||
/// </summary>
|
||||
|
@ -254,7 +265,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox drpPosition;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Panel5 控件。
|
||||
/// </summary>
|
||||
|
@ -263,7 +274,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel5;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Image1 控件。
|
||||
/// </summary>
|
||||
|
@ -272,7 +283,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Image Image1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Form7 控件。
|
||||
/// </summary>
|
||||
|
@ -281,7 +292,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form Form7;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtPerformance 控件。
|
||||
/// </summary>
|
||||
|
@ -290,7 +301,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtPerformance;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Tab2 控件。
|
||||
/// </summary>
|
||||
|
@ -299,7 +310,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Tab Tab2;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm2 控件。
|
||||
/// </summary>
|
||||
|
@ -308,7 +319,7 @@ namespace FineUIPro.Web.Personal {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm2;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -105,7 +105,12 @@
|
|||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
BLL.UserService.UpdatePassword(rowID, BLL.Const.Password);
|
||||
var getUser = UserService.GetUserByUserId(rowID);
|
||||
if (getUser != null)
|
||||
{
|
||||
string password = Funs.getInitialPassword(getUser.UnitId, getUser.IdentityCard);
|
||||
BLL.UserService.UpdatePassword(rowID, password);
|
||||
}
|
||||
}
|
||||
BindGrid();
|
||||
ShowNotify("密码已重置为原始密码!", MessageBoxIcon.Success);
|
||||
|
|
|
@ -89,6 +89,22 @@ namespace FineUIPro.Web.SysManage
|
|||
return;
|
||||
}
|
||||
|
||||
if (this.txtNewPassword.Text.Length < 8)
|
||||
{
|
||||
Alert.ShowInParent("密码长度至少8位!");
|
||||
return;
|
||||
}
|
||||
if (this.txtNewPassword.Text != this.txtConfirmPassword.Text)
|
||||
{
|
||||
Alert.ShowInParent("确认密码输入不一致!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Funs.IsValIDPassword(this.txtNewPassword.Text))
|
||||
{
|
||||
Alert.ShowInParent("密码必须包含字母、数字、特殊符号!");
|
||||
return;
|
||||
}
|
||||
BLL.UserService.UpdatePassword(user.UserId, this.txtNewPassword.Text);
|
||||
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, "修改密码", string.Empty, BLL.Const.UserMenuId, Const.BtnModify);
|
||||
|
|
|
@ -366,7 +366,8 @@ namespace FineUIPro.Web.SysManage
|
|||
var getUser = Funs.DB.Sys_User.FirstOrDefault(x => x.Account == userViews[i].Account);
|
||||
if (getUser == null)
|
||||
{
|
||||
newUser.Password = Funs.EncryptionPassword(Const.Password);
|
||||
newUser.RawPassword = Funs.getInitialPassword(newUser.UnitId, newUser.IdentityCard);
|
||||
newUser.Password = Funs.EncryptionPassword(newUser.RawPassword);
|
||||
BLL.UserService.AddUser(newUser);
|
||||
insertCount++;
|
||||
}
|
||||
|
|
|
@ -235,8 +235,9 @@ namespace FineUIPro.Web.SysManage
|
|||
}
|
||||
if (string.IsNullOrEmpty(this.UserId))
|
||||
{
|
||||
newUser.Password = Funs.EncryptionPassword(Const.Password);
|
||||
newUser.UserId = SQLHelper.GetNewID(typeof(Model.Sys_User));
|
||||
newUser.RawPassword = Funs.getInitialPassword(newUser.UnitId, newUser.IdentityCard);
|
||||
newUser.Password = Funs.EncryptionPassword(newUser.RawPassword);
|
||||
newUser.UserId = SQLHelper.GetNewID();
|
||||
newUser.DataSources = this.CurrUser.LoginProjectId;
|
||||
UserService.AddUser(newUser);
|
||||
LogService.AddSys_Log(this.CurrUser, newUser.UserCode, newUser.UserId, BLL.Const.UserMenuId, BLL.Const.BtnAdd);
|
||||
|
@ -324,10 +325,12 @@ namespace FineUIPro.Web.SysManage
|
|||
/// <param name="e"></param>
|
||||
protected void btnArrowRefresh_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.UserId))
|
||||
var getUser = UserService.GetUserByUserId(this.UserId);
|
||||
if (getUser != null)
|
||||
{
|
||||
BLL.UserService.UpdatePassword(this.UserId, BLL.Const.Password);
|
||||
ShowNotify("密码已重置为原始密码!", MessageBoxIcon.Success);
|
||||
string passWord = Funs.getInitialPassword(getUser.UnitId, getUser.IdentityCard);
|
||||
BLL.UserService.UpdatePassword(this.UserId, passWord);
|
||||
ShowNotify("密码已重置为原始密码!密码为" + passWord, MessageBoxIcon.Success);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -255428,7 +255428,7 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Address", DbType="NVarChar(200)")]
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Address", DbType="NVarChar(2000)")]
|
||||
public string Address
|
||||
{
|
||||
get
|
||||
|
@ -255492,7 +255492,7 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkAreaName", DbType="NVarChar(200)")]
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkAreaName", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
|
||||
public string WorkAreaName
|
||||
{
|
||||
get
|
||||
|
@ -257937,6 +257937,8 @@ namespace Model
|
|||
|
||||
private System.Nullable<bool> _IsCardNoOK;
|
||||
|
||||
private string _RawPassword;
|
||||
|
||||
private EntitySet<Accident_AccidentPersonRecord> _Accident_AccidentPersonRecord;
|
||||
|
||||
private EntitySet<Accident_AccidentReportOtherItem> _Accident_AccidentReportOtherItem;
|
||||
|
@ -258117,6 +258119,8 @@ namespace Model
|
|||
partial void OnRealNameUpdateTimeChanged();
|
||||
partial void OnIsCardNoOKChanging(System.Nullable<bool> value);
|
||||
partial void OnIsCardNoOKChanged();
|
||||
partial void OnRawPasswordChanging(string value);
|
||||
partial void OnRawPasswordChanged();
|
||||
#endregion
|
||||
|
||||
public SitePerson_Person()
|
||||
|
@ -259365,6 +259369,26 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RawPassword", DbType="NVarChar(100)")]
|
||||
public string RawPassword
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._RawPassword;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._RawPassword != value))
|
||||
{
|
||||
this.OnRawPasswordChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._RawPassword = value;
|
||||
this.SendPropertyChanged("RawPassword");
|
||||
this.OnRawPasswordChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Accident_AccidentPersonRecord_SitePerson_Person", Storage="_Accident_AccidentPersonRecord", ThisKey="PersonId", OtherKey="PersonId", DeleteRule="NO ACTION")]
|
||||
public EntitySet<Accident_AccidentPersonRecord> Accident_AccidentPersonRecord
|
||||
{
|
||||
|
@ -274254,6 +274278,8 @@ namespace Model
|
|||
|
||||
private string _WorkNo;
|
||||
|
||||
private string _RawPassword;
|
||||
|
||||
private EntitySet<Comprehensive_NCRManagement> _Comprehensive_NCRManagement;
|
||||
|
||||
private EntitySet<Comprehensive_PressurePipe> _Comprehensive_PressurePipe;
|
||||
|
@ -274998,6 +275024,8 @@ namespace Model
|
|||
partial void OnViceCNProfessionalIdChanged();
|
||||
partial void OnWorkNoChanging(string value);
|
||||
partial void OnWorkNoChanged();
|
||||
partial void OnRawPasswordChanging(string value);
|
||||
partial void OnRawPasswordChanged();
|
||||
#endregion
|
||||
|
||||
public Sys_User()
|
||||
|
@ -276322,6 +276350,26 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RawPassword", DbType="NVarChar(100)")]
|
||||
public string RawPassword
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._RawPassword;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._RawPassword != value))
|
||||
{
|
||||
this.OnRawPasswordChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._RawPassword = value;
|
||||
this.SendPropertyChanged("RawPassword");
|
||||
this.OnRawPasswordChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="Comprehensive_NCRManagement_Sys_User", Storage="_Comprehensive_NCRManagement", ThisKey="UserId", OtherKey="CompileMan", DeleteRule="NO ACTION")]
|
||||
public EntitySet<Comprehensive_NCRManagement> Comprehensive_NCRManagement
|
||||
{
|
||||
|
@ -337439,7 +337487,7 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Address", DbType="NVarChar(200)")]
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Address", DbType="NVarChar(2000)")]
|
||||
public string Address
|
||||
{
|
||||
get
|
||||
|
@ -337455,7 +337503,7 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkAreaName", DbType="NVarChar(200)")]
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkAreaName", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
|
||||
public string WorkAreaName
|
||||
{
|
||||
get
|
||||
|
|
Loading…
Reference in New Issue