/// <summary>检查参数是否存在</summary> /// <param name="varname">参数名</param> /// <returns></returns> private bool IsExist(string varname) { string strSql = "select * from sysconfig where varname='" + varname + "'"; int iCount = StaticValue.SelectTable(strSql).Rows.Count; if (iCount == 0) { return(false); //不存在 } return(true); //存在 }
/// <summary>系统参数设置。</summary> /// <param name="varname">参数名</param> public SystemConfig(int index, string varname) { if (!this.IsExist(varname)) { this.Initialize(); this.Insert(index); } string strSql = "select * from sysconfig where varname='" + varname + "'"; DataRow objRow = StaticValue.SelectTable(strSql).Rows[0]; this.VarIndex = int.Parse(objRow["varindex"].ToString()); this.VarName = objRow["varname"].ToString(); this.VarType = objRow["vartype"].ToString(); this.VarValue = objRow["varvalue"].ToString(); this.VarInfo = objRow["varinfo"].ToString(); }