Exemplo n.º 1
0
        private void button7_Click(object sender, EventArgs e)
        {
            try
            {
                if (listView1.SelectedItems.Count <= 0)
                {
                    throw new Exception("Eror!");
                }
                Universal_Forms at_form = new Universal_Forms(new Student());


                at_form.AddFacultity(this);
                at_form.comboBox1.Visible       = false;
                at_form.listBox1.Visible        = false;
                at_form.comboBox1.SelectedIndex = 0;
                at_form.listBox1.SelectedIndex  = 0;

                if (at_form.ShowDialog() == DialogResult.OK)
                {
                    dm.MyUniver.Faculties[comboBox1.SelectedIndex].Groups[listBox1.SelectedIndex].Students[listView1.SelectedItems.Count + 1] = ((Student)at_form.universal_obj);
                    Save();
                    Update();
                    MessageBox.Show($"Сохранение изменений ...");
                }
            }
            catch (Exception eror)
            {
                MessageBox.Show(eror.Message, "Eror index!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Universal_Forms at_form = new Universal_Forms(new Faculty());

            if (at_form.ShowDialog() == DialogResult.OK)
            {
                dm.MyUniver.Faculties.Add((Faculty)at_form.universal_obj);
                Save();
                Update();
                MessageBox.Show($"Сохранение изменений ...");
            }
        }
Exemplo n.º 3
0
        private void button6_Click(object sender, EventArgs e)

        {
            Universal_Forms at_form = new Universal_Forms(new Group());

            at_form.AddFacultity(this);
            if (at_form.ShowDialog() == DialogResult.OK)
            {
                dm.MyUniver.Faculties[at_form.comboBox1.SelectedIndex].Groups.Add((Group)at_form.universal_obj);
                Save();
                Update();
                MessageBox.Show($"Сохранение изменений ...");
            }
        }
Exemplo n.º 4
0
        private void button3_Click(object sender, EventArgs e)
        {
            try {
                if (comboBox1.SelectedIndex < 0)
                {
                    throw new Exception("Eror!");
                }
                Universal_Forms at_form = new Universal_Forms(new Faculty());

                if (at_form.ShowDialog() == DialogResult.OK)
                {
                    dm.MyUniver.Faculties[comboBox1.SelectedIndex].Name = ((Faculty)at_form.universal_obj).Name;
                    Save();
                    Update();
                    MessageBox.Show($"Сохранение изменений ...");
                }
            }
            catch (Exception eror)
            {
                MessageBox.Show(eror.Message, "Eror index!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }