public void initControl() { YearToolStripComboBox.ComboBox.DataSource = Year.getYearListWithAllMapping(); YearToolStripComboBox.ComboBox.DisplayMember = "yearName"; YearToolStripComboBox.ComboBox.ValueMember = "yearID"; YearToolStripComboBox.ComboBox.SelectedIndex = 0; TermToolStripComboBox.ComboBox.DataSource = Term.getTermListWithAllMapping(); TermToolStripComboBox.ComboBox.DisplayMember = "termName"; TermToolStripComboBox.ComboBox.ValueMember = "termID"; TermToolStripComboBox.ComboBox.SelectedIndex = 0; dataGridView1.Rows.Clear(); try { Settings s = new Settings("Settings.xml"); YearToolStripComboBox.ComboBox.SelectedValue = (int)s.GetValue("DefaultYearID", SettingType.Int32); TermToolStripComboBox.ComboBox.SelectedValue = (int)s.GetValue("DefaultTermID", SettingType.Int32); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void initControls() { SessionToolStripComboBox.ComboBox.DataSource = Session.getSessionList((int?)null, (string)null); ; SessionToolStripComboBox.ComboBox.DisplayMember = "sessionName"; SessionToolStripComboBox.ComboBox.ValueMember = "sessionID"; SessionToolStripComboBox.SelectedIndex = 0; SessionLabel.Text = SessionToolStripComboBox.Text; courseList = Course.getCourseListOfATerm((int?)null, (int?)null); CourseNoToolStripComboBox.ComboBox.DataSource = courseList; CourseNoToolStripComboBox.ComboBox.DisplayMember = "DisplayableCourseNumberWithTitle"; CourseNoToolStripComboBox.ComboBox.ValueMember = "ID"; if (courseList.Count > 0) { CourseNoToolStripComboBox.SelectedIndex = 0; CourseNoLabel.Text = CourseNoToolStripComboBox.Text + " | " + courseList[0].Title; } try { Settings s = new Settings("Settings.xml"); SessionToolStripComboBox.ComboBox.SelectedValue = (int)s.GetValue("DefaultSessionID", SettingType.Int32); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void saveButton_Click(object sender, EventArgs e) { try { Settings s = new Settings("Settings.xml"); s.SetValue("DefaultSessionID", SettingType.Int32, this.sessionComboBox.SelectedValue); s.SetValue("DefaultYearID", SettingType.Int32, this.yearComboBox.SelectedValue); s.SetValue("DefaultTermID", SettingType.Int32, this.termComboBox.SelectedValue); s.Save(); MessageBox.Show("Saved successfully"); this.Dispose(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public void initControls() { sessionList = Session.getSessionList((int?)null,(string)null); sessionList.Insert(0, Session.GetAllMapping()); batchList = Batch.getAllBatchList((string)null); batchList.Insert(0, Batch.getAllMapping()); SessionToolStripComboBox.ComboBox.DataSource = sessionList; SessionToolStripComboBox.ComboBox.DisplayMember = "sessionName"; SessionToolStripComboBox.ComboBox.ValueMember = "sessionID"; SessionToolStripComboBox.SelectedIndex = 0; BatchToolStripComboBox.ComboBox.DataSource = batchList; BatchToolStripComboBox.ComboBox.DisplayMember = "BatchName"; BatchToolStripComboBox.ComboBox.ValueMember = "BatchID"; BatchToolStripComboBox.SelectedIndex = 0; YearToolStripComboBox.ComboBox.DataSource = Year.getYearListWithAllMapping(); YearToolStripComboBox.ComboBox.DisplayMember = "yearName"; YearToolStripComboBox.ComboBox.ValueMember = "yearID"; YearToolStripComboBox.SelectedIndex = 0; TermToolStripComboBox.ComboBox.DataSource = Term.getTermListWithAllMapping(); TermToolStripComboBox.ComboBox.DisplayMember = "TermName"; TermToolStripComboBox.ComboBox.ValueMember = "TermID"; TermToolStripComboBox.SelectedIndex = 0; try { Settings s = new Settings("Settings.xml"); SessionToolStripComboBox.ComboBox.SelectedValue = (int)s.GetValue("DefaultSessionID", SettingType.Int32); YearToolStripComboBox.ComboBox.SelectedValue = (int)s.GetValue("DefaultYearID", SettingType.Int32); TermToolStripComboBox.ComboBox.SelectedValue = (int)s.GetValue("DefaultTermID", SettingType.Int32); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void initControls() { /////////////////////////////////////// try { this.sessionList = Session.getSessionList((int?)null, (string)null); this.yearList = Year.getYearList(); this.termList = Term.getTermList(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } this.sessionComboBox.DataSource = this.sessionList; this.sessionComboBox.DisplayMember = "sessionName"; this.sessionComboBox.ValueMember = "sessionID"; this.yearComboBox.DataSource = this.yearList; this.yearComboBox.DisplayMember = "yearName"; this.yearComboBox.ValueMember = "yearID"; this.termComboBox.DataSource = this.termList; this.termComboBox.DisplayMember = "termName"; this.termComboBox.ValueMember = "termID"; ///////////////////////////////////////////////////// try { Settings s = new Settings("Settings.xml"); this.sessionComboBox.SelectedValue = (int)s.GetValue("DefaultSessionID", SettingType.Int32); this.yearComboBox.SelectedValue = (int)s.GetValue("DefaultYearID", SettingType.Int32); this.termComboBox.SelectedValue = (int)s.GetValue("DefaultTermID", SettingType.Int32); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public void initControls() { sessionList = Session.getSessionList(null, null); courseList = Course.getCourseListOfATerm(null, null); yearList = Year.getYearList(); termList = Term.getTermList(); StudentWiseSessionComboBox.DataSource = sessionList; StudentWiseSessionComboBox.DisplayMember = "sessionName"; StudentWiseSessionComboBox.ValueMember = "sessionID"; StudentWiseSessionComboBox.SelectedIndex = 0; CourseWiseSessionComboBox.DataSource = sessionList; CourseWiseSessionComboBox.DisplayMember = "sessionName"; CourseWiseSessionComboBox.ValueMember = "sessionID"; CourseWiseSessionComboBox.SelectedIndex = 0; StudentWiseYearComboBox.DataSource = yearList; StudentWiseYearComboBox.DisplayMember = "yearName"; StudentWiseYearComboBox.ValueMember = "yearID"; StudentWiseYearComboBox.SelectedIndex = 0; CourseWiseYearComboBox.DataSource = yearList; CourseWiseYearComboBox.DisplayMember = "yearName"; CourseWiseYearComboBox.ValueMember = "yearID"; CourseWiseYearComboBox.SelectedIndex = 0; StudentWiseTermComboBox.DataSource = termList; StudentWiseTermComboBox.DisplayMember = "termName"; StudentWiseTermComboBox.ValueMember = "termID"; StudentWiseTermComboBox.SelectedIndex = 0; CourseWiseTermComboBox.DataSource = termList; CourseWiseTermComboBox.DisplayMember = "termName"; CourseWiseTermComboBox.ValueMember = "termID"; CourseWiseTermComboBox.SelectedIndex = 0; CourseWiseCourseNoComboBox.DataSource = courseList; CourseWiseCourseNoComboBox.DisplayMember = "displayableCourseNumber"; CourseWiseCourseNoComboBox.ValueMember = "ID"; if (courseList.Count>0) CourseWiseCourseNoComboBox.SelectedIndex = 0; try { Settings s = new Settings("Settings.xml"); this.StudentWiseSessionComboBox.SelectedValue = (int)s.GetValue("DefaultSessionID", SettingType.Int32); this.CourseWiseSessionComboBox.SelectedValue = (int)s.GetValue("DefaultSessionID", SettingType.Int32); this.StudentWiseYearComboBox.SelectedValue = (int)s.GetValue("DefaultYearID", SettingType.Int32); this.CourseWiseYearComboBox.SelectedValue = (int)s.GetValue("DefaultYearID", SettingType.Int32); this.CourseWiseTermComboBox.SelectedValue = (int)s.GetValue("DefaultTermID", SettingType.Int32); this.CourseWiseTermComboBox.SelectedValue = (int)s.GetValue("DefaultTermID", SettingType.Int32); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void initControls() { YearComboBox.DataSource = Year.getYearList(); YearComboBox.DisplayMember = "YearName"; YearComboBox.ValueMember = "YearID"; YearComboBox.SelectedIndex = 0; TermComboBox.DataSource = Term.getTermList(); TermComboBox.DisplayMember = "TermName"; TermComboBox.ValueMember = "TermID"; TermComboBox.SelectedIndex = 0; SessionComboBox.DataSource = Session.getSessionList((int?)null,null); SessionComboBox.DisplayMember = "SessionName"; SessionComboBox.ValueMember = "SessionID"; SessionComboBox.SelectedIndex = 0; LoadCoursesYearComboBox.DataSource = Year.getYearListWithAllMapping(); LoadCoursesYearComboBox.DisplayMember = "YearName"; LoadCoursesYearComboBox.ValueMember = "YearID"; LoadCoursesYearComboBox.SelectedIndex = 0; LoadCoursesTermComboBox.DataSource = Term.getTermListWithAllMapping(); LoadCoursesTermComboBox.DisplayMember = "TermName"; LoadCoursesTermComboBox.ValueMember = "TermID"; LoadCoursesTermComboBox.SelectedIndex = 0; try { Settings s = new Settings("Settings.xml"); this.SessionComboBox.SelectedValue = (int)s.GetValue("DefaultSessionID", SettingType.Int32); this.YearComboBox.SelectedValue = (int)s.GetValue("DefaultYearID", SettingType.Int32); this.TermComboBox.SelectedValue = (int)s.GetValue("DefaultTermID", SettingType.Int32); this.LoadCoursesYearComboBox.SelectedValue = (int)s.GetValue("DefaultYearID", SettingType.Int32); this.LoadCoursesTermComboBox.SelectedValue = (int)s.GetValue("DefaultTermID", SettingType.Int32); } catch (Exception ex) { //MessageBox.Show(ex.ToString()); } }