Пример #1
0
        /// <summary>
        /// 根据条件获取实体集合
        /// </summary>
        /// <param name="pc">pc</param>
        /// <param name="obc">obc</param>
        /// <returns>实体</returns>
        public List <PhoneLocationInfoModel> RetrieveMultiple(ParameterCollection pc, OrderByCollection obc)
        {
            List <PhoneLocationInfoModel> phonelocationinfos = new List <PhoneLocationInfoModel>();

            PhoneLocationInfoModel phonelocationinfo = new PhoneLocationInfoModel();
            DataTable dt = DbUtil.Current.RetrieveMultiple(phonelocationinfo, pc, obc);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                phonelocationinfo = new PhoneLocationInfoModel();
                phonelocationinfo.ConvertFrom(dt, i);
                phonelocationinfos.Add(phonelocationinfo);
            }

            return(phonelocationinfos);
        }
Пример #2
0
        /// <summary>
        /// 根据主键获取实体
        /// </summary>
        /// <param name="phonecode"></param>
        /// <returns>实体</returns>
        public PhoneLocationInfoModel Retrieve(string phonecode)
        {
            PhoneLocationInfoModel phonelocationinfo = new PhoneLocationInfoModel();

            phonelocationinfo.PhoneCode = phonecode;

            DataTable dt = DbUtil.Current.Retrieve(phonelocationinfo);

            if (dt.Rows.Count < 1)
            {
                return(null);
            }

            phonelocationinfo.ConvertFrom(dt);

            return(phonelocationinfo);
        }