|
@@ -13,6 +13,7 @@ using System.Collections.ObjectModel;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
+using WPFDevelopers.Helpers;
|
|
|
|
|
|
namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
{
|
|
@@ -93,6 +94,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
{
|
|
|
allDeviceList.Add(new BasDeviceWithSchModel()
|
|
|
{
|
|
|
+ ProjectId=item.ProjectId,
|
|
|
DeviceId = item.DeviceId,
|
|
|
DeviceNo = item.DeviceNo,
|
|
|
DeviceName = item.DeviceName,
|
|
@@ -105,14 +107,17 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- //所有新项目
|
|
|
+ //所有的项目
|
|
|
List<string> projectNames = allDeviceList.Select(x => x.ProjectName).Distinct().ToList();
|
|
|
foreach (var project in projectNames)
|
|
|
{
|
|
|
+ int deviceCount = (int)allDeviceList.FindAll(x => x.ProjectName == project).Select(x => x.DeviceNo)?.Distinct().Count();
|
|
|
DeviceTestCardView deviceCard = new DeviceTestCardView();
|
|
|
deviceCard.txtName.Text = project;
|
|
|
deviceCard.txtProjectNo.Text = _iBasicProjectService.FindByProjectName(project)?.project_no;
|
|
|
deviceCard.txtPProjectLeader.Text = _iBasicProjectService.FindByProjectName(project)?.project_leader;
|
|
|
+ deviceCard.txtDeviceCount.Text = deviceCount.ToString();
|
|
|
+ deviceCard.txtNoTestCount.Text = deviceCount.ToString();
|
|
|
//赋值
|
|
|
allProjectePicList.Add(deviceCard);
|
|
|
}
|