示例#1
0
        /// <summary>
        /// 修改NotifyInfo
        /// </summary>
        /// <param name="notify"></param>
        /// <returns></returns>
        public static int UpdateNotify(NotifyInfo notify)
        {
            string sql = @"UPDATE  [Notify] SET 
						FromUserId=@FromUserId,
						ToUserId=@ToUserId,
						CreateTime=@CreateTime,
						IsDelete=@IsDelete,
						IsRead=@IsRead,
						IsSystem=@IsSystem,
						Content=@Content,
						Title=@Title
 WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", notify.Id, DbType.Int64);
            par.Add("@FromUserId", notify.FromUserId, DbType.Int32);
            par.Add("@ToUserId", notify.ToUserId, DbType.Int32);
            par.Add("@CreateTime", notify.CreateTime, DbType.DateTime);
            par.Add("@IsDelete", notify.IsDelete, DbType.Boolean);
            par.Add("@IsRead", notify.IsRead, DbType.Boolean);
            par.Add("@IsSystem", notify.IsSystem, DbType.Boolean);
            par.Add("@Content", notify.Content, DbType.String);
            par.Add("@Title", notify.Title, DbType.String);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#2
0
        /// <summary>
        /// 修改AdminLogInfo
        /// </summary>
        /// <param name="adminlog"></param>
        /// <returns></returns>
        public static int UpdateAdminLog(AdminLogInfo adminlog)
        {
            string sql = @"UPDATE  [AdminLog] SET 
						UserId=@UserId,
						Controllers=@Controllers,
						Action=@Action,
						Parameter=@Parameter,
						ActionId=@ActionId,
						Ip=@Ip,
						Url=@Url,
						InTime=@InTime,
						Method=@Method,
						IsAjax=@IsAjax,
						UserAgent=@UserAgent,
						ControllersDsc=@ControllersDsc,
						ActionDsc=@ActionDsc
 WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", adminlog.Id, DbType.Int32);
            par.Add("@UserId", adminlog.UserId, DbType.Int64);
            par.Add("@Controllers", adminlog.Controllers, DbType.AnsiString);
            par.Add("@Action", adminlog.Action, DbType.AnsiString);
            par.Add("@Parameter", adminlog.Parameter, DbType.AnsiString);
            par.Add("@ActionId", adminlog.ActionId, DbType.AnsiString);
            par.Add("@Ip", adminlog.Ip, DbType.AnsiString);
            par.Add("@Url", adminlog.Url, DbType.AnsiString);
            par.Add("@InTime", adminlog.InTime, DbType.DateTime);
            par.Add("@Method", adminlog.Method, DbType.AnsiString);
            par.Add("@IsAjax", adminlog.IsAjax, DbType.Int32);
            par.Add("@UserAgent", adminlog.UserAgent, DbType.AnsiString);
            par.Add("@ControllersDsc", adminlog.ControllersDsc, DbType.String);
            par.Add("@ActionDsc", adminlog.ActionDsc, DbType.String);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#3
0
        /// <summary>
        /// 修改SendMailLogInfo
        /// </summary>
        /// <param name="sendmaillog"></param>
        /// <returns></returns>
        public static int UpdateSendMailLog(SendMailLogInfo sendmaillog)
        {
            string sql = @"UPDATE  [SendMailLog] SET 
						UserId=@UserId,
						SendUserId=@SendUserId,
						TemplateId=@TemplateId,
						ToEmail=@ToEmail,
						FromEmail=@FromEmail,
						Status=@Status,
						Title=@Title,
						Body=@Body,
						Ip=@Ip,
						IsSystem=@IsSystem,
						CreateTime=@CreateTime
 WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", sendmaillog.Id, DbType.Int64);
            par.Add("@UserId", sendmaillog.UserId, DbType.Int32);
            par.Add("@SendUserId", sendmaillog.SendUserId, DbType.Int32);
            par.Add("@TemplateId", sendmaillog.TemplateId, DbType.Int32);
            par.Add("@ToEmail", sendmaillog.ToEmail, DbType.AnsiString);
            par.Add("@FromEmail", sendmaillog.FromEmail, DbType.AnsiString);
            par.Add("@Status", sendmaillog.Status, DbType.Int16);
            par.Add("@Title", sendmaillog.Title, DbType.String);
            par.Add("@Body", sendmaillog.Body, DbType.AnsiString);
            par.Add("@Ip", sendmaillog.Ip, DbType.AnsiString);
            par.Add("@IsSystem", sendmaillog.IsSystem, DbType.Boolean);
            par.Add("@CreateTime", sendmaillog.CreateTime, DbType.DateTime);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#4
0
        /// <summary>
        /// 修改ArticleInfo
        /// </summary>
        /// <param name="article"></param>
        /// <returns></returns>
        public static int UpdateArticle(ArticleInfo article)
        {
            string sql = @"UPDATE  [Article] SET 
						Title=@Title,
						Content=@Content,
						Type=@Type,
						CommentNum=@CommentNum,
						Dot=@Dot,
						CreateTime=@CreateTime,
						UserId=@UserId,
						ImgNum=@ImgNum,
						AttachmentNum=@AttachmentNum,
						LastEditUserId=@LastEditUserId,
                        LastEditTime=GETDATE()
 WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", article.Id, DbType.Int32);
            par.Add("@Title", article.Title, DbType.String);
            par.Add("@Content", article.Content, DbType.AnsiString);
            par.Add("@Type", article.Type, DbType.Int32);
            par.Add("@CommentNum", article.CommentNum, DbType.Int32);
            par.Add("@Dot", article.Dot, DbType.Int32);
            par.Add("@CreateTime", article.CreateTime, DbType.DateTime);
            par.Add("@UserId", article.UserId, DbType.Int32);
            par.Add("@ImgNum", article.ImgNum, DbType.Int32);
            par.Add("@AttachmentNum", article.AttachmentNum, DbType.Int32);
            par.Add("@LastEditUserId", article.LastEditUserId, DbType.Int32);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#5
0
        /// <summary>
        /// 修改ModulInfo
        /// </summary>
        /// <param name="modul"></param>
        /// <returns></returns>
        public static int UpdateModul(ModulInfo modul)
        {
            string sql = @"UPDATE  [Modul] SET 
						ModulName=@ModulName,
						Controller=@Controller,
						Action=@Action,
						Description=@Description,
						CreateTime=@CreateTime,
						PId=@PId,
						OrderId=@OrderId,
						IsShow=@IsShow,
						Priority=@Priority,
						IsDisplay=@IsDisplay,
						Ico=@Ico
 WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", modul.Id, DbType.Int32);
            par.Add("@ModulName", modul.ModulName, DbType.String);
            par.Add("@Controller", modul.Controller, DbType.AnsiString);
            par.Add("@Action", modul.Action, DbType.AnsiString);
            par.Add("@Description", modul.Description, DbType.String);
            par.Add("@CreateTime", modul.CreateTime, DbType.DateTime);
            par.Add("@PId", modul.PId, DbType.Int32);
            par.Add("@OrderId", modul.OrderId, DbType.Int32);
            par.Add("@IsShow", modul.IsShow, DbType.Boolean);
            par.Add("@Priority", modul.Priority, DbType.Int32);
            par.Add("@IsDisplay", modul.IsDisplay, DbType.Boolean);
            par.Add("@Ico", modul.Ico, DbType.AnsiString);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#6
0
        /// <summary>
        /// 修改CommentInfo
        /// </summary>
        /// <param name="comment"></param>
        /// <returns></returns>
        public static int UpdateComment(CommentInfo comment)
        {
            string sql = @"UPDATE  [Comment] SET 
						AId=@AId,
						UserId=@UserId,
						CreateTime=@CreateTime,
						Content=@Content,
						IP=@IP,
						UserAgent=@UserAgent,
						State=@State,
						RefuseReason=@RefuseReason,
						IsDelete=@IsDelete,
						LastEditUserId=@LastEditUserId,
						LastEditTime=@LastEditTime,
						IsStick=@IsStick,
						DianZanNum=@DianZanNum
 WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", comment.Id, DbType.Int64);
            par.Add("@AId", comment.AId, DbType.Int64);
            par.Add("@UserId", comment.UserId, DbType.Int32);
            par.Add("@CreateTime", comment.CreateTime, DbType.Date);
            par.Add("@Content", comment.Content, DbType.String);
            par.Add("@IP", comment.IP, DbType.AnsiString);
            par.Add("@UserAgent", comment.UserAgent, DbType.AnsiString);
            par.Add("@State", comment.State, DbType.Int16);
            par.Add("@RefuseReason", comment.RefuseReason, DbType.String);
            par.Add("@IsDelete", comment.IsDelete, DbType.Boolean);
            par.Add("@LastEditUserId", comment.LastEditUserId, DbType.Int32);
            par.Add("@LastEditTime", comment.LastEditTime, DbType.DateTime);
            par.Add("@IsStick", comment.IsStick, DbType.Boolean);
            par.Add("@DianZanNum", comment.DianZanNum, DbType.Int32);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#7
0
        /// <summary>
        /// 修改ArticleTypeInfo
        /// </summary>
        /// <param name="articletype"></param>
        /// <returns></returns>
        public static int UpdateArticleType(ArticleTypeInfo articletype)
        {
            string sql = @"UPDATE  [ArticleType] SET 
						Name=@Name,
						PId=@PId,
						Sort=@Sort,
						PinYin=@PinYin,
						IsHomeMenu=@IsHomeMenu,
						CreateTime=@CreateTime,
						Ico=@Ico,
						IsShow=@IsShow
 WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", articletype.Id, DbType.Int32);
            par.Add("@Name", articletype.Name, DbType.AnsiString);
            par.Add("@PId", articletype.PId, DbType.Int32);
            par.Add("@Sort", articletype.Sort, DbType.Int32);
            par.Add("@PinYin", articletype.PinYin, DbType.AnsiString);
            par.Add("@IsHomeMenu", articletype.IsHomeMenu, DbType.Boolean);
            par.Add("@CreateTime", articletype.CreateTime, DbType.DateTime);
            par.Add("@Ico", articletype.Ico, DbType.AnsiString);
            par.Add("@IsShow", articletype.IsShow, DbType.Boolean);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#8
0
        /// <summary>
        /// 修改DianZanLogInfo
        /// </summary>
        /// <param name="dianzanlog"></param>
        /// <returns></returns>
        public static int UpdateDianZanLog(DianZanLogInfo dianzanlog)
        {
            string sql = @"UPDATE  [DianZanLog] SET 
						MId=@MId,
						CId=@CId,
						UserId=@UserId,
						Ip=@Ip,
						IsCancel=@IsCancel,
						CancelTime=@CancelTime,
						Type=@Type,
						CreateTime=@CreateTime
 WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", dianzanlog.Id, DbType.Int64);
            par.Add("@MId", dianzanlog.MId, DbType.Int64);
            par.Add("@CId", dianzanlog.CId, DbType.Int64);
            par.Add("@UserId", dianzanlog.UserId, DbType.Int32);
            par.Add("@Ip", dianzanlog.Ip, DbType.AnsiString);
            par.Add("@IsCancel", dianzanlog.IsCancel, DbType.Boolean);
            par.Add("@CancelTime", dianzanlog.CancelTime, DbType.DateTime);
            par.Add("@Type", dianzanlog.Type, DbType.Int16);
            par.Add("@CreateTime", dianzanlog.CreateTime, DbType.DateTime);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#9
0
        /// <summary>
        /// 修改EmailTemplateInfo
        /// </summary>
        /// <param name="emailtemplate"></param>
        /// <returns></returns>
        public static int UpdateEmailTemplate(EmailTemplateInfo emailtemplate)
        {
            string sql = @"UPDATE  [EmailTemplate] SET 
						Title=@Title,
						Template=@Template,
						ValueIdentifier=@ValueIdentifier,
						Explanation=@Explanation,
						IsSystem=@IsSystem,
						IsHtml=@IsHtml,
						CreateTime=@CreateTime,
						UserId=@UserId,
						LastEditUserId=@LastEditUserId,
						LastEditTime=@LastEditTime
 WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", emailtemplate.Id, DbType.Int32);
            par.Add("@Title", emailtemplate.Title, DbType.String);
            par.Add("@Template", emailtemplate.Template, DbType.AnsiString);
            par.Add("@ValueIdentifier", emailtemplate.ValueIdentifier, DbType.String);
            par.Add("@Explanation", emailtemplate.Explanation, DbType.String);
            par.Add("@IsSystem", emailtemplate.IsSystem, DbType.Boolean);
            par.Add("@IsHtml", emailtemplate.IsHtml, DbType.Boolean);
            par.Add("@CreateTime", emailtemplate.CreateTime, DbType.DateTime);
            par.Add("@UserId", emailtemplate.UserId, DbType.Int32);
            par.Add("@LastEditUserId", emailtemplate.LastEditUserId, DbType.Int32);
            par.Add("@LastEditTime", emailtemplate.LastEditTime, DbType.DateTime);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#10
0
        /// <summary>
        /// 修改UserAccessLogInfo
        /// </summary>
        /// <param name="useraccesslog"></param>
        /// <returns></returns>
        public static int UpdateUserAccessLog(UserAccessLogInfo useraccesslog)
        {
            string sql = @"UPDATE  [UserAccessLog] SET 
						Url=@Url,
						Referer=@Referer,
						UserAgent=@UserAgent,
						UserId=@UserId,
						Ip=@Ip,
						InsertTime=@InsertTime,
						Other=@Other,
						Type=@Type
 WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", useraccesslog.Id, DbType.Int64);
            par.Add("@Url", useraccesslog.Url, DbType.AnsiString);
            par.Add("@Referer", useraccesslog.Referer, DbType.AnsiString);
            par.Add("@UserAgent", useraccesslog.UserAgent, DbType.AnsiString);
            par.Add("@UserId", useraccesslog.UserId, DbType.Int32);
            par.Add("@Ip", useraccesslog.Ip, DbType.AnsiString);
            par.Add("@InsertTime", useraccesslog.InsertTime, DbType.DateTime);
            par.Add("@Other", useraccesslog.Other, DbType.String);
            par.Add("@Type", useraccesslog.Type, DbType.Int16);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#11
0
        /// <summary>
        /// 根据id删除AdminLog
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static Int32 DeleteAdminLog(int id)
        {
            string sql = "DELETE [AdminLog] WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", id, DbType.Int32);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#12
0
        /// <summary>
        /// 根据id删除UserActivateToken
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static Int32 DeleteUserActivateToken(long id)
        {
            string sql = "DELETE [UserActivateToken] WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", id, DbType.Int64);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#13
0
        /// <summary>
        /// 根据userid删除UserOther
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        public static Int32 DeleteUserOther(int userid)
        {
            string sql = "DELETE [UserOther] WHERE UserId=@UserId";
            var    par = new DynamicParameters();

            par.Add("@UserId", userid, DbType.Int32);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#14
0
文件: Users.cs 项目: szp11/HGShareBBS
        /// <summary>
        /// 更新用户最后在线时间、用户最后操作时间
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static int UpdateActionTimeAndOnLineTime(int id)
        {
            string sql = "UPDATE [User] SET OnLineTime=GETDATE(),ActionTime=GETDATE() WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", id, DbType.Int32);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#15
0
        /// <summary>
        /// 根据rid删除RoleModul多条记录
        /// </summary>
        /// <param name="rid"></param>
        /// <returns></returns>
        public static Int32 DeleteRoleModuls(int rid)
        {
            string sql = "DELETE [Role_Modul] WHERE RId=@RId";
            var    par = new DynamicParameters();

            par.Add("@RId", rid, DbType.Int32);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#16
0
文件: Users.cs 项目: szp11/HGShareBBS
        /// <summary>
        /// 更新用户密码
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public static int UpdatePassword(int userId, string password)
        {
            string sql = "UPDATE [User] SET Password=@Password WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", userId, DbType.Int32);
            par.Add("@Password", password, DbType.String);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#17
0
文件: Users.cs 项目: szp11/HGShareBBS
        /// <summary>
        /// 更新用户文章数
        /// </summary>
        /// <param name="id"></param>
        /// <param name="num">+1/-1</param>
        /// <returns></returns>
        public static int UpdateArticleNum(int id, int num)
        {
            const string sql = "UPDATE [User] SET ArticleNum=ArticleNum+@Num WHERE Id=@Id";
            var          par = new DynamicParameters();

            par.Add("@Id", id, DbType.Int32);
            par.Add("@Num", num, DbType.Int32);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#18
0
文件: Users.cs 项目: szp11/HGShareBBS
        /// <summary>
        /// 更新用户头像
        /// </summary>
        /// <param name="id"></param>
        /// <param name="avatar"></param>
        /// <returns></returns>
        public static int UpdateAvatar(int id, string avatar)
        {
            string sql = "UPDATE [User] SET Avatar=@Avatar WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Avatar", avatar, DbType.String);
            par.Add("@Id", id, DbType.Int32);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#19
0
文件: Users.cs 项目: szp11/HGShareBBS
        /// <summary>
        /// 更新用户邮箱激活状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="emailStatus"></param>
        /// <returns></returns>
        public static bool UpdateEmailStatus(int id, bool emailStatus)
        {
            const string sql = "UPDATE [User] SET EmailStatus=@EmailStatus WHERE Id=@Id";
            var          par = new DynamicParameters();

            par.Add("@Id", id, DbType.Int32);
            par.Add("@EmailStatus", emailStatus, DbType.Boolean);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par) > 0);
        }
示例#20
0
        /// <summary>
        /// 点赞数+1/-1
        /// </summary>
        /// <param name="aId"></param>
        /// <param name="num">+1/-1</param>
        /// <returns></returns>
        public static int UpdateDianZanNum(long aId, int num)
        {
            const string sql = @"UPDATE [Article] SET DianZanNum=DianZanNum+@Num WHERE Id=@Id";
            var          par = new DynamicParameters();

            par.Add("@Id", aId, DbType.Int32);
            par.Add("@Num", num, DbType.Int32);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#21
0
文件: Users.cs 项目: szp11/HGShareBBS
        /// <summary>
        /// 更新用户密码
        /// </summary>
        /// <param name="email"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public static int UpdatePasswordByEmail(string email, string password)
        {
            string sql = "UPDATE [User] SET Password=@Password WHERE Email=@Email";
            var    par = new DynamicParameters();

            par.Add("@Email", email, DbType.String);
            par.Add("@Password", password, DbType.String);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#22
0
        /// <summary>
        /// 修改 Status 为无效
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public static bool UpdateStatusToFalseByUserId(int userId)
        {
            string sql = @"UPDATE  [UserActivateToken] SET 
						Status=0
                        WHERE UserId=@UserId AND Status=1";
            var    par = new DynamicParameters();

            par.Add("@UserId", userId, DbType.Int32);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par) > 0);
        }
示例#23
0
文件: Users.cs 项目: szp11/HGShareBBS
        /// <summary>
        /// 更新用户禁用状态
        /// </summary>
        /// <param name="id">用户id</param>
        /// <param name="disable">是否禁用</param>
        /// <param name="disableReason">原因</param>
        /// <returns></returns>
        public static bool UpdateDisable(int id, bool disable, string disableReason = null)
        {
            const string sql = "UPDATE [User] SET Disable=@Disable,DisableReason=@DisableReason WHERE Id=@Id";
            var          par = new DynamicParameters();

            par.Add("@Id", id, DbType.Int32);
            par.Add("@Disable", disable, DbType.Boolean);
            par.Add("@DisableReason", disableReason, DbType.String);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par) > 0);
        }
示例#24
0
        /// <summary>
        /// 修改评论点赞数
        /// </summary>
        /// <param name="id"></param>
        /// <param name="num">+-1</param>
        /// <returns></returns>
        public static bool UpdateDianZanNum(long id, int num)
        {
            string sql = @"UPDATE  [Comment] SET 
						DianZanNum=DianZanNum+@DianZanNum
                            WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", id, DbType.Int64);
            par.Add("@DianZanNum", num, DbType.Int32);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par) > 0);
        }
示例#25
0
        /// <summary>
        /// 修改UserOtherInfo
        /// </summary>
        /// <param name="userother"></param>
        /// <returns></returns>
        public static int UpdateUserOther(UserOtherInfo userother)
        {
            string sql = @"UPDATE  [UserOther] SET 
						PersonalityIntroduce=@PersonalityIntroduce
 WHERE UserId=@UserId";
            var    par = new DynamicParameters();

            par.Add("@UserId", userother.UserId, DbType.Int32);
            par.Add("@PersonalityIntroduce", userother.PersonalityIntroduce, DbType.String);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#26
0
        /// <summary>
        /// 修改 Status
        /// </summary>
        /// <param name="id"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        public static bool UpdateStatus(long id, bool status)
        {
            string sql = @"UPDATE  [UserActivateToken] SET 
						Status=@Status
                        WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", id, DbType.Int32);
            par.Add("@Status", status, DbType.Boolean);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par) > 0);
        }
示例#27
0
        /// <summary>
        /// 修改ArticleInfo
        /// </summary>
        /// <param name="article"></param>
        /// <returns></returns>
        public static int UpdateArticle(ArticleInfo article)
        {
            string sql = @"UPDATE  [Article] SET 
						Title=@Title,
						Content=@Content,
						Type=@Type,
						CommentNum=@CommentNum,
						Dot=@Dot,
						CreateTime=@CreateTime,
						UserId=@UserId,
						ImgNum=@ImgNum,
						AttachmentNum=@AttachmentNum,
						LastEditUserId=@LastEditUserId,
						LastEditTime=@LastEditTime,
						Guid=@Guid,
						IsDelete=@IsDelete,
						State=@State,
						RefuseReason=@RefuseReason,
						BType=@BType,
						DianZanNum=@DianZanNum,
						Score=@Score,
						IsStick=@IsStick,
						IsJiaJing=@IsJiaJing,
						IsCloseComment=@IsCloseComment,
						CloseCommentReason=@CloseCommentReason
 WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", article.Id, DbType.Int64);
            par.Add("@Title", article.Title, DbType.String);
            par.Add("@Content", article.Content, DbType.AnsiString);
            par.Add("@Type", article.Type, DbType.Int32);
            par.Add("@CommentNum", article.CommentNum, DbType.Int32);
            par.Add("@Dot", article.Dot, DbType.Int32);
            par.Add("@CreateTime", article.CreateTime, DbType.DateTime);
            par.Add("@UserId", article.UserId, DbType.Int32);
            par.Add("@ImgNum", article.ImgNum, DbType.Int32);
            par.Add("@AttachmentNum", article.AttachmentNum, DbType.Int32);
            par.Add("@LastEditUserId", article.LastEditUserId, DbType.Int32);
            par.Add("@LastEditTime", article.LastEditTime, DbType.DateTime);
            par.Add("@Guid", article.Guid, DbType.Guid);
            par.Add("@IsDelete", article.IsDelete, DbType.Boolean);
            par.Add("@State", article.State, DbType.Int16);
            par.Add("@RefuseReason", article.RefuseReason, DbType.String);
            par.Add("@BType", article.BType, DbType.Int16);
            par.Add("@DianZanNum", article.DianZanNum, DbType.Int32);
            par.Add("@Score", article.Score, DbType.Int32);
            par.Add("@IsStick", article.IsStick, DbType.Boolean);
            par.Add("@IsJiaJing", article.IsJiaJing, DbType.Boolean);
            par.Add("@IsCloseComment", article.IsCloseComment, DbType.Boolean);
            par.Add("@CloseCommentReason", article.CloseCommentReason, DbType.String);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#28
0
        /// <summary>
        /// 更新取消状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="isCancel"></param>
        /// <returns></returns>
        public static bool UpdateIsCancel(long id, bool isCancel)
        {
            string sql = @"UPDATE  [DianZanLog] SET 
						IsCancel=@IsCancel,
                        CancelTime=GETDATE()
                        WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", id, DbType.Int64);
            par.Add("@IsCancel", isCancel, DbType.Boolean);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par) > 0);
        }
示例#29
0
        /// <summary>
        /// 修改UserPositionInfo
        /// </summary>
        /// <param name="userposition"></param>
        /// <returns></returns>
        public static int UpdateUserPosition(UserPositionInfo userposition)
        {
            string sql = @"UPDATE  [UserPosition] SET 
						Code=@Code,
						Type=@Type
 WHERE UserId=@UserId";
            var    par = new DynamicParameters();

            par.Add("@UserId", userposition.UserId, DbType.Int32);
            par.Add("@Code", userposition.Code, DbType.Int32);
            par.Add("@Type", userposition.Type, DbType.Int16);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }
示例#30
0
        /// <summary>
        /// 修改RoleModulInfo
        /// </summary>
        /// <param name="rolemodul"></param>
        /// <returns></returns>
        public static int UpdateRoleModul(RoleModulInfo rolemodul)
        {
            string sql = @"UPDATE  [Role_Modul] SET 
						MId=@MId,
						RId=@RId
 WHERE Id=@Id";
            var    par = new DynamicParameters();

            par.Add("@Id", rolemodul.Id, DbType.Int32);
            par.Add("@MId", rolemodul.MId, DbType.Int32);
            par.Add("@RId", rolemodul.RId, DbType.Int32);
            return(DapWrapper.InnerExecuteSql(DbConfig.ArticleManagerConnString, sql, par));
        }