⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 truck.cs

📁 微软的行业应用解决方案示例
💻 CS
字号:
using System;

namespace HardwareDistributor.Business
{
    public class Truck : DataObject
    {
        #region Constants
        public const string LICENSEPLATENUMBER_COLUMN = "LicensePlateNumber";
        public const string LICENSEPLATESTATEPROVINCE_COLUMN = "LicensePlateStateProvince";
        public const string ROUTEID_COLUMN = "RouteId";
        public const string TRUCKID_COLUMN = "TruckId";
        #endregion


        #region Fields
        private string _licensePlateNumber = string.Empty;
        private string _licensePlateState = string.Empty;
        private Nullable<int> _routeId = null;
        private Nullable<int> _truckId = null;
        #endregion


        #region Constructor(s) & Dispose
        /// <summary>
        /// Create a new Truck
        /// </summary>
        public Truck() : base()
        {
        }


        /// <summary>
        /// Create an unmodified Truck
        /// </summary>
        /// <param name="truckId">Id of the Truck</param>
        /// <param name="truckLicenseStateProvince">
        /// State of the license plate of the Truck
        /// </param>
        /// <param name="truckLicenseNumber">License plate of the Truck</param>
        /// <param name="routeId">Route assigned to the Truck</param>
        public Truck(Nullable<int> truckId, 
                     string truckLicenseStateProvince, 
                     string truckLicenseNumber, 
                     Nullable<int> routeId)
        {
            _truckId = truckId;
            _licensePlateNumber = truckLicenseNumber;
            _licensePlateState = truckLicenseStateProvince;
            _routeId = routeId;
            _objectState = ObjectState.Unchanged;
        }
        #endregion

        #region Properties
        /// <summary>
        /// Truck's license plate number
        /// </summary>
        public string LicenseNumber
        {
            get
            {
                return _licensePlateNumber;
            }
            set
            {
                _licensePlateNumber = ChangeValue<string>(_licensePlateNumber, 
                                                          value,
                                                          LICENSEPLATENUMBER_COLUMN);
            }
        }


        /// <summary>
        /// State or Province found on Truck's license plate
        /// </summary>
        public string LicenseStateProvince
        {
            get
            {
                return _licensePlateState;
            }
            set
            {
                _licensePlateState = ChangeValue<string>(_licensePlateState,
                                                         value,
                                                         LICENSEPLATESTATEPROVINCE_COLUMN);
            }
        }


        /// <summary>
        /// Unique Route Id that this truck belongs to
        /// </summary>
        public Nullable<int> RouteId
        {
            get
            {
                return _routeId;
            }
            set
            {
                _routeId = ChangeValue<Nullable<int>>(_routeId, value,
                                                      ROUTEID_COLUMN);
            }
        }


        /// <summary>
        /// Unique Truck Id
        /// </summary>
        public Nullable<int> TruckId
        {
            get
            {
                return _truckId;
            }
            set
            {
                _truckId = ChangeKey<Nullable<int>>(_truckId, value,
                                                    TRUCKID_COLUMN);
            }
        }
        #endregion
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -