Shuxia Ning
2024-08-14 44d2d7d6f3b3a4c1b5befe7ec33f3c4fc7ca5122
WinFrmUI/HStation.WinFrmUI.Basic/02-SysPropManage/EditSysPropDlg.cs
@@ -11,41 +11,41 @@
            InitializeComponent();
        }
        public event Func<Yw.Dto.UpdateSysPropInput, Task<bool>> ReloadDataEvent = null;
        public event Func<Yw.Vmo.SysProp, Task<bool>> ReloadDataEvent = null;
        private UpdateSysPropInput _UpdatePropDto { get; set; }
        private Yw.Vmo.SysProp _UpdatePropDto { get; set; }
        public async void SetBindingData(long PropID)
        {
            var model = await new Yw.BLL.SysProp().GetByID(PropID);
            _UpdatePropDto = model.Adapt<UpdateSysPropInput>();
            _UpdatePropDto = model;
            this.TextEditName.Text = _UpdatePropDto.Name;
            this.TextEditDefaultValue.Text = _UpdatePropDto.DefaultValue;
            this.TextEditDescription.Text = _UpdatePropDto.Description;
            this.TextEditUnitName.Text = _UpdatePropDto.UnitName;
            this.TextEditCode.Text = _UpdatePropDto.Code;
            this.CheckEditIsNull.Checked = _UpdatePropDto.IsNull;
            if (_UpdatePropDto.Format == Yw.Basic.ePropFormat.Bigint)
            if (_UpdatePropDto.Format == Yw.Vmo.Core.ePropFormat.Bigint)
            {
                this.TextComoBoxFormat.SelectedIndex = 1;
            }
            else if (_UpdatePropDto.Format == Yw.Basic.ePropFormat.Integer)
            else if (_UpdatePropDto.Format == Yw.Vmo.Core.ePropFormat.Integer)
            {
                this.TextComoBoxFormat.SelectedIndex = 0;
            }
            else if (_UpdatePropDto.Format == Yw.Basic.ePropFormat.MultiText)
            else if (_UpdatePropDto.Format == Yw.Vmo.Core.ePropFormat.MultiText)
            {
                this.TextComoBoxFormat.SelectedIndex = 4;
            }
            else if (_UpdatePropDto.Format == Yw.Basic.ePropFormat.Time)
            else if (_UpdatePropDto.Format == Yw.Vmo.Core.ePropFormat.Time)
            {
                this.TextComoBoxFormat.SelectedIndex = 5;
            }
            else if (_UpdatePropDto.Format == Yw.Basic.ePropFormat.Numeric)
            else if (_UpdatePropDto.Format == Yw.Vmo.Core.ePropFormat.Numeric)
            {
                this.TextComoBoxFormat.SelectedIndex = 2;
            }
            else if (_UpdatePropDto.Format == Yw.Basic.ePropFormat.Text)
            else if (_UpdatePropDto.Format == Yw.Vmo.Core.ePropFormat.Text)
            {
                this.TextComoBoxFormat.SelectedIndex = 3;
            }
@@ -87,31 +87,31 @@
            _UpdatePropDto.UnitName = TextEditUnitName.Text.Trim();
            if (TextComoBoxFormat.SelectedIndex == 0)
            {
                _UpdatePropDto.Format = ePropFormat.Integer;
                _UpdatePropDto.Format = (Yw.Vmo.Core.ePropFormat)ePropFormat.Integer;
            }
            else if (TextComoBoxFormat.SelectedIndex == 1)
            {
                _UpdatePropDto.Format = ePropFormat.Bigint;
                _UpdatePropDto.Format = (Yw.Vmo.Core.ePropFormat)ePropFormat.Bigint;
            }
            else if (TextComoBoxFormat.SelectedIndex == 2)
            {
                _UpdatePropDto.Format = ePropFormat.Numeric;
                _UpdatePropDto.Format = (Yw.Vmo.Core.ePropFormat)ePropFormat.Numeric;
            }
            else if (TextComoBoxFormat.SelectedIndex == 3)
            {
                _UpdatePropDto.Format = ePropFormat.Text;
                _UpdatePropDto.Format = (Yw.Vmo.Core.ePropFormat)ePropFormat.Text;
            }
            else if (TextComoBoxFormat.SelectedIndex == 4)
            {
                _UpdatePropDto.Format = ePropFormat.MultiText;
                _UpdatePropDto.Format = (Yw.Vmo.Core.ePropFormat)ePropFormat.MultiText;
            }
            else if (TextComoBoxFormat.SelectedIndex == 5)
            {
                _UpdatePropDto.Format = ePropFormat.Time;
                _UpdatePropDto.Format = (Yw.Vmo.Core.ePropFormat)ePropFormat.Time;
            }
            else
            {
                _UpdatePropDto.Format = ePropFormat.Boolen;
                _UpdatePropDto.Format = (Yw.Vmo.Core.ePropFormat)ePropFormat.Boolen;
            }
            _UpdatePropDto.IsNull = CheckEditIsNull.Checked;
            if (await this.ReloadDataEvent.Invoke(_UpdatePropDto))