public SetupTool(MainForm parent) { dataValid = true; parentForm = parent; InitializeComponent(); Config cfg = new Config(); string path = cfg.Get("current_work_space"); tb_WorkspacePath.Text = path; Globals.currentWorkspace = path; String templateIndex = cfg.Get(Config.CURRENT_TEMPLATE_INDEX); if (templateIndex != null) { cbbTemplate.SelectedIndex = Convert.ToInt32(templateIndex); } else { cbbTemplate.SelectedIndex = 0; } jobLoadExamInfo.RunWorkerAsync(); loadingDialog = new LoadingDialog("Đang lấy thông tin..."); loadingDialog.ShowDialog(); }
private void btnDone_Click(object sender, EventArgs e) { if (tb_WorkspacePath.Text == "") { MessageBox.Show("Vui lòng chọn đường dẫn đến thư mục làm việc"); } else { if (cbbSubject.SelectedValue != null) { parentForm.isCancel = false; Globals.examName = cbbExam.Text.ToString(); Globals.subject = cbbSubject.Text.ToString(); Globals.subjectId = (int)cbbSubject.SelectedValue; Globals.examId = (int)cbbExam.SelectedValue; Globals.currentTemplate = TemplateUtils.GetTemplate(cbbTemplate.SelectedIndex); jobLoadDataFromDB.RunWorkerAsync(new Tuple <int, int>((int)cbbExam.SelectedValue, (int)cbbSubject.SelectedValue)); loadingDialog = new LoadingDialog("Đang lấy thông tin..."); loadingDialog.ShowDialog(); } else { MessageBox.Show("Không có môn thi nào được chọn"); } } }
public SetupTool() { InitializeComponent(); cbbTemplate.SelectedIndex = 0; jobLoadExamInfo.RunWorkerAsync(); loadingDialog = new LoadingDialog("Đang lấy thông tin..."); loadingDialog.ShowDialog(); }