Exemple #1
0
        /// <summary>
        ///  得到对象列表
        /// </summary>
        /// <typeparam name="T"> 对象类</typeparam>
        /// <param name="str_Condition">条件</param>
        /// <returns>对象列表</returns>
        public List <T> getObjectListByCondition <T>(string str_Condition)
        {
            this.strDsJson = "";
            // 得到数据集
            DataSet ds = Item_db.GetDataSetByCondition(this.tablename, this.lst_colId, str_Condition);

            // 数据集转Json
            if (!(ds == null || ds.Tables.Count == 0))
            {
                strDsJson = Angel_DataJson.dataSet2Json(ds);
            }
            // 去掉Json串中的表名
            // string strMatch = @"^{.*?:";
            Regex rx = new Regex(@"^{.*?:", RegexOptions.IgnoreCase | RegexOptions.Multiline);

            if (rx.IsMatch(strDsJson))
            {
                strDsJson = rx.Replace(strDsJson, "");
            }

            return(Angel_DataJson.json2ObjList <T>(strDsJson));
        }