Fly with the wind-TerryDong

.NET on the way

导航

实体类demo代码

Posted on 2007-11-20 13:51  Terry Dong  阅读(512)  评论(1编辑  收藏  举报

数据实体采用最简单的单表映射,用于各层之间的强类型数据交互,未进行entity collection封装,多个实体采用继承.net 2.0范型的List<>类的自定义可以排序类SortList<Entity>进行存储与交互。

 

/*
Name:Orders, Northwind demo
Author: Terry Dong
Description: data entity
*/
using System;
using System.Data;
namespace TerryDong.Entity
{
    public class OrdersEntity
    {
        #region constructors
        public OrdersEntity()
        { }

        public OrdersEntity(int orderid, string customerid, int employeeid, DateTime orderdate, DateTime requireddate, DateTime shippeddate, int shipvia, decimal freight, string shipname, string shipaddress, string shipcity, string shipregion, string shippostalcode, string shipcountry)
        {
            this._OrderID = orderid;
            this._CustomerID = customerid;
            this._EmployeeID = employeeid;
            this._OrderDate = orderdate;
            this._RequiredDate = requireddate;
            this._ShippedDate = shippeddate;
            this._ShipVia = shipvia;
            this._Freight = freight;
            this._ShipName = shipname;
            this._ShipAddress = shipaddress;
            this._ShipCity = shipcity;
            this._ShipRegion = shipregion;
            this._ShipPostalCode = shippostalcode;
            this._ShipCountry = shipcountry;
        }
        #endregion

        #region Fileds

        private int? _OrderID;

        private string _CustomerID;

        private int? _EmployeeID;

        private DateTime? _OrderDate;

        private DateTime? _RequiredDate;

        private DateTime? _ShippedDate;

        private int? _ShipVia;

        private decimal? _Freight;

        private string _ShipName;

        private string _ShipAddress;

        private string _ShipCity;

        private string _ShipRegion;

        private string _ShipPostalCode;

        private string _ShipCountry;

        #endregion

        #region Properties
        public int? OrderID
        {
            set { this._OrderID = value; }
            get { return this._OrderID; }
        }

        public string CustomerID
        {
            set { this._CustomerID = value; }
            get { return this._CustomerID; }
        }

        public int? EmployeeID
        {
            set { this._EmployeeID = value; }
            get { return this._EmployeeID; }
        }

        public DateTime? OrderDate
        {
            set { this._OrderDate = value; }
            get { return this._OrderDate; }
        }

        public DateTime? RequiredDate
        {
            set { this._RequiredDate = value; }
            get { return this._RequiredDate; }
        }

        public DateTime? ShippedDate
        {
            set { this._ShippedDate = value; }
            get { return this._ShippedDate; }
        }

        public int? ShipVia
        {
            set { this._ShipVia = value; }
            get { return this._ShipVia; }
        }

        public decimal? Freight
        {
            set { this._Freight = value; }
            get { return this._Freight; }
        }

        public string ShipName
        {
            set { this._ShipName = value; }
            get { return this._ShipName; }
        }

        public string ShipAddress
        {
            set { this._ShipAddress = value; }
            get { return this._ShipAddress; }
        }

        public string ShipCity
        {
            set { this._ShipCity = value; }
            get { return this._ShipCity; }
        }

        public string ShipRegion
        {
            set { this._ShipRegion = value; }
            get { return this._ShipRegion; }
        }

        public string ShipPostalCode
        {
            set { this._ShipPostalCode = value; }
            get { return this._ShipPostalCode; }
        }

        public string ShipCountry
        {
            set { this._ShipCountry = value; }
            get { return this._ShipCountry; }
        }

        #endregion
    }
}