duheng
2024-09-27 0e54c48e8190937f5b483c79e3cc9d17ec7c9af0
WinFrmUI/HStation.WinFrmUI.Basic/02-SysPropManage/EditSysPropDlg.cs
@@ -9,16 +9,17 @@
        public EditSysPropDlg()
        {
            InitializeComponent();
            this.IconOptions.Icon = Yw.WinFrmUI.GlobalParas.AppIcon;
        }
        public event Func<Yw.Dto.UpdateSysPropInput, Task<bool>> ReloadDataEvent = null;
        public event Func<Yw.Vmo.SysPropVmo, Task<bool>> ReloadDataEvent = null;
        private UpdateSysPropInput _UpdatePropDto { get; set; }
        private Yw.Vmo.SysPropVmo _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;
@@ -87,31 +88,31 @@
            _UpdatePropDto.UnitName = TextEditUnitName.Text.Trim();
            if (TextComoBoxFormat.SelectedIndex == 0)
            {
                _UpdatePropDto.Format = ePropFormat.Integer;
                _UpdatePropDto.Format = (Yw.Basic.ePropFormat)ePropFormat.Integer;
            }
            else if (TextComoBoxFormat.SelectedIndex == 1)
            {
                _UpdatePropDto.Format = ePropFormat.Bigint;
                _UpdatePropDto.Format = (Yw.Basic.ePropFormat)ePropFormat.Bigint;
            }
            else if (TextComoBoxFormat.SelectedIndex == 2)
            {
                _UpdatePropDto.Format = ePropFormat.Numeric;
                _UpdatePropDto.Format = (Yw.Basic.ePropFormat)ePropFormat.Numeric;
            }
            else if (TextComoBoxFormat.SelectedIndex == 3)
            {
                _UpdatePropDto.Format = ePropFormat.Text;
                _UpdatePropDto.Format = (Yw.Basic.ePropFormat)ePropFormat.Text;
            }
            else if (TextComoBoxFormat.SelectedIndex == 4)
            {
                _UpdatePropDto.Format = ePropFormat.MultiText;
                _UpdatePropDto.Format = (Yw.Basic.ePropFormat)ePropFormat.MultiText;
            }
            else if (TextComoBoxFormat.SelectedIndex == 5)
            {
                _UpdatePropDto.Format = ePropFormat.Time;
                _UpdatePropDto.Format = (Yw.Basic.ePropFormat)ePropFormat.Time;
            }
            else
            {
                _UpdatePropDto.Format = ePropFormat.Boolen;
                _UpdatePropDto.Format = (Yw.Basic.ePropFormat)ePropFormat.Boolen;
            }
            _UpdatePropDto.IsNull = CheckEditIsNull.Checked;
            if (await this.ReloadDataEvent.Invoke(_UpdatePropDto))