Exemple #1
0
        public static List <SortMainObject> GetMainData(ViewModeOptionEnum viewMode, int?orgMode, string orgOption)
        {
            var data = new List <SortMainObject>();

            orgMode = orgMode ?? 0;

            if (Config.User.IsInAnyRole("Admin,ReleaseOfficial,ReadAll"))
            {
                data = SortMainObject.GetAllSorts(viewMode);
            }
            else if (Config.User.IsInAnyRole("OrgManager"))
            {
                if (((OrgOptionEnum)orgMode) == OrgOptionEnum.OrgArtifacts)
                {
                    data = SortMainObject.GetSortForUserOrg(Config.User.EmployeeId, orgOption);
                }
                else
                {
                    data = SortMainObject.GetSortForUser(Config.User.EmployeeId);
                }
            }
            else
            {
                data = SortMainObject.GetSortForUser(Config.User.EmployeeId);
            }

            return(data);
        }