RoleAccountProvider.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Aitex.Core.Account;
  7. using Aitex.Core.RT.Log;
  8. using MECF.Framework.Common.Account.Extends;
  9. using MECF.Framework.UI.Core.Accounts;
  10. using OpenSEMI.ClientBase;
  11. using OpenSEMI.ClientBase.ServiceProvider;
  12. namespace VirgoUI.Client
  13. {
  14. public class RoleAccountProvider : IProvider
  15. {
  16. private static RoleAccountProvider _Instance = null;
  17. public static RoleAccountProvider Instance
  18. {
  19. get
  20. {
  21. if (_Instance == null)
  22. {
  23. _Instance = new RoleAccountProvider();
  24. _Instance.Create();
  25. }
  26. return _Instance;
  27. }
  28. }
  29. public void Create()
  30. {
  31. }
  32. public List<AccountEx> GetAccounts()
  33. {
  34. return AccountClient.Instance.Service.GetAccounts();
  35. }
  36. public bool UpdateAccount(AccountEx p_newAccount)
  37. {
  38. return AccountClient.Instance.Service.UpdateAccountEx(p_newAccount);
  39. }
  40. public bool DeleteAccount(string p_strUserID)
  41. {
  42. return AccountClient.Instance.Service.DeleteAccountEx(p_strUserID);
  43. }
  44. public List<Role> GetRoles()
  45. {
  46. return AccountClient.Instance.Service.GetRoles();
  47. }
  48. public bool UpdateRole(Role p_newRole)
  49. {
  50. return AccountClient.Instance.Service.UpdateRole(p_newRole);
  51. }
  52. public bool DeleteRole(string p_strRoleID)
  53. {
  54. return AccountClient.Instance.Service.DeleteRole(p_strRoleID);
  55. }
  56. public List<AppMenu> GetMenusByRole(string roleid, List<AppMenu> menulist)
  57. {
  58. return AccountClient.Instance.Service.GetMenusByRole(roleid, menulist);
  59. }
  60. }
  61. }