Example #1
0
        /// <summary>
        /// Loads the JobPart abstract class for the current selected record primary key.
        /// </summary>
        /// <returns>true if the call succeeded; false, otherwise.</returns>
        public bool RefreshCurrentRecord()
        {
            if (this.SelectedIndex == -1)
            {
                if (oAbstract_JobPart != null)
                {
                    oAbstract_JobPart.Reset();
                }
                return(false);
            }

            System.Data.SqlTypes.SqlInt32 PK_JobPartId = (System.Int32) this.SelectedValue;

            if (this.oAbstract_JobPart == null)
            {
                switch (this.LastKnownConnectionType)
                {
                case Bob.DataClasses.ConnectionType.ConnectionString:
                    this.oAbstract_JobPart = new Bob.AbstractClasses.Abstract_JobPart(this.connectionString);
                    break;

                case Bob.DataClasses.ConnectionType.SqlConnection:
                    this.oAbstract_JobPart = new Bob.AbstractClasses.Abstract_JobPart(this.sqlConnection);
                    break;
                }
            }

            return(this.oAbstract_JobPart.Refresh(PK_JobPartId));
        }
Example #2
0
        /// <summary>
        /// Loads the JobPart abstract class for the current selected record primary key.
        /// </summary>
        /// <returns>true if the call succeeded; false, otherwise.</returns>
        public bool RefreshCurrentRecord()
        {
            if (this.SelectionMode != System.Windows.Forms.SelectionMode.One)
            {
                throw new InvalidOperationException("SelectionMode property is not set to One. Hence, you cannot call this method.");
            }

            if (this.SelectedIndex == -1)
            {
                if (oAbstract_JobPart != null)
                {
                    oAbstract_JobPart.Reset();
                }
                return(false);
            }

            System.Data.SqlTypes.SqlInt32 PK_JobPartId = (System.Int32) this.SelectedValue;

            if (this.oAbstract_JobPart == null)
            {
                switch (this.LastKnownConnectionType)
                {
                case Bob.DataClasses.ConnectionType.ConnectionString:
                    this.oAbstract_JobPart = new Bob.AbstractClasses.Abstract_JobPart(this.connectionString);
                    break;

                case Bob.DataClasses.ConnectionType.SqlConnection:
                    this.oAbstract_JobPart = new Bob.AbstractClasses.Abstract_JobPart(this.sqlConnection);
                    break;
                }
            }

            return(this.oAbstract_JobPart.Refresh(PK_JobPartId));
        }
Example #3
0
        /// <summary>
        /// Disposes the current instance of this object.
        /// </summary>
        /// <param name="disposing">
        /// true to release both managed and unmanaged resources;
        /// false to release only unmanaged resources.
        /// </param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                this.oAbstract_JobPart = null;

                this.FK_JobId         = System.Data.SqlTypes.SqlInt32.Null;
                this.FK_JobPartTypeId = System.Data.SqlTypes.SqlInt32.Null;

                if (this.param != null)
                {
                    this.param.Dispose();
                }
            }

            base.Dispose(disposing);
        }