webservice 调用修改
This commit is contained in:
@@ -29,7 +29,7 @@ namespace BLL
|
||||
ProjectId = x.ProjectId,
|
||||
TestPlanId = x.TestPlanId,
|
||||
TestManId = x.TestManId,
|
||||
TestManName = db.SitePerson_Person.FirstOrDefault(p => p.PersonId == x.TestManId).PersonName,
|
||||
//TestManName = db.SitePerson_Person.FirstOrDefault(p => p.PersonId == x.TestManId).PersonName,
|
||||
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
|
||||
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
|
||||
TestScores = x.TestScores ?? 0,
|
||||
@@ -83,7 +83,7 @@ namespace BLL
|
||||
TestPlanId = x.TestPlanId,
|
||||
TestPlanName = y.PlanName,
|
||||
TestManId = x.TestManId,
|
||||
TestManName = db.SitePerson_Person.First(u => u.PersonId == x.TestManId).PersonName,
|
||||
// TestManName = db.SitePerson_Person.First(u => u.PersonId == x.TestManId).PersonName,
|
||||
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
|
||||
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
|
||||
TestPlanEndTime = x.TestStartTime.HasValue ? string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime.Value.AddMinutes(x.Duration)) : "",
|
||||
@@ -813,39 +813,40 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
#region 根据TestRecord生成一条补考记录
|
||||
/// <summary>
|
||||
/// 根据TestRecord生成一条补考记录
|
||||
/// </summary>
|
||||
/// <param name="testRecord"></param>
|
||||
public static string getResitTestRecord(Model.Training_TestRecord getTestRecord)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{ Model.Training_TestRecord newTestRecord = new Model.Training_TestRecord
|
||||
#region 根据TestRecord生成一条补考记录
|
||||
/// <summary>
|
||||
/// 根据TestRecord生成一条补考记录
|
||||
/// </summary>
|
||||
/// <param name="testRecord"></param>
|
||||
public static string getResitTestRecord(Model.Training_TestRecord getTestRecord)
|
||||
{
|
||||
TestRecordId = SQLHelper.GetNewID(),
|
||||
ProjectId = getTestRecord.ProjectId,
|
||||
TestPlanId = getTestRecord.TestPlanId,
|
||||
TestManId = getTestRecord.TestManId,
|
||||
TestType = getTestRecord.TestType,
|
||||
TemporaryUser = getTestRecord.TemporaryUser,
|
||||
Duration = getTestRecord.Duration,
|
||||
// TestStartTime = DateTime.Now,
|
||||
};
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Training_TestRecord newTestRecord = new Model.Training_TestRecord
|
||||
{
|
||||
TestRecordId = SQLHelper.GetNewID(),
|
||||
ProjectId = getTestRecord.ProjectId,
|
||||
TestPlanId = getTestRecord.TestPlanId,
|
||||
TestManId = getTestRecord.TestManId,
|
||||
TestType = getTestRecord.TestType,
|
||||
TemporaryUser = getTestRecord.TemporaryUser,
|
||||
Duration = getTestRecord.Duration,
|
||||
// TestStartTime = DateTime.Now,
|
||||
};
|
||||
|
||||
db.Training_TestRecord.InsertOnSubmit(newTestRecord);
|
||||
db.SubmitChanges();
|
||||
db.Training_TestRecord.InsertOnSubmit(newTestRecord);
|
||||
db.SubmitChanges();
|
||||
|
||||
var getTestPlan = db.Training_TestPlan.FirstOrDefault(x => x.TestPlanId == newTestRecord.TestPlanId);
|
||||
var user = db.Sys_User.FirstOrDefault(x => x.UserId == newTestRecord.TestManId);
|
||||
var person = PersonService.GetPersonByUserId(newTestRecord.TestManId, getTestPlan.ProjectId);
|
||||
if (getTestPlan != null && person != null)
|
||||
{
|
||||
CreateTestRecordItem(getTestPlan, newTestRecord.TestRecordId, person, user);
|
||||
}
|
||||
return newTestRecord.TestRecordId;
|
||||
var getTestPlan = db.Training_TestPlan.FirstOrDefault(x => x.TestPlanId == newTestRecord.TestPlanId);
|
||||
var user = db.Sys_User.FirstOrDefault(x => x.UserId == newTestRecord.TestManId);
|
||||
var person = PersonService.GetPersonByUserIdForApi(newTestRecord.TestManId, getTestPlan.ProjectId);
|
||||
if (getTestPlan != null && person != null)
|
||||
{
|
||||
CreateTestRecordItem(getTestPlan, newTestRecord.TestRecordId, person, user);
|
||||
}
|
||||
return newTestRecord.TestRecordId;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user