public Chapter update(Chapter newChapter) { Chapter oldChapter = _repository.get(newChapter.IDChapter); if (oldChapter == null) { return(null); } oldChapter = ChapterMapper.mapModel(oldChapter, newChapter); if (oldChapter == null) { return(null); } _repository.update(oldChapter); return(oldChapter); }
public dynamic AddChapter(W_Chapter model) { if (model != null) { model.AddPerson = this.AccountID; model.AddTime = DateTime.Now.ToString(); ChapterMapper mapper = new ChapterMapper(); var dict = mapper.AddChapter(model); if (dict) { return(Success("操作成功")); } else { return(Success("操作失败")); } } else { return(Success("操作失败")); } }