| | |
| | | namespace HStation.WinFrmUI.Assets |
| | | using DevExpress.XtraEditors.Controls; |
| | | |
| | | namespace HStation.WinFrmUI.Assets |
| | | { |
| | | public partial class AddAssetsPackageSeriesDlg : DevExpress.XtraEditors.XtraForm |
| | | { |
| | |
| | | this.Load += AddAssetsEquipmentSeriesDlg_Load; |
| | | } |
| | | |
| | | public event Func<Vmo.AssetsPackageSeriesVmo, object, Task<bool>> ReloadDataEvent = null; |
| | | public event Func<Vmo.AssetsPackageSeriesVmo, object, object, Task<bool>> ReloadDataEvent = null; |
| | | |
| | | private List<AssetsPackageSeriesViewModel> _assetsEquipmentSeriesViews; |
| | | |
| | |
| | | _assetsEquipmentSeriesViews.Add(new AssetsPackageSeriesViewModel(item)); |
| | | } |
| | | } |
| | | var manufacturerList = await new BLL.AssetsManufacturer().GetAll(); |
| | | if (manufacturerList != null) |
| | | { |
| | | foreach (var item in manufacturerList) |
| | | { |
| | | var imageItem = new ImageComboBoxItem(item.Name, item.ID); |
| | | textEditManufacturer.Properties.Items.Add(imageItem); |
| | | } |
| | | } |
| | | treeListLookUpEdit1TreeList.DataSource = _assetsEquipmentSeriesViews; |
| | | var bll = new Yw.BLL.SysCatalog(); |
| | | var alllist = await bll.GetAll(); |
| | | foreach (var item in alllist) |
| | | { |
| | | var imageItem = new ImageComboBoxItem(item.Name, item.ID); |
| | | TextEditCatalogChoice.Properties.Items.Add(imageItem); |
| | | } |
| | | } |
| | | |
| | | //数据验证 |
| | |
| | | model.Name = NameTextEdit.Text; |
| | | model.TagName = TagNameTextEdit.Text; |
| | | model.Description = DescriptionTextEdit.Text; |
| | | if (await this.ReloadDataEvent.Invoke(model, this.textEditParentList.EditValue)) |
| | | if (long.TryParse(TextEditCatalogChoice.EditValue?.ToString() ?? "", out long catalogID)) |
| | | { |
| | | model.CatalogID = catalogID; |
| | | } |
| | | if (await this.ReloadDataEvent.Invoke(model, this.textEditParentList.EditValue, this.textEditManufacturer.EditValue)) |
| | | { |
| | | TipFormHelper.ShowSucceed("添加成功!"); |
| | | } |