コード例 #1
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (name.Text == "")
     {
         a1.Visibility = Visibility.Visible;
         p.Visibility  = Visibility.Visible;
         if (hours.Text == "")
         {
             a2.Visibility = Visibility.Visible;
         }
         if (semester.Text == "")
         {
             a3.Visibility = Visibility.Visible;
         }
         if (speciality.Text == "")
         {
             a4.Visibility = Visibility.Visible;
         }
     }
     else
     {
         if (hours.Text == "")
         {
             a2.Visibility = Visibility.Visible;
             p.Visibility  = Visibility.Visible;
             if (semester.Text == "")
             {
                 a3.Visibility = Visibility.Visible;
             }
             if (speciality.Text == "")
             {
                 a4.Visibility = Visibility.Visible;
             }
         }
         else
         {
             if (semester.Text == "")
             {
                 a3.Visibility = Visibility.Visible;
                 p.Visibility  = Visibility.Visible;
                 if (speciality.Text == "")
                 {
                     a4.Visibility = Visibility.Visible;
                 }
             }
             else
             {
                 if (speciality.Text == "")
                 {
                     a4.Visibility = Visibility.Visible;
                     p.Visibility  = Visibility.Visible;
                 }
                 else
                 {
                     ListInterface a = new ClassList();
                     a.AddDiscipline(name.Text, hours.Text, semester.Text, speciality.Text);
                     name.Clear();
                     hours.Clear();
                     semester.SelectedIndex   = -1;
                     speciality.SelectedIndex = -1;
                 }
             }
         }
     }
 }