Ejemplo n.º 1
0
 private void comboBoxNekskursii_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBoxEkskursija.SelectedIndex == -1)
     {
         return;
     }
     m_ekskursii = (_Ekskursii)comboBoxEkskursija.SelectedItem;
 }
Ejemplo n.º 2
0
        public void refreshEkskursii()
        {
            string N_ekskursii = "";

            if (comboBoxEkskursija.SelectedIndex != -1)
            {
                N_ekskursii = m_ekskursii.id.ToString();
            }

            comboBoxEkskursija.Items.Clear();
            queueEkskursii.Clear();

            try
            {
                mainWin.m_dbConnector.Lock();
                MySqlConnection conn = mainWin.m_dbConnector.getMySqlConnection();

                string           sql       = "SELECT `N_ekskursii`, `nazvanie` FROM `ekskursii` ORDER BY `N_ekskursii`";
                MySqlDataAdapter myAdapter = new MySqlDataAdapter();
                myAdapter.SelectCommand = new MySqlCommand(sql, conn);
                DataSet dataSet = new DataSet();
                myAdapter.Fill(dataSet);
                DataTable dataTable = dataSet.Tables[0];

                _Ekskursii c = new _Ekskursii();

                foreach (DataRow dataRow in dataTable.Rows)
                {
                    c.id       = dataRow["N_ekskursii"].ToString();
                    c.nazvanie = dataRow["N_ekskursii"].ToString().Trim();

                    comboBoxEkskursija.Items.Add(c);


                    if (N_ekskursii != "" && N_ekskursii == c.id.ToString())
                    {
                        comboBoxEkskursija.SelectedItem = c;
                    }


                    queueEkskursii.Enqueue(c);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                mainWin.m_dbConnector.Unlock();
            }
        }
Ejemplo n.º 3
0
        public void refreshEkskursii()
        {
            listViewEkskursii.Items.Clear();
            queueEkskursii.Clear();

            try
            {
                mainWin.m_dbConnector.Lock();
                MySqlConnection conn = mainWin.m_dbConnector.getMySqlConnection();

                string           sql       = "SELECT `N_ekskursii`, `nazvanie`, `stoimost`, `1_kat`, `2_kat`, `3_kat` FROM `ekskursii` ORDER BY `N_ekskursii`";
                MySqlDataAdapter myAdapter = new MySqlDataAdapter();
                myAdapter.SelectCommand = new MySqlCommand(sql, conn);
                DataSet dataSet = new DataSet();
                myAdapter.Fill(dataSet);
                DataTable dataTable = dataSet.Tables[0];

                listViewEkskursii.Items.Clear();
                queueEkskursii.Clear();
                _Ekskursii t = new _Ekskursii();

                foreach (DataRow dataRow in dataTable.Rows)
                {
                    ListViewItem item1 = new ListViewItem(dataRow["N_ekskursii"].ToString().Trim());
                    t.id = dataRow["N_ekskursii"].ToString().Trim();
                    item1.SubItems.Add(dataRow["nazvanie"].ToString().Trim());
                    t.nazvanie = dataRow["nazvanie"].ToString().Trim();
                    item1.SubItems.Add(dataRow["stoimost"].ToString().Trim());
                    t.stoimost = dataRow["stoimost"].ToString().Trim();
                    item1.SubItems.Add(dataRow["1_kat"].ToString().Trim());
                    t.P_kat = dataRow["1_kat"].ToString().Trim();
                    item1.SubItems.Add(dataRow["2_kat"].ToString().Trim());
                    t.S_kat = dataRow["2_kat"].ToString().Trim();
                    item1.SubItems.Add(dataRow["3_kat"].ToString().Trim());
                    t.T_kat = dataRow["3_kat"].ToString().Trim();


                    listViewEkskursii.Items.Add(item1);
                    listViewEkskursii.Items[listViewEkskursii.Items.Count - 1].Tag = dataRow["N_ekskursii"].ToString();
                    queueEkskursii.Enqueue(t);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                mainWin.m_dbConnector.Unlock();
            }
        }
Ejemplo n.º 4
0
        private void listViewEkskursii_SelectedIndexChanged(object sender, EventArgs e)
        {
            buttonApply.Enabled  = true;
            buttonDelete.Enabled = true;

            textBoxNumber.Enabled    = true;
            textBox1.Enabled         = true;
            textBox2.Enabled         = true;
            textBox3.Enabled         = true;
            textBox4.Enabled         = true;
            textBox5.Enabled         = true;
            comboBoxActivity.Enabled = true;
            bNew = false;

            if (listViewEkskursii.FocusedItem == null)
            {
                return;
            }

            int k = queueEkskursii.Count;

            for (int i = 0; i < k; i++)
            {
                m_ekskursii = (_Ekskursii)queueEkskursii.Dequeue();
                if (m_ekskursii.id.ToString() == (string)listViewEkskursii.Items[listViewEkskursii.FocusedItem.Index].Tag)
                {
                    textBoxNumber.Text    = m_ekskursii.id;
                    textBox1.Text         = m_ekskursii.nazvanie;
                    textBox2.Text         = m_ekskursii.stoimost;
                    textBox3.Text         = m_ekskursii.P_kat;
                    textBox4.Text         = m_ekskursii.S_kat;
                    textBox5.Text         = m_ekskursii.T_kat;
                    comboBoxActivity.Text = m_ekskursii.activ;

                    queueEkskursii.Enqueue(m_ekskursii);
                    break;
                }
                ;

                queueEkskursii.Enqueue(m_ekskursii);
            }
        }
Ejemplo n.º 5
0
        private void listViewZhurnal_SelectedIndexChanged(object sender, EventArgs e)
        {
            buttonApply.Enabled  = true;
            buttonDelete.Enabled = true;

            comboBoxEkskursovod.SelectedIndex = -1;
            comboBoxEkskursovod.Enabled       = true;
            comboBoxEkskursija.SelectedIndex  = -1;
            comboBoxEkskursija.Enabled        = true;
            comboBoxZakazczik.SelectedIndex   = -1;
            comboBoxZakazczik.Enabled         = true;
            textBoxKvN.Text            = "";
            textBoxKvN.Enabled         = true;
            textBoxKvK.Text            = "";
            textBoxKvK.Enabled         = true;
            textBoxKolCzel.Text        = "";
            textBoxKolCzel.Enabled     = true;
            dateTimePickerDate.Enabled = true;

            bNew = false;

            if (listViewZhurnal.FocusedItem == null)
            {
                return;
            }

            int k = queueZhurnal.Count;

            for (int i = 0; i < k; i++)
            {
                m_zhurnal = (_Zhurnal)queueZhurnal.Dequeue();
                if (m_zhurnal.id.ToString() == (string)listViewZhurnal.Items[listViewZhurnal.FocusedItem.Index].Tag)
                {
                    comboBoxEkskursija.Text  = m_ekskursii.id;
                    comboBoxEkskursovod.Text = m_zhurnal.fio;
                    comboBoxZakazczik.Text   = m_zhurnal.zakaz;
                    textBoxKvN.Text          = m_zhurnal.kvn;
                    textBoxKvK.Text          = m_zhurnal.kvk;
                    textBoxKolCzel.Text      = m_zhurnal.kolczel;
                    dateTimePickerDate.Value = DateTime.Parse(m_zhurnal.date);
                    //фигня для comboboxов
                    _Ekskursii c;
                    int        k2 = queueEkskursii.Count;
                    for (int i2 = 0; i2 < k2; i2++)
                    {
                        c = (_Ekskursii)queueEkskursii.Dequeue();
                        if (c.id.ToString() == m_zhurnal.numer.ToString())
                        {
                            for (int iii = 0; iii < comboBoxEkskursija.Items.Count; iii++)
                            {
                                if (((_Ekskursii)comboBoxEkskursija.Items[iii]).id == c.id)
                                {
                                    comboBoxEkskursija.SelectedIndex = iii;
                                    m_ekskursii = c;
                                    break;
                                }
                            }
                        }
                        ;
                        queueEkskursii.Enqueue(c);
                    }

                    _Zakazczik d;
                    k2 = queueZakazczik.Count;
                    for (int i2 = 0; i2 < k2; i2++)
                    {
                        d = (_Zakazczik)queueZakazczik.Dequeue();
                        if (d.id.ToString() == m_zhurnal.zakaz.ToString())
                        {
                            for (int iii = 0; iii < comboBoxZakazczik.Items.Count; iii++)
                            {
                                if (((_Zakazczik)comboBoxZakazczik.Items[iii]).id == d.id)
                                {
                                    comboBoxZakazczik.SelectedIndex = iii;
                                    m_zakazczik = d;
                                    break;
                                }
                            }
                        }
                        ;
                        queueZakazczik.Enqueue(d);
                    }

                    _Ekskursovody a;
                    k2 = queueEkskursovod.Count;
                    for (int i2 = 0; i2 < k2; i2++)
                    {
                        a = (_Ekskursovody)queueEkskursovod.Dequeue();
                        if (a.name.ToString() == m_zhurnal.fio.ToString())
                        {
                            for (int iii = 0; iii < comboBoxEkskursovod.Items.Count; iii++)
                            {
                                if (((_Ekskursovody)comboBoxEkskursovod.Items[iii]).id == a.id)
                                {
                                    comboBoxEkskursovod.SelectedIndex = iii;
                                    m_ekskursovody = a;
                                    break;
                                }
                            }
                        }
                        ;

                        queueEkskursovod.Enqueue(a);
                    }

                    queueZhurnal.Enqueue(m_zhurnal);
                    break;
                }
                ;


                queueZhurnal.Enqueue(m_zhurnal);
            }
        }
Ejemplo n.º 6
0
        private void listViewBilety_SelectedIndexChanged(object sender, EventArgs e)
        {
            buttonApply.Enabled = true;
            buttonDelete.Enabled = true;

            textBoxKvN.Enabled = true;

            comboBoxEkskursii.Enabled = true;
            textBoxKvK.Enabled = true;
            dateTimePicker1.Enabled = true;

            bNew = false;

            if (listViewBilety.FocusedItem == null)
                return;

            int k = queueBilety.Count;
            for (int i = 0; i < k; i++)
            {
                m_bilety = (_Bilety)queueBilety.Dequeue();
                if (m_bilety.id == (string)listViewBilety.Items[listViewBilety.FocusedItem.Index].Tag)
                {
                    textBoxKvN.Text = m_bilety.KvN;
                    comboBoxEkskursii.Text = m_bilety.name;
                    textBoxKvK.Text = m_bilety.KvK;
                    dateTimePicker1.Value = DateTime.Parse(m_bilety.date);
                    queueBilety.Enqueue(m_bilety);

                    _Ekskursii c;
                    int k2 = queueEkskursii.Count;
                    for (int i2 = 0; i2 < k2; i2++)
                    {
                        c = (_Ekskursii)queueEkskursii.Dequeue();
                        if (c.nazvanie.ToString() == m_bilety.name.ToString())
                        {
                            for (int iii = 0; iii < comboBoxEkskursii.Items.Count; iii++)
                            {
                                if (((_Ekskursii)comboBoxEkskursii.Items[iii]).id == c.id)
                                {
                                    comboBoxEkskursii.SelectedIndex = iii;
                                    m_ekskursii = c;
                                    break;
                                }
                            }
                        };
                        queueEkskursii.Enqueue(c);
                    }

                    break;
                };

                queueBilety.Enqueue(m_bilety);
            }
        }
Ejemplo n.º 7
0
 private void comboBoxEkskursii_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBoxEkskursii.SelectedIndex == -1)
         return;
     m_ekskursii = (_Ekskursii)comboBoxEkskursii.SelectedItem;
 }
