/// <summary> /// Loads the tblOrderItem 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_tblOrderItem != null) { oAbstract_tblOrderItem.Reset(); } return(false); } System.Data.SqlTypes.SqlGuid PK_Oit_GuidID = new Guid(this.SelectedItem.Value); if (this.oAbstract_tblOrderItem == null) { switch (this.LastKnownConnectionType) { case OlymarsDemo.DataClasses.ConnectionType.ConnectionString: this.oAbstract_tblOrderItem = new OlymarsDemo.AbstractClasses.Abstract_tblOrderItem(this.connectionString); break; case OlymarsDemo.DataClasses.ConnectionType.SqlConnection: this.oAbstract_tblOrderItem = new OlymarsDemo.AbstractClasses.Abstract_tblOrderItem(this.sqlConnection); break; } } return(this.oAbstract_tblOrderItem.Refresh(PK_Oit_GuidID)); }
/// <summary> /// Loads the tblOrderItem 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_tblOrderItem != null) { oAbstract_tblOrderItem.Reset(); } return(false); } System.Data.SqlTypes.SqlGuid PK_Oit_GuidID = (System.Guid) this.SelectedValue; if (this.oAbstract_tblOrderItem == null) { switch (this.LastKnownConnectionType) { case OlymarsDemo.DataClasses.ConnectionType.ConnectionString: this.oAbstract_tblOrderItem = new OlymarsDemo.AbstractClasses.Abstract_tblOrderItem(this.connectionString); break; case OlymarsDemo.DataClasses.ConnectionType.SqlConnection: this.oAbstract_tblOrderItem = new OlymarsDemo.AbstractClasses.Abstract_tblOrderItem(this.sqlConnection); break; } } return(this.oAbstract_tblOrderItem.Refresh(PK_Oit_GuidID)); }
/// <summary> /// Disposes the current instance of this object. /// </summary> public override void Dispose() { this.oAbstract_tblOrderItem = null; this.FK_Oit_GuidOrderID = System.Data.SqlTypes.SqlGuid.Null; this.FK_Oit_GuidProductID = System.Data.SqlTypes.SqlGuid.Null; if (this.param != null) { this.param.Dispose(); } base.Dispose(); }
/// <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_tblOrderItem = null; this.FK_Oit_GuidOrderID = System.Data.SqlTypes.SqlGuid.Null; this.FK_Oit_GuidProductID = System.Data.SqlTypes.SqlGuid.Null; if (this.param != null) { this.param.Dispose(); } } base.Dispose(disposing); }
private bool RefreshCurrentRecord() { EmptyControls(); Abstracts.Abstract_tblOrderItem oAbstract_tblOrderItem = null; switch (this.lastKnownConnectionType) { case OlymarsDemo.DataClasses.ConnectionType.ConnectionString: oAbstract_tblOrderItem = new Abstracts.Abstract_tblOrderItem(this.connectionString); break; case OlymarsDemo.DataClasses.ConnectionType.SqlConnection: oAbstract_tblOrderItem = new Abstracts.Abstract_tblOrderItem(this.sqlConnection); break; } if (oAbstract_tblOrderItem.Refresh(this.currentID)) { this.IgnoreChanges = true; if (!oAbstract_tblOrderItem.Col_Oit_GuidOrderID.IsNull) { Control_Oit_GuidOrderID.SelectedValue = oAbstract_tblOrderItem.Col_Oit_GuidOrderID.Value; } if (!oAbstract_tblOrderItem.Col_Oit_GuidProductID.IsNull) { Control_Oit_GuidProductID.SelectedValue = oAbstract_tblOrderItem.Col_Oit_GuidProductID.Value; } if (!oAbstract_tblOrderItem.Col_Oit_LngAmount.IsNull) { Control_Oit_LngAmount.Text = oAbstract_tblOrderItem.Col_Oit_LngAmount.Value.ToString(); } this.IgnoreChanges = false; return(true); } else { MessageBox.Show("The record does not exist any more !", "Record not found", MessageBoxButtons.OK, MessageBoxIcon.Stop); return(false); } }