Beispiel #1
0
        private void editB2_Click(object sender, EventArgs e)
        {
            if (Program.getDB().prilby.FindByjmeno(list2.Text) == null)
            {
                MessageBox.Show("Pro úpravu musíte vybrat přilbu ze seznamu.", "Vyberte přilbu", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            newZbrojDialog editras = new newZbrojDialog(list2.Text, 1);
            editras.Text = "Úprava přilby";
            this.Hide();

            if (editras.ShowDialog(this) == DialogResult.OK)
            {
                list2.Items.Insert(list2.Items.IndexOf(editras.edit), editras.jmeno);
                list2.Items.RemoveAt(list2.Items.IndexOf(editras.edit));
            }
            this.Show();
        }
Beispiel #2
0
 private void newB_Click(object sender, EventArgs e)
 {
     newZbrojDialog newras = new newZbrojDialog(0);
     newras.Text = "Nová zbroj";
     this.Hide();
     if (newras.ShowDialog(this) == DialogResult.OK)
     {
         list1.Items.Add(newras.jmeno);
     }
     newras.Close();
     this.Show();
 }