예제 #1
0
        /// <summary>
        /// 装载实体
        /// </summary>
        /// <param name="pReader">向前只读器</param>
        /// <param name="pInstance">实体实例</param>
        protected void Load(SqlDataReader pReader, out TUnitEntity pInstance)
        {
            //将所有的数据从SqlDataReader中读取到Entity中
            pInstance = new TUnitEntity();
            pInstance.PersistenceHandle = new PersistenceHandle();
            pInstance.PersistenceHandle.Load();

            if (pReader["unit_id"] != DBNull.Value)
            {
                pInstance.UnitID = Convert.ToString(pReader["unit_id"]);
            }
            if (pReader["type_id"] != DBNull.Value)
            {
                pInstance.TypeID = Convert.ToString(pReader["type_id"]);
            }
            if (pReader["unit_code"] != DBNull.Value)
            {
                pInstance.UnitCode = Convert.ToString(pReader["unit_code"]);
            }
            if (pReader["unit_name"] != DBNull.Value)
            {
                pInstance.UnitName = Convert.ToString(pReader["unit_name"]);
            }
            if (pReader["unit_name_en"] != DBNull.Value)
            {
                pInstance.UnitNameEn = Convert.ToString(pReader["unit_name_en"]);
            }
            if (pReader["unit_name_short"] != DBNull.Value)
            {
                pInstance.UnitNameShort = Convert.ToString(pReader["unit_name_short"]);
            }
            if (pReader["unit_city_id"] != DBNull.Value)
            {
                pInstance.UnitCityID = Convert.ToString(pReader["unit_city_id"]);
                var cityDao  = new T_CityDAO(CurrentUserInfo);
                var cityInfo = cityDao.GetByID(pInstance.UnitCityID);
                if (cityInfo != null)
                {
                    pInstance.Province     = cityInfo.city1_name;
                    pInstance.CityName     = cityInfo.city2_name;
                    pInstance.DistrictName = cityInfo.city3_name;
                }
            }
            if (pReader["unit_address"] != DBNull.Value)
            {
                pInstance.UnitAddress = Convert.ToString(pReader["unit_address"]);
            }
            if (pReader["unit_contact"] != DBNull.Value)
            {
                pInstance.UnitContact = Convert.ToString(pReader["unit_contact"]);
            }
            if (pReader["unit_tel"] != DBNull.Value)
            {
                pInstance.UnitTel = Convert.ToString(pReader["unit_tel"]);
            }
            if (pReader["unit_fax"] != DBNull.Value)
            {
                pInstance.UnitFax = Convert.ToString(pReader["unit_fax"]);
            }
            if (pReader["unit_email"] != DBNull.Value)
            {
                pInstance.UnitEmail = Convert.ToString(pReader["unit_email"]);
            }
            if (pReader["unit_postcode"] != DBNull.Value)
            {
                pInstance.UnitPostcode = Convert.ToString(pReader["unit_postcode"]);
            }
            if (pReader["unit_remark"] != DBNull.Value)
            {
                pInstance.UnitRemark = Convert.ToString(pReader["unit_remark"]);
            }
            if (pReader["Status"] != DBNull.Value)
            {
                pInstance.Status = Convert.ToString(pReader["Status"]);
            }
            if (pReader["unit_flag"] != DBNull.Value)
            {
                pInstance.UnitFlag = Convert.ToString(pReader["unit_flag"]);
            }
            if (pReader["CUSTOMER_LEVEL"] != DBNull.Value)
            {
                pInstance.CUSTOMERLEVEL = Convert.ToInt32(pReader["CUSTOMER_LEVEL"]);
            }
            if (pReader["create_user_id"] != DBNull.Value)
            {
                pInstance.CreateUserID = Convert.ToString(pReader["create_user_id"]);
            }
            if (pReader["create_time"] != DBNull.Value)
            {
                pInstance.CreateTime = Convert.ToString(pReader["create_time"]);
            }
            if (pReader["modify_user_id"] != DBNull.Value)
            {
                pInstance.ModifyUserID = Convert.ToString(pReader["modify_user_id"]);
            }
            if (pReader["modify_time"] != DBNull.Value)
            {
                pInstance.ModifyTime = Convert.ToString(pReader["modify_time"]);
            }
            if (pReader["status_desc"] != DBNull.Value)
            {
                pInstance.StatusDesc = Convert.ToString(pReader["status_desc"]);
            }
            if (pReader["bat_id"] != DBNull.Value)
            {
                pInstance.BatID = Convert.ToString(pReader["bat_id"]);
            }
            if (pReader["if_flag"] != DBNull.Value)
            {
                pInstance.IfFlag = Convert.ToString(pReader["if_flag"]);
            }
            if (pReader["customer_id"] != DBNull.Value)
            {
                pInstance.CustomerID = Convert.ToString(pReader["customer_id"]);
            }
            if (pReader["longitude"] != DBNull.Value)
            {
                pInstance.Longitude = Convert.ToString(pReader["longitude"]);
            }
            if (pReader["dimension"] != DBNull.Value)
            {
                pInstance.Dimension = Convert.ToString(pReader["dimension"]);
            }
            if (pReader["imageURL"] != DBNull.Value)
            {
                pInstance.ImageURL = Convert.ToString(pReader["imageURL"]);
            }
            if (pReader["ftpImagerURL"] != DBNull.Value)
            {
                pInstance.FtpImagerURL = Convert.ToString(pReader["ftpImagerURL"]);
            }
            if (pReader["webserversURL"] != DBNull.Value)
            {
                pInstance.WebserversURL = Convert.ToString(pReader["webserversURL"]);
            }
            if (pReader["weiXinId"] != DBNull.Value)
            {
                pInstance.WeiXinId = Convert.ToString(pReader["weiXinId"]);
            }
            if (pReader["dimensionalCodeURL"] != DBNull.Value)
            {
                pInstance.DimensionalCodeURL = Convert.ToString(pReader["dimensionalCodeURL"]);
            }
            //if (pReader["CreateBy"] != DBNull.Value)
            //{
            //    pInstance.CreateBy =  Convert.ToString(pReader["CreateBy"]);
            //}
            //if (pReader["CreateTime"] != DBNull.Value)
            //{
            //    pInstance.CreateTime =  Convert.ToDateTime(pReader["CreateTime"]);
            //}
            //if (pReader["LastUpdateBy"] != DBNull.Value)
            //{
            //    pInstance.LastUpdateBy =  Convert.ToString(pReader["LastUpdateBy"]);
            //}
            //if (pReader["LastUpdateTime"] != DBNull.Value)
            //{
            //    pInstance.LastUpdateTime =  Convert.ToDateTime(pReader["LastUpdateTime"]);
            //}
            //if (pReader["IsDelete"] != DBNull.Value)
            //{
            //    pInstance.IsDelete =   Convert.ToInt32(pReader["IsDelete"]);
            //}
        }
