Example #1
0
 public GroupPage(Group g, DBL d)
 {
     InitializeComponent();
     group     = new Group();
     group     = g;
     dbl       = d;
     faculties = new List <Faculty>();
     foreach (Faculty faculty in dbl.GiveFaculties())
     {
         if (faculty.University == dbl.LoggedPerson.University)
         {
             faculties.Add(faculty);
             Faculty_Box.Items.Add(faculty.Name);
         }
     }
     if (group == null)
     {
         group = new Group();
         NewGroup();
     }
     else
     {
         EditGroup();
     }
 }
Example #2
0
 public SpecialtyPage(Specialty s, DBL d)
 {
     InitializeComponent();
     specialty = new Specialty();
     specialty = s;
     dbl       = d;
     faculties = new List <Faculty>();
     foreach (Faculty faculty in dbl.GiveFaculties())
     {
         if (faculty.University == dbl.LoggedPerson.University)
         {
             faculties.Add(faculty);
             Faculty_Box.Items.Add(faculty.Name);
         }
     }
     if (specialty == null)
     {
         specialty = new Specialty();
         NewSpecialty();
     }
     else
     {
         EditSpecialty();
     }
 }
 public FacultiesGridPage(DBL d)
 {
     InitializeComponent();
     dbl       = d;
     Faculties = new ObservableCollection <Faculty>();
     foreach (Faculty f in dbl.GiveFaculties())
     {
         if (f.University == dbl.LoggedPerson.University)
         {
             Faculties.Add(f);
         }
     }
     FacultiesGrid.ItemsSource = Faculties;
 }
Example #4
0
 private void Name_Field_TextChanged(object sender, TextChangedEventArgs e)
 {
     foreach (Faculty f in dbl.GiveFaculties())
     {
         if (f.Name == Name_Field.Text && faculty.Name != Name_Field.Text)
         {
             Success.Visibility   = Visibility.Hidden;
             NameError.Visibility = Visibility.Visible;
         }
         else
         {
             NameError.Visibility = Visibility.Hidden;
         }
     }
 }
Example #5
0
        private void EditeDean()
        {
            Dean dean = (Dean)person;

            foreach (Faculty f in dbl.GiveFaculties())
            {
                if (f.Name == Facylty_Box.Text)
                {
                    dean.Faculty = f;
                    dbl.ChangeObject(dean);
                    Success.Visibility = Visibility.Visible;
                }
                else
                {
                    NullableError.Visibility = Visibility.Visible;
                }
            }
        }
Example #6
0
        public ProfilePage(Person p, DBL d, ProfilePageType pt)
        {
            InitializeComponent();
            person         = p;
            dbl            = d;
            pageType       = pt;
            FacultyBoxList = new List <Faculty>(dbl.GiveFaculties());
            foreach (Faculty f in FacultyBoxList)
            {
                if (f.University == dbl.LoggedPerson.University)
                {
                    Facylty_Box.Items.Add(new ComboBoxItem {
                        Content = f.Name
                    });
                }
            }
            switch (pageType)
            {
            case ProfilePageType.Edit:
                EditType();
                break;

            case ProfilePageType.NewStudent:
                AddType();
                NewStudentType();
                break;

            case ProfilePageType.NewTeacher:
                AddType();
                NewTeacherType();
                break;

            case ProfilePageType.NewDean:
                AddType();
                NewDeanType();
                break;

            default:
                break;
            }
        }