예제 #1
0
파일: iController.cs 프로젝트: ud223/jx
        public virtual void delete(string id)
        {
            DatabaseLib.DatabaseFactory dataFactory = new DatabaseLib.DatabaseFactory();
            DatabaseLib.Tools tools = new DatabaseLib.Tools();

            //获取数据访问操作端
            DatabaseLib.IDatabase dataClient = dataFactory.CreateClient(BaseLib.SystemType.Web);

            string strSql = this.SqlText + id;

            strSql = tools.fixSqlText(strSql);

            dataClient.SqlText = strSql;

            dataClient.Execute(CommandType.Text);

            this.Message = dataClient.Message;
            this.Result = dataClient.Result;
        }
예제 #2
0
파일: iController.cs 프로젝트: ud223/jx
        /// <summary>
        /// 合并模板sql语句和数据为执行sql语句
        /// </summary>
        /// <param name="strSql">模板sql语句</param>
        /// <param name="data">hashtable类型的数据集合</param>
        /// <returns>执行的sql语句字符串</returns>
        public string extendSql(string strSql, System.Collections.Hashtable data)
        {
            DatabaseLib.Tools tools = new DatabaseLib.Tools();

            foreach (System.Collections.DictionaryEntry item in data)
            {
                string strKey = "@" + item.Key + "@";
                string strValue = item.Value.ToString();

                strSql = strSql.Replace(strKey, strValue);
            }

            strSql = tools.fixSqlText(strSql);

            return strSql;
        }