From 8907429179e9db44d14a7152eb7fb9375cb1ddf6 Mon Sep 17 00:00:00 2001 From: liangkun Date: Sat, 5 Aug 2023 16:34:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=97=A5=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ADR_RestrictionController.cs | 20 ++++++++++---- .../Views/ADR_Restriction/FormDay.cshtml | 27 ++++++++++--------- .../Views/ADR_Restriction/FormDay.js | 15 ++++------- 3 files changed, 35 insertions(+), 27 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ADR_RestrictionController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ADR_RestrictionController.cs index 2abbb9ee5..f106d5583 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ADR_RestrictionController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ADR_RestrictionController.cs @@ -1,8 +1,10 @@ -using Learun.Util; +using System; +using Learun.Util; using System.Data; using Learun.Application.TwoDevelopment.PersonnelManagement; using System.Web.Mvc; using System.Collections.Generic; +using System.Linq; namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers { @@ -89,10 +91,10 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers [AjaxOnly] public ActionResult GetFormDayData(string keyValue) { - var ADR_RestrictionData = aDR_RestrictionIBLL.GetADR_RestrictionDay(keyValue); + var ADR_RestrictionData = aDR_RestrictionIBLL.GetADR_RestrictionDay(keyValue).Select(m=>m.WorkDay.ToString("yyyy-MM-dd")); var jsonData = new { - ADR_RestrictionDay = ADR_RestrictionData, + ADR_RestrictionDay = string.Join(",",ADR_RestrictionData) }; return Success(jsonData); } @@ -148,8 +150,16 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers [AjaxOnly] public ActionResult SaveFormDay(string keyValue, string strEntity) { - List entity = strEntity.ToObject>(); - aDR_RestrictionIBLL.SaveFormDay(keyValue, entity); + List entity = strEntity.ToObject>(); + List listday=new List(); + foreach (var item in entity) + { + var ADR_RestrictionDayEntity = new ADR_RestrictionDayEntity(); + ADR_RestrictionDayEntity.RId = keyValue; + ADR_RestrictionDayEntity.WorkDay =Convert.ToDateTime(item); + listday.Add(ADR_RestrictionDayEntity); + } + aDR_RestrictionIBLL.SaveFormDay(keyValue, listday); if (string.IsNullOrEmpty(keyValue)) { } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/FormDay.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/FormDay.cshtml index 5450c6215..dcd9388d8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/FormDay.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ADR_Restriction/FormDay.cshtml @@ -16,16 +16,15 @@
上班日期*
- -
-
+ +
- +