Exemplo n.º 1
0
        public ShowAllNannies()
        {
            SortNannyBy sortBy = new SortNannyBy();

            DataContext = sortBy;
            InitializeComponent();
            bl = factoryBL.get_bl();
            dataGrid.ItemsSource = bl.get_nanny_list();
            comboBox.ItemsSource = bl.get_sort_nannies_by_list();
        }
Exemplo n.º 2
0
        public List <Nanny> get_nanny_list(SortNannyBy sortBy)
        {
            List <Nanny> nanny_list = d2.get_nanny_list();

            if (sortBy == SortNannyBy.Id)
            {
                nanny_list.Sort((mother1, mother2) => (mother1.Id.CompareTo(mother2.Id)));
            }
            if (sortBy == SortNannyBy.floor)
            {
                nanny_list.Sort((mother1, mother2) => (mother1.floor.CompareTo(mother2.floor)));
            }
            if (sortBy == SortNannyBy.LastName)
            {
                nanny_list.Sort((mother1, mother2) => (mother1.Family_Name.CompareTo(mother2.Family_Name)));
            }
            if (sortBy == SortNannyBy.Experience_Years)
            {
                nanny_list.Sort((mother1, mother2) => (mother1.Experience_Years.CompareTo(mother2.Experience_Years)));
            }
            if (sortBy == SortNannyBy.Max_Children)
            {
                nanny_list.Sort((mother1, mother2) => (mother1.Max_Children.CompareTo(mother2.Max_Children)));
            }
            if (sortBy == SortNannyBy.Hourly_Price)
            {
                nanny_list.Sort((mother1, mother2) => (mother1.Hourly_Price.CompareTo(mother2.Hourly_Price)));
            }
            if (sortBy == SortNannyBy.Monthly_Price)
            {
                nanny_list.Sort((mother1, mother2) => (mother1.Monthly_Price.CompareTo(mother2.Monthly_Price)));
            }
            if (sortBy == SortNannyBy.Rating)
            {
                nanny_list.Sort((mother1, mother2) => (mother1.Rating.CompareTo(mother2.Rating)));
            }
            return(nanny_list);
        }
Exemplo n.º 3
0
 private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     sortBy = (SortNannyBy)comboBox.SelectedItem;
     dataGrid.ItemsSource = bl.get_nanny_list(sortBy);
 }