1
This commit is contained in:
@@ -445,15 +445,30 @@ namespace WebAPI.Controllers
|
||||
var person = Funs.DB.View_SitePerson_Person.FirstOrDefault(x => x.PersonId == personId);
|
||||
if (person != null)
|
||||
{
|
||||
Model.Training_TestRecord newTestRecord = new Model.Training_TestRecord
|
||||
string testRecordId = string.Empty;
|
||||
Model.Training_TestRecord testRecord = Funs.DB.Training_TestRecord
|
||||
.Where(e => e.ProjectId == projectId && e.TestManId == personId && e.TestScores == null)
|
||||
.OrderByDescending(e => e.TestStartTime)
|
||||
.FirstOrDefault();
|
||||
if (testRecord != null)
|
||||
{
|
||||
TestRecordId = SQLHelper.GetNewID(),
|
||||
ProjectId = projectId,
|
||||
TestManId = person.PersonId
|
||||
};
|
||||
TestRecordService.AddTestRecord(newTestRecord);
|
||||
testRecordId = testRecord.TestRecordId;
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.SUBQHSEDB db = Funs.DB;
|
||||
Model.Training_TestRecord newTestRecord = new Model.Training_TestRecord
|
||||
{
|
||||
TestRecordId = SQLHelper.GetNewID(),
|
||||
ProjectId = projectId,
|
||||
TestManId = personId,
|
||||
Duration = 60,
|
||||
};
|
||||
db.Training_TestRecord.InsertOnSubmit(newTestRecord);
|
||||
db.SubmitChanges();
|
||||
testRecordId = CreateTestRecordItemNew(newTestRecord.TestRecordId, person);
|
||||
}
|
||||
|
||||
var testRecordId = CreateTestRecordItemNew(newTestRecord.TestRecordId, person);
|
||||
responeData.code = 1;
|
||||
responeData.data = new { testRecordId };
|
||||
}
|
||||
@@ -473,7 +488,8 @@ namespace WebAPI.Controllers
|
||||
using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString))
|
||||
{
|
||||
var getTestTrainingItemList = (from x in Funs.DB.Training_TestTrainingItem
|
||||
where x.TrainingId == "99ccf4c8-6f8e-47da-a900-53b12a278f25" &&
|
||||
join y in Funs.DB.Training_TestTraining on x.TrainingId equals y.TrainingId
|
||||
where y.TrainingName.Contains("岗位人员试题") &&
|
||||
x.WorkPostNames.Contains(person.WorkPostName)
|
||||
orderby x.TestType, x.TrainingItemCode
|
||||
select new
|
||||
|
||||
Reference in New Issue
Block a user