/// <summary> /// Loads the Customers 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_Customers != null) { oAbstract_Customers.Reset(); } return(false); } System.Data.SqlTypes.SqlInt32 PK_CustomerID = (System.Int32) this.SelectedValue; if (this.oAbstract_Customers == null) { switch (this.LastKnownConnectionType) { case Bob.DataClasses.ConnectionType.ConnectionString: this.oAbstract_Customers = new Bob.AbstractClasses.Abstract_Customers(this.connectionString); break; case Bob.DataClasses.ConnectionType.SqlConnection: this.oAbstract_Customers = new Bob.AbstractClasses.Abstract_Customers(this.sqlConnection); break; } } return(this.oAbstract_Customers.Refresh(PK_CustomerID)); }
/// <summary> /// Loads the Customers 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_Customers != null) { oAbstract_Customers.Reset(); } return(false); } System.Data.SqlTypes.SqlInt32 PK_CustomerID = (System.Int32) this.SelectedValue; if (this.oAbstract_Customers == null) { switch (this.LastKnownConnectionType) { case Bob.DataClasses.ConnectionType.ConnectionString: this.oAbstract_Customers = new Bob.AbstractClasses.Abstract_Customers(this.connectionString); break; case Bob.DataClasses.ConnectionType.SqlConnection: this.oAbstract_Customers = new Bob.AbstractClasses.Abstract_Customers(this.sqlConnection); break; } } return(this.oAbstract_Customers.Refresh(PK_CustomerID)); }
/// <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_Customers = null; this.FK_TitleId = System.Data.SqlTypes.SqlInt32.Null; if (this.param != null) { this.param.Dispose(); } } base.Dispose(disposing); }