数据库变更CNPC_XJYJ
This commit is contained in:
@@ -80,7 +80,7 @@ namespace WebAPI.Controllers
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
var getTasks = new Model.SGGLDB(Funs.ConnString).Training_Task.FirstOrDefault(x => x.PlanId == trainingPlanId);
|
||||
var getTasks = new Model.CNPCDB(Funs.ConnString).Training_Task.FirstOrDefault(x => x.PlanId == trainingPlanId);
|
||||
if (getTasks != null)
|
||||
{
|
||||
if (CommonService.IsMainUnitOrAdmin(userId))
|
||||
@@ -193,7 +193,7 @@ namespace WebAPI.Controllers
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
var getTestPlan = new Model.SGGLDB(Funs.ConnString).Training_TestPlan.FirstOrDefault(e => e.TestPlanId == testPlanId && e.States != "3" && e.TestStartTime <= DateTime.Now && e.TestEndTime >= DateTime.Now);
|
||||
var getTestPlan = new Model.CNPCDB(Funs.ConnString).Training_TestPlan.FirstOrDefault(e => e.TestPlanId == testPlanId && e.States != "3" && e.TestStartTime <= DateTime.Now && e.TestEndTime >= DateTime.Now);
|
||||
if (getTestPlan != null)
|
||||
{
|
||||
var person = PersonService.GetPersonByUserId(personId, getTestPlan.ProjectId);
|
||||
@@ -202,7 +202,7 @@ namespace WebAPI.Controllers
|
||||
//2-考试中;生成考试试卷
|
||||
if (getTestPlan.States == "2" )
|
||||
{
|
||||
var testRecord = new Model.SGGLDB(Funs.ConnString).Training_TestRecord.FirstOrDefault(x => x.TestPlanId == getTestPlan.TestPlanId && x.TestManId == person.PersonId && !x.TestEndTime.HasValue);
|
||||
var testRecord = new Model.CNPCDB(Funs.ConnString).Training_TestRecord.FirstOrDefault(x => x.TestPlanId == getTestPlan.TestPlanId && x.TestManId == person.PersonId && !x.TestEndTime.HasValue);
|
||||
if (testRecord != null)
|
||||
{
|
||||
string testRecordId = APITestRecordService.CreateTestRecordItem(getTestPlan, testRecord.TestRecordId, person);
|
||||
@@ -215,7 +215,7 @@ namespace WebAPI.Controllers
|
||||
if (string.IsNullOrEmpty(getTestPlan.PlanId) && getTestPlan.UnitIds.Contains(person.UnitId) && (getTestPlan.WorkPostIds == null || getTestPlan.WorkPostIds.Contains(person.WorkPostId)))
|
||||
{
|
||||
//0-待提交;1-已发布未考试 将人员添加进考试记录
|
||||
var testTRecord = new Model.SGGLDB(Funs.ConnString).Training_TestRecord.FirstOrDefault(x => x.TestPlanId == testPlanId && x.TestManId == personId);
|
||||
var testTRecord = new Model.CNPCDB(Funs.ConnString).Training_TestRecord.FirstOrDefault(x => x.TestPlanId == testPlanId && x.TestManId == personId);
|
||||
if ((getTestPlan.States == "0" || getTestPlan.States == "1") && testTRecord == null && !string.IsNullOrEmpty(personId))
|
||||
{
|
||||
Model.Training_TestRecord newTestRecord = new Model.Training_TestRecord
|
||||
@@ -262,7 +262,7 @@ namespace WebAPI.Controllers
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
var getTestPlan = new Model.SGGLDB(Funs.ConnString).Training_TestPlan.FirstOrDefault(e => e.TestPlanId == testPlanId);
|
||||
var getTestPlan = new Model.CNPCDB(Funs.ConnString).Training_TestPlan.FirstOrDefault(e => e.TestPlanId == testPlanId);
|
||||
if (getTestPlan != null)
|
||||
{
|
||||
|
||||
@@ -299,7 +299,7 @@ namespace WebAPI.Controllers
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
using (var db = new Model.CNPCDB(Funs.ConnString))
|
||||
{
|
||||
var getCompanyTraining = db.Training_CompanyTrainingItem.FirstOrDefault(e => e.CompanyTrainingItemCode == companyTrainingItemCode);
|
||||
if (getCompanyTraining != null)
|
||||
|
||||
Reference in New Issue
Block a user