38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using WX.CRM.BLL.Base;
|
|
using WX.CRM.DAL.Exam;
|
|
using WX.CRM.IBLL.Exam;
|
|
using WX.CRM.Model.Entity;
|
|
|
|
namespace WX.CRM.BLL.Exam
|
|
{
|
|
public class EXAM_ITEMBANK_BL : DbContextRepository<EXAM_ITEMBANK>, IEXAM_ITEMBANK
|
|
{
|
|
private EXAM_ITEMBANK_DAL _dal = new EXAM_ITEMBANK_DAL();
|
|
public void Import(EXAM_ITEMBANK itembank, List<EXAM_ITEMBANKSUBJECT> subject)
|
|
{
|
|
using (var db = new crmContext())
|
|
{
|
|
itembank.ID = new SEQUENCES_BL().Seq_base_get();
|
|
itembank.CTIME = DateTime.Now;
|
|
|
|
foreach (var item in subject)
|
|
{
|
|
item.ID = new SEQUENCES_BL().Seq_base_get();
|
|
item.ITEMBANKID = itembank.ID;
|
|
}
|
|
|
|
db.EXAM_ITEMBANK.Add(itembank);
|
|
db.EXAM_ITEMBANKSUBJECT.AddRange(subject);
|
|
db.SaveChanges();
|
|
}
|
|
}
|
|
|
|
public decimal GenerateExam(decimal paperType, decimal eid)
|
|
{
|
|
return _dal.GenerateExam(paperType, eid);
|
|
}
|
|
}
|
|
}
|