private void ImportSchemaRoles(MCS.Library.SOA.DataObjects.Security.SCObjectSet objectSet, IImportContext context, Operations.IFacade exec, AUSchema item) { if (this.IncludeSchemaRoles) { var roles = (from p in objectSet.Membership where p.ContainerID == item.ID && p.MemberSchemaType == AUCommon.SchemaAUSchemaRole join q in objectSet.Objects on p.ID equals q.ID select q); int total = roles.Count(); int roleCount = 0; foreach (AUSchemaRole role in roles) { roleCount++; try { context.SetSubStatusAndLog(roleCount, total, "正在添加角色:" + role.GetQualifiedName()); exec.AddAdminSchemaRole(role, item); } catch (Exception ex) { context.ErrorCount++; context.AppendLog("对角色的操作失败,原因是:" + ex.Message); } } } }