示例#1
0
        /// <summary>
        /// 不带参数的文本查询
        /// </summary>
        /// <param name="cmdText"></param>
        /// <returns></returns>
        public static List <Dictionary <string, object> > GetDataSet(string cmdText)
        {
            List <Dictionary <string, object> > resDics = new List <Dictionary <string, object> >();
            var connDics = new ConnectionHelper().GetOrgConnDic();

            foreach (var dic in connDics)
            {
                Dictionary <string, object> resDic = new Dictionary <string, object>();
                resDic["code"] = dic["code"];
                resDic["name"] = dic["name"];

                ISqlHelper sqlHelper = SqlConvertHelper.GetInstallSqlHelper(dic["connectionstring"]);
                resDic["data"] = sqlHelper.GetDataSet(cmdText);

                resDics.Add(resDic);
            }
            return(resDics);
        }
示例#2
0
        /// <summary>
        /// 获取数据
        /// </summary>
        /// <param name="cmdType"></param>
        /// <param name="cmdText"></param>
        /// <param name="spr"></param>
        /// <returns></returns>
        public static List <OrganizationExecuteResult> GetDataSet(CommandType cmdType, string cmdText, List <SqlParameter> spr)
        {
            List <OrganizationExecuteResult> result = new List <OrganizationExecuteResult>();
            var organizationEntitys = new ConnectionHelper().GetOrganizationEntitys();

            foreach (var organizationEntity in organizationEntitys)
            {
                OrganizationExecuteResult organizationExecuteResult = new OrganizationExecuteResult();
                organizationExecuteResult.Code = organizationEntity.Code;
                organizationExecuteResult.Name = organizationEntity.Name;

                ISqlHelper sqlHelper = SqlConvertHelper.GetInstallSqlHelper(organizationEntity.Connectionstring);
                organizationExecuteResult.Data = sqlHelper.GetDataSet(cmdType, cmdText, spr);

                result.Add(organizationExecuteResult);
            }
            return(result);
        }
 public static DataSet GetDataSet(string strSql)
 {
     return(IHelper.GetDataSet(strSql));
 }