RoleDataRangeView.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.Entities;
  6. namespace EMIS.ViewModel.SystemView
  7. {
  8. public class RoleDataRangeView
  9. {
  10. /// <summary>
  11. /// MenuNo
  12. /// </summary>
  13. public string MenuNo { get; set; }
  14. /// <summary>
  15. /// MenuName
  16. /// </summary>
  17. public string MenuName { get; set; }
  18. /// <summary>
  19. /// ParentMenuNo
  20. /// </summary>
  21. public string ParentMenuNo { get; set; }
  22. /// <summary>
  23. /// OrderNo
  24. /// </summary>
  25. public short OrderNo { get; set; }
  26. /// <summary>
  27. /// RoleDataRangeID
  28. /// </summary>
  29. public System.Guid? RoleDataRangeID { get; set; }
  30. /// <summary>
  31. /// RoleID
  32. /// </summary>
  33. public System.Guid? RoleID { get; set; }
  34. /// <summary>
  35. /// DataRangeID
  36. /// </summary>
  37. public int? DataRangeID { get; set; }
  38. public bool IsLeaf { get; set; }
  39. public Sys_RoleDataRange ParseToEntity()
  40. {
  41. Sys_RoleDataRange roleDataRange = new Sys_RoleDataRange();
  42. roleDataRange.RoleDataRangeID = this.RoleDataRangeID ?? Guid.NewGuid();
  43. if (this.MenuNo == null) throw new Exception("MenuNo为必填项。");
  44. roleDataRange.MenuNo = this.MenuNo;
  45. if (!this.RoleID.HasValue) throw new Exception("RoleID为必填项。");
  46. roleDataRange.RoleID = this.RoleID.Value;
  47. if (!this.DataRangeID.HasValue) throw new Exception("DataRangeID为必填项。");
  48. roleDataRange.DataRangeID = this.DataRangeID.Value;
  49. return roleDataRange;
  50. }
  51. }
  52. }