Esempio n. 1
0
        public virtual void LoadData()
        {
            //m_tblInfo = s_config.getTable(m_tblName);
            m_tblInfo.LoadData();

#if manual_crt_dgv_columns
            m_dataGridView.AutoGenerateColumns = false;
            crtColumns();
#endif
            m_dataContent = appConfig.s_contentProvider.CreateDataContent(m_tblInfo.m_tblName);
#if !use_bg_work
            m_dataContent.FillTableCompleted   += M_dataContent_FillTableCompleted;
            m_dataContent.UpdateTableCompleted += M_dataContent_FillTableCompleted;
#endif
#if !init_datatable_cols
            m_dataContent.Load();
#endif

            m_dataGridView.DataSource = m_dataContent.m_bindingSource;
            DataTable tbl = (DataTable)m_dataContent.m_bindingSource.DataSource;
            if (tbl != null)
            {
                update();
            }
            else
            {
                Debug.Assert(false, "tbl not created!");
            }

#if use_bg_work
            m_wkr            = myWorker.getWorker();
            m_wkr.BgProcess += M_wkr_BgProcess;
            m_wkr.FgProcess += M_wkr_FgProcess;
#endif
        }
Esempio n. 2
0
 private void LReportDlg_Load(object sender, EventArgs e)
 {
     {
         //load data for building combo box
         BindingSource bs = new BindingSource();
         lDataContent  dc = appConfig.s_contentProvider.CreateDataContent("building");
         bs.DataSource             = dc.m_dataTable;
         buildingCmb.DataSource    = bs;
         buildingCmb.DisplayMember = dc.m_dataTable.Columns[1].ColumnName;
     }
     //load data for constr org cmb
     {
         BindingSource bs = new BindingSource();
         lDataContent  dc = appConfig.s_contentProvider.CreateDataContent("constr_org");
         bs.DataSource              = dc.m_dataTable;
         constrorgCmb.DataSource    = bs;
         constrorgCmb.DisplayMember = dc.m_dataTable.Columns[1].ColumnName;
     }
 }