Example #1
0
 public GroupsGridPage(DBL d)
 {
     InitializeComponent();
     dbl    = d;
     Groups = new ObservableCollection <Group>();
     if (dbl.accounttype == DBL.AccountType.Dean)
     {
         foreach (Group g in dbl.GiveGroups())
         {
             if (g.University == dbl.LoggedPerson.University && g.Faculty == ((Dean)dbl.LoggedPerson).Faculty)
             {
                 Groups.Add(g);
             }
         }
     }
     else
     {
         foreach (Group g in dbl.GiveGroups())
         {
             if (g.University == dbl.LoggedPerson.University)
             {
                 Groups.Add(g);
             }
         }
     }
     GroupsGrid.ItemsSource = Groups;
 }
Example #2
0
 private void Group_Fields_TextChanged()
 {
     foreach (Group g in dbl.GiveGroups())
     {
         if (Specialty_Box.SelectedIndex != -1)
         {
             if (g.Number.ToString() == Number_Field.Text && g.Specialty.Name == SpecialtyBoxList[Specialty_Box.SelectedIndex].Name && g != group)
             {
                 Success.Visibility     = Visibility.Hidden;
                 NumberError.Visibility = Visibility.Visible;
             }
             else
             {
                 NumberError.Visibility = Visibility.Hidden;
             }
         }
     }
 }
Example #3
0
 private void Specialty_Box_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (Specialty_Box.SelectedIndex != (-1))
     {
         GroupBoxList = new List <Group>();
         Group_Box.Items.Clear();
         foreach (Group g in dbl.GiveGroups())
         {
             if (g.Specialty == SpecialtyBoxList[Specialty_Box.SelectedIndex])
             {
                 GroupBoxList.Add(g);
             }
         }
         foreach (Group g in GroupBoxList)
         {
             Group_Box.Items.Add(g.Course.ToString() + "-" + g.Number.ToString());
         }
     }
     else
     {
         GroupBoxList = new List <Group>();
         Group_Box.Items.Clear();
     }
 }