This commit is contained in:
2024-05-14 10:52:21 +08:00
parent 67d2f019d4
commit 331172c12b
4 changed files with 34 additions and 9 deletions
@@ -5,6 +5,7 @@ using System.Net;
using System.Net.Http;
using System.Web.Http;
using BLL;
using Model;
namespace WebAPI.Controllers
{
@@ -350,6 +351,32 @@ namespace WebAPI.Controllers
responeData.code = 2;
responeData.data = new { testRecordId };
}
else
{
Training_TestRecord training_TestRecord = new Training_TestRecord();
training_TestRecord.TestRecordId = Guid.NewGuid().ToString();
training_TestRecord.ProjectId = projectId;
training_TestRecord.CompanyTrainingItemId = getCompanyTraining.CompanyTrainingItemId;
training_TestRecord.TestManId = person.PersonId;
db.Training_TestRecord.InsertOnSubmit(training_TestRecord);
db.SubmitChanges();
string testRecordId = APITestRecordService.CreateTestRecordItem(getCompanyTraining, training_TestRecord.TestRecordId, person, user);
responeData.code = 2;
responeData.data = new { testRecordId };
}
}
else
{
Training_TestRecord training_TestRecord = new Training_TestRecord();
training_TestRecord.TestRecordId = Guid.NewGuid().ToString();
training_TestRecord.ProjectId = projectId;
training_TestRecord.CompanyTrainingItemId= getCompanyTraining.CompanyTrainingItemId;
training_TestRecord.TestManId = user.UserId;
db.Training_TestRecord.InsertOnSubmit(training_TestRecord);
db.SubmitChanges();
string testRecordId = APITestRecordService.CreateTestRecordItem(getCompanyTraining, training_TestRecord.TestRecordId, person, user);
responeData.code = 2;
responeData.data = new { testRecordId };
}
}
}