Commit c543a200 authored by 黄奎's avatar 黄奎

页面修改

parent 7262b9b1
......@@ -1526,7 +1526,7 @@ namespace Edu.Module.Course
if (flag)
{
flag = student_MakeupRepository.Insert(new RB_Student_Makeup()
flag = student_MakeupRepository.SetStudentMakeUpRepository(new RB_Student_Makeup()
{
Id = 0,
ClassCheckId = checkModel.ClassCheckId,
......
......@@ -4,6 +4,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Course
......@@ -73,5 +74,50 @@ WHERE 1=1
builder.Append(" ORDER BY A.ClassId,A.ClassDate,A.OrderGuestId ");
return GetPage<RB_Student_Makeup_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
/// <summary>
/// 新增修改学员补课信息
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetStudentMakeUpRepository(RB_Student_Makeup model)
{
bool flag = false;
var newModel = new RB_Student_Makeup()
{
Id = 0,
ClassCheckId = model.ClassCheckId,
ClassDate = model.ClassDate,
ClassId = model.ClassId,
CreateBy = model.CreateBy,
CreateTime = model.CreateTime,
Group_Id = model.Group_Id,
MakeUpStatus = 3,
OrderGuestId = model.OrderGuestId
};
newModel.Id = CheckStudentMakeUpExistsRepository(model);
if (newModel.Id > 0)
{
flag = base.Insert(newModel) > 0;
}
else
{
flag = base.Update(newModel);
}
return flag;
}
/// <summary>
/// 检查数据是否存在
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public int CheckStudentMakeUpExistsRepository(RB_Student_Makeup model)
{
List<WhereHelper> whereHelpers = new List<WhereHelper>();
whereHelpers.Add(new WhereHelper(nameof(RB_Student_Makeup.ClassCheckId), model.ClassCheckId));
whereHelpers.Add(new WhereHelper(nameof(RB_Student_Makeup.OrderGuestId), model.OrderGuestId));
return base.Exists("Id", whereHelpers);
}
}
}
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