/// <summary> /// 通过文章id修改文章 /// </summary> /// <param name="title"></param> /// <param name="content"></param> /// <param name="aname"></param> /// <returns></returns> public static bool RePubArticleById(string title, string content, string aname, int nid) { string zhaiyao = content.Length > 50 ? content.Substring(0, 50) : content;//摘要 string pubtime = Now_User.GetNowTime(); if (aname == "") { aname = "未分类"; } string sql = "UPDATE news SET " + "ntitle=" + "'" + title + "'," + "ncontent=" + "'" + content + "'," + "nkey=" + "'" + zhaiyao + "'," + "aname=" + "'" + aname + "'," + "ndate=" + "'" + pubtime + "' " + " WHERE nid=" + nid; int result = SSMS.ExecuteCommand(sql); if (result > 0) { return(true); } else { return(false); } }
/// <summary> /// 通过文章id删除文章 /// </summary> /// <param name="id"></param> /// <returns></returns> public static bool DeleteArticleById(int nid) { string sql = "DELETE news WHERE nID=" + nid.ToString(); if (SSMS.ExecuteCommand(sql) > 0) { return(true); } else { return(false); } }
/// <summary> /// 通过评论id删除评论 /// </summary> /// <param name="Cid"></param> /// <returns></returns> public static bool DelCommentByCid(int Cid) { string sql = "DELETE comment WHERE cid=" + Cid; if (SSMS.ExecuteCommand(sql) > 0) { return(true); } else { return(false); } }
/// <summary> /// 通过友链id删除友链 /// </summary> /// <param name="lid"></param> /// <returns></returns> public static bool DeleteLinkById(int lid) { string sql = "DELETE FriendLink WHERE lid=" + lid.ToString(); if (SSMS.ExecuteCommand(sql) > 0) { return(true); } else { return(false); } }
/// <summary> /// 通过评论id修改评论 /// </summary> /// <param name="title"></param> /// <param name="huifu"></param> /// <param name="Cid"></param> /// <returns></returns> public static bool UpdateCommentByCid(string title, string huifu, int Cid) { string Publictime = Now_User.GetNowTime(); int uid = Now_User.now_user_id; string sql = "UPDATE comment SET " + "title=" + "'" + title + "'," + "huifu=" + "'" + huifu + "'," + "Publictime=" + "'" + Publictime + "' " + " WHERE cid=" + Cid; int result = SSMS.ExecuteCommand(sql); if (result > 0) { return(true); } else { return(false); } }