コード例 #1
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <param name="Col_JobPartId">[To be supplied.]</param>
        public void Remove(System.Data.SqlTypes.SqlInt32 Col_JobPartId)
        {
            bool alreadyOpened = false;

            Params.spD_JobPart Param = new Params.spD_JobPart(true);
            Param.CommandTimeOut = this.deleteCommandTimeOut;
            switch (this.lastKnownConnectionType)
            {
            case Bob.DataClasses.ConnectionType.ConnectionString:
                Param.SetUpConnection(this.connectionString);
                break;

            case Bob.DataClasses.ConnectionType.SqlConnection:
                Param.SetUpConnection(this.sqlConnection);
                alreadyOpened = (this.sqlConnection.State == System.Data.ConnectionState.Open);
                break;

            case Bob.DataClasses.ConnectionType.SqlTransaction:
                Param.SetUpConnection(this.sqlTransaction);
                break;
            }

            Param.Param_JobPartId = Col_JobPartId;

            SPs.spD_JobPart Sp = new SPs.spD_JobPart(true);

            Sp.Execute(ref Param);

            CloseConnection(Sp.Connection, alreadyOpened);
        }
コード例 #2
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <param name="record">[To be supplied.]</param>
        public void Remove(IBusinessComponentRecord record)
        {
            JobPart_Record recordToDelete = record as JobPart_Record;

            if (recordToDelete == null)
            {
                throw new ArgumentException("Invalid record type. Must be 'Bob.BusinessComponents.JobPart_Record'.", "record");
            }

            bool alreadyOpened = false;

            Params.spD_JobPart Param = new Params.spD_JobPart(true);
            Param.CommandTimeOut = this.deleteCommandTimeOut;
            switch (this.lastKnownConnectionType)
            {
            case Bob.DataClasses.ConnectionType.ConnectionString:
                Param.SetUpConnection(this.connectionString);
                break;

            case Bob.DataClasses.ConnectionType.SqlConnection:
                Param.SetUpConnection(this.sqlConnection);
                alreadyOpened = (this.sqlConnection.State == System.Data.ConnectionState.Open);
                break;

            case Bob.DataClasses.ConnectionType.SqlTransaction:
                Param.SetUpConnection(this.sqlTransaction);
                break;
            }

            Param.Param_JobPartId = recordToDelete.Col_JobPartId;

            SPs.spD_JobPart Sp = new SPs.spD_JobPart(true);

            Sp.Execute(ref Param);
            CloseConnection(Sp.Connection, alreadyOpened);

            if (internalRecords != null)
            {
                internalRecords.Remove(recordToDelete);
            }
        }