namespace HStation.WinFrmUI
|
{
|
public partial class ThreeLinkSingleMatchingForm : DevExpress.XtraEditors.XtraUserControl
|
{
|
public ThreeLinkSingleMatchingForm()
|
{
|
InitializeComponent();
|
this.gridView3.SetNormalView();
|
}
|
|
private HydroThreelinkMatchingViewModel _pipeMatchingViewModel;
|
private BLL.AssetsThreelinkMain _ThreeLinkBll;
|
private List<ThreeLinkSingleMatchingViewModel> _allBindingList;
|
|
public async void SetBindingData(HydroThreelinkMatchingViewModel PipeMatchingViewModel)
|
{
|
_pipeMatchingViewModel = PipeMatchingViewModel;
|
_allBindingList = new List<ThreeLinkSingleMatchingViewModel>();
|
_ThreeLinkBll = new BLL.AssetsThreelinkMain();
|
var allAssetsThreelinkMain = await _ThreeLinkBll.GetAll();
|
foreach (var Main in allAssetsThreelinkMain)
|
{
|
_allBindingList.Add(new ThreeLinkSingleMatchingViewModel(Main));
|
}
|
this.threeLinkSingleMatchingViewModelBindingSource.DataSource = _allBindingList;
|
this.threeLinkSingleMatchingViewModelBindingSource.ResetBindings(false);
|
this.searchControl1.Text = _pipeMatchingViewModel.ModelType;
|
}
|
|
//选择项切换事件
|
private void gridView3_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
|
{
|
var vm = this.gridView3.GetCurrentViewModel(_allBindingList);
|
if (vm != null)
|
{
|
_pipeMatchingViewModel.MatchingDbId = vm.ID.ToString();
|
_pipeMatchingViewModel.MatchingMinorLoss = vm.MinorLoss;
|
_pipeMatchingViewModel.MatchingCaliber = vm.Caliber;
|
_pipeMatchingViewModel.MatchingMaterial = vm.Material;
|
_pipeMatchingViewModel.MatchingModelType = vm.ModelType;
|
}
|
}
|
}
|
}
|