Commit 8626d680 authored by 黄奎's avatar 黄奎

页面修改

parent 5eb7bb12
......@@ -1055,20 +1055,31 @@ namespace Edu.Module.Course
/// <param name="ClassPlanId"></param>
/// <param name="UserInfo">用户信息</param>
/// <returns></returns>
public bool RemoveClassPlanModule(int ClassPlanId, UserInfo UserInfo)
[TransactionCallHandler]
public virtual bool RemoveClassPlanModule(int ClassPlanId, UserInfo UserInfo,out string message)
{
bool flag = false;
message = "";
var planModel = class_PlanRepository.GetEntity(ClassPlanId);
classLogRepository.AddClassLogRepository(new Model.Entity.Log.RB_Class_Log()
{
LogType = Common.Enum.Course.ClassLogTypeEnum.Class,
LogContent = "删除【" + Common.ConvertHelper.FormatDate(planModel?.ClassDate) + "】上课计划",
ClassId = planModel.ClassId,
CreateBy = UserInfo.Id,
Group_Id = UserInfo.Group_Id,
School_Id = UserInfo.School_Id,
});
UpdateClassEndDateModule(planModel.ClassId);
return class_PlanRepository.DeleteOne(new WhereHelper(nameof(RB_Class_Plan_ViewModel.ClassPlanId), ClassPlanId));
if (planModel != null)
{
classLogRepository.AddClassLogRepository(new Model.Entity.Log.RB_Class_Log()
{
LogType = Common.Enum.Course.ClassLogTypeEnum.Class,
LogContent = "删除【" + Common.ConvertHelper.FormatDate(planModel?.ClassDate) + "】上课计划",
ClassId = planModel.ClassId,
CreateBy = UserInfo.Id,
Group_Id = UserInfo.Group_Id,
School_Id = UserInfo.School_Id,
});
flag = UpdateClassEndDateModule(planModel.ClassId);
flag = class_PlanRepository.DeleteOne(new WhereHelper(nameof(RB_Class_Plan_ViewModel.ClassPlanId), ClassPlanId));
}
else
{
message = "此上课计划不存在,请刷新后再试!";
}
return flag;
}
/// <summary>
......
......@@ -637,9 +637,8 @@ namespace Edu.WebApi.Controllers.Course
public ApiResult RemoveClassPlan()
{
var ClassPlanId = base.ParmJObj.GetInt("ClassPlanId");
var flag = classModule.RemoveClassPlanModule(ClassPlanId, base.UserInfo);
return flag ? ApiResult.Success() : ApiResult.Failed();
var flag = classModule.RemoveClassPlanModule(ClassPlanId, base.UserInfo,out string message);
return flag ? ApiResult.Success() : ApiResult.Failed(message: message);
}
/// <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