/// <summary> /// Loads the Job 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_Job != null) { oAbstract_Job.Reset(); } return(false); } System.Data.SqlTypes.SqlInt32 PK_JobId = (System.Int32) this.SelectedValue; if (this.oAbstract_Job == null) { switch (this.LastKnownConnectionType) { case Bob.DataClasses.ConnectionType.ConnectionString: this.oAbstract_Job = new Bob.AbstractClasses.Abstract_Job(this.connectionString); break; case Bob.DataClasses.ConnectionType.SqlConnection: this.oAbstract_Job = new Bob.AbstractClasses.Abstract_Job(this.sqlConnection); break; } } return(this.oAbstract_Job.Refresh(PK_JobId)); }
/// <summary> /// Loads the Job 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_Job != null) { oAbstract_Job.Reset(); } return(false); } System.Data.SqlTypes.SqlInt32 PK_JobId = (System.Int32) this.SelectedValue; if (this.oAbstract_Job == null) { switch (this.LastKnownConnectionType) { case Bob.DataClasses.ConnectionType.ConnectionString: this.oAbstract_Job = new Bob.AbstractClasses.Abstract_Job(this.connectionString); break; case Bob.DataClasses.ConnectionType.SqlConnection: this.oAbstract_Job = new Bob.AbstractClasses.Abstract_Job(this.sqlConnection); break; } } return(this.oAbstract_Job.Refresh(PK_JobId)); }