/// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(HeqiaoDaoshiCore.Model.AttractRanking model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update AttractRanking set ");
            strSql.Append("UserUuid=@UserUuid,");
            strSql.Append("SceientUuid=@SceientUuid,");
            strSql.Append("Picture=@Picture,");
            strSql.Append("State=@State,");
            strSql.Append("Evaluate=@Evaluate");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@UserUuid",           SqlDbType.UniqueIdentifier, 16),
                new SqlParameter("@SceientUuid",        SqlDbType.UniqueIdentifier, 16),
                new SqlParameter("@Picture",            SqlDbType.NVarChar,         -1),
                new SqlParameter("@State",              SqlDbType.Int,               4),
                new SqlParameter("@Evaluate",           SqlDbType.NVarChar,         -1),
                new SqlParameter("@ID",                 SqlDbType.Int,               4),
                new SqlParameter("@AttractRankingUuid", SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value = model.UserUuid;
            parameters[1].Value = model.SceientUuid;
            parameters[2].Value = model.Picture;
            parameters[3].Value = model.State;
            parameters[4].Value = model.Evaluate;
            parameters[5].Value = model.ID;
            parameters[6].Value = model.AttractRankingUuid;

            int rows = DbHelperSql.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public HeqiaoDaoshiCore.Model.AttractRanking DataRowToModel(DataRow row)
 {
     HeqiaoDaoshiCore.Model.AttractRanking model = new HeqiaoDaoshiCore.Model.AttractRanking();
     if (row != null)
     {
         if (row["ID"] != null && row["ID"].ToString() != "")
         {
             model.ID = int.Parse(row["ID"].ToString());
         }
         if (row["AttractRankingUuid"] != null && row["AttractRankingUuid"].ToString() != "")
         {
             model.AttractRankingUuid = new Guid(row["AttractRankingUuid"].ToString());
         }
         if (row["UserUuid"] != null && row["UserUuid"].ToString() != "")
         {
             model.UserUuid = new Guid(row["UserUuid"].ToString());
         }
         if (row["SceientUuid"] != null && row["SceientUuid"].ToString() != "")
         {
             model.SceientUuid = new Guid(row["SceientUuid"].ToString());
         }
         if (row["Picture"] != null)
         {
             model.Picture = row["Picture"].ToString();
         }
         if (row["State"] != null && row["State"].ToString() != "")
         {
             model.State = int.Parse(row["State"].ToString());
         }
         if (row["Evaluate"] != null)
         {
             model.Evaluate = row["Evaluate"].ToString();
         }
     }
     return(model);
 }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(HeqiaoDaoshiCore.Model.AttractRanking model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into AttractRanking(");
            strSql.Append("AttractRankingUuid,UserUuid,SceientUuid,Picture,State,Evaluate)");
            strSql.Append(" values (");
            strSql.Append("@AttractRankingUuid,@UserUuid,@SceientUuid,@Picture,@State,@Evaluate)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@AttractRankingUuid", SqlDbType.UniqueIdentifier, 16),
                new SqlParameter("@UserUuid",           SqlDbType.UniqueIdentifier, 16),
                new SqlParameter("@SceientUuid",        SqlDbType.UniqueIdentifier, 16),
                new SqlParameter("@Picture",            SqlDbType.NVarChar,         -1),
                new SqlParameter("@State",              SqlDbType.Int,               4),
                new SqlParameter("@Evaluate",           SqlDbType.NVarChar, -1)
            };
            parameters[0].Value = Guid.NewGuid();
            parameters[1].Value = Guid.NewGuid();
            parameters[2].Value = Guid.NewGuid();
            parameters[3].Value = model.Picture;
            parameters[4].Value = model.State;
            parameters[5].Value = model.Evaluate;

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

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public HeqiaoDaoshiCore.Model.AttractRanking GetModel(int ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 ID,AttractRankingUuid,UserUuid,SceientUuid,Picture,State,Evaluate from AttractRanking ");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID", SqlDbType.Int, 4)
            };
            parameters[0].Value = ID;

            HeqiaoDaoshiCore.Model.AttractRanking model = new HeqiaoDaoshiCore.Model.AttractRanking();
            DataSet ds = DbHelperSql.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }