/// <summary> /// Load or reloads a subset of the table content. You can specify which record you want to be selected /// by default. In order to successfully call this method, you need to call first the Initialize method. /// </summary> /// <param name="PK_Oit_GuidID">Primary key of the record you want to be selected by default.</param> /// <param name="startRecord">The zero-based record number to start with.</param> /// <param name="maxRecords">The maximum number of records to retrieve.</param> public void RefreshData(WS_tblOrderItem_Record.WSGuid PK_Oit_GuidID, int startRecord, int maxRecords) { System.Data.DataSet dataSet = null; dataSet = tblOrderItem_RecordWebService.GetAllDisplay_tblOrderItem_Collection_DataSet(this.FK_Oit_GuidOrderID, this.FK_Oit_GuidProductID); this.BeginUpdate(); this.bindingInProgress = true; this.DataSource = dataSet.Tables["spS_tblOrderItem_Display"].DefaultView; this.ValueMember = "ID1"; this.DisplayMember = "Display"; this.bindingInProgress = false; if (!PK_Oit_GuidID.UseNull) { this.SelectedValue = PK_Oit_GuidID.Value; } else { base.OnSelectedIndexChanged(EventArgs.Empty); } this.EndUpdate(); }
/// <summary> /// Load or reloads a subset of the table content. In order to successfully call this method, you need to call first /// the Initialize method. /// </summary> /// <param name="startRecord">The zero-based record number to start with.</param> /// <param name="maxRecords">The maximum number of records to retrieve.</param> public void RefreshData(int startRecord, int maxRecords) { WS_tblOrderItem_Record.WSGuid nullValue = new WS_tblOrderItem_Record.WSGuid(); nullValue.UseNull = true; this.RefreshData(nullValue, startRecord, maxRecords); }
/// <summary> /// Load or reloads all the table content. In order to successfully call this method, /// you need to call first the Initialize method. /// </summary> public void RefreshData() { WS_tblOrderItem_Record.WSGuid nullValue = new WS_tblOrderItem_Record.WSGuid(); nullValue.UseNull = true; this.RefreshData(nullValue, -1, -1); }
/// <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.FK_Oit_GuidOrderID = null; this.FK_Oit_GuidProductID = null; } base.Dispose(disposing); }
/// <summary> /// Initializes the control. You need to specify how to connect to the /// SQL Server database and if you want to populate the whole table content or /// only a subset (based on its foreign keys). The data will only be populated once /// you have called the RefreshData method. /// </summary> /// <param name="FK_Oit_GuidOrderID">Value for this foreign key.</param> /// <param name="FK_Oit_GuidProductID">Value for this foreign key.</param> public void Initialize(System.Net.NetworkCredential networkCredential, WS_tblOrderItem_Record.WSGuid FK_Oit_GuidOrderID, WS_tblOrderItem_Record.WSGuid FK_Oit_GuidProductID) { this.networkCredential = networkCredential; tblOrderItem_RecordWebService = new WS_tblOrderItem_Record.tblOrderItem_Record(); tblOrderItem_RecordWebService.Credentials = this.networkCredential; string url = ConfigurationSettings.AppSettings["WS_tblOrderItem_Record"]; if (url != null && url.Length != 0) { tblOrderItem_RecordWebService.Url = url; } this.FK_Oit_GuidOrderID = FK_Oit_GuidOrderID; this.FK_Oit_GuidProductID = FK_Oit_GuidProductID; }
/// <summary> /// Load or reloads a subset of the table content. You can specify which record you want to be checked by default. /// In order to successfully call this method, you need to call first the Initialize method. /// </summary> /// <param name="ArrayOf_PK_Oit_GuidID">Primary keys of the records you want to be checked by default.</param> /// <param name="startRecord">The zero-based record number to start with.</param> /// <param name="maxRecords">The maximum number of records to retrieve.</param> public void RefreshData(System.Collections.ArrayList ArrayOf_PK_Oit_GuidID, int startRecord, int maxRecords) { if (ArrayOf_PK_Oit_GuidID != null && ArrayOf_PK_Oit_GuidID.Count > 0) { WS_tblOrderItem_Record.WSGuid[] typedArray = new WS_tblOrderItem_Record.WSGuid[ArrayOf_PK_Oit_GuidID.Count]; int index = 0; foreach (object item in ArrayOf_PK_Oit_GuidID) { if (item is WS_tblOrderItem_Record.WSGuid) { typedArray[index] = (WS_tblOrderItem_Record.WSGuid)item; index++; } else if (item is System.Data.SqlTypes.SqlGuid) { WS_tblOrderItem_Record.WSGuid value = new WS_tblOrderItem_Record.WSGuid(); value.UseNull = false; value.Value = ((System.Data.SqlTypes.SqlGuid)item).Value; typedArray[index] = value; index++; } else if (item is System.Guid) { WS_tblOrderItem_Record.WSGuid value = new WS_tblOrderItem_Record.WSGuid(); value.UseNull = false; value.Value = (System.Guid)item; typedArray[index] = value; index++; } else { throw new InvalidOperationException("ArrayOf_PK_Oit_GuidID does not contain ONLY System.Data.SqlTypes.SqlGuid, WS_tblOrderItem_Record.WSGuid or System.Guid elements."); } } this.RefreshData(typedArray, startRecord, maxRecords); } else { this.RefreshData(startRecord, maxRecords); } }
/// <summary> /// Sets the supplied collection records to a System.Windows.Forms.CheckState value. /// </summary> /// <param name="ArrayOf_PK_Oit_GuidID">Primary keys of the records to set the check state for.</param> /// <param name="value">One of the System.Windows.Forms.CheckState values.</param> public void SetRecordsCheckState(System.Collections.ArrayList ArrayOf_PK_Oit_GuidID, System.Windows.Forms.CheckState value) { if (ArrayOf_PK_Oit_GuidID != null && ArrayOf_PK_Oit_GuidID.Count > 0) { WS_tblOrderItem_Record.WSGuid[] typedArray = new WS_tblOrderItem_Record.WSGuid[ArrayOf_PK_Oit_GuidID.Count]; int index = 0; foreach (object item in ArrayOf_PK_Oit_GuidID) { if (item is WS_tblOrderItem_Record.WSGuid) { typedArray[index] = (WS_tblOrderItem_Record.WSGuid)item; index++; } else if (item is System.Data.SqlTypes.SqlGuid) { WS_tblOrderItem_Record.WSGuid record = new WS_tblOrderItem_Record.WSGuid(); record.UseNull = false; record.Value = ((System.Data.SqlTypes.SqlGuid)item).Value; typedArray[index] = record; index++; } else if (item is System.Guid) { WS_tblOrderItem_Record.WSGuid record = new WS_tblOrderItem_Record.WSGuid(); record.UseNull = false; record.Value = (System.Guid)item; typedArray[index] = record; index++; } else { throw new InvalidOperationException("ArrayOf_PK_Oit_GuidID does not contain ONLY System.Data.SqlTypes.SqlGuid, WS_tblOrderItem_Record.WSGuid or System.Guid elements."); } } this.SetRecordsCheckState(typedArray, value); } }
/// <summary> /// Load or reloads a subset of the table content. You can specify which record you want to be selected /// by default. In order to successfully call this method, you need to call first the Initialize method. /// </summary> /// <param name="PK_Oit_GuidID">Primary key of the record you want to be selected by default.</param> /// <param name="startRecord">The zero-based record number to start with.</param> /// <param name="maxRecords">The maximum number of records to retrieve.</param> public void RefreshData(WS_tblOrderItem_Record.WSGuid PK_Oit_GuidID, int startRecord, int maxRecords) { if (!PK_Oit_GuidID.UseNull && this.SelectionMode == System.Windows.Forms.SelectionMode.None) { throw new ArgumentException("You cannot supply a value to this parameter when SelectionMode property is set to None.", "PK_Oit_GuidID"); } if (this.networkCredential == null) { throw new InvalidOperationException("You must call the 'Initialize' method before calling this method."); } System.Data.DataSet dataSet = null; dataSet = tblOrderItem_RecordWebService.GetAllDisplay_tblOrderItem_Collection_DataSet(this.FK_Oit_GuidOrderID, this.FK_Oit_GuidProductID); this.BeginUpdate(); this.bindingInProgress = true; this.DataSource = dataSet.Tables["spS_tblOrderItem_Display"].DefaultView; this.ValueMember = "ID1"; this.DisplayMember = "Display"; this.bindingInProgress = false; if (!PK_Oit_GuidID.UseNull) { this.SelectedValue = PK_Oit_GuidID.Value; } else { base.OnSelectedIndexChanged(EventArgs.Empty); } this.EndUpdate(); }
/// <summary> /// Load or reloads all the table content. You can specify which record you want to be selected by default. /// In order to successfully call this method, you need to call first the Initialize method. /// </summary> /// <param name="PK_Oit_GuidID">Primary key of the record you want to be selected by default.</param> public void RefreshData(WS_tblOrderItem_Record.WSGuid PK_Oit_GuidID) { this.RefreshData(PK_Oit_GuidID, -1, -1); }