修改公司级培训

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();
}
}
}
}
+18
View File
@@ -750,5 +750,23 @@ namespace BLL
};
}
#endregion
public static Model.SitePerson_Person GetPersonByUserIdForApi(string userId, string projectId)
{
using (var db = new Model.SGGLDB(Funs.ConnString))
{
var getPerson = db.SitePerson_Person.FirstOrDefault(e => e.PersonId == userId);
if (getPerson == null)
{
var getUser = db.Sys_User.FirstOrDefault(e => e.UserId == userId);
if (getUser != null)
{
getPerson = db.SitePerson_Person.FirstOrDefault(e => e.IdentityCard == getUser.IdentityCard && e.ProjectId == projectId);
}
}
return getPerson;
}
}
}
}