private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e) { var openFileDialog = new OpenFileDialog { Filter = @"Excel Files (*.xls) | *.xls", DefaultExt = ".xls", RestoreDirectory = true }; if (openFileDialog.ShowDialog() == DialogResult.OK) { try { Cursor = Cursors.WaitCursor; listEnrollees = UtilityClass.ImportEnrollees(openFileDialog.FileName); var jList = new JSortingListClass <Enrollee>(listEnrollees); enrolleeBindingSource.DataSource = jList; Cursor = Cursors.Default; } catch (Exception ex) { Console.WriteLine(@"Error - " + ex.Message); //throw; } } toolStripStatusLabel1.Text = String.Format("({0}) - records loaded.", enrolleeBindingSource.Count); }
private void toolStripButtonRefresh_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; var listEnrollees = new JSortingListClass <Enrollee>(ActionClass.FillEnrollees()); enrolleeBindingSource.DataSource = listEnrollees; Cursor.Current = Cursors.Default; }
private void toolStripButtonGo_Click(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; int iMonth = toolStripComboBoxMonth.SelectedIndex + 1; int iYear = int.Parse(toolStripComboBoxYear.Text); bool bSource = toolStripComboBox1.SelectedIndex == 0 ? false : true; var listJDTR = new JSortingListClass <JDTRClass>(DataManagementClass.LoadDTRUpdated(iYear, iMonth, bSource)); jDTRClassBindingSource.DataSource = listJDTR; Cursor = Cursors.Default; }