/// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Model.Settings model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Settings(");
            strSql.Append("Name,Value)");
            strSql.Append(" values (");
            strSql.Append("@Name,@Value)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Name",  SqlDbType.NVarChar, 50),
                new SqlParameter("@Value", SqlDbType.NVarChar, 50)
            };
            parameters[0].Value = model.Name;
            parameters[1].Value = model.Value;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(1);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
        //-------------------------------------
        /// <summary>
        ///根据配置的名称 得到一个对象实体
        /// </summary>
        public Model.Settings GetModel(string name)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 Id,Name,Value from Settings ");
            strSql.Append(" where Name=@Name ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Name", SqlDbType.NVarChar, 50)
            };
            parameters[0].Value = name;

            Model.Settings model = new Model.Settings();
            DataSet        ds    = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["Id"].ToString() != "")
                {
                    model.Id = int.Parse(ds.Tables[0].Rows[0]["Id"].ToString());
                }
                model.Name  = ds.Tables[0].Rows[0]["Name"].ToString();
                model.Value = ds.Tables[0].Rows[0]["Value"].ToString();
                return(model);
            }
            else
            {
                return(null);
            }
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(Model.Settings model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Settings set ");
            strSql.Append("Name=@Name,");
            strSql.Append("Value=@Value");
            strSql.Append(" where Id=@Id ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Id",    SqlDbType.Int,       4),
                new SqlParameter("@Name",  SqlDbType.NVarChar, 50),
                new SqlParameter("@Value", SqlDbType.NVarChar, 50)
            };
            parameters[0].Value = model.Id;
            parameters[1].Value = model.Name;
            parameters[2].Value = model.Value;

            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }