using Edu.Model.Entity.Course;
using Edu.Model.Entity.EduTask;
using Edu.Model.ViewModel.EduTask;
using Edu.Repository.Course;
using Edu.Repository.EduTask;
using System.Collections.Generic;
using VT.FW.AOP.CustomerAttribute;
using VT.FW.DB;
namespace Edu.Module.EduTask
{
///
/// 临时上课邀请处理类
///
public class TempInvitationClassModule
{
///
/// 教务单据仓储层对象
///
private readonly RB_Education_ReceiptRepository education_ReceiptRepository = new RB_Education_ReceiptRepository();
///
/// 临时上课邀请计划仓储层对象
///
private readonly RB_Student_TempInvitationRepository student_TempInvitationRepository = new RB_Student_TempInvitationRepository();
///
/// 获取临时上课邀请列表
///
///
///
public List GetTemporaryInvitationListRepository(RB_Student_TempInvitation_ViewModel query)
{
return student_TempInvitationRepository.GetStundetTempInvitationListRepository(query);
}
///
/// 新增修改停课申请
///
///
[TransactionCallHandler]
public virtual bool SetStudentTempInvitationModule(RB_Student_TempInvitation_ViewModel extModel, string receiptFile)
{
bool flag = false;
if (extModel.Id > 0)
{
Dictionary fileds = new Dictionary()
{
{nameof(RB_Student_TempInvitation_ViewModel.OrderGuestIds),extModel.OrderGuestIds },
{nameof(RB_Student_TempInvitation_ViewModel.ClassId),extModel.ClassId },
{nameof(RB_Student_TempInvitation_ViewModel.CourseId),extModel.CourseId },
{nameof(RB_Student_TempInvitation_ViewModel.ClassTimeIds),extModel.ClassTimeIds },
{nameof(RB_Student_TempInvitation_ViewModel.TeacherId),extModel.TeacherId },
{nameof(RB_Student_TempInvitation_ViewModel.School_Id),extModel.School_Id},
{nameof(RB_Student_TempInvitation_ViewModel.UpdateBy),extModel.UpdateBy },
{nameof(RB_Student_TempInvitation_ViewModel.UpdateTime),extModel.UpdateTime },
};
flag = student_TempInvitationRepository.Update(fileds, new WhereHelper(nameof(RB_Temporary_Invitation_ViewModel.Id), extModel.Id));
}
else
{
var newId = student_TempInvitationRepository.Insert(extModel);
extModel.Id = newId;
flag = newId > 0;
if (flag)
{
var educationReceipt = new RB_Education_Receipt()
{
Id = 0,
Title = "临时上课邀请申请",
ReceiptType = Common.Enum.Finance.ReceiptTypeEnum.InvitationClass,
RelationId = newId,
ClassId = extModel.ClassId,
Group_Id = extModel.Group_Id,
School_Id = extModel.School_Id,
CreateBy = extModel.CreateBy,
CreateTime = extModel.CreateTime,
UpdateBy = extModel.UpdateBy,
UpdateTime = extModel.UpdateTime,
VerifyStatus = Common.Enum.EduTask.EduTaskRrocessStatus.NotAudit,
ReceiptFile = receiptFile
};
flag = education_ReceiptRepository.SetEducationReceiptRepository(educationReceipt, out string message);
}
}
return flag;
}
}
}