105040 Fix 动力刹车线逻辑

This commit is contained in:
lihanbo 2024-12-23 12:04:21 +08:00
parent 9ffe8c8080
commit 5b11cae2cd
2 changed files with 7 additions and 5 deletions

View File

@ -1,5 +1,6 @@
using HandyControl.Controls;
using Sinvo.EplanHpD.Plugin.Service;
using Sinvo.EplanHpD.Plugin.Service.Model;
using Sinvo.EplanHpD.Plugin.WPFUI.Enum;
using Sinvo.EplanHpD.Plugin.WPFUI.Models;
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
@ -8,6 +9,7 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Security.Cryptography.X509Certificates;
using System.Security.RightsManagement;
using System.Windows.Shapes;
@ -106,7 +108,7 @@ public class CableLectotypeViewModel : INotifyPropertyChanged
//DrawingNo = DrawingNo,
//CableModelNo = CableModelNo,
CableConnectionClass = cableConnectionType,
CableType = "动力线",
CableType = CableType.Contains("刹车") ? "动力刹车线" : "动力线",
LineCount = PowerLineParagraph,
//PowerLineLength = PowerLineLength,
//CurrentLineNumber = i,
@ -331,10 +333,10 @@ public class CableLectotypeViewModel : INotifyPropertyChanged
public bool SaveToDb()
{
var id = Motor.OccPartId;
var json = Newtonsoft.Json.JsonConvert.SerializeObject(this);
var service = new MotorLectotypeService();
return service.SaveMotorLectotypeData(id, json);
// 查找或添加 Motor
return service.SaveMotorLectotypeData(Motor.OccPartId, this);
}
public event PropertyChangedEventHandler PropertyChanged;