/// <summary> /// 权限范围枚举类型名称转换 /// </summary> public static string ToCaption(this PositionDataScopeType value) { switch (value) { case PositionDataScopeType.None: return("没有任何权限制"); case PositionDataScopeType.Self: return("仅限本人的数据"); case PositionDataScopeType.Department: return("本部门的数据"); case PositionDataScopeType.DepartmentAndLower: return("本部门及下级的数据"); case PositionDataScopeType.Company: return("本区域的数据"); case PositionDataScopeType.CompanyAndLower: return("本区域及下级区域与部门的数据"); case PositionDataScopeType.Custom: return("自定义"); default: return("权限范围枚举类型(未知)"); } }
/// <summary> /// 设置属性值 /// </summary> /// <param name="property"></param> /// <param name="value"></param> protected override void SetValueInner(string property, object value) { switch (property.Trim().ToLower()) { case "id": this.ID = (int)Convert.ToDecimal(value); return; case "pageitemid": this.PageItemId = (int)Convert.ToDecimal(value); return; case "roleid": this.RoleId = (int)Convert.ToDecimal(value); return; case "power": this.Power = (int)Convert.ToDecimal(value); return; case "datascope": if (value != null) { if (value is int) { this.DataScope = (PositionDataScopeType)(int)value; } else if (value is PositionDataScopeType) { this.DataScope = (PositionDataScopeType)value; } else { var str = value.ToString(); PositionDataScopeType val; if (PositionDataScopeType.TryParse(str, out val)) { this.DataScope = val; } else { int vl; if (int.TryParse(str, out vl)) { this.DataScope = (PositionDataScopeType)vl; } } } } return; } //System.Diagnostics.Trace.WriteLine(property + @"=>" + value); }
/// <summary> /// 复制值 /// </summary> /// <param name="source">复制的源字段</param> protected override void CopyValueInner(DataObjectBase source) { var sourceEntity = source as RolePowerData; if (sourceEntity == null) { return; } this._id = sourceEntity._id; this._pageitemid = sourceEntity._pageitemid; this._roleid = sourceEntity._roleid; this._power = sourceEntity._power; this._datascope = sourceEntity._datascope; CopyExtendValue(sourceEntity); this.__EntityStatus.SetModified(); }
partial void OnDataScopeSet(ref PositionDataScopeType value);