using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EMIS.Entities;
namespace EMIS.ViewModel.SystemView
{
public class RoleDataRangeView
{
///
/// MenuNo
///
public string MenuNo { get; set; }
///
/// MenuName
///
public string MenuName { get; set; }
///
/// ParentMenuNo
///
public string ParentMenuNo { get; set; }
///
/// OrderNo
///
public short OrderNo { get; set; }
///
/// RoleDataRangeID
///
public System.Guid? RoleDataRangeID { get; set; }
///
/// RoleID
///
public System.Guid? RoleID { get; set; }
///
/// DataRangeID
///
public int? DataRangeID { get; set; }
public bool IsLeaf { get; set; }
public Sys_RoleDataRange ParseToEntity()
{
Sys_RoleDataRange roleDataRange = new Sys_RoleDataRange();
roleDataRange.RoleDataRangeID = this.RoleDataRangeID ?? Guid.NewGuid();
if (this.MenuNo == null) throw new Exception("MenuNo为必填项。");
roleDataRange.MenuNo = this.MenuNo;
if (!this.RoleID.HasValue) throw new Exception("RoleID为必填项。");
roleDataRange.RoleID = this.RoleID.Value;
if (!this.DataRangeID.HasValue) throw new Exception("DataRangeID为必填项。");
roleDataRange.DataRangeID = this.DataRangeID.Value;
return roleDataRange;
}
}
}