/// <summary> /// Loads the tblProduct 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_tblProduct != null) { oAbstract_tblProduct.Reset(); } return(false); } System.Data.SqlTypes.SqlGuid PK_Pro_GuidID = new Guid(this.SelectedItem.Value); if (this.oAbstract_tblProduct == null) { switch (this.LastKnownConnectionType) { case OlymarsDemo.DataClasses.ConnectionType.ConnectionString: this.oAbstract_tblProduct = new OlymarsDemo.AbstractClasses.Abstract_tblProduct(this.connectionString); break; case OlymarsDemo.DataClasses.ConnectionType.SqlConnection: this.oAbstract_tblProduct = new OlymarsDemo.AbstractClasses.Abstract_tblProduct(this.sqlConnection); break; } } return(this.oAbstract_tblProduct.Refresh(PK_Pro_GuidID)); }
/// <summary> /// Loads the tblProduct 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_tblProduct != null) { oAbstract_tblProduct.Reset(); } return(false); } System.Data.SqlTypes.SqlGuid PK_Pro_GuidID = (System.Guid) this.SelectedValue; if (this.oAbstract_tblProduct == null) { switch (this.LastKnownConnectionType) { case OlymarsDemo.DataClasses.ConnectionType.ConnectionString: this.oAbstract_tblProduct = new OlymarsDemo.AbstractClasses.Abstract_tblProduct(this.connectionString); break; case OlymarsDemo.DataClasses.ConnectionType.SqlConnection: this.oAbstract_tblProduct = new OlymarsDemo.AbstractClasses.Abstract_tblProduct(this.sqlConnection); break; } } return(this.oAbstract_tblProduct.Refresh(PK_Pro_GuidID)); }