0917-005-gaofei

This commit is contained in:
gaofei
2021-09-17 16:04:52 +08:00
parent d8dc0be1ce
commit 938713a942
6 changed files with 182 additions and 90 deletions
@@ -47,7 +47,7 @@ namespace FineUIPro.Web.Personal
/// </summary>
private void Tab1LoadData()
{
var user = Funs.DB.Sys_User.FirstOrDefault(x=>x.UserId == this.CurrUser.UserId);
var user = Funs.DB.Sys_User.FirstOrDefault(x => x.UserId == this.CurrUser.UserId);
if (user != null)
{
this.txtUserName.Text = user.UserName;
@@ -70,7 +70,7 @@ namespace FineUIPro.Web.Personal
{
this.drpNation.Text = NationVules.ConstText;
}
var units = Funs.DB.Base_Unit.FirstOrDefault(x=>x.UnitId == user.UnitId);
var units = Funs.DB.Base_Unit.FirstOrDefault(x => x.UnitId == user.UnitId);
if (units != null)
{
this.drpUnit.Text = units.UnitName;
@@ -98,6 +98,50 @@ namespace FineUIPro.Web.Personal
}
}
}
#endregion
#endregion
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
var q = Funs.DB.Sys_User.FirstOrDefault(x => x.Account == this.txtAccount.Text.Trim() && (x.UserId != this.CurrUser.UserId || (this.CurrUser.UserId == null && x.UserId != null)));
if (q != null)
{
Alert.ShowInParent("输入的账号已存在!", MessageBoxIcon.Warning);
return;
}
if (!string.IsNullOrEmpty(this.txtUserCode.Text))
{
var q2 = Funs.DB.Sys_User.FirstOrDefault(x => x.UserCode == this.txtUserCode.Text.Trim() && (x.UserId != this.CurrUser.UserId || (this.CurrUser.UserId == null && x.UserId != null)));
if (q2 != null)
{
Alert.ShowInParent("输入的编号已存在!", MessageBoxIcon.Warning);
return;
}
}
if (!string.IsNullOrEmpty(this.txtIdentityCard.Text) && BLL.UserService.IsExistUserIdentityCard(this.CurrUser.UserId, this.txtIdentityCard.Text.Trim()) == true)
{
Alert.ShowInParent("输入的身份证号码已存在!", MessageBoxIcon.Warning);
return;
}
Model.Sys_User newUser = new Model.Sys_User
{
UserCode = this.txtUserCode.Text.Trim(),
UserName = this.txtUserName.Text.Trim(),
Account = this.txtAccount.Text.Trim(),
IdentityCard = this.txtIdentityCard.Text.Trim(),
Email = this.txtEmail.Text.Trim(),
Telephone = this.txtTelephone.Text.Trim(),
};
newUser.UserId = this.CurrUser.UserId;
UserService.UpdateUserInfo(newUser);
Alert.ShowInParent("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
}
}