From 36489513b40ebf9d5c8a754dd845c913ff7884e0 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Mon, 19 Aug 2024 17:09:15 +0800 Subject: [PATCH] 1 --- .../Ghre/Ghre_CourseWareServices.cs | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/Tiobon.Core.Services/Ghre/Ghre_CourseWareServices.cs b/Tiobon.Core.Services/Ghre/Ghre_CourseWareServices.cs index 3e4c51f3..e25b59cb 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_CourseWareServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_CourseWareServices.cs @@ -66,6 +66,7 @@ public class Ghre_CourseWareServices : BaseServices x.CourseWareId = Id); await _ghre_CourseWareAttachmentServices.Add(editModel.Attachments); + return await base.Update(Id, editModel); } @@ -93,6 +94,48 @@ public class Ghre_CourseWareServices : BaseServices(sql); +// for (int i = 0; i < questionAnswers.Count; i++) +// { +// await Db.Deleteable(new Ghre_QuestionAnswer() { Id = questionAnswers[i].Id }).ExecuteCommandAsync(); +// sql = $@"UPDATE A +//SET A.TaxisNo = B.NUM +//FROM Ghre_QuestionAnswer A +// JOIN +// (SELECT ID, NUM * 100 NUM +// FROM (SELECT *, ROW_NUMBER () OVER (ORDER BY TaxisNo) NUM +// FROM (SELECT * +// FROM (SELECT * +// FROM Ghre_QuestionAnswer +// WHERE QuestionId = '{questionAnswers[i].QuestionId}') A) B) C) B +// ON A.ID = b.ID; + + + +//UPDATE Ghre_QuestionAnswer +//SET QuestionNo = +// CASE TaxisNo +// WHEN 100 THEN 'A' +// WHEN 200 THEN 'B' +// WHEN 300 THEN 'C' +// WHEN 400 THEN 'D' +// WHEN 500 THEN 'E' +// WHEN 600 THEN 'F' +// WHEN 700 THEN 'G' +// WHEN 800 THEN 'H' +// WHEN 900 THEN 'I' +// WHEN 1000 THEN 'J' +// WHEN 1100 THEN 'K' +// WHEN 1200 THEN 'L' +// END +//WHERE QuestionId = '{questionAnswers[i].QuestionId}'"; +// await Db.Ado.SqlQueryAsync(sql); +// } + return result; }