ÎļþÃû´Ó WinFrmUI/HStation.WinFrmUI.Assets.Core/01-ValveManage/ValveManageMainPanel.cs ÐÞ¸Ä |
| | |
| | | { |
| | | InitializeComponent(); |
| | | this.PageTitle.Caption = "éé¨ç®¡ç"; |
| | | this.gridView1.SetNormalView(); |
| | | this.gridView1.RegistCustomDrawRowIndicator(); |
| | | this.PageTitle.HeaderSvgImage = this.svgImageCollection1[0]; |
| | | this.PageTitle.SvgImageSize = new Size(24, 24); |
| | | this.valveTypeTreeListCtrl1.RloadEvent += ValveTypeTreeListCtrl1_RloadEvent; |
| | | } |
| | | |
| | | private BLL.ValveMain _Bll = null; |
| | | private BLL.ValveMain _bll = null; |
| | | |
| | | private List<ValveMainViewModel> _allBindingList = new List<ValveMainViewModel>(); |
| | | |
| | | //åå§åæ°æ® |
| | | public override void InitialDataSource() |
| | | { |
| | | _Bll = new BLL.ValveMain(); |
| | | _bll = new BLL.ValveMain(); |
| | | this.valveTypeTreeListCtrl1.SetBindingData(); |
| | | this.valveMainViewModelBindingSource.DataSource = _allBindingList; |
| | | } |
| | | |
| | | private async void ValveTypeTreeListCtrl1_RloadEvent(long SeriesID) |
| | | { |
| | | var alllist = await _Bll.GetBySeriesID(SeriesID); |
| | | var alllist = await _bll.GetBySeriesID(SeriesID); |
| | | _allBindingList.Clear(); |
| | | foreach (var item in alllist) |
| | | { |
| | |
| | | dlg.SetBindingData(seriesid); |
| | | dlg.ReloadDataEvent += async (rhs) => |
| | | { |
| | | var id = await _Bll.Insert(rhs); |
| | | var id = await _bll.Insert(rhs); |
| | | if (id > 0) |
| | | { |
| | | rhs.ID = id; |
| | |
| | | dlg.SetBindingData(vm.ID); |
| | | dlg.ReloadDataEvent += async (rhs) => |
| | | { |
| | | if (await _Bll.Update(rhs)) |
| | | if (await _bll.Update(rhs)) |
| | | { |
| | | vm.Reset(rhs); |
| | | this.valveMainViewModelBindingSource.ResetBindings(false); |
| | |
| | | }; |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | //å é¤éé¨ |
| | | private async void BtnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var currentVm = this.gridView1.GetCurrentViewModel(_allBindingList); |
| | | if (currentVm == null) |
| | | { |
| | | MessageBoxHelper.ShowWarning("è¯·éæ©æ°æ®è¡ï¼"); |
| | | return; |
| | | } |
| | | if (MessageBoxHelper.IsClickOk($"确认å 餿°æ®è¡?", "æç¤º")) |
| | | return; |
| | | var groupresult = await _bll.DeleteByID(currentVm.ID); |
| | | if (groupresult) |
| | | { |
| | | _allBindingList.Remove(currentVm); |
| | | this.valveMainViewModelBindingSource.ResetBindings(false); |
| | | TipFormHelper.ShowSucceed("å 餿å!"); |
| | | } |
| | | else |
| | | { |
| | | TipFormHelper.ShowSucceed("å é¤å¤±è´¥!"); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |