diff --git a/YLErpDAL/BLL_System/ViewUser.cs b/YLErpDAL/BLL_System/ViewUser.cs index 4179b09e..319e62bb 100644 --- a/YLErpDAL/BLL_System/ViewUser.cs +++ b/YLErpDAL/BLL_System/ViewUser.cs @@ -17,6 +17,7 @@ namespace BaseOUDAL get { if (State == 0) return "正常"; + if (State == 2) return "已注销"; return "禁用"; } } diff --git a/YLErpWeb/Controllers/SystemController.cs b/YLErpWeb/Controllers/SystemController.cs index 06118809..5b7d0681 100644 --- a/YLErpWeb/Controllers/SystemController.cs +++ b/YLErpWeb/Controllers/SystemController.cs @@ -1,11 +1,22 @@ -using Dapper; +using BaseOUDAL; +using Dapper; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.EntityFrameworkCore; using Newtonsoft.Json; +using Org.BouncyCastle.Asn1.Ocsp; +using System; +using System.Collections.Generic; using System.Data; +using System.Linq; using YLErp.Abstract; using YLErp.BLL; +using YLErp.DBModels; using YLErp.DBModels.Consts; using YLErp.Modules.DictionaryModule; using YLErp.Modules.SystemModule; +using YLErp.Web.Models; namespace YLErp.Web.Controllers { @@ -667,7 +678,7 @@ namespace YLErp.Web.Controllers r.Password = null; return View(r); } - + [MyAuthorize("系统管理-用户管理")] public ActionResult UserLevelView(int id) { @@ -852,6 +863,15 @@ namespace YLErp.Web.Controllers } } + public JsonResult accountDelete(int accountIds) + { + var r = basedb.SystemUsers.Find(accountIds); + r.State = 2; + basedb.SaveChanges(); + new SysUserService(CurUser).UpdateState(accountIds, 2); + return JsonSuccess("注销账户成功", r); + } + public JsonResult accountAble(int accountIds) { var r = basedb.SystemUsers.Find(accountIds); diff --git a/YLErpWeb/Views/System/UserEdit.cshtml b/YLErpWeb/Views/System/UserEdit.cshtml index 85e60d8a..0689f9c8 100644 --- a/YLErpWeb/Views/System/UserEdit.cshtml +++ b/YLErpWeb/Views/System/UserEdit.cshtml @@ -169,7 +169,7 @@