copy from WinFrmUI/Yw.WinFrmUI.Hydro.Core/07-bulkset/02-node/02-junction/01-coupling/01-blunthead/HydroBluntheadBulkSetDlg.cs
copy to WinFrmUI/Yw.WinFrmUI.Hydro.Core/06-parter/08-fourlink/SetHydroFourlinkDlg.cs
Îļþ´Ó WinFrmUI/Yw.WinFrmUI.Hydro.Core/07-bulkset/02-node/02-junction/01-coupling/01-blunthead/HydroBluntheadBulkSetDlg.cs ¸´ÖÆ |
| | |
| | | namespace Yw.WinFrmUI |
| | | { |
| | | public partial class HydroBluntheadBulkSetDlg : DevExpress.XtraEditors.XtraForm |
| | | public partial class SetHydroFourlinkDlg : DevExpress.XtraEditors.XtraForm |
| | | { |
| | | public HydroBluntheadBulkSetDlg() |
| | | public SetHydroFourlinkDlg() |
| | | { |
| | | InitializeComponent(); |
| | | this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon; |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// è¿åæ°æ®äºä»¶ |
| | | /// </summary> |
| | | public event Action<List<Yw.Model.HydroBluntheadInfo>> ReloadDataEvent; |
| | | public event Action<List<Yw.Model.HydroFourlinkInfo>> ReloadDataEvent; |
| | | |
| | | // |
| | | private List<Yw.Model.HydroBluntheadInfo> _allParterList = null; |
| | | //æææä»¶å表 |
| | | private List<Yw.Model.HydroFourlinkInfo> _allParterList = null; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// ç»å®æ°æ® |
| | | /// </summary> |
| | | public void SetBindingData(Yw.Model.HydroBluntheadInfo parter) |
| | | public void SetBindingData(Yw.Model.HydroFourlinkInfo parter) |
| | | { |
| | | var allParterList = parter == null ? null : new List<Yw.Model.HydroBluntheadInfo>() { parter }; |
| | | var allParterList = parter == null ? null : new List<Yw.Model.HydroFourlinkInfo>() { parter }; |
| | | SetBindingData(allParterList); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// ç»å®æ°æ® |
| | | /// </summary> |
| | | public void SetBindingData(List<Yw.Model.HydroBluntheadInfo> allParterList) |
| | | public void SetBindingData(List<Yw.Model.HydroFourlinkInfo> allParterList) |
| | | { |
| | | _allParterList = allParterList; |
| | | if (_allParterList != null && _allParterList.Count == 1) |
| | | { |
| | | var parter = _allParterList.First(); |
| | | this.txtElev.EditValue = Math.Round(parter.Elev, 4); |
| | | this.txtMinorLoss.EditValue = parter.MinorLoss; |
| | | this.txtDemand.EditValue = parter.Demand; |
| | | this.txtMaterial.EditValue = parter.Material; |
| | | this.txtCaliber.EditValue = parter.Caliber; |
| | | this.txtElev.EditValue = Math.Round(parter.Elev, 4); |
| | | this.txtMinorLoss.EditValue = parter.MinorLoss; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | return; |
| | | } |
| | | var elev = double.Parse(this.txtElev.EditValue.ToString()); |
| | | double? minorLoss = this.txtMinorLoss.EditValue == null ? null : double.Parse(this.txtMinorLoss.EditValue.ToString()); |
| | | double? demand = this.txtDemand.EditValue == null ? null : double.Parse(this.txtDemand.EditValue.ToString()); |
| | | |
| | | var material = this.txtMaterial.Text.Trim(); |
| | | double? caliber = this.txtCaliber.EditValue == null ? null : double.Parse(this.txtCaliber.EditValue.ToString()); |
| | | var elev = double.Parse(this.txtElev.EditValue.ToString()); |
| | | double? minorLoss = this.txtMinorLoss.EditValue == null ? null : double.Parse(this.txtMinorLoss.EditValue.ToString()); |
| | | |
| | | _allParterList.ForEach(x => |
| | | { |
| | | x.Elev = elev; |
| | | x.MinorLoss = minorLoss; |
| | | x.Demand = demand; |
| | | x.Material = material; |
| | | x.Caliber = caliber; |
| | | }); |