From 3667e2cfdd51c2084be1674b174d21158ee13bbf Mon Sep 17 00:00:00 2001 From: ndbs Date: Thu, 23 Dec 2021 10:55:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StuVolunteerPhoneController.cs | 14 +- .../Views/StuVolunteerPhone/FormApply.cshtml | 461 +++++------------- .../Views/StuVolunteerPhone/Search.cshtml | 8 +- .../StuVolunteerPhone/SearchResult.cshtml | 201 ++++---- .../StuVolunteer/StuVolunteerBLL.cs | 23 + .../StuVolunteer/StuVolunteerIBLL.cs | 6 + .../StuVolunteer/StuVolunteerService.cs | 41 +- 7 files changed, 298 insertions(+), 456 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuVolunteerPhoneController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuVolunteerPhoneController.cs index f08e5b0a1..2ba72ff8f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuVolunteerPhoneController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuVolunteerPhoneController.cs @@ -132,7 +132,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { StuVolunteerEntity entity = strEntity.ToObject(); entity.IsSubmit = false; - stuVolunteerIBLL.SaveEntity(keyValue, entity); + stuVolunteerIBLL.DraftForm(keyValue, entity); return Success("保存成功!"); } @@ -146,7 +146,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { StuVolunteerEntity entity = strEntity.ToObject(); entity.IsSubmit = true; - stuVolunteerIBLL.SaveEntity(keyValue, entity); + stuVolunteerIBLL.SubmitForm(entity.CardNo, entity); return Success("提交成功!"); } @@ -184,6 +184,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success(null); } } + + public ActionResult SearchCard(string CardNo) + { + var StuVolunteerData = stuVolunteerIBLL.GetCardId(CardNo); + var jsonData = new + { + StuVolunteer = StuVolunteerData, + }; + return Success(jsonData); + } #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteerPhone/FormApply.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteerPhone/FormApply.cshtml index d55c75b08..6f725fd9a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteerPhone/FormApply.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteerPhone/FormApply.cshtml @@ -278,363 +278,144 @@ - + }; + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteerPhone/Search.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteerPhone/Search.cshtml index b6408eb49..493ae29d8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteerPhone/Search.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteerPhone/Search.cshtml @@ -53,12 +53,16 @@ @Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuVolunteerPhone/server.js") @Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuVolunteerPhone/server.js") - + }; + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerBLL.cs index 9c73f333c..5242812ce 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerBLL.cs @@ -334,6 +334,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取StuVolunteer表实体数据 + /// + /// 主键 + /// + public StuVolunteerEntity GetCardId(string CardNo) + { + try + { + return stuVolunteerService.GetCardId(CardNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerIBLL.cs index bce7de38c..d0ac18c90 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerIBLL.cs @@ -103,6 +103,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration StuVolunteerEntity IsEnrollByCard(string CardNo); + /// + /// 获取StuVolunteer表实体数据 + /// + /// 主键 + /// + StuVolunteerEntity GetCardId(string keyValue); #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerService.cs index 7e33e69df..e1f8f9feb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerService.cs @@ -173,8 +173,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion - - #region + #region 扩展代码 /// /// 去重 @@ -367,16 +366,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - if (!string.IsNullOrEmpty(keyValue)) - { - entity.Modify(keyValue); - this.BaseRepository("CollegeMIS").Update(entity); - } - else - { - entity.Create(); - this.BaseRepository("CollegeMIS").Insert(entity); - } + entity.Modify(keyValue); + entity.UpdateTime = DateTime.Now; + } catch (Exception ex) { @@ -401,6 +393,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration try { entity.Modify(keyValue); + entity.UpdateTime = DateTime.Now; this.BaseRepository("CollegeMIS").Update(entity); } catch (Exception ex) @@ -433,6 +426,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + /// + /// 获取StuVolunteer表实体数据 + /// + /// 主键 + /// + public StuVolunteerEntity GetCardId(string CardId) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(x => x.CardNo == CardId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion } }