Ejemplo n.º 1
0
        private void LoadUsersRules()
        {
            users = new List <User>();
            if (functions.IntToBool(user.IsValidator) ? true : functions.IntToBool(user.IsAdmin))
            {
                switch (userSelect.SelectedItem.ToString())
                {
                case "Show Approvees":
                    user_name.ItemsSource =
                        (
                            from X in queries.User_GetApprovees(user)
                            where functions.IntToBool(X.IsActive)
                            orderby X.UserName
                            select X
                        ).ToList();
                    break;

                case "Show Active Users":
                    user_name.ItemsSource =
                        (
                            from X in queries.GetUser_All()
                            where functions.IntToBool(X.IsActive)
                            orderby X.UserName
                            select X
                        ).ToList();
                    break;

                case "Show All Users":
                    user_name.ItemsSource =
                        (
                            from X in queries.GetUser_All()
                            orderby X.UserName
                            select X
                        ).ToList();
                    break;
                }
            }
            else
            {
                users.Add(user);
                userSelect.Visibility  = Visibility.Hidden;
                user_name.SelectedItem = user;
                user_name.ItemsSource  = users;
            }
            user_name.DisplayMemberPath = "UserName";
        }