| | |
| | | using DevExpress.XtraSpreadsheet.Model.CopyOperation; |
| | | using System.Windows.Media.Imaging; |
| | | using Yw.DAL.Basic; |
| | | using Yw.EPAnet; |
| | | using Yw.Hydro; |
| | | using Yw.Hydro; |
| | | using Yw.Model; |
| | | |
| | | namespace Yw.WinFrmUI |
| | |
| | | /// <summary> |
| | | /// 应用 |
| | | /// </summary> |
| | | public static bool Apply(HydroPumpViewModel visualViewModel, HydroPumpMatchingViewModel matching) |
| | | public static bool Apply |
| | | ( |
| | | HydroPumpViewModel visualViewModel, |
| | | HydroPumpMatchingViewModel matching, |
| | | HydroChangeHelper changeHelper = null, |
| | | HydroPropStatusHelper propStatusHelper = null |
| | | ) |
| | | { |
| | | var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching); |
| | | var bol = Apply(visualViewModel.HydroInfo, visualViewModel.Vmo, matching, changeHelper, propStatusHelper); |
| | | visualViewModel.UpdateProperty(); |
| | | return bol; |
| | | } |
| | |
| | | } |
| | | hydroInfo.Curves.Add(curveqh); |
| | | visual.CurveQH = curveqh.Code; |
| | | changeHelper?.Append(curveqh, eChangeType.Add); |
| | | changeHelper?.Append(visual, eChangeType.Update); |
| | | propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.CurveQH), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}通过产品配置匹配修改"); |
| | | result = true; |
| | | } |
| | | else |
| | |
| | | { |
| | | curveqh.DbId = matching.MatchingCurveDbId; |
| | | curveqh.CurveData = matching.MatchingCurveQH?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList(); |
| | | changeHelper?.Append(curveqh, eChangeType.Update); |
| | | result = true; |
| | | } |
| | | } |
| | |
| | | } |
| | | hydroInfo.Curves.Add(curveqp); |
| | | visual.CurveQP = curveqp.Code; |
| | | changeHelper?.Append(curveqp, eChangeType.Add); |
| | | changeHelper?.Append(visual, eChangeType.Update); |
| | | propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.CurveQP), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}通过产品配置匹配修改"); |
| | | result = true; |
| | | } |
| | | else |
| | |
| | | { |
| | | curveqp.DbId = matching.MatchingCurveDbId; |
| | | curveqp.CurveData = matching.MatchingCurveQP?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList(); |
| | | changeHelper?.Append(curveqp, eChangeType.Update); |
| | | result = true; |
| | | } |
| | | } |
| | |
| | | } |
| | | hydroInfo.Curves.Add(curveqe); |
| | | visual.CurveQE = curveqe.Code; |
| | | changeHelper?.Append(curveqe, eChangeType.Add); |
| | | changeHelper?.Append(visual, eChangeType.Update); |
| | | propStatusHelper?.UpdatePropStatus(visual.Code, nameof(visual.CurveQE), ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}通过产品配置匹配修改"); |
| | | result = true; |
| | | } |
| | | else |
| | |
| | | { |
| | | curveqe.DbId = matching.MatchingCurveDbId; |
| | | curveqe.CurveData = matching.MatchingCurveQE?.Select(x => new Yw.Model.Hydro.CurvePoint(x.X, x.Y)).ToList(); |
| | | changeHelper?.Append(curveqe, eChangeType.Update); |
| | | result = true; |
| | | } |
| | | } |