Exemplo n.º 1
0
 /// <summary>
 /// 窗体装载
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmPrjBoq_Load(object sender, EventArgs e)
 {
     tlWBS.DataSource            = null;
     gcRelationDetail.DataSource = null;
     DoWork("加载清单中...", "加载清单中...", () =>
     {
         viewModel = new WBSBoqViewModel(ProjectNo, ProjectName);
         viewModel.RelationListChanged += ResetGridBingdings;
         viewModel.Load();
     }, (myException) =>
     {
         if (myException == null)
         {
             tlWBS.DataSource = viewModel.NodeBindingSource;
             tlWBS.ExpandAll();
             gcRelationDetail.DataSource = viewModel.RelationBindingSource;
             RefreshStat();
         }
     });
 }
Exemplo n.º 2
0
        /// <summary>
        /// 刷新
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bbiRefresh_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            DoWork("加载清单中...", "加载清单中...", () =>
            {
                tlWBS.DataSource            = null;
                gcRelationDetail.DataSource = null;

                viewModel = new WBSBoqViewModel(ProjectNo, ProjectName);
                //viewModel.ListChanged += RefreshBottomBar;
                viewModel.Load();
            }, (myException) =>
            {
                if (myException == null)
                {
                    tlWBS.DataSource = viewModel.NodeBindingSource;
                    tlWBS.ExpandAll();

                    gcRelationDetail.DataSource = viewModel.RelationBindingSource;
                    gvRelationDetail.RefreshData();
                    RefreshStat();
                }
            });
        }