Пример #1
0
 private void comboBoxPdv_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBoxPdv.SelectedIndex == -1)
     {
         return;
     }
     m_pdv = (_Pdv)comboBoxPdv.SelectedItem;
 }
Пример #2
0
        public void refreshPdv()
        {
            comboBoxPdv.Items.Clear();
            queuePdv.Clear();

            _Pdv p1 = new _Pdv();

            p1.id   = 1;
            p1.name = "ПДВ";
            comboBoxPdv.Items.Add(p1);
            queuePdv.Enqueue(p1);

            _Pdv p2 = new _Pdv();

            p2.id   = 2;
            p2.name = "Без ПДВ";
            comboBoxPdv.Items.Add(p2);
            queuePdv.Enqueue(p2);
        }
Пример #3
0
        public void refreshPdv()
        {
            comboBoxPdv.Items.Clear();
            queuePdv.Clear();

            _Pdv p1 = new _Pdv();
            p1.id = 1;
            p1.name = "ПДВ";
            comboBoxPdv.Items.Add(p1);
            queuePdv.Enqueue(p1);

            _Pdv p2 = new _Pdv();
            p2.id = 2;
            p2.name = "Без ПДВ";
            comboBoxPdv.Items.Add(p2);
            queuePdv.Enqueue(p2);
        }
Пример #4
0
        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);
            }
        }
Пример #5
0
 private void comboBoxPdv_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBoxPdv.SelectedIndex == -1)
         return;
     m_pdv = (_Pdv)comboBoxPdv.SelectedItem;
 }
Пример #6
0
        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);
            }
        }