Пример #1
0
        /// <summary>
        /// Filtre sur l'ordre alphabetique du nom des membres
        /// On utilise pour les filtres une list<Filter> ce qui permet de stocker tous les filtres actifs pour les cas ou l'on veut
        /// pouvoir utiliser des filtres simultanéments
        /// pour effectué un filtre on ajoute une classe fille dans la liste activefilter
        /// pour reset le filtre on l'enleve de la liste
        /// a la fin de la methode on effectue tous les filtres actifs
        /// la variable bool permet de choisir le pattern en fonction des valeurs
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AlfabetButtonClick(object sender, RoutedEventArgs e)
        {
            this._alfabetSorted = !this._alfabetSorted;

            AlfabetButton.Background = this._alfabetSorted ? SolidColorBrushHelper.Green() : SolidColorBrushHelper.Transparent();

            AlfabetFilter filter = new AlfabetFilter();

            if (this._alfabetSorted)
            {
                this._memberVM.AddFilter(filter);
            }
            else
            {
                this._memberVM.RemoveFilter(filter);
            }

            if (this._memberSelected)
            {
                this._memberVM.SelectedUserControl = new MemberListUserControl(this._memberVM.Sort(), this._memberVM.Save);
            }
            else
            {
                this._memberVM.SelectedUserControl = new EmployeeListUserControl(this._memberVM.Sort(), this._memberVM.Save);
            }
        }
Пример #2
0
        private void MemberButtonClick(object sender, RoutedEventArgs e)
        {
            PaymentComboBox.Visibility = LoisirComboBox.Visibility = ClassementButton.Visibility = Visibility.Visible;
            this._memberSelected       = !this._memberSelected;

            MemberButton.Background = this._memberSelected ? SolidColorBrushHelper.DarkGreen() : SolidColorBrushHelper.Green();

            //Reset coulours des autres buttons
            EmployeeButton.Background = SolidColorBrushHelper.Green();
            this._employeeSelected    = false;

            this._memberVM.SelectedUserControl = new MemberListUserControl(this._memberVM.Save.Peoples, this._memberVM.Save);
        }
Пример #3
0
        /// <summary>
        /// Filtre sur le classement des membres
        /// Même fonctionnement que pour celui alphabetique
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ClassementButtonClick(object sender, RoutedEventArgs e)
        {
            this._classementSorted = !this._classementSorted;

            ClassementButton.Background = this._classementSorted ? SolidColorBrushHelper.Green() : SolidColorBrushHelper.Transparent();
            CompetitionFilter filter = new CompetitionFilter();

            if (this._classementSorted)
            {
                this._memberVM.AddFilter(filter);
            }
            else
            {
                this._memberVM.RemoveFilter(filter);
            }

            this._memberVM.SelectedUserControl = new MemberListUserControl(this._memberVM.Sort(), this._memberVM.Save);
        }
Пример #4
0
        private void UnselectedButtonsColorization(Button button)
        {
            List <Button> unselectedButtons = this._buttons.Where(x => !x.Equals(button)).ToList();

            unselectedButtons.ForEach(x => x.Background = SolidColorBrushHelper.Green());
        }
Пример #5
0
        public MemberUserControl(Save save)
        {
            this._memberVM = new MemberVM(save);

            this._employeeSelected = false;
            this._memberSelected   = true;
            this._alfabetSorted    = false;
            this._classementSorted = false;
            this._activeFilters    = new List <Filter>();
            InitializeComponent();

            MemberButton.Background = this._memberSelected ? SolidColorBrushHelper.DarkGreen() : SolidColorBrushHelper.Green();

            DataContext = this._memberVM;
        }