20220928考试计划试题类型加判断
This commit is contained in:
@@ -265,18 +265,22 @@ namespace BLL
|
||||
var trainingType = TestTrainingService.GetTestTrainingById(item.TrainingTypeId);
|
||||
if (trainingType != null)
|
||||
{
|
||||
Model.Training_TestPlanTraining newPlanItem = new Model.Training_TestPlanTraining
|
||||
var getT = db.Training_TestPlanTraining.FirstOrDefault(x => x.TestPlanId == newTestPlan.TestPlanId && x.TrainingId == item.TrainingTypeId);
|
||||
if (getT == null)
|
||||
{
|
||||
TestPlanTrainingId = SQLHelper.GetNewID(),
|
||||
TestPlanId = newTestPlan.TestPlanId,
|
||||
TrainingId = item.TrainingTypeId,
|
||||
TestType1Count = item.TestType1Count,
|
||||
TestType2Count = item.TestType2Count,
|
||||
TestType3Count = item.TestType3Count,
|
||||
};
|
||||
Model.Training_TestPlanTraining newPlanItem = new Model.Training_TestPlanTraining
|
||||
{
|
||||
TestPlanTrainingId = SQLHelper.GetNewID(),
|
||||
TestPlanId = newTestPlan.TestPlanId,
|
||||
TrainingId = item.TrainingTypeId,
|
||||
TestType1Count = item.TestType1Count,
|
||||
TestType2Count = item.TestType2Count,
|
||||
TestType3Count = item.TestType3Count,
|
||||
};
|
||||
|
||||
db.Training_TestPlanTraining.InsertOnSubmit(newPlanItem);
|
||||
db.SubmitChanges();
|
||||
db.Training_TestPlanTraining.InsertOnSubmit(newPlanItem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -321,18 +325,22 @@ namespace BLL
|
||||
var trainingType = db.Training_TestTraining.FirstOrDefault(e => e.TrainingId == item.TrainingTypeId);
|
||||
if (trainingType != null)
|
||||
{
|
||||
Model.Training_TestPlanTraining newPlanItem = new Model.Training_TestPlanTraining
|
||||
var getT = db.Training_TestPlanTraining.FirstOrDefault(x => x.TestPlanId == testPlanId && x.TrainingId == item.TrainingTypeId);
|
||||
if (getT == null)
|
||||
{
|
||||
TestPlanTrainingId = SQLHelper.GetNewID(),
|
||||
TestPlanId = testPlanId,
|
||||
TrainingId = item.TrainingTypeId,
|
||||
TestType1Count = item.TestType1Count,
|
||||
TestType2Count = item.TestType2Count,
|
||||
TestType3Count = item.TestType3Count,
|
||||
};
|
||||
Model.Training_TestPlanTraining newPlanItem = new Model.Training_TestPlanTraining
|
||||
{
|
||||
TestPlanTrainingId = SQLHelper.GetNewID(),
|
||||
TestPlanId = testPlanId,
|
||||
TrainingId = item.TrainingTypeId,
|
||||
TestType1Count = item.TestType1Count,
|
||||
TestType2Count = item.TestType2Count,
|
||||
TestType3Count = item.TestType3Count,
|
||||
};
|
||||
|
||||
db.Training_TestPlanTraining.InsertOnSubmit(newPlanItem);
|
||||
db.SubmitChanges();
|
||||
db.Training_TestPlanTraining.InsertOnSubmit(newPlanItem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -459,18 +467,22 @@ namespace BLL
|
||||
{
|
||||
foreach (var item in getTrainTypeItems)
|
||||
{
|
||||
/////考试题型类别及数量
|
||||
Model.Training_TestPlanTraining newTestPlanTraining = new Model.Training_TestPlanTraining
|
||||
var getT = db.Training_TestPlanTraining.FirstOrDefault(x => x.TestPlanId == testPlanId && x.TrainingId == item.TrainingId);
|
||||
if (getT == null)
|
||||
{
|
||||
TestPlanTrainingId = SQLHelper.GetNewID(),
|
||||
TestPlanId = testPlanId,
|
||||
TrainingId = item.TrainingId,
|
||||
TestType1Count = item.SCount,
|
||||
TestType2Count = item.MCount,
|
||||
TestType3Count = item.JCount,
|
||||
};
|
||||
db.Training_TestPlanTraining.InsertOnSubmit(newTestPlanTraining);
|
||||
db.SubmitChanges();
|
||||
/////考试题型类别及数量
|
||||
Model.Training_TestPlanTraining newTestPlanTraining = new Model.Training_TestPlanTraining
|
||||
{
|
||||
TestPlanTrainingId = SQLHelper.GetNewID(),
|
||||
TestPlanId = testPlanId,
|
||||
TrainingId = item.TrainingId,
|
||||
TestType1Count = item.SCount,
|
||||
TestType2Count = item.MCount,
|
||||
TestType3Count = item.JCount,
|
||||
};
|
||||
db.Training_TestPlanTraining.InsertOnSubmit(newTestPlanTraining);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user