xiaochanghai 10 months ago
parent ec08aa656c
commit 36489513b4
  1. 43
      Tiobon.Core.Services/Ghre/Ghre_CourseWareServices.cs

@ -66,6 +66,7 @@ public class Ghre_CourseWareServices : BaseServices<Ghre_CourseWare, Ghre_Course
editModel.Attachments.ForEach(x => x.CourseWareId = Id);
await _ghre_CourseWareAttachmentServices.Add(editModel.Attachments);
return await base.Update(Id, editModel);
}
@ -93,6 +94,48 @@ public class Ghre_CourseWareServices : BaseServices<Ghre_CourseWare, Ghre_Course
result.result.DT_TableDataT1[0].CourseWareNo = null;
result.result.DT_TableDataT1[0].CourseWareName = null;
}
// string sql = "SELECT Id,QuestionId from Ghre_QuestionAnswer where AnswerContent='单选题'";
// var questionAnswers = await Db.Ado.SqlQueryAsync<Ghre_QuestionAnswer>(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<Ghre_QuestionAnswer>(sql);
// }
return result;
}

Loading…
Cancel
Save