| | |
| | | using System.Windows.Media.Imaging; |
| | | using Yw.DAL.Basic; |
| | | using Yw.EPAnet; |
| | | using Yw.Hydro; |
| | | using Yw.Model; |
| | | |
| | | namespace Yw.WinFrmUI |
| | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(HydroTankViewModel visualViewModel, HydroTankMatchingViewModel matching) |
| | | { |
| | | var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); |
| | | visualViewModel.UpdateProperty(); |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroTankInfo visual, HydroTankMatchingViewModel matching) |
| | | { |
| | | if (hydroInfo == null) |
| | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(HydroBluntheadViewModel visualViewModel, HydroBluntheadMatchingViewModel matching) |
| | | { |
| | | var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); |
| | | visualViewModel.UpdateProperty(); |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroBluntheadInfo visual, HydroBluntheadMatchingViewModel matching) |
| | | { |
| | | if (hydroInfo == null) |
| | |
| | | #endregion |
| | | |
| | | #region 弯头 |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(HydroElbowViewModel visualViewModel, HydroElbowMatchingViewModel matching) |
| | | { |
| | | var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); |
| | | visualViewModel.UpdateProperty(); |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(HydroThreelinkViewModel visualViewModel, HydroThreelinkMatchingViewModel matching) |
| | | { |
| | | var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); |
| | | visualViewModel.UpdateProperty(); |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroThreelinkInfo visual, HydroThreelinkMatchingViewModel matching) |
| | | { |
| | | if (hydroInfo == null) |
| | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(HydroFourlinkViewModel visualViewModel, HydroFourlinkMatchingViewModel matching) |
| | | { |
| | | var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); |
| | | visualViewModel.UpdateProperty(); |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroFourlinkInfo visual, HydroFourlinkMatchingViewModel matching) |
| | | { |
| | | if (hydroInfo == null) |
| | |
| | | #endregion |
| | | |
| | | #region 喷头 |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(HydroNozzleViewModel visualViewModel, HydroNozzleMatchingViewModel matching) |
| | | { |
| | | var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); |
| | | visualViewModel.UpdateProperty(); |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(HydroHydrantViewModel visualViewModel, HydroHydrantMatchingViewModel matching) |
| | | { |
| | | var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); |
| | | visualViewModel.UpdateProperty(); |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroHydrantInfo visual, HydroHydrantMatchingViewModel matching) |
| | | { |
| | | if (hydroInfo == null) |
| | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(HydroMeterViewModel visualViewModel, HydroMeterMatchingViewModel matching) |
| | | { |
| | | var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); |
| | | visualViewModel.UpdateProperty(); |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroMeterInfo visual, HydroMeterMatchingViewModel matching) |
| | | { |
| | | if (hydroInfo == null) |
| | |
| | | #endregion |
| | | |
| | | #region 流量计 |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(HydroFlowmeterViewModel visualViewModel, HydroFlowmeterMatchingViewModel matching) |
| | | { |
| | | var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); |
| | | visualViewModel.UpdateProperty(); |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(HydroPressmeterViewModel visualViewModel, HydroPressmeterMatchingViewModel matching) |
| | | { |
| | | var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); |
| | | visualViewModel.UpdateProperty(); |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroPressmeterInfo visual, HydroPressmeterMatchingViewModel matching) |
| | | { |
| | | if (hydroInfo == null) |
| | |
| | | #endregion |
| | | |
| | | #region 管道 |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(HydroPipeViewModel visualViewModel, HydroPipeMatchingViewModel matching) |
| | | { |
| | | var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); |
| | | visualViewModel.UpdateProperty(); |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | |
| | | #endregion |
| | | |
| | | #region 过渡件 |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(HydroTranslationViewModel visualViewModel, HydroTranslationMatchingViewModel matching) |
| | | { |
| | | var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); |
| | | visualViewModel.UpdateProperty(); |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | |
| | | #endregion |
| | | |
| | | #region 水泵 |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(HydroPumpViewModel visualViewModel, HydroPumpMatchingViewModel matching) |
| | | { |
| | | var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); |
| | | visualViewModel.UpdateProperty(); |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | |
| | | #endregion |
| | | |
| | | #region 阀门 |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(HydroValveViewModel visualViewModel, HydroValveMatchingViewModel matching) |
| | | { |
| | | var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); |
| | | visualViewModel.UpdateProperty(); |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(HydroExchangerViewModel visualViewModel, HydroExchangerMatchingViewModel matching) |
| | | { |
| | | var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); |
| | | visualViewModel.UpdateProperty(); |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroExchangerInfo visual, HydroExchangerMatchingViewModel matching) |
| | | { |
| | | if (hydroInfo == null) |
| | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(HydroCompressorViewModel visualViewModel, HydroCompressorMatchingViewModel matching) |
| | | { |
| | | var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); |
| | | visualViewModel.UpdateProperty(); |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(Yw.Model.HydroModelInfo hydroInfo, Yw.Model.HydroCompressorInfo visual, HydroCompressorMatchingViewModel matching) |
| | | { |
| | | if (hydroInfo == null) |
| | |
| | | if (!string.IsNullOrEmpty(matching.MatchingModelType)) |
| | | { |
| | | visual.ModelType = matching.MatchingModelType; |
| | | visual.UpdatePropStatus(nameof(visual.ModelType), ePropStatus.Normal, "匹配修复"); |
| | | result = true; |
| | | } |
| | | if (!string.IsNullOrEmpty(matching.MatchingDbId)) |
| | | { |
| | | visual.DbId = matching.MatchingDbId; |
| | | visual.UpdatePropStatus(nameof(visual.DbId), ePropStatus.Normal, "匹配修复"); |
| | | result = true; |
| | | } |
| | | if (!string.IsNullOrEmpty(matching.MatchingMaterial)) |
| | | { |
| | | visual.Material = matching.MatchingMaterial; |
| | | visual.UpdatePropStatus(nameof(visual.Material), ePropStatus.Normal, "匹配修复"); |
| | | result = true; |
| | | } |
| | | if (matching.MatchingDiameter.HasValue) |
| | | { |
| | | visual.Diameter = matching.MatchingDiameter.Value; |
| | | visual.UpdatePropStatus(nameof(visual.Diameter), ePropStatus.Normal, "匹配修复"); |
| | | result = true; |
| | | } |
| | | if (matching.MatchingMinorLoss.HasValue) |
| | | { |
| | | visual.MinorLoss = matching.MatchingMinorLoss.Value; |
| | | visual.UpdatePropStatus(nameof(visual.MinorLoss), ePropStatus.Normal, "匹配修复"); |
| | | result = true; |
| | | } |
| | | |