/// <summary>
        /// Converts <see cref="System.Data.DataRow"/> to <see cref="LoadBalancingMapViewRow"/>.
        /// </summary>
        /// <param name="row">The <see cref="System.Data.DataRow"/> object to be mapped.</param>
        /// <returns>A reference to the <see cref="LoadBalancingMapViewRow"/> object.</returns>
        protected virtual LoadBalancingMapViewRow MapRow(DataRow row)
        {
            LoadBalancingMapViewRow mappedObject = new LoadBalancingMapViewRow();
            DataTable  dataTable = row.Table;
            DataColumn dataColumn;

            // Column "Node_id"
            dataColumn = dataTable.Columns["Node_id"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Node_id = (short)row[dataColumn];
            }
            // Column "Customer_acct_id"
            dataColumn = dataTable.Columns["Customer_acct_id"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Customer_acct_id = (short)row[dataColumn];
            }
            // Column "Max_calls"
            dataColumn = dataTable.Columns["Max_calls"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Max_calls = (int)row[dataColumn];
            }
            // Column "Current_calls"
            dataColumn = dataTable.Columns["Current_calls"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Current_calls = (int)row[dataColumn];
            }
            // Column "Platform_id"
            dataColumn = dataTable.Columns["Platform_id"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Platform_id = (short)row[dataColumn];
            }
            // Column "Node_description"
            dataColumn = dataTable.Columns["Node_description"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Node_description = (string)row[dataColumn];
            }
            // Column "Node_config"
            dataColumn = dataTable.Columns["Node_config"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Node_config = (int)row[dataColumn];
            }
            // Column "Transport_type"
            dataColumn = dataTable.Columns["Transport_type"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Transport_type = (byte)row[dataColumn];
            }
            // Column "Node_status"
            dataColumn = dataTable.Columns["Node_status"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Node_status = (byte)row[dataColumn];
            }
            // Column "Ip_address"
            dataColumn = dataTable.Columns["Ip_address"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Ip_address = (int)row[dataColumn];
            }
            // Column "Dot_ip_address"
            dataColumn = dataTable.Columns["Dot_ip_address"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Dot_ip_address = (string)row[dataColumn];
            }
            // Column "Platform_location"
            dataColumn = dataTable.Columns["Platform_location"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Platform_location = (string)row[dataColumn];
            }
            // Column "Platform_status"
            dataColumn = dataTable.Columns["Platform_status"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Platform_status = (byte)row[dataColumn];
            }
            // Column "Platform_config"
            dataColumn = dataTable.Columns["Platform_config"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Platform_config = (int)row[dataColumn];
            }
            // Column "Customer_acct_name"
            dataColumn = dataTable.Columns["Customer_acct_name"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Customer_acct_name = (string)row[dataColumn];
            }
            // Column "Customer_acct_status"
            dataColumn = dataTable.Columns["Customer_acct_status"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Customer_acct_status = (byte)row[dataColumn];
            }
            // Column "Prefix_in"
            dataColumn = dataTable.Columns["Prefix_in"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Prefix_in = (string)row[dataColumn];
            }
            // Column "Prefix_out"
            dataColumn = dataTable.Columns["Prefix_out"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Prefix_out = (string)row[dataColumn];
            }
            // Column "Prefix_in_type_id"
            dataColumn = dataTable.Columns["Prefix_in_type_id"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Prefix_in_type_id = (short)row[dataColumn];
            }
            // Column "Partner_id"
            dataColumn = dataTable.Columns["Partner_id"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Partner_id = (int)row[dataColumn];
            }
            // Column "Partner_name"
            dataColumn = dataTable.Columns["Partner_name"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Partner_name = (string)row[dataColumn];
            }
            // Column "Partner_status"
            dataColumn = dataTable.Columns["Partner_status"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Partner_status = (byte)row[dataColumn];
            }
            // Column "Service_type"
            dataColumn = dataTable.Columns["Service_type"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Service_type = (byte)row[dataColumn];
            }
            // Column "Service_retail_type"
            dataColumn = dataTable.Columns["Service_retail_type"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Service_retail_type = (int)row[dataColumn];
            }
            // Column "Is_prepaid"
            dataColumn = dataTable.Columns["Is_prepaid"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Is_prepaid = (byte)row[dataColumn];
            }
            // Column "Is_shared_service"
            dataColumn = dataTable.Columns["Is_shared_service"];
            if (!row.IsNull(dataColumn))
            {
                mappedObject.Is_shared_service = (byte)row[dataColumn];
            }
            return(mappedObject);
        }
        /// <summary>
        /// Reads data from the provided data reader and returns
        /// an array of mapped objects.
        /// </summary>
        /// <param name="reader">The <see cref="System.Data.IDataReader"/> object to read data from the view.</param>
        /// <param name="startIndex">The index of the first record to map.</param>
        /// <param name="length">The number of records to map.</param>
        /// <param name="totalRecordCount">A reference parameter that returns the total number
        /// of records in the reader object if 0 was passed into the method; otherwise it returns -1.</param>
        /// <returns>An array of <see cref="LoadBalancingMapViewRow"/> objects.</returns>
        protected virtual LoadBalancingMapViewRow[] MapRecords(IDataReader reader,
                                                               int startIndex, int length, ref int totalRecordCount)
        {
            if (0 > startIndex)
            {
                throw new ArgumentOutOfRangeException("startIndex", startIndex, "StartIndex cannot be less than zero.");
            }
            if (0 > length)
            {
                throw new ArgumentOutOfRangeException("length", length, "Length cannot be less than zero.");
            }

            int node_idColumnIndex              = reader.GetOrdinal("node_id");
            int customer_acct_idColumnIndex     = reader.GetOrdinal("customer_acct_id");
            int max_callsColumnIndex            = reader.GetOrdinal("max_calls");
            int current_callsColumnIndex        = reader.GetOrdinal("current_calls");
            int platform_idColumnIndex          = reader.GetOrdinal("platform_id");
            int node_descriptionColumnIndex     = reader.GetOrdinal("node_description");
            int node_configColumnIndex          = reader.GetOrdinal("node_config");
            int transport_typeColumnIndex       = reader.GetOrdinal("transport_type");
            int node_statusColumnIndex          = reader.GetOrdinal("node_status");
            int ip_addressColumnIndex           = reader.GetOrdinal("ip_address");
            int dot_ip_addressColumnIndex       = reader.GetOrdinal("dot_ip_address");
            int platform_locationColumnIndex    = reader.GetOrdinal("platform_location");
            int platform_statusColumnIndex      = reader.GetOrdinal("platform_status");
            int platform_configColumnIndex      = reader.GetOrdinal("platform_config");
            int customer_acct_nameColumnIndex   = reader.GetOrdinal("customer_acct_name");
            int customer_acct_statusColumnIndex = reader.GetOrdinal("customer_acct_status");
            int prefix_inColumnIndex            = reader.GetOrdinal("prefix_in");
            int prefix_outColumnIndex           = reader.GetOrdinal("prefix_out");
            int prefix_in_type_idColumnIndex    = reader.GetOrdinal("prefix_in_type_id");
            int partner_idColumnIndex           = reader.GetOrdinal("partner_id");
            int partner_nameColumnIndex         = reader.GetOrdinal("partner_name");
            int partner_statusColumnIndex       = reader.GetOrdinal("partner_status");
            int service_typeColumnIndex         = reader.GetOrdinal("service_type");
            int service_retail_typeColumnIndex  = reader.GetOrdinal("service_retail_type");
            int is_prepaidColumnIndex           = reader.GetOrdinal("is_prepaid");
            int is_shared_serviceColumnIndex    = reader.GetOrdinal("is_shared_service");

            System.Collections.ArrayList recordList = new System.Collections.ArrayList();
            int ri = -startIndex;

            while (reader.Read())
            {
                ri++;
                if (ri > 0 && ri <= length)
                {
                    LoadBalancingMapViewRow record = new LoadBalancingMapViewRow();
                    recordList.Add(record);

                    record.Node_id          = Convert.ToInt16(reader.GetValue(node_idColumnIndex));
                    record.Customer_acct_id = Convert.ToInt16(reader.GetValue(customer_acct_idColumnIndex));
                    record.Max_calls        = Convert.ToInt32(reader.GetValue(max_callsColumnIndex));
                    record.Current_calls    = Convert.ToInt32(reader.GetValue(current_callsColumnIndex));
                    if (!reader.IsDBNull(platform_idColumnIndex))
                    {
                        record.Platform_id = Convert.ToInt16(reader.GetValue(platform_idColumnIndex));
                    }
                    if (!reader.IsDBNull(node_descriptionColumnIndex))
                    {
                        record.Node_description = Convert.ToString(reader.GetValue(node_descriptionColumnIndex));
                    }
                    if (!reader.IsDBNull(node_configColumnIndex))
                    {
                        record.Node_config = Convert.ToInt32(reader.GetValue(node_configColumnIndex));
                    }
                    if (!reader.IsDBNull(transport_typeColumnIndex))
                    {
                        record.Transport_type = Convert.ToByte(reader.GetValue(transport_typeColumnIndex));
                    }
                    if (!reader.IsDBNull(node_statusColumnIndex))
                    {
                        record.Node_status = Convert.ToByte(reader.GetValue(node_statusColumnIndex));
                    }
                    if (!reader.IsDBNull(ip_addressColumnIndex))
                    {
                        record.Ip_address = Convert.ToInt32(reader.GetValue(ip_addressColumnIndex));
                    }
                    if (!reader.IsDBNull(dot_ip_addressColumnIndex))
                    {
                        record.Dot_ip_address = Convert.ToString(reader.GetValue(dot_ip_addressColumnIndex));
                    }
                    if (!reader.IsDBNull(platform_locationColumnIndex))
                    {
                        record.Platform_location = Convert.ToString(reader.GetValue(platform_locationColumnIndex));
                    }
                    if (!reader.IsDBNull(platform_statusColumnIndex))
                    {
                        record.Platform_status = Convert.ToByte(reader.GetValue(platform_statusColumnIndex));
                    }
                    if (!reader.IsDBNull(platform_configColumnIndex))
                    {
                        record.Platform_config = Convert.ToInt32(reader.GetValue(platform_configColumnIndex));
                    }
                    if (!reader.IsDBNull(customer_acct_nameColumnIndex))
                    {
                        record.Customer_acct_name = Convert.ToString(reader.GetValue(customer_acct_nameColumnIndex));
                    }
                    if (!reader.IsDBNull(customer_acct_statusColumnIndex))
                    {
                        record.Customer_acct_status = Convert.ToByte(reader.GetValue(customer_acct_statusColumnIndex));
                    }
                    if (!reader.IsDBNull(prefix_inColumnIndex))
                    {
                        record.Prefix_in = Convert.ToString(reader.GetValue(prefix_inColumnIndex));
                    }
                    if (!reader.IsDBNull(prefix_outColumnIndex))
                    {
                        record.Prefix_out = Convert.ToString(reader.GetValue(prefix_outColumnIndex));
                    }
                    if (!reader.IsDBNull(prefix_in_type_idColumnIndex))
                    {
                        record.Prefix_in_type_id = Convert.ToInt16(reader.GetValue(prefix_in_type_idColumnIndex));
                    }
                    if (!reader.IsDBNull(partner_idColumnIndex))
                    {
                        record.Partner_id = Convert.ToInt32(reader.GetValue(partner_idColumnIndex));
                    }
                    if (!reader.IsDBNull(partner_nameColumnIndex))
                    {
                        record.Partner_name = Convert.ToString(reader.GetValue(partner_nameColumnIndex));
                    }
                    if (!reader.IsDBNull(partner_statusColumnIndex))
                    {
                        record.Partner_status = Convert.ToByte(reader.GetValue(partner_statusColumnIndex));
                    }
                    if (!reader.IsDBNull(service_typeColumnIndex))
                    {
                        record.Service_type = Convert.ToByte(reader.GetValue(service_typeColumnIndex));
                    }
                    if (!reader.IsDBNull(service_retail_typeColumnIndex))
                    {
                        record.Service_retail_type = Convert.ToInt32(reader.GetValue(service_retail_typeColumnIndex));
                    }
                    if (!reader.IsDBNull(is_prepaidColumnIndex))
                    {
                        record.Is_prepaid = Convert.ToByte(reader.GetValue(is_prepaidColumnIndex));
                    }
                    if (!reader.IsDBNull(is_shared_serviceColumnIndex))
                    {
                        record.Is_shared_service = Convert.ToByte(reader.GetValue(is_shared_serviceColumnIndex));
                    }

                    if (ri == length && 0 != totalRecordCount)
                    {
                        break;
                    }
                }
            }

            totalRecordCount = 0 == totalRecordCount ? ri + startIndex : -1;
            return((LoadBalancingMapViewRow[])(recordList.ToArray(typeof(LoadBalancingMapViewRow))));
        }