コード例 #1
0
        private void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            switch (TaskId)
            {
            case MainFormEnum.BindDataBaseToUI.NothingToDo:
                break;

            case MainFormEnum.BindDataBaseToUI.BindTeacherEntityToGridview:
                if (dt != null)
                {
                    MainFormUIBind.DataGridViewBind.GetTeacherEntityToDataGridView(dataGridView_Teacher, dt);
                    dt     = null;
                    TaskId = MainFormEnum.BindDataBaseToUI.NothingToDo;
                }
                break;

            case MainFormEnum.BindDataBaseToUI.BindActiveYearEntityToComboBox:
                break;

            case MainFormEnum.BindDataBaseToUI.BindVwCscheduleEntityToGridview:
                if (dt != null)
                {
                    dataGridView1.DataSource = dt;
                    dt     = null;
                    TaskId = MainFormEnum.BindDataBaseToUI.NothingToDo;
                }
                break;
            }
        }
コード例 #2
0
 private void buttonKCBtoGridView_Click(object sender, EventArgs e)
 {
     if (comboBox_Activeyear.Items.Count > 0)
     {
         TaskId = MainFormEnum.BindDataBaseToUI.BindVwCscheduleEntityToGridview;
         if (!backgroundWorker.IsBusy)
         {
             backgroundWorker.RunWorkerAsync(
                 (int)ConvertHelper.ConvertStringToInt(comboBox_Activeyear.SelectedValue.ToString()));
         }
     }
 }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: terrydash/MyIeidjtKCB
 private void buttonKCBtoGridView_Click(object sender, EventArgs e)
 {
     if (comboBox_Activeyear.Items.Count > 0)
     {
         TaskId = MainFormEnum.BindDataBaseToUI.BindVwCscheduleEntityToGridview;
         if (!backgroundWorker.IsBusy)
         {
             backgroundWorker.RunWorkerAsync((int)ConvertHelper.ConvertStringToInt(comboBox_Activeyear.SelectedValue.ToString()));
         }
     }
 }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: terrydash/MyIeidjtKCB
 private void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     switch (TaskId)
     {
         case MainFormEnum.BindDataBaseToUI.NothingToDo:
             break;
         case MainFormEnum.BindDataBaseToUI.BindTeacherEntityToGridview:
             if (dt != null)
             {
                 MainFormUIBind.DataGridViewBind.GetTeacherEntityToDataGridView(dataGridView_Teacher, dt);
                 dt = null;
                 TaskId = MainFormEnum.BindDataBaseToUI.NothingToDo;
             }
             break;
         case MainFormEnum.BindDataBaseToUI.BindActiveYearEntityToComboBox:
             break;
         case MainFormEnum.BindDataBaseToUI.BindVwCscheduleEntityToGridview:
             if (dt!=null)
             {
                 dataGridView1.DataSource = dt;
                 dt = null;
                 TaskId = MainFormEnum.BindDataBaseToUI.NothingToDo;
             }
             break;
         
     }
 }