Ejemplo n.º 1
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <param name="Col_JobId">[To be supplied.]</param>
        public void Remove(System.Data.SqlTypes.SqlInt32 Col_JobId)
        {
            bool alreadyOpened = false;

            Params.spD_Job Param = new Params.spD_Job(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_JobId = Col_JobId;

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

            Sp.Execute(ref Param);

            CloseConnection(Sp.Connection, alreadyOpened);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <param name="record">[To be supplied.]</param>
        public void Remove(IBusinessComponentRecord record)
        {
            Job_Record recordToDelete = record as Job_Record;

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

            bool alreadyOpened = false;

            Params.spD_Job Param = new Params.spD_Job(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_JobId = recordToDelete.Col_JobId;

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

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

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