private void AddAuthDataRow(IAzManAuthorization authorization) { DataRow dr = _AuthData.NewRow(); dr["AuthorizationID"] = authorization.AuthorizationId; dr["AttributesLink"] = ""; // this.getAttributesLink((int)dr["AuthorizationID"]); string displayName; MemberType memberType = authorization.GetMemberInfo(out displayName); string ownerName; MemberType ownerType = authorization.GetOwnerInfo(out ownerName); dr["MemberType"] = NetSqlAzManHelper.GetMemberTypeName(memberType, authorization.SID, _AuthItem); dr["MemberTypeEnum"] = memberType; dr["Owner"] = ownerName; dr["Name"] = displayName; dr["OwnerSID"] = authorization.Owner; if (authorization.SidWhereDefined == WhereDefined.Database) { dr["ObjectSID"] = authorization.SID.StringValue; } else { dr["ObjectSID"] = authorization.SID.StringValue; } switch (authorization.SidWhereDefined.ToString()) { case "LDAP": dr["WhereDefined"] = "Active Directory"; break; case "Local": dr["WhereDefined"] = "Local"; break; case "Database": dr["WhereDefined"] = "DB User"; break; case "Store": dr["WhereDefined"] = "Store"; break; case "Application": dr["WhereDefined"] = "Application"; break; } dr["WhereDefinedEnum"] = authorization.SidWhereDefined; dr["AuthorizationType"] = NetSqlAzManHelper.GetAuthTypeName(authorization.AuthorizationType); dr["AuthorizationTypeEnum"] = authorization.AuthorizationType; dr["ValidFrom"] = authorization.ValidFrom.HasValue ? (object)authorization.ValidFrom.Value : DBNull.Value; dr["ValidTo"] = authorization.ValidTo.HasValue ? (object)authorization.ValidTo.Value : DBNull.Value; _AuthData.Rows.Add(dr); }
private void AddAuthorizationDataRow(IAzManAuthorization authorization) { DataRow dr = this.dtAuthorizations.NewRow(); dr["AuthorizationID"] = authorization.AuthorizationId; string displayName; MemberType memberType = authorization.GetMemberInfo(out displayName); string ownerName; MemberType ownerType = authorization.GetOwnerInfo(out ownerName); dr["MemberType"] = this.RenderMemberType(memberType, authorization.SID); dr["MemberTypeEnum"] = memberType; dr["Owner"] = ownerName; dr["Name"] = displayName; dr["OwnerSID"] = authorization.Owner; if (authorization.SidWhereDefined == WhereDefined.Database) { dr["ObjectSID"] = new SqlAzManSID(authorization.SID.BinaryValue, true); } else { dr["ObjectSID"] = authorization.SID; } switch (authorization.SidWhereDefined.ToString()) { case "LDAP": dr["WhereDefined"] = Globalization.MultilanguageResource.GetString("WhereDefined_LDAP"); break; case "Local": dr["WhereDefined"] = Globalization.MultilanguageResource.GetString("WhereDefined_Local"); break; case "Database": dr["WhereDefined"] = Globalization.MultilanguageResource.GetString("WhereDefined_DB"); break; case "Store": dr["WhereDefined"] = Globalization.MultilanguageResource.GetString("WhereDefined_Store"); break; case "Application": dr["WhereDefined"] = Globalization.MultilanguageResource.GetString("WhereDefined_Application"); break; } dr["WhereDefinedEnum"] = authorization.SidWhereDefined; dr["AuthorizationType"] = this.RenderAuthorizationType(authorization.AuthorizationType); dr["AuthorizationTypeEnum"] = authorization.AuthorizationType; dr["ValidFrom"] = authorization.ValidFrom.HasValue ? (object)authorization.ValidFrom.Value : DBNull.Value; dr["ValidTo"] = authorization.ValidTo.HasValue ? (object)authorization.ValidTo.Value : DBNull.Value; this.dtAuthorizations.Rows.Add(dr); }
private void AddAuthorizationDataRow(IAzManAuthorization authorization) { DataRow dr = this.dtAuthorizations.NewRow(); dr["AuthorizationID"] = authorization.AuthorizationId; dr["AttributesLink"] = this.getAttributesLink((int)dr["AuthorizationID"]); string displayName; MemberType memberType = authorization.GetMemberInfo(out displayName); string ownerName; MemberType ownerType = authorization.GetOwnerInfo(out ownerName); dr["MemberType"] = this.RenderMemberType(memberType, authorization.SID); dr["MemberTypeEnum"] = memberType; dr["Owner"] = ownerName; dr["Name"] = displayName; dr["OwnerSID"] = authorization.Owner; if (authorization.SidWhereDefined == WhereDefined.Database) { dr["ObjectSID"] = authorization.SID.StringValue; } else { dr["ObjectSID"] = authorization.SID.StringValue; } switch (authorization.SidWhereDefined.ToString()) { case "LDAP": dr["WhereDefined"] = "Active Directory"; break; case "Local": dr["WhereDefined"] = "Local"; break; case "Database": dr["WhereDefined"] = "DB User"; break; case "Store": dr["WhereDefined"] = "Store"; break; case "Application": dr["WhereDefined"] = "Application"; break; } dr["WhereDefinedEnum"] = authorization.SidWhereDefined; dr["AuthorizationType"] = this.RenderAuthorizationType(authorization.AuthorizationType); dr["AuthorizationTypeEnum"] = authorization.AuthorizationType; dr["ValidFrom"] = authorization.ValidFrom.HasValue ? (object)authorization.ValidFrom.Value : DBNull.Value; dr["ValidTo"] = authorization.ValidTo.HasValue ? (object)authorization.ValidTo.Value : DBNull.Value; this.dtAuthorizations.Rows.Add(dr); }