| | |
| | | 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; |
| | |
| | | _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)) |