示例#1
0
 private void изменитьToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     if (Univer.Disciplines.Count != 0)
     {
         if (listViewSubject.SelectedItems.Count == 1)
         {
             Discipline     tempDiscipline = Univer.Disciplines[listViewSubject.SelectedIndices[0] + 1];
             DisciplineForm f2             = new DisciplineForm(tempDiscipline);
             if (f2.ShowDialog() == DialogResult.OK)
             {
                 if (f2.discipline.IsValid)
                 {
                     Discipline temp = f2.discipline;
                     Univer.Disciplines.Remove(temp.DisciplineId);
                     Univer.Disciplines.Add(temp.DisciplineId, temp);
                 }
             }
         }
         updateListDiscipline();
     }
     else
     {
         MessageBox.Show("Ошибка! Сначала добавьте предметы", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#2
0
        private void добавитьToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            DisciplineForm f2 = new DisciplineForm();

            f2.Show();
            this.discipline = f2.discipline;
        }
示例#3
0
 private void изменитьToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     if (this.discipline != null)
     {
         DisciplineForm f2 = new DisciplineForm(this.discipline);
         f2.Show();
         this.discipline = f2.discipline;
     }
     else
     {
         MessageBox.Show("Ошибка! Сначала добавьте предметы", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#4
0
        private void добавитьToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            DisciplineForm f2 = new DisciplineForm();

            if (f2.ShowDialog() == DialogResult.OK)
            {
                if (f2.discipline.IsValid)
                {
                    Discipline temp = f2.discipline;
                    Univer.Disciplines.Add(temp.DisciplineId, temp);
                    updateListDiscipline();
                }
            }
        }