public bool ModifyDynamically(int accountId, int dynamicId, string content)
        {
            string sql = "UPDATE tbl_blog_dynamically SET content=@content WHERE acc_id=@aid AND id=@dyId LIMIT 1;";

            int row = db.ExecuteQuery(sql, content, accountId, dynamicId);

            return(row > 0 ? true : false);
        }
        /// <summary>
        /// 设置权限等级
        /// </summary>
        /// <param name="id"></param>
        /// <param name="auth"></param>
        /// <returns></returns>
        public bool SetAuthLevel(int id, byte auth)
        {
            string sql = "UPDATE tbl_account SET auth_level=@auth WHERE account_id=@id LIMIT 1;";
            int    row = db.ExecuteQuery(sql, auth, id);

            return(row > 0 ? true : false);
        }
Exemple #3
0
        /// <summary>
        /// 修改个人信息
        /// </summary>
        /// <param name="modtifyInfo"></param>
        /// <returns></returns>
        public bool ModifyPersonInfo(ModtifyPersonInfoModel modtifyInfo)
        {
            string sql = "UPDATE tbl_account SET sex=@sex , region=@region , profession=@profession , icon_urladdress=@icon , blog_title=@btitle , blog_describe=@describe , blog_guest_msg=@guestMsg WHERE account_id=@id LIMIT 1;";
            int    row = db.ExecuteQuery(sql,
                                         modtifyInfo.sex,
                                         modtifyInfo.region,
                                         modtifyInfo.profession,
                                         modtifyInfo.icon_urladdress,
                                         modtifyInfo.blog_title,
                                         modtifyInfo.blog_describe,
                                         modtifyInfo.blog_guest_msg,
                                         modtifyInfo.account_id);

            return(row > 0 ? true : false);
        }
Exemple #4
0
        public bool PublishDynamically(DynamicallyModel dynamically)
        {
            string sql = "INSERT INTO tbl_blog_dynamically ('acc_id' , 'article_id' , 'sys_type' , 'content' , 'visits' , 'starts' , 'create_datetime' , 'modify_datetime' , 'islock' , 'lock_describe') VALUES(@accid , @articleid , @stype , @content , @visits , @starts , @createtime , @modifytime , @islock , @lockdescribe)";
            int    row = db.ExecuteQuery(sql,
                                         dynamically.acc_id,
                                         dynamically.article_id,
                                         dynamically.sys_type,
                                         dynamically.content,
                                         dynamically.visits,
                                         dynamically.starts,
                                         dynamically.create_datetime,
                                         dynamically.modify_datetime,
                                         dynamically.islock,
                                         dynamically.lock_describe);

            return(row > 0 ? true : false);
        }
Exemple #5
0
        public bool PublishReply(CommentModel comment)
        {
            string sql = "INSERT INTO tbl_blog_comment ('article_id' , 'feature_type' , 'parent_id' , 'comment_content' , 'comment_user_id' , 'comment_user_name' , 'user_id' , 'user_name' , 'ip_address' , 'region_name' , 'starts' , 'create_datetime' , 'isreview') VALUES(@articleId , @featureType ,@parentId ,@content ,@cuserId ,@cuserName ,@uid ,@uName ,@ip ,@region ,@starts ,@ctime ,@review);";

            int row = db.ExecuteQuery(sql,
                                      comment.article_id,
                                      comment.feature_type,
                                      comment.parent_id,
                                      comment.comment_content,
                                      comment.comment_user_id,
                                      comment.comment_user_name,
                                      comment.user_id,
                                      comment.user_name,
                                      comment.ip_address,
                                      comment.region_name,
                                      comment.starts,
                                      comment.create_datetime,
                                      comment.isreview);

            return(row > 0 ? true : false);
        }
Exemple #6
0
        /// <summary>
        /// 注册账户
        /// </summary>
        /// <param name="accountInfo"></param>
        /// <returns></returns>
        public bool RegisterAccount(AccountInfoModel accountInfo)
        {
            string sql = "INSERT INTO tbl_account ('user_name','password','sex','auth_level','region','profession','icon_urladdress','blog_title','blog_describe','blog_guest_msg','mobile','register_datetime','islock','lock_describe') VALUES(@uname,@pwd,@sex,@auth,@region,@profession,@icon,@title,@describe,@guestmsg,@mobile,@regdate,@islock,@lockdescribe)";

            int row = db.ExecuteQuery(sql,
                                      accountInfo.user_name,
                                      accountInfo.password,
                                      accountInfo.sex,
                                      accountInfo.auth_level,
                                      accountInfo.region,
                                      accountInfo.profession,
                                      accountInfo.icon_urladdress,
                                      accountInfo.blog_title,
                                      accountInfo.blog_describe,
                                      accountInfo.blog_guest_msg,
                                      accountInfo.mobile,
                                      accountInfo.register_datetime,
                                      accountInfo.islock,
                                      accountInfo.lock_describe);

            return(row > 0 ? true : false);
        }