private void comboBoxSemester_SelectedIndexChanged(object sender, EventArgs e) { if (comboBoxSemester.SelectedIndex == -1) { return; } m_semester = (_Semester)comboBoxSemester.SelectedItem; }
public void refreshSemesters() { comboBoxSemester.Items.Clear(); queueSemesters.Clear(); _Semester s1 = new _Semester(); s1.id = 1; s1.name = "за І семестр"; comboBoxSemester.Items.Add(s1); queueSemesters.Enqueue(s1); _Semester s2 = new _Semester(); s2.id = 2; s2.name = "за ІІ семестр"; comboBoxSemester.Items.Add(s2); queueSemesters.Enqueue(s2); _Semester s3 = new _Semester(); s3.id = 3; s3.name = "за ІІI семестр"; comboBoxSemester.Items.Add(s3); queueSemesters.Enqueue(s3); _Semester s4 = new _Semester(); s4.id = 4; s4.name = "за ІV семестр"; comboBoxSemester.Items.Add(s4); queueSemesters.Enqueue(s4); _Semester s5 = new _Semester(); s5.id = 5; s5.name = "за V семестр"; comboBoxSemester.Items.Add(s5); queueSemesters.Enqueue(s5); _Semester s6 = new _Semester(); s6.id = 6; s6.name = "за VІ семестр"; comboBoxSemester.Items.Add(s6); queueSemesters.Enqueue(s6); _Semester s7 = new _Semester(); s7.id = 7; s7.name = "за VІІ семестр"; comboBoxSemester.Items.Add(s7); queueSemesters.Enqueue(s7); _Semester s8 = new _Semester(); s8.id = 8; s8.name = "за VIІІ семестр"; comboBoxSemester.Items.Add(s8); queueSemesters.Enqueue(s8); _Semester s9 = new _Semester(); s9.id = 9; s9.name = "за ІX семестр"; comboBoxSemester.Items.Add(s9); queueSemesters.Enqueue(s9); _Semester s10 = new _Semester(); s10.id = 10; s10.name = "за X семестр"; comboBoxSemester.Items.Add(s10); queueSemesters.Enqueue(s10); }
private void listViewMarks_SelectedIndexChanged(object sender, EventArgs e) { buttonApply.Enabled = true; buttonExcel.Enabled = true; buttonDelete.Enabled = true; textBoxStudent.Enabled = true; textBoxGroup.Enabled = true; textBoxSum.Enabled = true; comboBoxPaymentNames.Enabled = true; comboBoxAccounts.Enabled = true; comboBoxEduYear.Enabled = true; comboBoxHostel.Enabled = true; comboBoxSemester.Enabled = true; comboBoxPdv.Enabled = true; bNew = false; if (listViewJournal.FocusedItem == null) return; int k = queueJournal.Count; for (int i = 0; i < k; i++) { m_journal = (_Journal)queueJournal.Dequeue(); if (m_journal.id.ToString() == (string)listViewJournal.Items[listViewJournal.FocusedItem.Index].Tag) { textBoxStudent.Text = m_journal.student; //MessageBox.Show(m_journal.student); textBoxGroup.Text = m_journal.group; textBoxSum.Text = m_journal.sum.ToString(); _PaymentNames c; int k2 = queuePaymentNames.Count; for (int i2 = 0; i2 < k2; i2++) { c = (_PaymentNames)queuePaymentNames.Dequeue(); if (c.id.ToString() == m_journal.payment_name_id.ToString()) { for (int iii = 0; iii < comboBoxPaymentNames.Items.Count; iii++) { if (((_PaymentNames)comboBoxPaymentNames.Items[iii]).id == c.id) { comboBoxPaymentNames.SelectedIndex = iii; m_payment_name = c; break; } } }; queuePaymentNames.Enqueue(c); } dateTimePickerDate.Value = DateTime.Parse(m_journal.date); dateTimePickerDate.Enabled = true; _Ekskursovody a; k2 = queueAccounts.Count; for (int i2 = 0; i2 < k2; i2++) { a = (_Ekskursovody)queueAccounts.Dequeue(); if (a.id.ToString() == m_journal.account_id.ToString()) { for (int iii = 0; iii < comboBoxAccounts.Items.Count; iii++) { if (((_Ekskursovody)comboBoxAccounts.Items[iii]).id == a.id) { comboBoxAccounts.SelectedIndex = iii; m_account = a; break; } } }; queueAccounts.Enqueue(a); } _Semester s; k2 = queueSemesters.Count; for (int i2 = 0; i2 < k2; i2++) { s = (_Semester)queueSemesters.Dequeue(); if (s.id.ToString() == m_journal.semester.ToString()) { for (int iii = 0; iii < comboBoxSemester.Items.Count; iii++) { if (((_Semester)comboBoxSemester.Items[iii]).id == s.id) { comboBoxSemester.SelectedIndex = iii; m_semester = s; break; } } }; queueSemesters.Enqueue(s); } _Pdv p; k2 = queuePdv.Count; for (int i2 = 0; i2 < k2; i2++) { p = (_Pdv)queuePdv.Dequeue(); if (p.id.ToString() == m_journal.pdv.ToString()) { for (int iii = 0; iii < comboBoxPdv.Items.Count; iii++) { if (((_Pdv)comboBoxPdv.Items[iii]).id == p.id) { comboBoxPdv.SelectedIndex = iii; m_pdv = p; break; } } }; queuePdv.Enqueue(p); } _Hostel h; k2 = queueHostel.Count; for (int i2 = 0; i2 < k2; i2++) { h = (_Hostel)queueHostel.Dequeue(); if (h.id.ToString() == m_journal.hostel_id.ToString()) { for (int iii = 0; iii < comboBoxHostel.Items.Count; iii++) { if (((_Hostel)comboBoxHostel.Items[iii]).id == h.id) { comboBoxHostel.SelectedIndex = iii; m_hostel = h; break; } } }; queueHostel.Enqueue(h); } _EduYears ey; k2 = queueEduYears.Count; for (int i2 = 0; i2 < k2; i2++) { ey = (_EduYears)queueEduYears.Dequeue(); if (ey.id.ToString() == m_journal.edu_year_id.ToString()) { for (int iii = 0; iii < comboBoxEduYear.Items.Count; iii++) { if (((_EduYears)comboBoxEduYear.Items[iii]).id == ey.id) { comboBoxEduYear.SelectedIndex = iii; m_edu_year = ey; break; } } }; queueEduYears.Enqueue(ey); } queueJournal.Enqueue(m_journal); break; }; queueJournal.Enqueue(m_journal); } }
private void comboBoxSemester_SelectedIndexChanged(object sender, EventArgs e) { if (comboBoxSemester.SelectedIndex == -1) return; m_semester = (_Semester)comboBoxSemester.SelectedItem; }
private void listViewMarks_SelectedIndexChanged(object sender, EventArgs e) { buttonApply.Enabled = true; buttonExcel.Enabled = true; buttonDelete.Enabled = true; textBoxStudent.Enabled = true; textBoxGroup.Enabled = true; textBoxSum.Enabled = true; comboBoxPaymentNames.Enabled = true; comboBoxAccounts.Enabled = true; comboBoxEduYear.Enabled = true; comboBoxHostel.Enabled = true; comboBoxSemester.Enabled = true; comboBoxPdv.Enabled = true; bNew = false; if (listViewJournal.FocusedItem == null) { return; } int k = queueJournal.Count; for (int i = 0; i < k; i++) { m_journal = (_Journal)queueJournal.Dequeue(); if (m_journal.id.ToString() == (string)listViewJournal.Items[listViewJournal.FocusedItem.Index].Tag) { textBoxStudent.Text = m_journal.student; //MessageBox.Show(m_journal.student); textBoxGroup.Text = m_journal.group; textBoxSum.Text = m_journal.sum.ToString(); _PaymentNames c; int k2 = queuePaymentNames.Count; for (int i2 = 0; i2 < k2; i2++) { c = (_PaymentNames)queuePaymentNames.Dequeue(); if (c.id.ToString() == m_journal.payment_name_id.ToString()) { for (int iii = 0; iii < comboBoxPaymentNames.Items.Count; iii++) { if (((_PaymentNames)comboBoxPaymentNames.Items[iii]).id == c.id) { comboBoxPaymentNames.SelectedIndex = iii; m_payment_name = c; break; } } } ; queuePaymentNames.Enqueue(c); } dateTimePickerDate.Value = DateTime.Parse(m_journal.date); dateTimePickerDate.Enabled = true; _Ekskursovody a; k2 = queueAccounts.Count; for (int i2 = 0; i2 < k2; i2++) { a = (_Ekskursovody)queueAccounts.Dequeue(); if (a.id.ToString() == m_journal.account_id.ToString()) { for (int iii = 0; iii < comboBoxAccounts.Items.Count; iii++) { if (((_Ekskursovody)comboBoxAccounts.Items[iii]).id == a.id) { comboBoxAccounts.SelectedIndex = iii; m_account = a; break; } } } ; queueAccounts.Enqueue(a); } _Semester s; k2 = queueSemesters.Count; for (int i2 = 0; i2 < k2; i2++) { s = (_Semester)queueSemesters.Dequeue(); if (s.id.ToString() == m_journal.semester.ToString()) { for (int iii = 0; iii < comboBoxSemester.Items.Count; iii++) { if (((_Semester)comboBoxSemester.Items[iii]).id == s.id) { comboBoxSemester.SelectedIndex = iii; m_semester = s; break; } } } ; queueSemesters.Enqueue(s); } _Pdv p; k2 = queuePdv.Count; for (int i2 = 0; i2 < k2; i2++) { p = (_Pdv)queuePdv.Dequeue(); if (p.id.ToString() == m_journal.pdv.ToString()) { for (int iii = 0; iii < comboBoxPdv.Items.Count; iii++) { if (((_Pdv)comboBoxPdv.Items[iii]).id == p.id) { comboBoxPdv.SelectedIndex = iii; m_pdv = p; break; } } } ; queuePdv.Enqueue(p); } _Hostel h; k2 = queueHostel.Count; for (int i2 = 0; i2 < k2; i2++) { h = (_Hostel)queueHostel.Dequeue(); if (h.id.ToString() == m_journal.hostel_id.ToString()) { for (int iii = 0; iii < comboBoxHostel.Items.Count; iii++) { if (((_Hostel)comboBoxHostel.Items[iii]).id == h.id) { comboBoxHostel.SelectedIndex = iii; m_hostel = h; break; } } } ; queueHostel.Enqueue(h); } _EduYears ey; k2 = queueEduYears.Count; for (int i2 = 0; i2 < k2; i2++) { ey = (_EduYears)queueEduYears.Dequeue(); if (ey.id.ToString() == m_journal.edu_year_id.ToString()) { for (int iii = 0; iii < comboBoxEduYear.Items.Count; iii++) { if (((_EduYears)comboBoxEduYear.Items[iii]).id == ey.id) { comboBoxEduYear.SelectedIndex = iii; m_edu_year = ey; break; } } } ; queueEduYears.Enqueue(ey); } queueJournal.Enqueue(m_journal); break; } ; queueJournal.Enqueue(m_journal); } }