duheng
2025-03-28 e411302bca8857e102443a5250c82b9580ef07a3
WinFrmUI/PBS.WinFrmUI/02-facility/00-core/FacilitiesCtrl.cs
@@ -71,8 +71,8 @@
        public async Task SetBindingData()
        {
            this.textEditWaterModel.Properties.AddEnum(typeof(HStation.PBS.eSupplyMode));
            this.comboBoxWaterSupply.Properties.AddEnum(typeof(HStation.PBS.eWaterSupply));
            this.textEditWaterModel.Properties.AddEnum(typeof(PBS.eSupplyMode));
            this.comboBoxWaterSupply.Properties.AddEnum(typeof(PBS.eWaterSupply));
            var allPackages = await new HStation.BLL.AssetsPackageMain().GetAll();
            foreach (var item in allPackages)
            {
@@ -81,6 +81,8 @@
            }
            var list = await new PBS.BLL.Place().GetAll();
            this.treeListLookUpEdit1TreeList.DataSource = list;
            this.imageComboBoxConnectionType.Properties.AddEnum(typeof(PBS.eConnectionType));
            this.imageComboBoxConnectionType.SelectedIndex = 1;
        }
        public void SetData(Vmo.FacilityVmo model)
@@ -97,6 +99,9 @@
            this.textEditWaterModel.EditValue = model.SupplyMode;
            this.txtEditPlace.EditValue = model.PlaceID;
            this.comboBoxPackages.EditValue = model.PackageID;
            this.imageComboBoxConnectionType.EditValue = model.ConnectionType;
            this.textEditConnectionAddress.EditValue = model.ConnectionAddress;
            this.textEditMaxHeight.EditValue = model.MaxHeight;
        }
        //获取文本信息
@@ -108,7 +113,7 @@
            _facilityVmo.Name = txtName.Text;
            if (this.textEditWaterModel.EditValue != null)
            {
                _facilityVmo.SupplyMode = (HStation.PBS.eSupplyMode)this.textEditWaterModel.EditValue;
                _facilityVmo.SupplyMode = (PBS.eSupplyMode)this.textEditWaterModel.EditValue;
            }
            _facilityVmo.UseStatus = Yw.Vmo.eUseStatus.Enable;
            _facilityVmo.FloorHeight = double.Parse(txtFloorHeight.Text);
@@ -126,7 +131,17 @@
            }
            if (comboBoxWaterSupply.EditValue != null)
            {
                _facilityVmo.WaterSupply = (HStation.PBS.eWaterSupply)comboBoxWaterSupply.EditValue;
                _facilityVmo.WaterSupply = (PBS.eWaterSupply)comboBoxWaterSupply.EditValue;
            }
            if (this.imageComboBoxConnectionType.EditValue != null)
            {
                _facilityVmo.ConnectionType = (PBS.eConnectionType)this.imageComboBoxConnectionType.EditValue;
            }
            _facilityVmo.ConnectionAddress = this.textEditConnectionAddress.Text;
            if (this.textEditMaxHeight.EditValue != null)
            {
                double.TryParse(this.textEditMaxHeight.Text, out double maxHeight);
                _facilityVmo.MaxHeight = maxHeight;
            }
            return _facilityVmo;
        }