//SELECT TOP (200) Id, WebId, Title, NovelUrl, StartUrl, LatestChapter, Author // , TypeId, Status, RecentUpdate, ChapterCount, CreateTime, ChapterChar, StartChapterIdx, ChapterType //FROM Novels #region 编辑小说数据 /// <summary> /// 编辑小说数据 /// </summary> /// <param name="model">小说实体</param> /// <returns></returns> public static int Edit(Model.Novels model) { string strSql = string.Format (@"UPDATE Novels SET WebId='{1}', Title='{2}', NovelUrl='{3}', StartUrl='{4}', LatestChapter='{5}', Author='{6}' , TypeId='{7}', Status='{8}', StartChapterIdx='{9}', ChapterChar='{10}', ChapterType='{11}' WHERE (Id = '{0}');" , model.Id, model.WebId, model.Title, model.NovelUrl, model.StartUrl, model.LatestChapter, model.Author , model.TypeId, model.Status, model.StartChapterIdx, model.ChapterChar, model.ChapterType); return(DbHelperSql.ExecuteSql(strSql)); }
/// <summary> /// 获取小说抓取参数实体 /// </summary> /// <param name="webId">站点编号</param> /// <param name="novelId">小说编号</param> /// <returns></returns> public Model.Novels CrawlModel(string webId, string novelId) { Model.Novels model = null; DataSet ds = NovelDal.CrawlData(webId, novelId); if (ds != null && ds.Tables[0].Rows.Count > 0) { model = new DataTableToList <Model.Novels>(ds.Tables[0]).ToList().FirstOrDefault(); } return(model); }
/// <summary> /// 添加小说数据 /// </summary> /// <remarks>创建人:李海玉 创建时间:2018-06-02</remarks> /// <param name="model">小说实体</param> /// <returns></returns> public static int Add(Model.Novels model) { string strSql = string.Format (@"INSERT INTO Novels (WebId, Title, NovelUrl, StartUrl, LatestChapter, Author, TypeId, Status, StartChapterIdx, ChapterChar, ChapterType) VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', '{9}', '{10}');" , model.WebId, model.Title, model.NovelUrl, model.StartUrl, model.LatestChapter, model.Author, model.TypeId , model.Status, model.StartChapterIdx, model.ChapterChar, model.ChapterType); return(DbHelperSql.ExecuteSql(strSql)); }
/// <summary> /// 编辑小说数据 /// </summary> /// <param name="model">小说实体</param> /// <returns></returns> public int Edit(Model.Novels model) { return(NovelDal.Edit(model)); }
/// <summary> /// 添加小说信息 /// </summary> /// <param name="model">小说实体</param> public int Add(Model.Novels model) { return(NovelDal.Add(model)); }