예제 #1
0
        /// <summary>
        /// 将DataReader的属性值转化为实体类的属性值,返回实体类
        /// </summary>
        /// <param name="dr">有效的DataReader对象</param>
        /// <returns>实体类对象</returns>
        protected override CustomerInfo DataReaderToEntity(IDataReader dataReader)
        {
            CustomerInfo    customerInfo = new CustomerInfo();
            SmartDataReader reader       = new SmartDataReader(dataReader);

            customerInfo.ID          = reader.GetString("ID");
            customerInfo.Number      = reader.GetString("Number");
            customerInfo.Name        = reader.GetString("Name");
            customerInfo.Type        = reader.GetString("Type");
            customerInfo.Area        = reader.GetString("Area");
            customerInfo.Company     = reader.GetString("Company");
            customerInfo.Address     = reader.GetString("Address");
            customerInfo.Telephone1  = reader.GetString("Telephone1");
            customerInfo.Telephone2  = reader.GetString("Telephone2");
            customerInfo.Telephone3  = reader.GetString("Telephone3");
            customerInfo.Telephone4  = reader.GetString("Telephone4");
            customerInfo.Telephone5  = reader.GetString("Telephone5");
            customerInfo.CreateDate  = reader.GetDateTime("CreateDate");
            customerInfo.Shop_ID     = reader.GetString("Shop_ID");
            customerInfo.Note        = reader.GetString("Note");
            customerInfo.LastUpdated = reader.GetDateTime("LastUpdated");

            return(customerInfo);
        }