| | |
| | | using DevExpress.XtraEditors; |
| | | |
| | | namespace Yw.WinFrmUI |
| | | namespace Yw.WinFrmUI |
| | | { |
| | | public partial class SetHydroGradingTreeDlg : DevExpress.XtraBars.Ribbon.RibbonForm |
| | | { |
| | |
| | | |
| | | /// <summary> |
| | | /// 应用数据事件 |
| | | /// 第一个参数为 catalog |
| | | /// 第二个参数为 propname |
| | | /// 第三个参数为 是否应用成功 |
| | | /// </summary> |
| | | public event Action ApplyDataEvent; |
| | | public event Action<string, string> ApplyDataEvent; |
| | | |
| | | //模型信息 |
| | | private Yw.Model.HydroModelInfo _hydroInfo; |
| | | //所有颜色分级 |
| | | private List<HydroGradingVmo> _allGradingList = null; |
| | | //当前属性 |
| | | private HydroGradingPropTreeViewModel _currentProp = null; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | public void SetBindingData |
| | | ( |
| | | Yw.Model.HydroModelInfo hydroInfo, |
| | | List<HydroGradingVmo> allGradingList |
| | | ) |
| | | public void SetBindingData(Yw.Model.HydroModelInfo hydroInfo, List<HydroGradingVmo> allGradingList) |
| | | { |
| | | _hydroInfo = hydroInfo; |
| | | _allGradingList = allGradingList; |
| | |
| | | { |
| | | return; |
| | | } |
| | | _currentProp = obj; |
| | | this.setHydroGradingModelCtrl1.SetBindingData(_hydroInfo.ID, obj.Catalog, obj.PropName); |
| | | } |
| | | |
| | |
| | | //应用 |
| | | private async void btnApply_Click(object sender, EventArgs e) |
| | | { |
| | | var bol = await Save(); |
| | | if (!bol) |
| | | if (_currentProp == null) |
| | | { |
| | | XtraMessageBox.Show("保存失败,无法应用!"); |
| | | return; |
| | | } |
| | | this.ApplyDataEvent?.Invoke(); |
| | | if (_currentProp.Type == 0) |
| | | { |
| | | TipFormHelper.ShowWarn("请选择属性"); |
| | | return; |
| | | } |
| | | if (!await Save()) |
| | | { |
| | | TipFormHelper.ShowError("保存失败"); |
| | | return; |
| | | } |
| | | if (this.ApplyDataEvent != null) |
| | | { |
| | | this.ApplyDataEvent.Invoke(_currentProp.Catalog, _currentProp.PropName); |
| | | TipFormHelper.ShowSucceed("应用成功"); |
| | | |
| | | } |
| | | } |
| | | |
| | | } |