IUserService.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7. using GreenTree.Nachtragsmanagement.Core.Authentication;
  8. using GreenTree.Nachtragsmanagement.Core.Domain.User;
  9. namespace GreenTree.Nachtragsmanagement.Services.User
  10. {
  11. /// <summary>
  12. /// User service interface
  13. /// </summary>
  14. public interface IUserService
  15. {
  16. #region User
  17. /// <summary>
  18. /// Gets all users
  19. /// </summary>
  20. IList<Core.Domain.User.User> GetAllUsers();
  21. /// <summary>
  22. /// Gets a user by specified Id
  23. /// </summary>
  24. /// <param name="id">User identifier.</param>
  25. Core.Domain.User.User GetUserById(int id);
  26. /// <summary>
  27. /// Gets all users to the specified ids
  28. /// </summary>
  29. IList<Core.Domain.User.User> GetUsersByIds(int[] ids);
  30. /// <summary>
  31. /// Gets a user by specified customer number
  32. /// </summary>
  33. /// <param name="customNumber">Customer number.</param>
  34. Core.Domain.User.User GetUserByCustomNumber(string customNumber);
  35. /// <summary>
  36. /// Insert a user
  37. /// </summary>
  38. /// <param name="user">User.</param>
  39. void InsertUser(Core.Domain.User.User user);
  40. /// <summary>
  41. /// Update a user
  42. /// </summary>
  43. /// <param name="user">User.</param>
  44. void UpdateUser(Core.Domain.User.User user);
  45. /// <summary>
  46. /// Delete a user
  47. /// </summary>
  48. /// <param name="user">User.</param>
  49. void DeleteUser(Core.Domain.User.User user);
  50. #endregion
  51. #region ActiveDirectory
  52. /// <summary>
  53. /// Searches the ActiveDirectory for users matching the searchValue
  54. /// </summary>
  55. /// <param name="searchValue">The text to be searched for.</param>
  56. IList<ActiveDirectoryUser> SearchUsers(string searchValue);
  57. #endregion
  58. #region Role
  59. /// <summary>
  60. /// Gets all roles
  61. /// </summary>
  62. IList<Role> GetAllRoles();
  63. /// <summary>
  64. /// Gets a user by specified Id
  65. /// </summary>
  66. /// <param name="id">Role identifier.</param>
  67. Role GetRoleById(int id);
  68. /// <summary>
  69. /// Gets all roles to the specified ids
  70. /// </summary>
  71. IList<Role> GetRolesByIds(int[] ids);
  72. /// <summary>
  73. /// Gets all users to the corresponding role
  74. /// </summary>
  75. /// <param name="roleId">Role id.</param>
  76. IList<Core.Domain.User.User> GetUsersByRole(int roleId);
  77. /// <summary>
  78. /// Insert a user
  79. /// </summary>
  80. /// <param name="role">Role.</param>
  81. void InsertRole(Role role);
  82. /// <summary>
  83. /// Update a role
  84. /// </summary>
  85. /// <param name="role">Role.</param>
  86. void UpdateRole(Role role);
  87. /// <summary>
  88. /// Delete a role
  89. /// </summary>
  90. /// <param name="role">Role.</param>
  91. void DeleteRole(Role role);
  92. #endregion
  93. #region Function
  94. /// <summary>
  95. /// Gets all functions
  96. /// </summary>
  97. IList<Function> GetAllFunctions();
  98. /// <summary>
  99. /// Gets a function by specified Id
  100. /// </summary>
  101. /// <param name="id">Function identifier.</param>
  102. Function GetFunctionById(int id);
  103. /// <summary>
  104. /// Gets a function by specified name
  105. /// </summary>
  106. /// <param name="name">Function name.</param>
  107. Function GetFunctionByName(string name);
  108. /// <summary>
  109. /// Gets all functions to the specified ids
  110. /// </summary>
  111. IList<Function> GetFunctionsByIds(int[] ids);
  112. /// <summary>
  113. /// Insert a function
  114. /// </summary>
  115. /// <param name="function">Function.</param>
  116. void InsertFunction(Function function);
  117. /// <summary>
  118. /// Update a function
  119. /// </summary>
  120. /// <param name="function">Function.</param>
  121. void UpdateFunction(Function function);
  122. /// <summary>
  123. /// Delete a function
  124. /// </summary>
  125. /// <param name="function">Function.</param>
  126. void DeleteFunction(Function function);
  127. #endregion
  128. }
  129. }