예제 #1
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <param name="Col_JobPartTypeId">[To be supplied.]</param>
        public void Remove(System.Data.SqlTypes.SqlInt32 Col_JobPartTypeId)
        {
            bool alreadyOpened = false;

            Params.spD_JobPartType Param = new Params.spD_JobPartType(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_JobPartTypeId = Col_JobPartTypeId;

            SPs.spD_JobPartType Sp = new SPs.spD_JobPartType(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)
        {
            JobPartType_Record recordToDelete = record as JobPartType_Record;

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

            bool alreadyOpened = false;

            Params.spD_JobPartType Param = new Params.spD_JobPartType(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_JobPartTypeId = recordToDelete.Col_JobPartTypeId;

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

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

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