Esempio n. 1
0
        /// <summary>
        /// 得到一个对象实体 GetModelById(int id)
        /// </summary>
        public PhotoInfo GetModelById(int id)
        {
            var strSql = new StringBuilder();

            strSql.Append("select Id, Guid, Name, Tag, Image_Url, Image_Key, User_Guid, Album_Guid, Create_time, Is_Cover ");
            strSql.Append("  from XSBlog_Photo ");
            strSql.Append(" where ");
            strSql.Append(" Id = @Id  ");

            DbParameter[] parameters =
            {
                SqlHelper.MakeInParam("@Id", (DbType)SqlDbType.Int, id)
            };

            return(SqlMethodHelper.FindOne(strSql.ToString(), ReaderBind, parameters));
        }
Esempio n. 2
0
        /// <summary>
        /// 得到一个对象实体 GetModel(Guid Guid)
        /// </summary>
        public UserInfo GetModel(string guid)
        {
            var strSql = new StringBuilder();

            strSql.Append("select Id, Guid, Name, Tag, Login_Name, Login_Pwd, Email  ");
            strSql.Append("  from XSBlog_User ");
            strSql.Append(" where ");
            strSql.Append(" Guid = @Guid  ");

            DbParameter[] parameters =
            {
                SqlHelper.MakeInParam("@Guid", (DbType)SqlDbType.UniqueIdentifier, ConvertHelper.GetGuid(guid))
            };

            return(SqlMethodHelper.FindOne(strSql.ToString(), ReaderBind, parameters));
        }
Esempio n. 3
0
        /// <summary>
        /// 得到一个对象实体 GetModel(Guid Guid)
        /// </summary>
        public MoodInfo GetModel(string guid)
        {
            var strSql = new StringBuilder();

            strSql.Append("select Id, Guid, Name, Content, Create_Time, Blog_Guid, User_Guid  ");
            strSql.Append("  from XSBlog_Mood ");
            strSql.Append(" where ");
            strSql.Append(" Guid = @Guid  ");

            DbParameter[] parameters =
            {
                SqlHelper.MakeInParam("@Guid", (DbType)SqlDbType.UniqueIdentifier, ConvertHelper.GetGuid(guid))
            };

            return(SqlMethodHelper.FindOne(strSql.ToString(), ReaderBind, parameters));
        }
Esempio n. 4
0
        /// <summary>
        /// 得到一个对象实体 GetModel(Guid Guid)
        /// </summary>
        public PhotoInfo GetModel(string guid)
        {
            var strSql = new StringBuilder();

            strSql.Append("select Id, Guid, Name, Tag, Image_Url, Image_Key, User_Guid, Album_Guid, Create_time, Is_Cover  ");
            strSql.Append("  from XSBlog_Photo ");
            strSql.Append(" where ");
            strSql.Append(" Guid = @Guid  ");

            DbParameter[] parameters =
            {
                SqlHelper.MakeInParam("@Guid", (DbType)SqlDbType.UniqueIdentifier, ConvertHelper.GetGuid(guid))
            };

            return(SqlMethodHelper.FindOne(strSql.ToString(), ReaderBind, parameters));
        }
Esempio n. 5
0
        /// <summary>
        /// 得到一个对象实体 GetModelById(int categoryId)
        /// </summary>
        public CategoryInfo GetModelById(int categoryId)
        {
            var strSql = new StringBuilder();

            strSql.Append("select Id, Guid, Name ,Order_Id, Blog_Guid, User_Guid, Image_Url, Image_Key, Parent_Guid ");
            strSql.Append("  from XSBlog_Category ");
            strSql.Append(" where ");
            strSql.Append(" Id = @Id  ");

            DbParameter[] parameters =
            {
                SqlHelper.MakeInParam("@Id", (DbType)SqlDbType.Int, categoryId)
            };

            return(SqlMethodHelper.FindOne(strSql.ToString(), ReaderBind, parameters));
        }
Esempio n. 6
0
        /// <summary>
        /// 得到一个对象实体 GetModel(Guid Guid)
        /// </summary>
        public CategoryInfo GetModel(string guid)
        {
            var strSql = new StringBuilder();

            strSql.Append("select Id, Guid, Name ,Order_Id, Blog_Guid, User_Guid, Image_Url, Image_Key, Parent_Guid ");
            strSql.Append("  from XSBlog_Category ");
            strSql.Append(" where ");
            strSql.Append(" Guid = @Guid  ");

            DbParameter[] parameters =
            {
                SqlHelper.MakeInParam("@Guid", (DbType)SqlDbType.UniqueIdentifier, ConvertHelper.GetGuid(guid))
            };

            return(SqlMethodHelper.FindOne(strSql.ToString(), ReaderBind, parameters));
        }
Esempio n. 7
0
        /// <summary>
        /// 得到一个对象实体 GetModel(Guid Guid)
        /// </summary>
        public BlogInfo GetModel(string guid)
        {
            var strSql = new StringBuilder();

            strSql.Append("select Id, Guid, Name, Tag, Order  ");
            strSql.Append("  from XSBlog_Blog ");
            strSql.Append(" where ");
            strSql.Append(" Guid = @Guid  ");

            DbParameter[] parameters =
            {
                SqlHelper.MakeInParam("@Guid", (DbType)SqlDbType.VarChar, ConvertHelper.GetGuid(guid))
            };

            return(SqlMethodHelper.FindOne(strSql.ToString(), ReaderBind, parameters));
        }
Esempio n. 8
0
        /// <summary>
        /// 得到一个对象实体 GetModelById(int id)
        /// </summary>
        public AlbumInfo GetModelById(int id)
        {
            var strSql = new StringBuilder();

            strSql.Append("select Id, Guid, Name, Blog_Guid, User_Guid, Create_Time,Order_Id ");
            strSql.Append("  from XSBlog_Album ");
            strSql.Append(" where ");
            strSql.Append(" Id = @Id  ");

            DbParameter[] parameters =
            {
                SqlHelper.MakeInParam("@Id", (DbType)SqlDbType.Int, id)
            };

            return(SqlMethodHelper.FindOne(strSql.ToString(), ReaderBind, parameters));
        }
Esempio n. 9
0
        /// <summary>
        /// 得到一个对象实体 GetModelById(int id)
        /// </summary>
        public DailyInfo GetModelById(int id)
        {
            var strSql = new StringBuilder();

            strSql.Append("select Id, Guid, Name, Content, Create_Time, Blog_Guid, User_Guid, Category_Guid, Is_Draft, Is_Stick, Is_Home, Is_Special, Page_View, Comments_Num  ");
            strSql.Append("  from XSBlog_Daily ");
            strSql.Append(" where ");
            strSql.Append(" Id = @Id  ");

            DbParameter[] parameters =
            {
                SqlHelper.MakeInParam("@Id", (DbType)SqlDbType.Int, id)
            };

            return(SqlMethodHelper.FindOne(strSql.ToString(), ReaderBind, parameters));
        }