RoleAccountProvider.cs 2.0 KB

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