예제 #2
0
        /// <summary>
        /// 装载实体
        /// </summary>
        /// <param name="pReader">向前只读器</param>
        /// <param name="pInstance">实体实例</param>
        protected void Load(SqlDataReader pReader, out VipAddressEntity pInstance)
        {
            //将所有的数据从SqlDataReader中读取到Entity中
            pInstance = new VipAddressEntity();
            pInstance.PersistenceHandle = new PersistenceHandle();
            pInstance.PersistenceHandle.Load();

            if (pReader["VipAddressID"] != DBNull.Value)
            {
                pInstance.VipAddressID = Convert.ToString(pReader["VipAddressID"]);
            }
            if (pReader["VIPID"] != DBNull.Value)
            {
                pInstance.VIPID = Convert.ToString(pReader["VIPID"]);
            }
            if (pReader["LinkMan"] != DBNull.Value)
            {
                pInstance.LinkMan = Convert.ToString(pReader["LinkMan"]);
            }
            if (pReader["LinkTel"] != DBNull.Value)
            {
                pInstance.LinkTel = Convert.ToString(pReader["LinkTel"]);
            }
            if (pReader["CityID"] != DBNull.Value)
            {
                pInstance.CityID = Convert.ToString(pReader["CityID"]);
                var cityDao  = new T_CityDAO(CurrentUserInfo);
                var cityInfo = cityDao.GetByID(pInstance.CityID);
                if (cityInfo != null)
                {
                    pInstance.Province     = cityInfo.city1_name;
                    pInstance.CityName     = cityInfo.city2_name;
                    pInstance.DistrictName = cityInfo.city3_name;
                }
            }
            if (pReader["Address"] != DBNull.Value)
            {
                pInstance.Address = Convert.ToString(pReader["Address"]);
            }
            if (pReader["IsDefault"] != DBNull.Value)
            {
                pInstance.IsDefault = Convert.ToInt32(pReader["IsDefault"]);
            }
            if (pReader["CreateBy"] != DBNull.Value)
            {
                pInstance.CreateBy = Convert.ToString(pReader["CreateBy"]);
            }
            if (pReader["CreateTime"] != DBNull.Value)
            {
                pInstance.CreateTime = Convert.ToDateTime(pReader["CreateTime"]);
            }
            if (pReader["LastUpdateBy"] != DBNull.Value)
            {
                pInstance.LastUpdateBy = Convert.ToString(pReader["LastUpdateBy"]);
            }
            if (pReader["LastUpdateTime"] != DBNull.Value)
            {
                pInstance.LastUpdateTime = Convert.ToDateTime(pReader["LastUpdateTime"]);
            }
            if (pReader["IsDelete"] != DBNull.Value)
            {
                pInstance.IsDelete = Convert.ToInt32(pReader["IsDelete"]);
            }
        }