private void SaveBookCover(string bookid) { string strBookUrl = "../Book/" + bookid + "/cover.htm"; BookBLL objBill = new BookBLL(); objBill.UpdateBookUrl(Convert.ToInt32(bookid), strBookUrl); string srcPath = "../Online/Book/" + bookid + "/cover.htm"; RailExam.Model.Book obj = objBill.GetBook(Convert.ToInt32(bookid)); if (File.Exists(Server.MapPath(srcPath))) { File.Delete(Server.MapPath(srcPath)); } string str = "<link href='book.css' type='text/css' rel='stylesheet' />" + "<body oncontextmenu='return false' ondragstart='return false' onselectstart ='return false' oncopy='document.selection.empty()' onbeforecopy='return false'>" + "<br><br><br><br><br><br><br>" + "<div id='booktitle'>" + obj.bookName + "</div>" + "<br>" + "<br><br><br><br><br><br><br><br><br><br><br>" + "<div id='orgtitle'>" + obj.publishOrgName + "</div>" + "<br>" + "<div id='authortitle'>" + obj.authors + "</div>" + "</body>"; File.AppendAllText(Server.MapPath(srcPath), str, System.Text.Encoding.UTF8); BookChapterBLL objChapterBll = new BookChapterBLL(); objChapterBll.GetIndex(bookid); }
/// <summary> /// 添加试题 /// </summary> /// <returns>受影响的行数</returns> public int AddItem(Item item) { int id = dal.AddItem(item); BookChapterBLL objChapterBll = new BookChapterBLL(); string strChapterName = objChapterBll.GetBookChapter(item.ChapterId).ChapterName; BookBLL objBookBll = new BookBLL(); string strBookName = objBookBll.GetBook(item.BookId).bookName; objLogBll.WriteLog("新增教材《" + strBookName + "》中“" + strChapterName + "”的试题信息"); return(id); }
/// <summary> /// 修改教材或章节所属试题的状态 /// </summary> /// <param name="bookId"></param> /// <param name="ChapterId"></param> /// <param name="statusId"></param> /// <returns></returns> public int UpdateItemEnabled(int bookId, int ChapterId, int statusId) { string bookName, chapterName; BookBLL objBookBll = new BookBLL(); bookName = objBookBll.GetBook(bookId).bookName; if (ChapterId == 0) { objLogBll.WriteLog("将教材《" + bookName + "》试题全部禁用"); } else { BookChapterBLL objChapterBll = new BookChapterBLL(); BookChapter objChapter = objChapterBll.GetBookChapter(ChapterId); chapterName = objChapter.ChapterName; objLogBll.WriteLog("将教材《" + bookName + "》中“" + chapterName + "”试题全部禁用"); } return(dal.UpdateItemEnabled(bookId, ChapterId, statusId)); }