1
This commit is contained in:
@@ -24,24 +24,53 @@ namespace BLL
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = (from x in db.Training_TestPlan
|
||||
where x.ProjectId == projectId && (x.States == states || states == null)
|
||||
orderby x.TestStartTime descending
|
||||
select new Model.TestPlanItem
|
||||
{
|
||||
TestPlanId = x.TestPlanId,
|
||||
TestPlanCode = x.PlanCode,
|
||||
TestPlanName = x.PlanName,
|
||||
ProjectId = x.ProjectId,
|
||||
TestPlanManId = x.PlanManId,
|
||||
TestPlanManName = db.Sys_User.First(y => y.UserId == x.PlanManId).UserName,
|
||||
TestPalce = x.TestPalce,
|
||||
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
|
||||
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
|
||||
States = x.States,
|
||||
QRCodeUrl = x.QRCodeUrl.Replace('\\', '/'),
|
||||
}).ToList();
|
||||
return getDataLists;
|
||||
if (string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
var getDataLists = (from x in db.Training_TestPlan
|
||||
where (x.ProjectId == null || x.ProjectId=="") && (x.States == states || states == null)
|
||||
orderby x.TestStartTime descending
|
||||
select new Model.TestPlanItem
|
||||
{
|
||||
TestPlanId = x.TestPlanId,
|
||||
TestPlanCode = x.PlanCode,
|
||||
TestPlanName = x.PlanName,
|
||||
ProjectId = x.ProjectId,
|
||||
DepartIds = x.DepartIds,
|
||||
DepartNames = WorkPostService.getDepartNamesByIdsForApi(x.DepartIds),
|
||||
TestPlanManId = x.PlanManId,
|
||||
TestPlanManName = db.Sys_User.First(y => y.UserId == x.PlanManId).UserName,
|
||||
TestPalce = x.TestPalce,
|
||||
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
|
||||
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
|
||||
States = x.States,
|
||||
QRCodeUrl = x.QRCodeUrl.Replace('\\', '/'),
|
||||
}).ToList();
|
||||
return getDataLists;
|
||||
}
|
||||
else
|
||||
{
|
||||
var getDataLists = (from x in db.Training_TestPlan
|
||||
where x.ProjectId == projectId && (x.States == states || states == null)
|
||||
orderby x.TestStartTime descending
|
||||
select new Model.TestPlanItem
|
||||
{
|
||||
TestPlanId = x.TestPlanId,
|
||||
TestPlanCode = x.PlanCode,
|
||||
TestPlanName = x.PlanName,
|
||||
ProjectId = x.ProjectId,
|
||||
TestPlanManId = x.PlanManId,
|
||||
DepartIds = x.DepartIds,
|
||||
DepartNames = WorkPostService.getDepartNamesByIdsForApi(x.DepartIds),
|
||||
TestPlanManName = db.Sys_User.First(y => y.UserId == x.PlanManId).UserName,
|
||||
TestPalce = x.TestPalce,
|
||||
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
|
||||
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
|
||||
States = x.States,
|
||||
QRCodeUrl = x.QRCodeUrl.Replace('\\', '/'),
|
||||
}).ToList();
|
||||
return getDataLists;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user