示例#1
0
 public AssertionStatusItem(CompletionStatusType completionStatus, string fromKey, string toKey, KeyedReference keyedReference, KeysOwned keysOwned)
 {
     this.CompletionStatus = completionStatus;
     this.FromKey          = fromKey;
     this.ToKey            = toKey;
     this.KeyedReference   = keyedReference;
     this.KeysOwned        = keysOwned;
 }
示例#2
0
        public void Get(CompletionStatusType completionStatus)
        {
            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("net_publisher_assertionStatus_get");

            sp.Parameters.Add("@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID);
            sp.Parameters.SetString("@PUID", Context.User.ID);

            if (CompletionStatusType.Uninitialized != completionStatus)
            {
                //
                // If the completion status was not specified get all
                // of the assertions by not specifying a completionStatus value
                // in the stored procedure.
                //
                sp.Parameters.Add("@completionStatus", SqlDbType.Int);
                sp.Parameters.SetInt("@completionStatus", (int)completionStatus);
            }

            SqlDataReaderAccessor reader = sp.ExecuteReader();

            try
            {
                while (reader.Read())
                {
                    KeyedReference keyedReference = new KeyedReference(
                        reader.GetString("keyName"),
                        reader.GetString("keyValue"),
                        reader.GetKeyFromGuid("tModelKey"));

                    CompletionStatusType status =
                        (CompletionStatusType)reader.GetInt("flag");

                    string fromKey = reader.GetGuidString("fromKey");
                    string toKey   = reader.GetGuidString("toKey");

                    int ownerFlag = reader.GetInt("ownerFlag");

                    KeysOwned keysOwned = new KeysOwned();

                    if (0x02 == (ownerFlag & 0x02))
                    {
                        keysOwned.FromKey = fromKey;
                    }

                    if (0x01 == (ownerFlag & 0x01))
                    {
                        keysOwned.ToKey = toKey;
                    }

                    this.Add(
                        new AssertionStatusItem(
                            status,
                            fromKey,
                            toKey,
                            keyedReference,
                            keysOwned));
                }
            }
            finally
            {
                reader.Close();
            }
        }