/// <summary>
            /// Creates a <see cref="BandwidthOverusageRow"/> using the <see cref="OverusageReport"/>
            /// DataSet from a row that contains information about bandwidth usage.
            /// </summary>
            /// <param name="report">Instance of <see cref="OverusageReport"/> class.</param>
            /// <param name="hostingSpaceDataRow">DataRow with bandwidth information.</param>
            /// <returns><see cref="BandwidthOverusageRow"/>.</returns>
            /// <exception cref="ArgumentNullException">When <paramref name="report"/> or either <paramref name="hostingSpaceDataRow"/> is <code>null</code>.</exception>
            public static BandwidthOverusageRow CreateFromHostingSpaceDataRow(OverusageReport report, DataRow hostingSpaceDataRow)
            {
                if (report == null)
                {
                    throw new ArgumentNullException("report");
                }
                if (hostingSpaceDataRow == null)
                {
                    throw new ArgumentNullException("hostingSpaceDataRow");
                }

                BandwidthOverusageRow row = report.BandwidthOverusage.NewBandwidthOverusageRow();

                row.HostingSpaceId = OverusageReportUtils.GetLongValueOrDefault(hostingSpaceDataRow["PackageID"].ToString(), 0);
                row.Allocated      = OverusageReportUtils.GetLongValueOrDefault(hostingSpaceDataRow["QuotaValue"].ToString(), 0);
                row.Used           = OverusageReportUtils.GetLongValueOrDefault(hostingSpaceDataRow["Bandwidth"].ToString(), 0);
                row.Usage          = (row.Used - row.Allocated);

                return(row);
            }
            /// <summary>
            /// Creates <see cref="BandwidthOverusageRow"/> using <see cref="PackageInfo"/> as a data source.
            /// </summary>
            /// <param name="report">Current <see cref="OverusageReport"/> dataset.</param>
            /// <param name="packageInfo"><see cref="PackageInfo"/> instance.</param>
            /// <returns><see cref="BandwidthOverusageRow"/> instance.</returns>
            /// <exception cref="ArgumentNullException">When <paramref name="report"/> or either <paramref name="packageInfo"/> is <code>null</code>.</exception>
            public static BandwidthOverusageRow CreateFromPackageInfo(OverusageReport report, PackageInfo packageInfo)
            {
                if (report == null)
                {
                    throw new ArgumentNullException("report");
                }

                if (packageInfo == null)
                {
                    throw new ArgumentNullException("packageInfo");
                }

                BandwidthOverusageRow row = report.BandwidthOverusage.NewBandwidthOverusageRow();

                row.HostingSpaceId = packageInfo.PackageId;
                row.Allocated      = packageInfo.BandWidthQuota;
                row.Used           = packageInfo.BandWidth;
                row.Usage          = (row.Used - row.Allocated);

                return(row);
            }
 public void AddBandwidthOverusageRow(BandwidthOverusageRow row) {
     this.Rows.Add(row);
 }
 public BandwidthOverusageRowChangeEvent(BandwidthOverusageRow row, global::System.Data.DataRowAction action) {
     this.eventRow = row;
     this.eventAction = action;
 }
 public OverusageDetailsRow AddOverusageDetailsRow(BandwidthOverusageRow parentBandwidthOverusageRowByBandwidthOverusage_OverusageDetails, string ResourceGroupName, long Used, long Allowed, string OverusageType, long AdditionalField) {
     OverusageDetailsRow rowOverusageDetailsRow = ((OverusageDetailsRow)(this.NewRow()));
     object[] columnValuesArray = new object[] {
             null,
             ResourceGroupName,
             Used,
             Allowed,
             OverusageType,
             AdditionalField};
     if ((parentBandwidthOverusageRowByBandwidthOverusage_OverusageDetails != null)) {
         columnValuesArray[0] = parentBandwidthOverusageRowByBandwidthOverusage_OverusageDetails[0];
     }
     rowOverusageDetailsRow.ItemArray = columnValuesArray;
     this.Rows.Add(rowOverusageDetailsRow);
     return rowOverusageDetailsRow;
 }
 public void RemoveBandwidthOverusageRow(BandwidthOverusageRow row) {
     this.Rows.Remove(row);
 }