修改公司级培训

This commit is contained in:
2024-11-20 17:47:24 +08:00
parent f4e6755b17
commit 70ff1350bb
25 changed files with 3546 additions and 108 deletions
@@ -152,5 +152,37 @@ namespace BLL
}
return icount;
}
public static void AddTestRecordForApi(Model.Training_TestRecord testRecord)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Training_TestRecord newTestRecord = new Model.Training_TestRecord
{
TestRecordId = testRecord.TestRecordId,
ProjectId = testRecord.ProjectId,
TestPlanId = testRecord.TestPlanId,
TestManId = testRecord.TestManId,
TestType = testRecord.TestType,
};
if (string.IsNullOrEmpty(newTestRecord.TestType))
{
var getTrainTypeName = (from x in db.Training_TestPlan
join y in db.Training_Plan on x.PlanId equals y.PlanId
join z in db.Base_TrainType on y.TrainTypeId equals z.TrainTypeId
where x.TestPlanId == testRecord.TestPlanId
select z).FirstOrDefault();
if (getTrainTypeName != null)
{
testRecord.TestType = getTrainTypeName.TrainTypeName;
}
}
db.Training_TestRecord.InsertOnSubmit(newTestRecord);
db.SubmitChanges();
}
}
}
}