Ejemplo n.º 8
0
        public void refreshEkskursii()
        {
            string N_ekskursii = "";
            if (comboBoxEkskursii.SelectedIndex != -1)
            {
                N_ekskursii = m_ekskursii.id.ToString();
            }

            comboBoxEkskursii.Items.Clear();
            queueEkskursii.Clear();

            try
            {
                mainWin.m_dbConnector.Lock();
                MySqlConnection conn = mainWin.m_dbConnector.getMySqlConnection();

                string sql = "SELECT `N_ekskursii`, `nazvanie` FROM `ekskursii` ORDER BY `N_ekskursii`";
                MySqlDataAdapter myAdapter = new MySqlDataAdapter();
                myAdapter.SelectCommand = new MySqlCommand(sql, conn);
                DataSet dataSet = new DataSet();
                myAdapter.Fill(dataSet);
                DataTable dataTable = dataSet.Tables[0];

                _Ekskursii c = new _Ekskursii();

                foreach (DataRow dataRow in dataTable.Rows)
                {
                    c.id = dataRow["N_ekskursii"].ToString();
                    c.nazvanie = dataRow["nazvanie"].ToString().Trim();

                    comboBoxEkskursii.Items.Add(c);

                    if (N_ekskursii != "" && N_ekskursii == c.id.ToString())
                    {
                        comboBoxEkskursii.SelectedItem = c;
                    }

                    queueEkskursii.Enqueue(c);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                mainWin.m_dbConnector.Unlock();
            }
        }
Ejemplo n.º 9
0
        private void listViewEkskursii_SelectedIndexChanged(object sender, EventArgs e)
        {
            buttonApply.Enabled = true;
            buttonDelete.Enabled = true;

            textBoxNumber.Enabled = true;
            textBox1.Enabled = true;
            textBox2.Enabled = true;
            textBox3.Enabled = true;
            textBox4.Enabled = true;
            textBox5.Enabled = true;
            comboBoxActivity.Enabled = true;
            bNew = false;

            if (listViewEkskursii.FocusedItem == null)
                return;

            int k = queueEkskursii.Count;
            for (int i = 0; i < k; i++)
            {
                m_ekskursii = (_Ekskursii)queueEkskursii.Dequeue();
                if (m_ekskursii.id.ToString() == (string)listViewEkskursii.Items[listViewEkskursii.FocusedItem.Index].Tag)
                {
                    textBoxNumber.Text = m_ekskursii.id;
                    textBox1.Text = m_ekskursii.nazvanie;
                    textBox2.Text = m_ekskursii.stoimost;
                    textBox3.Text = m_ekskursii.P_kat;
                    textBox4.Text = m_ekskursii.S_kat;
                    textBox5.Text = m_ekskursii.T_kat;
                    comboBoxActivity.Text = m_ekskursii.activ;

                    queueEkskursii.Enqueue(m_ekskursii);
                    break;
                };

                queueEkskursii.Enqueue(m_ekskursii);
            }
        }
Ejemplo n.º 10
0
        public void refreshEkskursii()
        {
            listViewEkskursii.Items.Clear();
            queueEkskursii.Clear();

            try
            {
                mainWin.m_dbConnector.Lock();
                MySqlConnection conn = mainWin.m_dbConnector.getMySqlConnection();

                string sql = "SELECT `N_ekskursii`, `nazvanie`, `stoimost`, `1_kat`, `2_kat`, `3_kat` FROM `ekskursii` ORDER BY `N_ekskursii`";
                MySqlDataAdapter myAdapter = new MySqlDataAdapter();
                myAdapter.SelectCommand = new MySqlCommand(sql, conn);
                DataSet dataSet = new DataSet();
                myAdapter.Fill(dataSet);
                DataTable dataTable = dataSet.Tables[0];

                listViewEkskursii.Items.Clear();
                queueEkskursii.Clear();
                _Ekskursii t = new _Ekskursii();

              foreach (DataRow dataRow in dataTable.Rows)
                {
                    ListViewItem item1 = new ListViewItem(dataRow["N_ekskursii"].ToString().Trim());
                    t.id = dataRow["N_ekskursii"].ToString().Trim();
                    item1.SubItems.Add(dataRow["nazvanie"].ToString().Trim());
                    t.nazvanie = dataRow["nazvanie"].ToString().Trim();
                    item1.SubItems.Add(dataRow["stoimost"].ToString().Trim());
                    t.stoimost = dataRow["stoimost"].ToString().Trim();
                    item1.SubItems.Add(dataRow["1_kat"].ToString().Trim());
                    t.P_kat = dataRow["1_kat"].ToString().Trim();
                    item1.SubItems.Add(dataRow["2_kat"].ToString().Trim());
                    t.S_kat = dataRow["2_kat"].ToString().Trim();
                    item1.SubItems.Add(dataRow["3_kat"].ToString().Trim());
                    t.T_kat = dataRow["3_kat"].ToString().Trim();

                    listViewEkskursii.Items.Add(item1);
                    listViewEkskursii.Items[listViewEkskursii.Items.Count - 1].Tag = dataRow["N_ekskursii"].ToString();
                    queueEkskursii.Enqueue(t);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                mainWin.m_dbConnector.Unlock();
            }
        }
Ejemplo n.º 11
0
        private void listViewZhurnal_SelectedIndexChanged(object sender, EventArgs e)
        {
            buttonApply.Enabled = true;
            buttonDelete.Enabled = true;

            comboBoxEkskursovod.SelectedIndex = -1;
            comboBoxEkskursovod.Enabled = true;
            comboBoxEkskursija.SelectedIndex = -1;
            comboBoxEkskursija.Enabled = true;
            comboBoxZakazczik.SelectedIndex = -1;
            comboBoxZakazczik.Enabled = true;
            textBoxKvN.Text = "";
            textBoxKvN.Enabled = true;
            textBoxKvK.Text = "";
            textBoxKvK.Enabled = true;
            textBoxKolCzel.Text = "";
            textBoxKolCzel.Enabled = true;
            dateTimePickerDate.Enabled = true;

            bNew = false;

            if (listViewZhurnal.FocusedItem == null)
                return;

            int k = queueZhurnal.Count;
            for (int i = 0; i < k; i++)
            {
                m_zhurnal = (_Zhurnal)queueZhurnal.Dequeue();
                if (m_zhurnal.id.ToString() == (string)listViewZhurnal.Items[listViewZhurnal.FocusedItem.Index].Tag)
                {
                    comboBoxEkskursija.Text = m_ekskursii.id;
                    comboBoxEkskursovod.Text = m_zhurnal.fio;
                    comboBoxZakazczik.Text = m_zhurnal.zakaz;
                    textBoxKvN.Text = m_zhurnal.kvn;
                    textBoxKvK.Text = m_zhurnal.kvk;
                    textBoxKolCzel.Text = m_zhurnal.kolczel;
                    dateTimePickerDate.Value = DateTime.Parse(m_zhurnal.date);
                    //фигня для comboboxов
                    _Ekskursii c;
                    int k2 = queueEkskursii.Count;
                    for (int i2 = 0; i2 < k2; i2++)
                    {
                        c = (_Ekskursii)queueEkskursii.Dequeue();
                        if (c.id.ToString() == m_zhurnal.numer.ToString())
                        {
                             for (int iii = 0; iii < comboBoxEkskursija.Items.Count; iii++)
                            {
                                if (((_Ekskursii)comboBoxEkskursija.Items[iii]).id == c.id)
                                {
                                    comboBoxEkskursija.SelectedIndex = iii;
                                    m_ekskursii = c;
                                    break;
                                }
                            }
                        };
                        queueEkskursii.Enqueue(c);
                    }

                    _Zakazczik d;
                    k2 = queueZakazczik.Count;
                    for (int i2 = 0; i2 < k2; i2++)
                    {
                        d = (_Zakazczik)queueZakazczik.Dequeue();
                        if (d.id.ToString() == m_zhurnal.zakaz.ToString())
                        {
                            for (int iii = 0; iii < comboBoxZakazczik.Items.Count; iii++)
                            {
                                if (((_Zakazczik)comboBoxZakazczik.Items[iii]).id == d.id)
                                {
                                    comboBoxZakazczik.SelectedIndex = iii;
                                    m_zakazczik = d;
                                    break;
                                }
                            }
                        };
                        queueZakazczik.Enqueue(d);
                    }

                    _Ekskursovody a;
                    k2 = queueEkskursovod.Count;
                    for (int i2 = 0; i2 < k2; i2++)
                    {
                        a = (_Ekskursovody)queueEkskursovod.Dequeue();
                        if (a.name.ToString() == m_zhurnal.fio.ToString())
                        {

                            for (int iii = 0; iii < comboBoxEkskursovod.Items.Count; iii++)
                            {
                                if (((_Ekskursovody)comboBoxEkskursovod.Items[iii]).id == a.id)
                                {
                                    comboBoxEkskursovod.SelectedIndex = iii;
                                    m_ekskursovody = a;
                                    break;
                                }
                            }
                        };

                            queueEkskursovod.Enqueue(a);
                        }

                        queueZhurnal.Enqueue(m_zhurnal);
                        break;

                    };

                queueZhurnal.Enqueue(m_zhurnal);
                }
        }
Ejemplo n.º 12
0
        private void listViewBilety_SelectedIndexChanged(object sender, EventArgs e)
        {
            buttonApply.Enabled  = true;
            buttonDelete.Enabled = true;

            textBoxKvN.Enabled = true;

            comboBoxEkskursii.Enabled = true;
            textBoxKvK.Enabled        = true;
            dateTimePicker1.Enabled   = true;

            bNew = false;


            if (listViewBilety.FocusedItem == null)
            {
                return;
            }

            int k = queueBilety.Count;

            for (int i = 0; i < k; i++)
            {
                m_bilety = (_Bilety)queueBilety.Dequeue();
                if (m_bilety.id == (string)listViewBilety.Items[listViewBilety.FocusedItem.Index].Tag)
                {
                    textBoxKvN.Text        = m_bilety.KvN;
                    comboBoxEkskursii.Text = m_bilety.name;
                    textBoxKvK.Text        = m_bilety.KvK;
                    dateTimePicker1.Value  = DateTime.Parse(m_bilety.date);
                    queueBilety.Enqueue(m_bilety);

                    _Ekskursii c;
                    int        k2 = queueEkskursii.Count;
                    for (int i2 = 0; i2 < k2; i2++)
                    {
                        c = (_Ekskursii)queueEkskursii.Dequeue();
                        if (c.nazvanie.ToString() == m_bilety.name.ToString())
                        {
                            for (int iii = 0; iii < comboBoxEkskursii.Items.Count; iii++)
                            {
                                if (((_Ekskursii)comboBoxEkskursii.Items[iii]).id == c.id)
                                {
                                    comboBoxEkskursii.SelectedIndex = iii;
                                    m_ekskursii = c;
                                    break;
                                }
                            }
                        }
                        ;
                        queueEkskursii.Enqueue(c);
                    }


                    break;
                }
                ;

                queueBilety.Enqueue(m_bilety);
            }
        }
Ejemplo n.º 13
0
        private void listViewEquipmentGroups_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listViewReports.FocusedItem == null)
                return;

            int k = queueReports.Count;
            for (int i = 0; i < k; i++)
            {
                m_reports = (_Reports)queueReports.Dequeue();
                if (m_reports.date.ToString() == (string)listViewReports.Items[listViewReports.FocusedItem.Index].Tag)
                {

                    //фигня про экскурсии и экскурсоводов
                    _Ekskursii c;
                    int k2 = queueEkskursii.Count;
                    for (int i2 = 0; i2 < k2; i2++)
                    {
                        c = (_Ekskursii)queueEkskursii.Dequeue();
                        if (c.id.ToString() == m_reports.numer.ToString())
                        {
                            for (int iii = 0; iii < comboBoxEkskursija.Items.Count; iii++)
                            {
                                if (((_Ekskursii)comboBoxEkskursija.Items[iii]).id == c.id)
                                {
                                    comboBoxEkskursija.SelectedIndex = iii;
                                    m_ekskursii = c;
                                    break;
                                }
                            }
                        };
                        queueEkskursii.Enqueue(c);
                    }

                    queueReports.Enqueue(m_reports);
                    break;

                };

            }
        }