|
@@ -113,10 +113,21 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
/// <param name="obj"></param>
|
|
/// <param name="obj"></param>
|
|
private void DgSelect(object obj)
|
|
private void DgSelect(object obj)
|
|
{
|
|
{
|
|
|
|
+ int count = 0;
|
|
BasDeviceWithSchModel dtlSch = (BasDeviceWithSchModel)obj;
|
|
BasDeviceWithSchModel dtlSch = (BasDeviceWithSchModel)obj;
|
|
|
|
+
|
|
if(dtlSch != null)
|
|
if(dtlSch != null)
|
|
{
|
|
{
|
|
- SchItemList = new ObservableCollection<BasDeviceWithSchModel>(allDeviceAndSchList.FindAll(x => ((x.ProjectName == dtlSch.ProjectName) && (x.DeviceName == dtlSch.DeviceName))));
|
|
|
|
|
|
+ var schs = allDeviceAndSchList.FindAll(x => ((x.ProjectName == dtlSch.ProjectName) && (x.DeviceName == dtlSch.DeviceName)));
|
|
|
|
+ foreach(var sch in schs)
|
|
|
|
+ {
|
|
|
|
+ if(sch!=null)
|
|
|
|
+ {
|
|
|
|
+ count++;
|
|
|
|
+ sch.DisId = count;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ SchItemList = new ObservableCollection<BasDeviceWithSchModel>(schs);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -306,7 +317,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
var schDtoList = _mapper.Map<List<bas_plc_test_scheme>, List<BasicPlcTestSchemeDto>>(schlist);
|
|
var schDtoList = _mapper.Map<List<bas_plc_test_scheme>, List<BasicPlcTestSchemeDto>>(schlist);
|
|
try
|
|
try
|
|
{
|
|
{
|
|
-
|
|
|
|
|
|
+ int count = 0;
|
|
foreach (var item in allDeviceKinds)
|
|
foreach (var item in allDeviceKinds)
|
|
{
|
|
{
|
|
|
|
|
|
@@ -318,6 +329,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
string deviceKind = _iBasicDeviceKindService.Find((int)item.DeviceKindId)?.devicekind_name;
|
|
string deviceKind = _iBasicDeviceKindService.Find((int)item.DeviceKindId)?.devicekind_name;
|
|
//在测试方案中查找此设备类型的所有方案
|
|
//在测试方案中查找此设备类型的所有方案
|
|
var schs = schDtoList.FindAll(x => x.DeviceKindName == deviceKind);
|
|
var schs = schDtoList.FindAll(x => x.DeviceKindName == deviceKind);
|
|
|
|
+
|
|
//设备方案
|
|
//设备方案
|
|
foreach (var sch in schs)
|
|
foreach (var sch in schs)
|
|
{
|
|
{
|
|
@@ -351,11 +363,14 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
{
|
|
{
|
|
totalTestStu = "已测试";
|
|
totalTestStu = "已测试";
|
|
}
|
|
}
|
|
|
|
+
|
|
//只添加选择的项目
|
|
//只添加选择的项目
|
|
if (projectName == selectProjectName)
|
|
if (projectName == selectProjectName)
|
|
{
|
|
{
|
|
|
|
+ count++;
|
|
allDeviceList.Add(new BasDeviceWithSchModel()
|
|
allDeviceList.Add(new BasDeviceWithSchModel()
|
|
- {
|
|
|
|
|
|
+ {
|
|
|
|
+ DisId=count,
|
|
DeviceId = item.DeviceId,
|
|
DeviceId = item.DeviceId,
|
|
DeviceNo = item.DeviceNo,
|
|
DeviceNo = item.DeviceNo,
|
|
DeviceName = item.DeviceName,
|
|
DeviceName = item.DeviceName,
|
|
@@ -368,6 +383,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
});
|
|
});
|
|
conditionDevices.Add(new BasDeviceWithSchModel()
|
|
conditionDevices.Add(new BasDeviceWithSchModel()
|
|
{
|
|
{
|
|
|
|
+ DisId = count,
|
|
DeviceId = item.DeviceId,
|
|
DeviceId = item.DeviceId,
|
|
DeviceNo = item.DeviceNo,
|
|
DeviceNo = item.DeviceNo,
|
|
DeviceName = item.DeviceName,
|
|
DeviceName = item.DeviceName,
|
|
@@ -382,7 +398,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
- conditionDevices = conditionDevices.OrderBy(x => x.DeviceId).ToList();
|
|
|
|
|
|
+ conditionDevices = conditionDevices.OrderBy(x => x.DisId).ToList();
|
|
Getpage();
|
|
Getpage();
|
|
}
|
|
}
|
|
catch(Exception ex)
|
|
catch(Exception ex)
|