/// <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)); }