Advertisement
MaksNew

enumhelper before editing

Apr 13th, 2022
1,033
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.13 KB | None | 0 0
  1. using System.Collections.Generic;
  2. using System.Linq;
  3.  
  4. namespace Lexily.ManagementUsersApplication.Helpers
  5. {
  6.     public static class UserRoles
  7.     {
  8.         public static string Administrator { get; set; } = "administrator";
  9.         public static string HumanResourcesManager { get; set; } = "human-resources-manager";
  10.     }
  11.  
  12.     public static class EnumHelper
  13.     {
  14.         /// <returns>Data format: user role enum id on user service - role display name</returns>
  15.         public static List<KeyValuePair<string, string>> GetUserRolesDisplayNames()
  16.         {
  17.             var response = new List<KeyValuePair<string, string>>();
  18.             response.Add(new KeyValuePair<string, string>("None", "None"));//remove
  19.             response.Add(new KeyValuePair<string, string>("Customer", "Customer"));
  20.             response.Add(new KeyValuePair<string, string>("Engineer", "Engineer"));
  21.             response.Add(new KeyValuePair<string, string>("EngineeringGroupLead", "Engineering group lead"));
  22.             response.Add(new KeyValuePair<string, string>("QualityAssurance", "Quality assurance"));
  23.             response.Add(new KeyValuePair<string, string>("QualityAssuranceGroupLead", "Quality assurance group lead"));
  24.             response.Add(new KeyValuePair<string, string>("LeadOfEngineering", "Lead of engineering"));
  25.             response.Add(new KeyValuePair<string, string>("ProjectManager", "Project manager"));
  26.             response.Add(new KeyValuePair<string, string>("LeadOfProjectManagement", "Lead of project management"));
  27.             response.Add(new KeyValuePair<string, string>("HeadOfProjectManagement", "Head of project management"));
  28.             response.Add(new KeyValuePair<string, string>("SalesManager", "Sales manager"));
  29.             response.Add(new KeyValuePair<string, string>("SalesManagementGroupLead", "Sales management group lead"));
  30.             response.Add(new KeyValuePair<string, string>("LeadOfSales", "Lead of sales"));
  31.             response.Add(new KeyValuePair<string, string>("HumanResourcesManager", "Human resources manager"));
  32.             response.Add(new KeyValuePair<string, string>("HumanResourcesManagementGroupLead", "Human resources management group lead"));
  33.             response.Add(new KeyValuePair<string, string>("LeadOfHumanResources", "Lead of human resources"));
  34.             response.Add(new KeyValuePair<string, string>("Student", "Student"));
  35.             response.Add(new KeyValuePair<string, string>("LearningManager", "Learning manager"));
  36.             response.Add(new KeyValuePair<string, string>("LearningManagementGroupLead", "Learning management group lead"));
  37.             response.Add(new KeyValuePair<string, string>("LeadOfLearningManagement", "Lead of learning management"));
  38.             response.Add(new KeyValuePair<string, string>("Administrator", "Administrator"));//remove
  39.             return response.Select(x=> new KeyValuePair<string, string>(x.Key, x.Value.ToTitleCase())).OrderBy(x => x.Value).ToList();
  40.         }
  41.  
  42.         /// <returns>Data format: department type enum id on user service - role display name</returns>
  43.         public static List<KeyValuePair<string, string>> GetDepartmentsTypesDisplayNames()
  44.         {
  45.             var response = new List<KeyValuePair<string, string>>();
  46.             response.Add(new KeyValuePair<string, string>("None", "None"));//remove
  47.             response.Add(new KeyValuePair<string, string>("Development", "Development"));
  48.             response.Add(new KeyValuePair<string, string>("ProjectManagement", "Project management"));
  49.             response.Add(new KeyValuePair<string, string>("SalesManagement", "Sales management"));
  50.             response.Add(new KeyValuePair<string, string>("HumanResourcesManagement", "Human resources management"));
  51.             response.Add(new KeyValuePair<string, string>("MarketingManagement", "Marketing management"));
  52.             response.Add(new KeyValuePair<string, string>("LearningManagement", "Learning management"));
  53.             response.Add(new KeyValuePair<string, string>("FinancialManagement", "Financial management"));
  54.             return response.Select(x=> new KeyValuePair<string, string>(x.Key, x.Value.ToTitleCase())).OrderBy(x => x.Value).ToList();
  55.         }
  56.  
  57.         public static List<KeyValuePair<string, string>> GetTimezonesDisplayNames()
  58.         {
  59.             var response = new List<KeyValuePair<string, string>>();
  60.             response.Add(new KeyValuePair<string, string>("UTC", "UTC"));
  61.             return response.Select(x=> new KeyValuePair<string, string>(x.Key, x.Value.ToTitleCase())).OrderBy(x => x.Value).ToList();
  62.         }
  63.  
  64.         /// <returns>Data format: user status enum id on user service - role display name</returns>
  65.         public static List<KeyValuePair<string, string>> GetUserStatusesDisplayNames()
  66.         {
  67.             var response = new List<KeyValuePair<string, string>>();
  68.             response.Add(new KeyValuePair<string, string>("Active", "Active"));
  69.             response.Add(new KeyValuePair<string, string>("Inactive", "Inactive"));
  70.             return response.Select(x=> new KeyValuePair<string, string>(x.Key, x.Value.ToTitleCase())).OrderBy(x => x.Value).ToList();
  71.         }
  72.     }
  73. }
  74.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement