/// <summary> /// 更新角色 /// </summary> /// <param name="businessRoleDomain"></param> /// <returns></returns> public virtual bool UpdateBusinessRoleDomain(BusinessRoleDomain businessRoleDomain) { SecRoleEntity SecRoleEntity = new SecRoleEntity(); SecRoleEntity = businessRoleDomain.SecRoleEntity; bool updateResult = Update(SecRoleEntity); return updateResult; }
public virtual SecRoleDomain CreateSecRoleDomain() { SecRoleEntity entity = new SecRoleEntity(); entity.RoleId = Guid.NewGuid().ToString(); return new SecRoleDomain(entity); }
/// <summary> /// 新增角色 /// </summary> /// <param name="businessRoleDomain"></param> /// <returns></returns> public virtual bool InsertBusinessRoleDomain(BusinessRoleDomain businessRoleDomain) { SecRoleEntity SecRoleEntity = new SecRoleEntity(); SecRoleEntity = businessRoleDomain.SecRoleEntity; bool insertResult = Insert(SecRoleEntity); return insertResult; }
/// <summary> /// 创建角色领域对象,初始化 /// </summary> /// <returns></returns> public virtual BusinessRoleDomain CreateBusinessRoleDomain() { SecRoleEntity SecRoleEntity = new SecRoleEntity(); SecRoleEntity.RoleId = Guid.NewGuid().ToString(); SecRoleEntity.RoleName = string.Empty; SecRoleEntity.RoleType = string.Empty; SecRoleEntity.RoleCategory = 1;//角色种类,1表示业务角色 SecRoleEntity.ParentId = string.Empty; SecRoleEntity.Remark = string.Empty; SecRoleEntity.LastModifiedBy = string.Empty; SecRoleEntity.LastModifiedTime = DateTime.Now; return new BusinessRoleDomain(SecRoleEntity); }
/// <summary> /// 创建领域对象 /// </summary> /// <returns></returns> public virtual FunctionRoleDomain CreateFunctionRoleDomain() { SecRoleEntity roleEty = new SecRoleEntity(); roleEty.RoleId = Guid.NewGuid().ToString(); roleEty.RoleName = string.Empty; roleEty.RoleType = string.Empty; roleEty.RoleCategory = 0; roleEty.ParentId = string.Empty; roleEty.Remark = string.Empty; roleEty.LastModifiedBy = string.Empty; roleEty.LastModifiedTime = DateTime.Now; return new FunctionRoleDomain(roleEty); }
/// <summary> /// 初始化 /// </summary> /// <param name="roleCityEntity"></param> public RoleDomain(SecRoleEntity SecRoleEntity) : base(SecRoleEntity) { }
///// <summary> ///// 该角色拥有权限的菜单数据项 ///// </summary> //private List<MenuDataItem> menuDataItem; //public List<MenuDataItem> MenuDataItem //{ // get // { // if (menuDataItem == null) // { // menuDataItem = SystemService.FunctionRoleService.GetMenuDataItemByRoleId(SecRoleEntity.RoleId); // } // return menuDataItem; // } // set // { // menuDataItem = value; // } //} #endregion #region 方法 /// <summary> /// 构造函数 /// </summary> /// <param name="SecRoleEntity"></param> public FunctionRoleDomain(SecRoleEntity SecRoleEntity) : base(SecRoleEntity) { }
public virtual BusinessRoleDomain GetBusinessRoleDomainByRoleId(string roleId) { SecRoleEntity SecRoleEntity = new SecRoleEntity(); SecRoleEntity = GetById<SecRoleEntity>(roleId); return new BusinessRoleDomain(SecRoleEntity); }
//public virtual List<BusinessRoleDomain> GetGetBusinessRoleDomainListByProjectID(string brandID) //{ // List<MstRoleBrandEntity> buss=new List<MstRoleBrandEntity>(); // List<BusinessRoleDomain> br=new List<BusinessRoleDomain>(); // buss = SelectByCondition<MstRoleBrandEntity>(BPSC.Common.Utils.QueryCondition.Create().Equals(MstRoleBrandTable.C_BRAND_ID, brandID)); // foreach (MstRoleBrandEntity rb in buss) // { SecRoleEntity rety=new SecRoleEntity(); // rety = SystemService.BusinessionRoleService.GetById<SecRoleEntity>(rb.RoleId); // BusinessRoleDomain brd= new BusinessRoleDomain(rety); // br.Add(brd); // } // return br; //} /// <summary> /// /// </summary> /// <param name="RoleIDList1"></param> /// <param name="RoleList2"></param> /// <returns></returns> public virtual BusinessRoleDomain GetBusinessRoleDomain(List<BusinessRoleDomain> RoleIDList1, List<BusinessRoleDomain> RoleList2) { bool brk = false; SecRoleEntity rety = new SecRoleEntity(); foreach (BusinessRoleDomain roleID1 in RoleIDList1) { foreach (BusinessRoleDomain roleID2 in RoleList2) { if (roleID1.SecRoleEntity.RoleId == roleID2.SecRoleEntity.RoleId) { rety = GetById<SecRoleEntity>(roleID1.SecRoleEntity.RoleId ); brk = true; break; } } if (brk) { break; } } if (brk) { return new BusinessRoleDomain(rety); } return null; }
//protected virtual List<MstRoleCityEntity> GetBusinessRoleCityDomainByRoleId(string roleId) //{ // BPSC.Common.Utils.QueryCondition qCondition = BPSC.Common.Utils.QueryCondition.Create().Equals(MstRoleCityTable.C_ROLE_ID, roleId); // return SelectByCondition<MstRoleCityEntity>(qCondition); //} //protected virtual List<MstRoleStoreEntity> GetBusinessRoleStoreDomainByRoleId(string roleId) //{ // BPSC.Common.Utils.QueryCondition qCondition = BPSC.Common.Utils.QueryCondition.Create().Equals(MstRoleStoreTable.C_ROLE_ID, roleId); // return SelectByCondition<MstRoleStoreEntity>(qCondition); //} //protected virtual List<MstRoleBrandEntity> GetBusinessRoleBrandDomainByRoleId(string roleId) //{ // BPSC.Common.Utils.QueryCondition qCondition = BPSC.Common.Utils.QueryCondition.Create().Equals(MstRoleBrandTable.C_ROLE_ID, roleId); // return SelectByCondition<MstRoleBrandEntity>(qCondition); //} //protected virtual List<MstRoleBannerEntity> GetBusinessRoleBannerDomainByRoleId(string roleId) //{ // BPSC.Common.Utils.QueryCondition qCondition = BPSC.Common.Utils.QueryCondition.Create().Equals(MstRoleBannerTable.C_ROLE_ID, roleId); // return SelectByCondition<MstRoleBannerEntity>(qCondition); //} /// <summary> /// 根据roleName获取BusinessRoleDomain /// </summary> /// <param name="roleName"></param> /// <returns></returns> public virtual BusinessRoleDomain GetBusinessRoleDomainByRoleName(string roleName) { SecRoleEntity SecRoleEntity = new SecRoleEntity(); SecRoleEntity.RoleName = roleName; SecRoleEntity = DataAccess.SelectSingle<SecRoleEntity>(SecRoleEntity); if (SecRoleEntity == null) { return null; } else { return new BusinessRoleDomain(SecRoleEntity); } }
/// <summary> /// 构造函数 /// </summary> /// <param name="SecRoleEntity"></param> public BusinessRoleDomain(SecRoleEntity SecRoleEntity) : base(SecRoleEntity) { }
public SecRoleDomain(SecRoleEntity entity) : base(entity) { masterEntity = entity; }
public virtual void UpdateSecRoleEntity(SecRoleEntity entity, DataAccessBroker broker) { DataAccess.Update(entity, broker); }
public virtual void InsertSecRoleEntity(SecRoleEntity entity, DataAccessBroker broker) { DataAccess.Insert(entity, broker); }