Commit 463f067d authored by 黄奎's avatar 黄奎

页面修改

parent 8ab77fd5
......@@ -11,21 +11,16 @@ namespace Edu.Common.Enum.Question
public enum LevelTypeEnum
{
/// <summary>
/// 高考日语
///N1
/// </summary>
[EnumField("高考日语")]
GaoKao = 6,
[EnumField("N1")]
N1 = 1,
/// <summary>
/// N5
/// </summary>
[EnumField("N5")]
N5 = 5,
/// <summary>
///N4
///N2
/// </summary>
[EnumField("N4")]
N4 = 4,
[EnumField("N2")]
N2 = 2,
/// <summary>
///N3
......@@ -34,15 +29,20 @@ namespace Edu.Common.Enum.Question
N3 = 3,
/// <summary>
///N2
///N4
/// </summary>
[EnumField("N2")]
N2 = 2,
[EnumField("N4")]
N4 = 4,
/// <summary>
///N1
/// N5
/// </summary>
[EnumField("N1")]
N1 = 1,
[EnumField("N5")]
N5 = 5,
/// <summary>
/// 高考日语
/// </summary>
[EnumField("高考日语")]
GaoKao = 6,
}
}
using Edu.AOP.CustomerAttribute;
using Edu.Common.Enum;
using Edu.Common.Enum.Question;
using Edu.Model.ViewModel.Question;
using Edu.Repository.Question;
using System.Collections.Generic;
......@@ -181,6 +182,17 @@ namespace Edu.Module.Question
return flag;
}
/// <summary>
/// 批量修改问题考级程度
/// </summary>
/// <param name="levelTypeEnum"></param>
/// <param name="questionIdList"></param>
/// <returns></returns>
public bool SetBatchQuestionLevelModule(LevelTypeEnum levelTypeEnum, List<int> questionIdList)
{
return questionRepository.SetBatchQuestionLevelRepository(levelTypeEnum, questionIdList);
}
/// <summary>
/// 批量添加问题
/// </summary>
......
using Edu.Common.Enum;
using Edu.Common.Enum.Question;
using Edu.Model.ViewModel.Question;
using System.Collections.Generic;
using System.Linq;
......@@ -97,6 +98,19 @@ WHERE 1=1 ");
return GetPage<RB_Question_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
}
/// <summary>
/// 批量更新问题考级程度
/// </summary>
/// <param name="levelTypeEnum"></param>
/// <param name="questionIdList"></param>
/// <returns></returns>
public bool SetBatchQuestionLevelRepository(LevelTypeEnum levelTypeEnum, List<int> questionIdList)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(" UPDATE RB_Question SET LevelType={0} WHERE QuestionId IN ({1}) ", (int)levelTypeEnum, string.Join(",", questionIdList));
return base.Execute(builder.ToString()) > 0;
}
}
}
\ No newline at end of file
......@@ -579,6 +579,19 @@ namespace Edu.WebApi.Controllers.Course
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 批量修改问题考级程度
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetBatchQuestionLevel()
{
var LevelType = (LevelTypeEnum)base.ParmJObj.GetInt("LevelType");
List<int> questionIds = Common.Plugin.JsonHelper.DeserializeObject<List<int>>(base.ParmJObj.GetStringValue("questionIds"));
var flag = questionModule.SetBatchQuestionLevelModule(LevelType, questionIds);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 选择题验证
/// </summary>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment