예제 #1
0
        /// <summary>
        /// 显示nid对应的小说信息
        /// </summary>
        /// <param name="nid"></param>
        private void showNidContent(string nid)
        {
            statusLabel.Text = "正在加载小说信息,nid为:" + nownid + "  请稍候。。。。";
            statusStrip1.Refresh();
            try
            {
                baseMode = nbase.GetModelFromNid(nownid);

                detailMode = ndetail.GetModel(nownid);

                nameTxt.Text           = baseMode.name;
                baseIdTxt.Text         = baseMode.id.ToString();
                nidTxt.Text            = nownid;
                urlTxt.Text            = detailMode.url;
                blankChapCountTxt.Text = baseMode.blankchapter_count.ToString();
                allChapCountTxt.Text   = baseMode.chaptercount.ToString();
                typeTxt.Text           = baseMode.type;
                stateTxt.Text          = baseMode.novelstate.ToString();
                descTxt.Text           = detailMode.description;

                statusLabel.Text = "加载小说信息成功,nid为:" + nownid;
                statusStrip1.Refresh();
            }
            catch (Exception ee)
            {
                statusLabel.Text = "获取小说内容出错:" + ee.Message;
            }

            saveInfoBtn.Enabled = false;
        }
예제 #2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <NovelManager.Model.novel_detail> DataTableToList(DataTable dt)
        {
            List <NovelManager.Model.novel_detail> modelList = new List <NovelManager.Model.novel_detail>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                NovelManager.Model.novel_detail model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new NovelManager.Model.novel_detail();
                    if (dt.Rows[n]["base_id"] != null && dt.Rows[n]["base_id"].ToString() != "")
                    {
                        model.base_id = long.Parse(dt.Rows[n]["base_id"].ToString());
                    }
                    if (dt.Rows[n]["Nid"] != null && dt.Rows[n]["Nid"].ToString() != "")
                    {
                        model.nid = dt.Rows[n]["Nid"].ToString();
                    }
                    if (dt.Rows[n]["url"] != null && dt.Rows[n]["url"].ToString() != "")
                    {
                        model.url = dt.Rows[n]["url"].ToString();
                    }
                    if (dt.Rows[n]["click"] != null && dt.Rows[n]["click"].ToString() != "")
                    {
                        model.click = int.Parse(dt.Rows[n]["click"].ToString());
                    }
                    if (dt.Rows[n]["recommend"] != null && dt.Rows[n]["recommend"].ToString() != "")
                    {
                        model.recommend = int.Parse(dt.Rows[n]["recommend"].ToString());
                    }
                    if (dt.Rows[n]["updatedate"] != null && dt.Rows[n]["updatedate"].ToString() != "")
                    {
                        model.updatedate = dt.Rows[n]["updatedate"].ToString();
                    }
                    if (dt.Rows[n]["description"] != null && dt.Rows[n]["description"].ToString() != "")
                    {
                        model.description = dt.Rows[n]["description"].ToString();
                    }
                    if (dt.Rows[n]["sourcesite"] != null && dt.Rows[n]["sourcesite"].ToString() != "")
                    {
                        model.sourcesite = dt.Rows[n]["sourcesite"].ToString();
                    }
                    if (dt.Rows[n]["chapter"] != null && dt.Rows[n]["chapter"].ToString() != "")
                    {
                        model.chapter = dt.Rows[n]["chapter"].ToString();
                    }
                    if (dt.Rows[n]["blank_chapter"] != null && dt.Rows[n]["blank_chapter"].ToString() != "")
                    {
                        model.blank_chapter = dt.Rows[n]["blank_chapter"].ToString();
                    }
                    if (dt.Rows[n]["cover_image"] != null && dt.Rows[n]["cover_image"].ToString() != "")
                    {
                        model.cover_image = dt.Rows[n]["cover_image"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #3
0
 /// <summary>
 /// 获得数据列表
 /// </summary>
 public List<NovelManager.Model.novel_detail> DataTableToList(DataTable dt)
 {
     List<NovelManager.Model.novel_detail> modelList = new List<NovelManager.Model.novel_detail>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         NovelManager.Model.novel_detail model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new NovelManager.Model.novel_detail();
             if(dt.Rows[n]["base_id"]!=null && dt.Rows[n]["base_id"].ToString()!="")
             {
                 model.base_id=long.Parse(dt.Rows[n]["base_id"].ToString());
             }
             if(dt.Rows[n]["Nid"]!=null && dt.Rows[n]["Nid"].ToString()!="")
             {
             model.nid=dt.Rows[n]["Nid"].ToString();
             }
             if(dt.Rows[n]["url"]!=null && dt.Rows[n]["url"].ToString()!="")
             {
             model.url=dt.Rows[n]["url"].ToString();
             }
             if(dt.Rows[n]["click"]!=null && dt.Rows[n]["click"].ToString()!="")
             {
                 model.click=int.Parse(dt.Rows[n]["click"].ToString());
             }
             if(dt.Rows[n]["recommend"]!=null && dt.Rows[n]["recommend"].ToString()!="")
             {
                 model.recommend=int.Parse(dt.Rows[n]["recommend"].ToString());
             }
             if(dt.Rows[n]["updatedate"]!=null && dt.Rows[n]["updatedate"].ToString()!="")
             {
             model.updatedate=dt.Rows[n]["updatedate"].ToString();
             }
             if(dt.Rows[n]["description"]!=null && dt.Rows[n]["description"].ToString()!="")
             {
             model.description=dt.Rows[n]["description"].ToString();
             }
             if(dt.Rows[n]["sourcesite"]!=null && dt.Rows[n]["sourcesite"].ToString()!="")
             {
             model.sourcesite=dt.Rows[n]["sourcesite"].ToString();
             }
             if(dt.Rows[n]["chapter"]!=null && dt.Rows[n]["chapter"].ToString()!="")
             {
             model.chapter=dt.Rows[n]["chapter"].ToString();
             }
             if(dt.Rows[n]["blank_chapter"]!=null && dt.Rows[n]["blank_chapter"].ToString()!="")
             {
             model.blank_chapter=dt.Rows[n]["blank_chapter"].ToString();
             }
             if(dt.Rows[n]["cover_image"]!=null && dt.Rows[n]["cover_image"].ToString()!="")
             {
             model.cover_image=dt.Rows[n]["cover_image"].ToString();
             }
             modelList.Add(model);
         }
     }
     return modelList;
 }
예제 #4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(NovelManager.Model.novel_detail model)
 {
     return(dal.Update(model));
 }
예제 #5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(NovelManager.Model.novel_detail model)
 {
     return(dal.Add(model));
 }
예제 #6
0
        /// <summary>
        /// 显示nid对应的小说信息
        /// </summary>
        /// <param name="nid"></param>
        private void showNidContent(string nid)
        {
            statusLabel.Text = "正在加载小说信息,nid为:" + nownid + "  请稍候。。。。";
            statusStrip1.Refresh();
            try
            {
                baseMode = nbase.GetModelFromNid(nownid);

                detailMode = ndetail.GetModel(nownid);

                nameTxt.Text = baseMode.name;
                baseIdTxt.Text = baseMode.id.ToString();
                nidTxt.Text = nownid;
                urlTxt.Text = detailMode.url;
                blankChapCountTxt.Text = baseMode.blankchapter_count.ToString();
                allChapCountTxt.Text = baseMode.chaptercount.ToString();
                typeTxt.Text = baseMode.type;
                stateTxt.Text = baseMode.novelstate.ToString();
                descTxt.Text = detailMode.description;

                statusLabel.Text = "加载小说信息成功,nid为:" + nownid;
                statusStrip1.Refresh();
            }
            catch (Exception ee)
            {
                statusLabel.Text = "获取小说内容出错:" + ee.Message;
            }

            saveInfoBtn.Enabled = false;
        }