コード例 #1
0
ファイル: Form1.cs プロジェクト: Ingaaa/Parvaldiba
        private void Form1_Load(object sender, EventArgs e)
        {
            Gramata         examp_gramata      = new Gramata("Saule", "Jumava", "Karlis Skalbe", 1998, new DateTime(2011, 6, 10), "Riga");
            Gramata         examp_gramata1     = new Gramata("Vejs", "Zvaigzne ABC", "Rainis", 2000, new DateTime(2011, 8, 9), "Valmiera");
            Nepublicetie    examp_nepublicetie = new Nepublicetie("Vinnijs Puks", "Nav publiceta", "Aspazija", 1996, new DateTime(2011, 8, 9));
            Nosleguma_darbs examp_nosleguma_d  = new Nosleguma_darbs("Inga", "Pire", "LU", Nosleguma_darba_veids.Kvalifikācijas_darbs, "Ingas darbs", 2015, new DateTime(2015, 10, 18));

            Kolekcija.kolekcija.Add(examp_gramata);
            Kolekcija.kolekcija.Add(examp_gramata1);
            Kolekcija.kolekcija.Add(examp_nepublicetie);
            Kolekcija.kolekcija.Add(examp_nosleguma_d);

            listBox1.DataSource    = Kolekcija.kolekcija; //Par datu avotu uzstādu vienumus, kas atrodas kolekcijā
            listBox1.DisplayMember = "Nosaukums";         //Listboxā tiks parādīts katra vienuma nosaukums.

            comboBox1.Items.Add("Bakalaura darbs");
            comboBox1.Items.Add("Maģistra darbs");
            comboBox1.Items.Add("Kvalifikācijas darbs");
            comboBox1.Items.Add("Doktora disertācija");
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: Ingaaa/Parvaldiba
        private void Form1_Load(object sender, EventArgs e)
        {
            Gramata examp_gramata = new Gramata("Saule", "Jumava", "Karlis Skalbe", 1998, new DateTime(2011, 6, 10), "Riga");
            Gramata examp_gramata1 = new Gramata("Vejs", "Zvaigzne ABC", "Rainis", 2000, new DateTime(2011, 8, 9), "Valmiera");
            Nepublicetie examp_nepublicetie = new Nepublicetie("Vinnijs Puks", "Nav publiceta", "Aspazija", 1996, new DateTime(2011, 8, 9));
            Nosleguma_darbs examp_nosleguma_d = new Nosleguma_darbs("Inga", "Pire", "LU", Nosleguma_darba_veids.Kvalifikācijas_darbs, "Ingas darbs", 2015, new DateTime(2015, 10, 18));

            Kolekcija.kolekcija.Add(examp_gramata);
            Kolekcija.kolekcija.Add(examp_gramata1);
            Kolekcija.kolekcija.Add(examp_nepublicetie);
            Kolekcija.kolekcija.Add(examp_nosleguma_d);

            listBox1.DataSource = Kolekcija.kolekcija;  //Par datu avotu uzstādu vienumus, kas atrodas kolekcijā
            listBox1.DisplayMember = "Nosaukums";       //Listboxā tiks parādīts katra vienuma nosaukums.

            comboBox1.Items.Add("Bakalaura darbs");
            comboBox1.Items.Add("Maģistra darbs");
            comboBox1.Items.Add("Kvalifikācijas darbs");
            comboBox1.Items.Add("Doktora disertācija");
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: Ingaaa/Parvaldiba
        private void button5_Click(object sender, EventArgs e)
        {
            //Poga "Saglabāt"
            comboBox1.ResetText();
            object item = listBox1.SelectedItem;
            bool saglabat = true;

            Gramata salidz1 = new Gramata("aaa", "aaa", "aaa", 1995, new DateTime(1995, 2, 3));
            Nosleguma_darbs salidz2 = new Nosleguma_darbs("aaa", "aaa", "aaa", Nosleguma_darba_veids.Bakalaura_darbs, "aaa", 1995, new DateTime(1995, 2, 3));
            Nepublicetie salidz3 = new Nepublicetie("aaa", "aaa", "aaa", 1995, new DateTime(1995, 2, 3));

            //Atkarībā no objekta tipa un izvēlētās īpašības, ko girb mainīt, uzstādu jauno vērtību
            if (item.GetType() == salidz1.GetType())
            {

                if (listBox3.SelectedIndex == 0)
                {
                    string text = textBox3.Text;
                    Type t = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Izdevejs").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }

                }
                if (listBox3.SelectedIndex == 1)
                {
                    string text = textBox3.Text;
                    Type t = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Izdeveja_adrese").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }

                }
                if (listBox3.SelectedIndex == 2)
                {
                    string text = textBox3.Text;
                    Type t = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Autori").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }

                }
                if (listBox3.SelectedIndex == 3)
                {
                    string text = textBox3.Text;
                    Type t = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Nosaukums").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }

                }
                if (listBox3.SelectedIndex == 4)
                {
                    int gads = dateTimePicker2.Value.Year;

                    Type t = item.GetType();
                    t.GetProperty("Gads").SetValue(item, gads);
                }
                if (listBox3.SelectedIndex == 5)
                {

                    DateTime date = dateTimePicker1.Value.Date;

                    Type t = item.GetType();
                    t.GetProperty("Izveidosanas_datums").SetValue(item, date);
                }

            }
            if (item.GetType() == salidz2.GetType())
            {

                if (listBox3.SelectedIndex == 0)
                {
                    comboBox1.Show();

                    Type t = item.GetType();
                    if (comboBox1.SelectedIndex == 0)
                    {
                        t.GetProperty("Darba_veids").SetValue(item, Nosleguma_darba_veids.Bakalaura_darbs);
                    }
                    if (comboBox1.SelectedIndex == 1)
                    {
                        t.GetProperty("Darba_veids").SetValue(item, Nosleguma_darba_veids.Maģistra_darbs);
                    }
                    if (comboBox1.SelectedIndex == 2)
                    {
                        t.GetProperty("Darba_veids").SetValue(item, Nosleguma_darba_veids.Kvalifikācijas_darbs);
                    }
                    if (comboBox1.SelectedIndex == 3)
                    {
                        t.GetProperty("Darba_veids").SetValue(item, Nosleguma_darba_veids.Doktora_disertācija);
                    }

                }
                if (listBox3.SelectedIndex == 1)
                {
                    string text = textBox3.Text;
                    Type t = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Autora_vards").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }

                }
                if (listBox3.SelectedIndex == 2)
                {
                    string text = textBox3.Text;
                    Type t = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Autora_uzvards").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }

                }
                if (listBox3.SelectedIndex == 3)
                {
                    string text = textBox3.Text;
                    Type t = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Izglitibas_iestades_nos").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }
                }
                if (listBox3.SelectedIndex == 4)
                {
                    string text = textBox3.Text;
                    Type t = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Nosaukums").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }

                }
                if (listBox3.SelectedIndex == 5)
                {

                    int gads = dateTimePicker2.Value.Year;

                    Type t = item.GetType();
                    t.GetProperty("Gads").SetValue(item, gads);
                }
                if (listBox3.SelectedIndex == 6)
                {

                    DateTime date = dateTimePicker1.Value.Date;

                    Type t = item.GetType();
                    t.GetProperty("Izveidosanas_datums").SetValue(item, date);
                }
            }
            if (item.GetType() == salidz3.GetType())
            {

                if (listBox3.SelectedIndex == 0)
                {
                    string text = textBox3.Text;
                    Type t = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Piezimes").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }

                }
                if (listBox3.SelectedIndex == 1)
                {
                    string text = textBox3.Text;
                    Type t = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Autori").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }

                }
                if (listBox3.SelectedIndex == 2)
                {
                    string text = textBox3.Text;
                    Type t = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Nosaukums").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }

                }

                if (listBox3.SelectedIndex == 3)
                {

                    int gads = dateTimePicker2.Value.Year;

                    Type t = item.GetType();
                    t.GetProperty("Gads").SetValue(item, gads);
                }
                if (listBox3.SelectedIndex == 4)
                {

                    DateTime date = dateTimePicker1.Value.Date;

                    Type t = item.GetType();
                    t.GetProperty("Izveidosanas_datums").SetValue(item, date);
                }
            }

            if (saglabat == true)
            {
                button5.Hide();

                textBox3.Clear();
                textBox3.Text = "Ievadiet jauno vērtību";
                textBox3.Hide();
                button4.Hide();
                listBox3.Hide();
                dateTimePicker2.Hide();
                dateTimePicker1.Hide();
                comboBox1.Hide();
                listBox1.DataSource = null;
                listBox1.DataSource = Kolekcija.kolekcija;
                listBox1.DisplayMember = "Nosaukums";
                label8.Hide();

            }
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: Ingaaa/Parvaldiba
        private void button4_Click(object sender, EventArgs e)
        {
            // Otrā poga "Mainīt"
            object item = listBox1.SelectedItem; //saglabāju pirmajā listboxā atlasīto obejktu

            //Izveidoju no katras klases pa vienam objektam, lai vēlāk veiktu salīdzināšanu
            Gramata salidz1 = new Gramata("aaa", "aaa", "aaa", 1995, new DateTime(1995, 2, 3));
            Nosleguma_darbs salidz2 = new Nosleguma_darbs("aaa", "aaa", "aaa", Nosleguma_darba_veids.Bakalaura_darbs, "aaa", 1995, new DateTime(1995, 2, 3));
            Nepublicetie salidz3 = new Nepublicetie("aaa", "aaa", "aaa", 1995, new DateTime(1995, 2, 3));

            //Salīdzinu saglabātā objekta tipu ar zināmiem objektu tipiem. Tādā veidā atrodu no kuras klases objekts ir nācis
            //Pēc tam atkarībā no tā kādu objekta īpašību vēlas mainīt, parādu attiecīgos kontroļus
            if (item.GetType() == salidz1.GetType())
            {

                if (listBox3.SelectedIndex == 0 || listBox3.SelectedIndex == 1 || listBox3.SelectedIndex == 2 || listBox3.SelectedIndex == 3)
                {

                    textBox3.Show();

                }
                if (listBox3.SelectedIndex == 4)
                {
                    dateTimePicker2.Show();
                }
                if (listBox3.SelectedIndex == 5)
                {
                    dateTimePicker1.Show();
                }
            }
            if (item.GetType() == salidz2.GetType())
            {
                if (listBox3.SelectedIndex == 0)
                {

                    comboBox1.Show();
                }
                if (listBox3.SelectedIndex == 1 || listBox3.SelectedIndex == 2 || listBox3.SelectedIndex == 3 || listBox3.SelectedIndex == 4)
                {

                    textBox3.Show();

                }
                if (listBox3.SelectedIndex == 5)
                {
                    dateTimePicker2.Show();
                }
                if (listBox3.SelectedIndex == 6)
                {
                    dateTimePicker1.Show();
                }
            }
            if (item.GetType() == salidz3.GetType())
            {

                if (listBox3.SelectedIndex == 0 || listBox3.SelectedIndex == 1 || listBox3.SelectedIndex == 2)
                {

                    textBox3.Show();

                }
                if (listBox3.SelectedIndex == 3)
                {
                    dateTimePicker2.Show();
                }
                if (listBox3.SelectedIndex == 4)
                {
                    dateTimePicker1.Show();
                }
            }

            button5.Show();
            button8.Show();
        }
コード例 #5
0
ファイル: Form1.cs プロジェクト: Ingaaa/Parvaldiba
        private void button5_Click(object sender, EventArgs e)
        {
            //Poga "Saglabāt"
            comboBox1.ResetText();
            object item     = listBox1.SelectedItem;
            bool   saglabat = true;


            Gramata         salidz1 = new Gramata("aaa", "aaa", "aaa", 1995, new DateTime(1995, 2, 3));
            Nosleguma_darbs salidz2 = new Nosleguma_darbs("aaa", "aaa", "aaa", Nosleguma_darba_veids.Bakalaura_darbs, "aaa", 1995, new DateTime(1995, 2, 3));
            Nepublicetie    salidz3 = new Nepublicetie("aaa", "aaa", "aaa", 1995, new DateTime(1995, 2, 3));

            //Atkarībā no objekta tipa un izvēlētās īpašības, ko girb mainīt, uzstādu jauno vērtību
            if (item.GetType() == salidz1.GetType())
            {
                if (listBox3.SelectedIndex == 0)
                {
                    string text = textBox3.Text;
                    Type   t    = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Izdevejs").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }
                }
                if (listBox3.SelectedIndex == 1)
                {
                    string text = textBox3.Text;
                    Type   t    = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Izdeveja_adrese").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }
                }
                if (listBox3.SelectedIndex == 2)
                {
                    string text = textBox3.Text;
                    Type   t    = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Autori").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }
                }
                if (listBox3.SelectedIndex == 3)
                {
                    string text = textBox3.Text;
                    Type   t    = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Nosaukums").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }
                }
                if (listBox3.SelectedIndex == 4)
                {
                    int gads = dateTimePicker2.Value.Year;

                    Type t = item.GetType();
                    t.GetProperty("Gads").SetValue(item, gads);
                }
                if (listBox3.SelectedIndex == 5)
                {
                    DateTime date = dateTimePicker1.Value.Date;

                    Type t = item.GetType();
                    t.GetProperty("Izveidosanas_datums").SetValue(item, date);
                }
            }
            if (item.GetType() == salidz2.GetType())
            {
                if (listBox3.SelectedIndex == 0)
                {
                    comboBox1.Show();

                    Type t = item.GetType();
                    if (comboBox1.SelectedIndex == 0)
                    {
                        t.GetProperty("Darba_veids").SetValue(item, Nosleguma_darba_veids.Bakalaura_darbs);
                    }
                    if (comboBox1.SelectedIndex == 1)
                    {
                        t.GetProperty("Darba_veids").SetValue(item, Nosleguma_darba_veids.Maģistra_darbs);
                    }
                    if (comboBox1.SelectedIndex == 2)
                    {
                        t.GetProperty("Darba_veids").SetValue(item, Nosleguma_darba_veids.Kvalifikācijas_darbs);
                    }
                    if (comboBox1.SelectedIndex == 3)
                    {
                        t.GetProperty("Darba_veids").SetValue(item, Nosleguma_darba_veids.Doktora_disertācija);
                    }
                }
                if (listBox3.SelectedIndex == 1)
                {
                    string text = textBox3.Text;
                    Type   t    = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Autora_vards").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }
                }
                if (listBox3.SelectedIndex == 2)
                {
                    string text = textBox3.Text;
                    Type   t    = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Autora_uzvards").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }
                }
                if (listBox3.SelectedIndex == 3)
                {
                    string text = textBox3.Text;
                    Type   t    = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Izglitibas_iestades_nos").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }
                }
                if (listBox3.SelectedIndex == 4)
                {
                    string text = textBox3.Text;
                    Type   t    = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Nosaukums").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }
                }
                if (listBox3.SelectedIndex == 5)
                {
                    int gads = dateTimePicker2.Value.Year;

                    Type t = item.GetType();
                    t.GetProperty("Gads").SetValue(item, gads);
                }
                if (listBox3.SelectedIndex == 6)
                {
                    DateTime date = dateTimePicker1.Value.Date;

                    Type t = item.GetType();
                    t.GetProperty("Izveidosanas_datums").SetValue(item, date);
                }
            }
            if (item.GetType() == salidz3.GetType())
            {
                if (listBox3.SelectedIndex == 0)
                {
                    string text = textBox3.Text;
                    Type   t    = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Piezimes").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }
                }
                if (listBox3.SelectedIndex == 1)
                {
                    string text = textBox3.Text;
                    Type   t    = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Autori").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }
                }
                if (listBox3.SelectedIndex == 2)
                {
                    string text = textBox3.Text;
                    Type   t    = item.GetType();
                    if (!string.IsNullOrWhiteSpace(text) && text != "Ievadiet jauno vērtību")
                    {
                        t.GetProperty("Nosaukums").SetValue(item, text);
                    }
                    else
                    {
                        label8.Show();
                        saglabat = false;
                    }
                }

                if (listBox3.SelectedIndex == 3)
                {
                    int gads = dateTimePicker2.Value.Year;

                    Type t = item.GetType();
                    t.GetProperty("Gads").SetValue(item, gads);
                }
                if (listBox3.SelectedIndex == 4)
                {
                    DateTime date = dateTimePicker1.Value.Date;

                    Type t = item.GetType();
                    t.GetProperty("Izveidosanas_datums").SetValue(item, date);
                }
            }


            if (saglabat == true)
            {
                button5.Hide();

                textBox3.Clear();
                textBox3.Text = "Ievadiet jauno vērtību";
                textBox3.Hide();
                button4.Hide();
                listBox3.Hide();
                dateTimePicker2.Hide();
                dateTimePicker1.Hide();
                comboBox1.Hide();
                listBox1.DataSource    = null;
                listBox1.DataSource    = Kolekcija.kolekcija;
                listBox1.DisplayMember = "Nosaukums";
                label8.Hide();
            }
        }
コード例 #6
0
ファイル: Form1.cs プロジェクト: Ingaaa/Parvaldiba
        private void button4_Click(object sender, EventArgs e)
        {
            // Otrā poga "Mainīt"
            object item = listBox1.SelectedItem; //saglabāju pirmajā listboxā atlasīto obejktu

            //Izveidoju no katras klases pa vienam objektam, lai vēlāk veiktu salīdzināšanu
            Gramata         salidz1 = new Gramata("aaa", "aaa", "aaa", 1995, new DateTime(1995, 2, 3));
            Nosleguma_darbs salidz2 = new Nosleguma_darbs("aaa", "aaa", "aaa", Nosleguma_darba_veids.Bakalaura_darbs, "aaa", 1995, new DateTime(1995, 2, 3));
            Nepublicetie    salidz3 = new Nepublicetie("aaa", "aaa", "aaa", 1995, new DateTime(1995, 2, 3));


            //Salīdzinu saglabātā objekta tipu ar zināmiem objektu tipiem. Tādā veidā atrodu no kuras klases objekts ir nācis
            //Pēc tam atkarībā no tā kādu objekta īpašību vēlas mainīt, parādu attiecīgos kontroļus
            if (item.GetType() == salidz1.GetType())
            {
                if (listBox3.SelectedIndex == 0 || listBox3.SelectedIndex == 1 || listBox3.SelectedIndex == 2 || listBox3.SelectedIndex == 3)
                {
                    textBox3.Show();
                }
                if (listBox3.SelectedIndex == 4)
                {
                    dateTimePicker2.Show();
                }
                if (listBox3.SelectedIndex == 5)
                {
                    dateTimePicker1.Show();
                }
            }
            if (item.GetType() == salidz2.GetType())
            {
                if (listBox3.SelectedIndex == 0)
                {
                    comboBox1.Show();
                }
                if (listBox3.SelectedIndex == 1 || listBox3.SelectedIndex == 2 || listBox3.SelectedIndex == 3 || listBox3.SelectedIndex == 4)
                {
                    textBox3.Show();
                }
                if (listBox3.SelectedIndex == 5)
                {
                    dateTimePicker2.Show();
                }
                if (listBox3.SelectedIndex == 6)
                {
                    dateTimePicker1.Show();
                }
            }
            if (item.GetType() == salidz3.GetType())
            {
                if (listBox3.SelectedIndex == 0 || listBox3.SelectedIndex == 1 || listBox3.SelectedIndex == 2)
                {
                    textBox3.Show();
                }
                if (listBox3.SelectedIndex == 3)
                {
                    dateTimePicker2.Show();
                }
                if (listBox3.SelectedIndex == 4)
                {
                    dateTimePicker1.Show();
                }
            }

            button5.Show();
            button8.Show();
        }