Ejemplo n.º 1
0
        /// <summary>
        /// Loads a tracked part fragment. Returns null if no part fragment was found.
        /// </summary>
        /// <param name="partId">The part id.</param>
        /// <param name="fragmentNumber">The fragment number.</param>
        /// <param name="spoolId">The spool id.</param>
        public BizTalkFragment LoadTrackedPartFragment(Guid partId, int fragmentNumber, int spoolId)
        {
            using (var connection = new SqlConnection(this.ConnectionString))
                using (var cmd = CreateStoredProcedureCommand(connection, "ops_LoadTrackedPartFragment"))
                {
                    AddInParameter(cmd, "@uidPartID", SqlDbType.UniqueIdentifier, partId);
                    AddInParameter(cmd, "@nFragmentNumber", SqlDbType.Int, fragmentNumber);
                    AddInParameter(cmd, "@nSpoolID", SqlDbType.Int, spoolId);

                    connection.Open();

                    using (var reader = cmd.ExecuteReader())
                    {
                        if (!reader.Read())
                        {
                            return(null);
                        }

                        var fragment = new BizTalkFragment();

                        fragment.ImagePart      = (byte[])reader.GetValue(0);
                        fragment.FragmentNumber = fragmentNumber;

                        return(fragment);
                    }
                }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Given a data record; tranform that record into a message part.
        /// </summary>
        protected BizTalkTrackedMessagePart DeserializeMessagePartFromRecord(IDataReader record, int spoolId)
        {
            var initialFragment = new BizTalkFragment {
                FragmentNumber = 1
            };
            var part = new BizTalkTrackedMessagePart(this, spoolId, initialFragment);

            part.PartName      = record.GetString(0);
            part.PartId        = record.GetGuid(1);
            part.FragmentCount = record.GetInt32(2);

            initialFragment.ImagePart = (byte[])record.GetValue(3);
            part.Properties           = BizTalkConvert.DeserializeContext((byte[])record.GetValue(4));

            part.OldPartId = record.GetGuid(5);

            return(part);
        }
Ejemplo n.º 3
0
 internal BizTalkTrackedMessagePart(BizTalkTrackingDb db, int spoolId, BizTalkFragment initialFragment) : this(db, spoolId)
 {
     this.initialFragment = initialFragment;
 }
Ejemplo n.º 4
0
 internal BizTalkTrackedMessagePart(BizTalkTrackingDb db, int spoolId, BizTalkFragment initialFragment)
     : this(db, spoolId)
 {
     this.initialFragment = initialFragment;
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Given a data record; tranform that record into a message part.
        /// </summary>
        protected BizTalkTrackedMessagePart DeserializeMessagePartFromRecord(IDataReader record, int spoolId)
        {
            var initialFragment = new BizTalkFragment { FragmentNumber = 1 };
            var part = new BizTalkTrackedMessagePart(this, spoolId, initialFragment);

            part.PartName = record.GetString(0);
            part.PartId = record.GetGuid(1);
            part.FragmentCount = record.GetInt32(2);

            initialFragment.ImagePart = (byte[])record.GetValue(3);
            part.Properties = BizTalkConvert.DeserializeContext((byte[])record.GetValue(4));

            part.OldPartId = record.GetGuid(5);

            return part;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Loads a tracked part fragment. Returns null if no part fragment was found.
        /// </summary>
        /// <param name="partId">The part id.</param>
        /// <param name="fragmentNumber">The fragment number.</param>
        /// <param name="spoolId">The spool id.</param>
        public BizTalkFragment LoadTrackedPartFragment(Guid partId, int fragmentNumber, int spoolId)
        {
            using (var connection = new SqlConnection(this.ConnectionString))
            using (var cmd = CreateStoredProcedureCommand(connection, "ops_LoadTrackedPartFragment"))
            {
                AddInParameter(cmd, "@uidPartID", SqlDbType.UniqueIdentifier, partId);
                AddInParameter(cmd, "@nFragmentNumber", SqlDbType.Int, fragmentNumber);
                AddInParameter(cmd, "@nSpoolID", SqlDbType.Int, spoolId);

                connection.Open();

                using (var reader = cmd.ExecuteReader())
                {
                    if (!reader.Read())
                        return null;

                    var fragment = new BizTalkFragment();

                    fragment.ImagePart = (byte[])reader.GetValue(0);
                    fragment.FragmentNumber = fragmentNumber;

                    return fragment;
                }
            }
        }