Example #1
0
        /// <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_Category.WSInt32 nullValue = new WS_Category.WSInt32();
            nullValue.UseNull = true;

            this.RefreshData(nullValue, startRecord, maxRecords);
        }
Example #2
0
        /// <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_Category.WSInt32 nullValue = new WS_Category.WSInt32();
            nullValue.UseNull = true;

            this.RefreshData(nullValue, -1, -1);
        }
        /// <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_Cat_LngID">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_Category.WSInt32 PK_Cat_LngID, int startRecord, int maxRecords)
        {
            System.Data.DataSet dataSet = null;
            dataSet = categoryWebService.GetAllDisplay_Categories_DataSet();

            this.BeginUpdate();
            this.bindingInProgress = true;

            this.DataSource    = dataSet.Tables["spS_tblCategory_Display"].DefaultView;
            this.ValueMember   = "ID1";
            this.DisplayMember = "Display";

            this.bindingInProgress = false;

            if (!PK_Cat_LngID.UseNull)
            {
                this.SelectedValue = PK_Cat_LngID.Value;
            }
            else
            {
                base.OnSelectedIndexChanged(EventArgs.Empty);
            }

            this.EndUpdate();
        }
Example #4
0
        /// <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_Cat_LngID">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_Cat_LngID, int startRecord, int maxRecords)
        {
            if (ArrayOf_PK_Cat_LngID != null && ArrayOf_PK_Cat_LngID.Count > 0)
            {
                WS_Category.WSInt32[] typedArray = new WS_Category.WSInt32[ArrayOf_PK_Cat_LngID.Count];
                int index = 0;
                foreach (object item in ArrayOf_PK_Cat_LngID)
                {
                    if (item is WS_Category.WSInt32)
                    {
                        typedArray[index] = (WS_Category.WSInt32)item;
                        index++;
                    }
                    else if (item is System.Data.SqlTypes.SqlInt32)
                    {
                        WS_Category.WSInt32 value = new WS_Category.WSInt32();
                        value.UseNull = false;
                        value.Value   = ((System.Data.SqlTypes.SqlInt32)item).Value;

                        typedArray[index] = value;
                        index++;
                    }
                    else if (item is System.Int32)
                    {
                        WS_Category.WSInt32 value = new WS_Category.WSInt32();
                        value.UseNull = false;
                        value.Value   = (System.Int32)item;

                        typedArray[index] = value;
                        index++;
                    }
                    else
                    {
                        throw new InvalidOperationException("ArrayOf_PK_Cat_LngID does not contain ONLY System.Data.SqlTypes.SqlInt32, WS_Category.WSInt32 or System.Int32 elements.");
                    }
                }
                this.RefreshData(typedArray, startRecord, maxRecords);
            }
            else
            {
                this.RefreshData(startRecord, maxRecords);
            }
        }
Example #5
0
        /// <summary>
        /// Sets the supplied collection records to a System.Windows.Forms.CheckState value.
        /// </summary>
        /// <param name="ArrayOf_PK_Cat_LngID">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_Cat_LngID, System.Windows.Forms.CheckState value)
        {
            if (ArrayOf_PK_Cat_LngID != null && ArrayOf_PK_Cat_LngID.Count > 0)
            {
                WS_Category.WSInt32[] typedArray = new WS_Category.WSInt32[ArrayOf_PK_Cat_LngID.Count];
                int index = 0;
                foreach (object item in ArrayOf_PK_Cat_LngID)
                {
                    if (item is WS_Category.WSInt32)
                    {
                        typedArray[index] = (WS_Category.WSInt32)item;
                        index++;
                    }
                    else if (item is System.Data.SqlTypes.SqlInt32)
                    {
                        WS_Category.WSInt32 record = new WS_Category.WSInt32();
                        record.UseNull = false;
                        record.Value   = ((System.Data.SqlTypes.SqlInt32)item).Value;

                        typedArray[index] = record;
                        index++;
                    }
                    else if (item is System.Int32)
                    {
                        WS_Category.WSInt32 record = new WS_Category.WSInt32();
                        record.UseNull = false;
                        record.Value   = (System.Int32)item;

                        typedArray[index] = record;
                        index++;
                    }
                    else
                    {
                        throw new InvalidOperationException("ArrayOf_PK_Cat_LngID does not contain ONLY System.Data.SqlTypes.SqlInt32, WS_Category.WSInt32 or System.Int32 elements.");
                    }
                }
                this.SetRecordsCheckState(typedArray, value);
            }
        }
Example #6
0
        /// <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_Cat_LngID">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_Category.WSInt32 PK_Cat_LngID, int startRecord, int maxRecords)
        {
            if (!PK_Cat_LngID.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_Cat_LngID");
            }

            if (this.networkCredential == null)
            {
                throw new InvalidOperationException("You must call the 'Initialize' method before calling this method.");
            }


            System.Data.DataSet dataSet = null;
            dataSet = categoryWebService.GetAllDisplay_Categories_DataSet();

            this.BeginUpdate();
            this.bindingInProgress = true;

            this.DataSource    = dataSet.Tables["spS_tblCategory_Display"].DefaultView;
            this.ValueMember   = "ID1";
            this.DisplayMember = "Display";

            this.bindingInProgress = false;

            if (!PK_Cat_LngID.UseNull)
            {
                this.SelectedValue = PK_Cat_LngID.Value;
            }
            else
            {
                base.OnSelectedIndexChanged(EventArgs.Empty);
            }

            this.EndUpdate();
        }
Example #7
0
 /// <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_Cat_LngID">Primary key of the record you want to be selected by default.</param>
 public void RefreshData(WS_Category.WSInt32 PK_Cat_LngID)
 {
     this.RefreshData(PK_Cat_LngID, -1, -1);
 }