/// <summary> /// Loads the tblCategory 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_tblCategory != null) { oAbstract_tblCategory.Reset(); } return(false); } System.Data.SqlTypes.SqlInt32 PK_Cat_LngID = Convert.ToInt32(this.SelectedItem.Value); if (this.oAbstract_tblCategory == null) { switch (this.LastKnownConnectionType) { case OlymarsDemo.DataClasses.ConnectionType.ConnectionString: this.oAbstract_tblCategory = new OlymarsDemo.AbstractClasses.Abstract_tblCategory(this.connectionString); break; case OlymarsDemo.DataClasses.ConnectionType.SqlConnection: this.oAbstract_tblCategory = new OlymarsDemo.AbstractClasses.Abstract_tblCategory(this.sqlConnection); break; } } return(this.oAbstract_tblCategory.Refresh(PK_Cat_LngID)); }
/// <summary> /// Loads the tblCategory 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_tblCategory != null) { oAbstract_tblCategory.Reset(); } return(false); } System.Data.SqlTypes.SqlInt32 PK_Cat_LngID = (System.Int32) this.SelectedValue; if (this.oAbstract_tblCategory == null) { switch (this.LastKnownConnectionType) { case OlymarsDemo.DataClasses.ConnectionType.ConnectionString: this.oAbstract_tblCategory = new OlymarsDemo.AbstractClasses.Abstract_tblCategory(this.connectionString); break; case OlymarsDemo.DataClasses.ConnectionType.SqlConnection: this.oAbstract_tblCategory = new OlymarsDemo.AbstractClasses.Abstract_tblCategory(this.sqlConnection); break; } } return(this.oAbstract_tblCategory.Refresh(PK_Cat_LngID)); }