diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Models/LectotypeLineModel.cs b/Sinvo.EplanHpD.Plugin.WPFUI/Models/LectotypeLineModel.cs index bb112b6..c619aec 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/Models/LectotypeLineModel.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Models/LectotypeLineModel.cs @@ -10,6 +10,8 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Models { public string CableLectotypeId { get; set; } + public string LectotypeLineId { get; set; } + /// /// 机械机构号 /// public string MechanicalNo { get; set; } @@ -460,7 +462,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Models { return MotorExcelHelper.Instance.GetBomList(drawingNo).Where(it => { - return it.Name == "编码器线" || it.Name == "动力线"; + return it.Name == "编码器线" || it.Name == "动力线" || it.Name == "刹车线"; }).Select(it => new LectotypeLineModel { SeqNo = 0, diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Service/MotorLectotypeService.cs b/Sinvo.EplanHpD.Plugin.WPFUI/Service/MotorLectotypeService.cs index 7e85fb1..7e016d1 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/Service/MotorLectotypeService.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Service/MotorLectotypeService.cs @@ -92,6 +92,7 @@ namespace Sinvo.EplanHpD.Plugin.Service viewModel.SelectedLines = selectedLines.Select(line => new LectotypeLineModel { CableLectotypeId = line.CableLectotypeId, + LectotypeLineId = line.LectotypeLineId, SeqNo = line.SeqNo, AxisNo = line.AxisNo, CableConnectionClass = line.CableConnectionClass, @@ -248,6 +249,27 @@ namespace Sinvo.EplanHpD.Plugin.Service } } - + public int SetLineDone(string motorId,string lineId) + { + var db = DBHelper.DB; + + try + { + db.BeginTran(); + + int changeCount = db.Updateable() + .Where(mt => mt.MotorId == motorId && mt.LectotypeLineId == lineId) + .SetColumns(it => it.IsChecked == true) + .ExecuteCommand(); + + db.CommitTran(); + return changeCount; + } + catch (Exception) + { + db.RollbackTran(); + return 0; + } + } } }