// <fileinfo name="SalesTotalsbyAmountRow_Base.cs">
//      <copyright>
//          All rights reserved.
//      </copyright>
//      <remarks>
//          Do not change this source code manually. Changes to this file may 
//          cause incorrect behavior and will be lost if the code is regenerated.
//      </remarks>
//      <generator rewritefile="True" infourl="http://www.SharpPower.com">RapTier</generator>
// </fileinfo>

using System;

namespace MyCompany.MyProject.Db
{
    /// <summary>
    /// The base class for <see cref="SalesTotalsbyAmountRow"/> that 
    /// represents a record in the <c>Sales Totals by Amount</c> view.
    /// </summary>
    /// <remarks>
    /// Do not change this source code manually. Update the <see cref="SalesTotalsbyAmountRow"/>
    /// class if you need to add or change some functionality.
    /// </remarks>
    public abstract class SalesTotalsbyAmountRow_Base
    {
        private decimal _saleAmount;
        private bool _saleAmountNull = true;
        private int _orderID;
        private string _companyName;
        private System.DateTime _shippedDate;
        private bool _shippedDateNull = true;

        /// <summary>
        /// Initializes a new instance of the <see cref="SalesTotalsbyAmountRow_Base"/> class.
        /// </summary>
        public SalesTotalsbyAmountRow_Base()
        {
            // EMPTY
        }

        /// <summary>
        /// Gets or sets the <c>SaleAmount</c> column value.
        /// This column is nullable.
        /// </summary>
        /// <value>The <c>SaleAmount</c> column value.</value>
        public decimal SaleAmount
        {
            get
            {
                if(IsSaleAmountNull)
                    throw new InvalidOperationException("Cannot get value because it is DBNull.");
                return _saleAmount;
            }
            set
            {
                _saleAmountNull = false;
                _saleAmount = value;
            }
        }

        /// <summary>
        /// Indicates whether the <see cref="SaleAmount"/>
        /// property value is null.
        /// </summary>
        /// <value>true if the property value is null, otherwise false.</value>
        public bool IsSaleAmountNull
        {
            get { return _saleAmountNull; }
            set { _saleAmountNull = value; }
        }

        /// <summary>
        /// Gets or sets the <c>OrderID</c> column value.
        /// </summary>
        /// <value>The <c>OrderID</c> column value.</value>
        public int OrderID
        {
            get { return _orderID; }
            set { _orderID = value; }
        }

        /// <summary>
        /// Gets or sets the <c>CompanyName</c> column value.
        /// </summary>
        /// <value>The <c>CompanyName</c> column value.</value>
        public string CompanyName
        {
            get { return _companyName; }
            set { _companyName = value; }
        }

        /// <summary>
        /// Gets or sets the <c>ShippedDate</c> column value.
        /// This column is nullable.
        /// </summary>
        /// <value>The <c>ShippedDate</c> column value.</value>
        public System.DateTime ShippedDate
        {
            get
            {
                if(IsShippedDateNull)
                    throw new InvalidOperationException("Cannot get value because it is DBNull.");
                return _shippedDate;
            }
            set
            {
                _shippedDateNull = false;
                _shippedDate = value;
            }
        }

        /// <summary>
        /// Indicates whether the <see cref="ShippedDate"/>
        /// property value is null.
        /// </summary>
        /// <value>true if the property value is null, otherwise false.</value>
        public bool IsShippedDateNull
        {
            get { return _shippedDateNull; }
            set { _shippedDateNull = value; }
        }

        /// <summary>
        /// Returns the string representation of this instance.
        /// </summary>
        /// <returns>The string representation of this instance.</returns>
        public override string ToString()
        {
            System.Text.StringBuilder dynStr = new System.Text.StringBuilder(GetType().Name);
            dynStr.Append(':');
            dynStr.Append("  SaleAmount=");
            dynStr.Append(IsSaleAmountNull ? (object)"<NULL>" : SaleAmount);
            dynStr.Append("  OrderID=");
            dynStr.Append(OrderID);
            dynStr.Append("  CompanyName=");
            dynStr.Append(CompanyName);
            dynStr.Append("  ShippedDate=");
            dynStr.Append(IsShippedDateNull ? (object)"<NULL>" : ShippedDate);
            return dynStr.ToString();
        }
    } // End of SalesTotalsbyAmountRow_Base class
} // End of namespace