From f888c6b193905ac23e3ceec6a852a045423239b6 Mon Sep 17 00:00:00 2001 From: gongpei Date: Tue, 2 Sep 2025 18:00:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=96=B0=E5=A2=9E=E5=B7=B2?= =?UTF-8?q?=E6=B3=A8=E9=94=80=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YLErpDAL/BLL_System/ViewUser.cs | 1 + YLErpWeb/Controllers/SystemController.cs | 24 ++++++++++++-- YLErpWeb/Views/System/UserEdit.cshtml | 2 +- YLErpWeb/Views/System/UserIndex.cshtml | 41 ++++++++++++++++-------- 4 files changed, 51 insertions(+), 17 deletions(-) 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 @@
- @Html.DropDownListFor(model => model.State, new SelectListItem[] { new SelectListItem { Text = "正常", Value = "0" }, new SelectListItem { Text = "禁用", Value = "1" } }) + @Html.DropDownListFor(model => model.State, new SelectListItem[] { new SelectListItem { Text = "正常", Value = "0" }, new SelectListItem { Text = "禁用", Value = "1" }, new SelectListItem { Text = "已注销", Value = "2" } })
diff --git a/YLErpWeb/Views/System/UserIndex.cshtml b/YLErpWeb/Views/System/UserIndex.cshtml index a012d7be..243d23f7 100644 --- a/YLErpWeb/Views/System/UserIndex.cshtml +++ b/YLErpWeb/Views/System/UserIndex.cshtml @@ -11,7 +11,7 @@ }; } -@section JS{ +@section JS {