예제 #1
0
        /// <summary>
        /// 动漫app由9miao社团研发,如有问题请登陆http://www.9miao.com/官网
        /// </summary>
        ///



        public void ProcessRequest(HttpContext context)
        {
            comicsearchhots chots = new comicsearchhots();

            chots.result = 1;
            chots.msg    = "OK";
            try
            {
                using (
                    CDBAccess cn =
                        new CDBAccess(System.Configuration.ConfigurationSettings.AppSettings["OledbStr"]))
                {
                    using (DataTable _dt = cn.ExecQuery(@"SELECT top 20 * FROM T0003 ORDER BY C00010 DESC"))
                    {
                        comicsearchhotData[] comDataList = new comicsearchhotData[_dt.Rows.Count];
                        for (int i = 0; i < _dt.Rows.Count; i++)
                        {
                            comicsearchhotData cData = new comicsearchhotData();
                            cData.id       = _dt.Rows[i]["C00010"].ToString();
                            cData.name     = Coding.ToUnicode(_dt.Rows[i]["C00011"].ToString());
                            comDataList[i] = cData;
                        }
                        chots.data = comDataList;
                    }
                }
            }
            catch
            {
            }
            context.Response.ContentType = "text/plain";
            context.Response.Write(JsonSerialize.jSerialize(chots));
        }
예제 #2
0
 public void ProcessRequest(HttpContext context)
 {
     using (
         CDBAccess cn =
             new CDBAccess(System.Configuration.ConfigurationSettings.AppSettings["OledbStr"]))
     {
         Ctop cp = new Ctop();
         using (DataTable _dt = cn.ExecQuery("select top 10 * from T0004 ORDER BY C00016 DESC"))
         {
             Topdata[] TD = new Topdata[_dt.Rows.Count];
             for (int i = 0; i < _dt.Rows.Count; i++)
             {
                 Topdata tdrow = new Topdata();
                 tdrow.authors = Coding.ToUnicode(_dt.Rows[i]["C00025"].ToString());
                 tdrow.cover   = _dt.Rows[i]["C00024"].ToString();
                 tdrow.id      = _dt.Rows[i]["C00016"].ToString();
                 tdrow.last_update_chapter_name = Coding.ToUnicode(_dt.Rows[i]["C00022"].ToString());
                 tdrow.sum_chapters             = "100";
                 tdrow.sum_source = "101";
                 tdrow.title      = Coding.ToUnicode(_dt.Rows[i]["C00017"].ToString());
                 tdrow.types      = Coding.ToUnicode(_dt.Rows[i]["C00019"].ToString());
                 TD[i]            = tdrow;
             }
             cp.month = TD;
             cp.total = TD;
             cp.week  = TD;
         }
         context.Response.Write(JsonSerialize.jSerialize(cp));
     }
 }
예제 #3
0
        public void ProcessRequest(HttpContext context)
        {
            string comic_id = context.Request["comic_id"];      //漫画id
            string chap_id  = context.Request["chap_id"];       //章节

            using (
                CDBAccess cn =
                    new CDBAccess(System.Configuration.ConfigurationSettings.AppSettings["OledbStr"]))
            {
                ChapInforMation chapIn = new ChapInforMation();

                using (DataTable _dt = cn.ExecQuery(@"select * from  T0005
	where C00029=? and C00030=?"    ,
                                                    new OleDbParameter[] {
                    new OleDbParameter("@C00029", chap_id),
                    new OleDbParameter("@C00030", comic_id)
                }))
                {
                    if (_dt.Rows.Count > 0)
                    {
                        DataRow dr = _dt.Rows[0];
                        chapIn.chapter_name  = Coding.ToUnicode(dr["C00031"].ToString());
                        chapIn.chapter_order = dr["C00032"].ToString();
                        chapIn.comic_id      = dr["C00030"].ToString();
                    }
                }



                string h_id = chap_id;         //上一张
                using (DataTable _dt = cn.ExecQuery(@"select top 1 C00029 from T0005 where C00030=" + comic_id + " and C00029 < " + chap_id + " order by C00029 desc"))
                {
                    if (_dt.Rows.Count > 0)
                    {
                        h_id      = _dt.Rows[0]["C00029"].ToString();
                        chapIn.id = h_id;
                        //根据话id 查找
                        using (DataTable _dts = cn.ExecQuery(@"Select * from T0006 WHERE C00035=?
			order by C00034 asc"            ,
                                                             new OleDbParameter[] {
                            new OleDbParameter("@C00035", h_id)
                        }))
                        {
                            string[] pages = new string[_dts.Rows.Count];
                            for (int i = 0; i < _dts.Rows.Count; i++)
                            {
                                pages[i] = _dts.Rows[i]["C00036"].ToString();
                            }
                            chapIn.page = pages;
                        }
                    }
                }



                context.Response.ContentType = "text/plain";
                context.Response.Write(JsonSerialize.jSerialize(chapIn));
            }
        }
예제 #4
0
 public void ProcessRequest(HttpContext context)
 {
     using (
         CDBAccess cn =
             new CDBAccess(System.Configuration.ConfigurationSettings.AppSettings["OledbStr"]))
     {
         //获取大分类的信息
         using (DataTable _dtBig = cn.ExecQuery(@"select * from T0000 order by C00001 asc"))
         {
             TreeListing[] tl = new TreeListing[_dtBig.Rows.Count];
             for (int i = 0; i < _dtBig.Rows.Count; i++)
             {
                 TreeListing tlb = new TreeListing();
                 tlb.id    = _dtBig.Rows[i]["C00001"].ToString();
                 tlb.title = _dtBig.Rows[i]["C00003"].ToString();
                 tlb.icon  = _dtBig.Rows[i]["C00002"].ToString();
                 using (DataTable _dtSmall = cn.ExecQuery(@"select * from T0001 where C00101=? order by C00004",
                                                          new OleDbParameter[] {
                     new OleDbParameter("@a", _dtBig.Rows[i]["C00001"].ToString())
                 }))
                 {
                     TreeListing[] tls = new TreeListing[_dtSmall.Rows.Count];
                     for (int j = 0; j < _dtSmall.Rows.Count; j++)
                     {
                         TreeListing tlsRow = new TreeListing();
                         tlsRow.id    = _dtSmall.Rows[j]["C00004"].ToString();
                         tlsRow.icon  = _dtSmall.Rows[j]["C00005"].ToString();
                         tlsRow.title = _dtSmall.Rows[j]["C00006"].ToString();
                         tls[j]       = tlsRow;
                     }
                     tlb.subnodes = tls;
                 }
                 tl[i] = tlb;
             }
             //信息填充后 json 序列化返回
             context.Response.Write(JsonSerialize.jSerialize(tl));
         }
     }
 }
예제 #5
0
        /// <summary>
        /// 动漫app由9miao社团研发,如有问题请登陆http://www.9miao.com/官网
        /// </summary>
        ///



        public void ProcessRequest(HttpContext context)
        {
            string classify_type = context.Request["classify_type"];         //字母
            string classify_id   = context.Request["classify_id"];           //小分类id
            string page          = context.Request["page"];                  //页码
            int    pages         = 0;

            int.TryParse(page, out pages);
            pages = pages + 1;
            LetterComic lc = new LetterComic();

            lc.result = 1;
            lc.msg    = "OK";
            try
            {
                using (
                    CDBAccess cn =
                        new CDBAccess(System.Configuration.ConfigurationSettings.AppSettings["OledbStr"]))
                {
                    int check_classify_type = 0;
                    int.TryParse(classify_type, out check_classify_type);
                    string           sql_Big = string.Empty;
                    OleDbParameter[] ole_big = new OleDbParameter[] { };
                    if (classify_type != "update")
                    {
                        if (check_classify_type > 0)
                        {
                            //说明是INT型的分类
                            sql_Big = "select * from T0000,T0001 where C00001=C00101 and C00001=" + classify_type + " and C00004='" + classify_id + "'";
                        }
                        else
                        {
                            //字母型
                            sql_Big = "select * from T0000,T0001 where C00001=C00101 and C00002 like '%" + classify_type + "%' and C00004='" + classify_id + "'";
                        }
                    }
                    else
                    {
                        sql_Big = "select * from T0000,T0001 where C00001=C00101 and C00004='" + classify_id + "'";
                    }

                    //先验证字母 跟小分类id
                    using (DataTable _dt = cn.ExecQuery(sql_Big))
                    {
                        if (_dt.Rows.Count > 0)
                        {
                            string           sql = string.Empty;
                            OleDbParameter[] ole = new OleDbParameter[] { };
                            if (pages == 1)
                            {
                                //第一页
                                sql = "select top " + 30 + " * from T0003,T0002 where C00009=C00010 and C00008='" + classify_id + "' order by C00010 desc";
                            }
                            else
                            {
                                //N页
                                sql = "select top " + 30 + " * from T0003,T0002 where C00009=C00010 and C00008='" + classify_id + "' and C00010 not in " +
                                      @"(select top " + ((pages - 1) * 1) + " C00010 from T0003,T0002 where C00009=C00010 and C00008='" + classify_id + "' order by C00010 desc)"
                                      + "order by C00010 desc";
                            }
                            //进行分页寻找返回列表
                            using (DataTable _dtList = cn.ExecQuery(sql))
                            {
                                ComicList[] cmlist = new ComicList[_dtList.Rows.Count];
                                for (int i = 0; i < _dtList.Rows.Count; i++)
                                {
                                    ComicList clist = new ComicList();
                                    clist.id       = _dtList.Rows[i]["C00010"].ToString();
                                    clist.cover    = _dtList.Rows[i]["C00013"].ToString();
                                    clist.hot_hits = _dtList.Rows[i]["C00015"].ToString();
                                    clist.last_update_chapter_name = Coding.ToUnicode(_dtList.Rows[i]["C00012"].ToString());
                                    clist.last_updatetime          = _dtList.Rows[i]["C00014"].ToString();
                                    clist.title = Coding.ToUnicode(_dtList.Rows[i]["C00011"].ToString());
                                    cmlist[i]   = clist;
                                }
                                lc.data = cmlist;
                            }
                        }
                    }
                }
            }
            catch
            {
            }
            context.Response.ContentType = "text/plain";
            context.Response.Write(JsonSerialize.jSerialize(lc));
        }
예제 #6
0
        public void ProcessRequest(HttpContext context)
        {
            using (
                CDBAccess cn =
                    new CDBAccess(System.Configuration.ConfigurationSettings.AppSettings["OledbStr"]))
            {
                CIndexData cdata = new CIndexData();

                //首页大图信息图片
                using (DataTable _dtInfo = cn.ExecQuery(@"SELECT top 1 * FROM T0004 ORDER BY rnd(C00016) DESC"))
                {
                    headlinesInfo hinfo = new headlinesInfo();
                    hinfo.id        = _dtInfo.Rows[0]["C00016"].ToString();
                    hinfo.subtitle  = Coding.ToUnicode(_dtInfo.Rows[0]["C00018"].ToString());
                    hinfo.title     = Coding.ToUnicode(_dtInfo.Rows[0]["C00017"].ToString());
                    hinfo.cover     = _dtInfo.Rows[0]["C00024"].ToString();
                    cdata.headlines = hinfo;
                }
                //首页信息
                using (DataTable _dtepList = cn.ExecQuery(@"SELECT top 15 * FROM T0004 ORDER BY rnd(C00016) DESC"))
                {
                    episodeList[] _dtepStr = new episodeList[_dtepList.Rows.Count];
                    for (int i = 0; i < _dtepList.Rows.Count; i++)
                    {
                        episodeList episRow = new episodeList();
                        episRow.id    = _dtepList.Rows[i]["C00016"].ToString();
                        episRow.title = Coding.ToUnicode(_dtepList.Rows[i]["C00017"].ToString());
                        episRow.last_update_chapter_name = Coding.ToUnicode(_dtepList.Rows[i]["C00022"].ToString());
                        episRow.cover = _dtepList.Rows[i]["C00024"].ToString();
                        _dtepStr[i]   = episRow;
                    }
                    cdata.episode = _dtepStr;
                }

                //连载
                CIndexData cdata1 = new CIndexData();
                using (DataTable _dtInfo = cn.ExecQuery(@"SELECT top 1 * FROM T0004 ORDER BY rnd(C00016) DESC"))
                {
                    headlinesInfo hinfo = new headlinesInfo();
                    hinfo.id         = _dtInfo.Rows[0]["C00016"].ToString();
                    hinfo.subtitle   = Coding.ToUnicode(_dtInfo.Rows[0]["C00018"].ToString());
                    hinfo.title      = Coding.ToUnicode(_dtInfo.Rows[0]["C00017"].ToString());
                    hinfo.cover      = _dtInfo.Rows[0]["C00024"].ToString();
                    cdata1.headlines = hinfo;
                }
                //连载
                using (DataTable _dtepList = cn.ExecQuery(@"SELECT top 15 * FROM T0004 ORDER BY rnd(C00016) DESC"))
                {
                    episodeList[] _dtepStr = new episodeList[_dtepList.Rows.Count];
                    for (int i = 0; i < _dtepList.Rows.Count; i++)
                    {
                        episodeList episRow = new episodeList();
                        episRow.id    = _dtepList.Rows[i]["C00016"].ToString();
                        episRow.title = Coding.ToUnicode(_dtepList.Rows[i]["C00017"].ToString());
                        episRow.last_update_chapter_name = Coding.ToUnicode(_dtepList.Rows[i]["C00022"].ToString());
                        episRow.cover = _dtepList.Rows[i]["C00024"].ToString();
                        _dtepStr[i]   = episRow;
                    }
                    cdata1.episode = _dtepStr;
                }

                //最新
                CIndexData cdata2 = new CIndexData();
                using (DataTable _dtInfo = cn.ExecQuery(@"SELECT top 1 * FROM T0004 ORDER BY rnd(C00016) DESC"))
                {
                    headlinesInfo hinfo = new headlinesInfo();
                    hinfo.id         = _dtInfo.Rows[0]["C00016"].ToString();
                    hinfo.subtitle   = Coding.ToUnicode(_dtInfo.Rows[0]["C00018"].ToString());
                    hinfo.title      = Coding.ToUnicode(_dtInfo.Rows[0]["C00017"].ToString());
                    hinfo.cover      = _dtInfo.Rows[0]["C00024"].ToString();
                    cdata2.headlines = hinfo;
                }
                using (DataTable _dtepList = cn.ExecQuery(@"SELECT top 15 * FROM T0004 ORDER BY rnd(C00016) DESC"))
                {
                    episodeList[] _dtepStr = new episodeList[_dtepList.Rows.Count];
                    for (int i = 0; i < _dtepList.Rows.Count; i++)
                    {
                        episodeList episRow = new episodeList();
                        episRow.id    = _dtepList.Rows[i]["C00016"].ToString();
                        episRow.title = Coding.ToUnicode(_dtepList.Rows[i]["C00017"].ToString());
                        episRow.last_update_chapter_name = Coding.ToUnicode(_dtepList.Rows[i]["C00022"].ToString());
                        episRow.cover = _dtepList.Rows[i]["C00024"].ToString();
                        _dtepStr[i]   = episRow;
                    }
                    cdata2.episode = _dtepStr;
                }
                //完结
                CIndexData cdata3 = new CIndexData();
                using (DataTable _dtInfo = cn.ExecQuery(@"SELECT top 1 * FROM T0004 ORDER BY rnd(C00016) DESC"))
                {
                    headlinesInfo hinfo = new headlinesInfo();
                    hinfo.id         = _dtInfo.Rows[0]["C00016"].ToString();
                    hinfo.subtitle   = Coding.ToUnicode(_dtInfo.Rows[0]["C00018"].ToString());
                    hinfo.title      = Coding.ToUnicode(_dtInfo.Rows[0]["C00017"].ToString());
                    hinfo.cover      = _dtInfo.Rows[0]["C00024"].ToString();
                    cdata3.headlines = hinfo;
                }
                using (DataTable _dtepList = cn.ExecQuery(@"SELECT top 15 * FROM T0004 ORDER BY rnd(C00016) DESC"))
                {
                    episodeList[] _dtepStr = new episodeList[_dtepList.Rows.Count];
                    for (int i = 0; i < _dtepList.Rows.Count; i++)
                    {
                        episodeList episRow = new episodeList();
                        episRow.id    = _dtepList.Rows[i]["C00016"].ToString();
                        episRow.title = Coding.ToUnicode(_dtepList.Rows[i]["C00017"].ToString());
                        episRow.last_update_chapter_name = Coding.ToUnicode(_dtepList.Rows[i]["C00022"].ToString());
                        episRow.cover = _dtepList.Rows[i]["C00024"].ToString();
                        _dtepStr[i]   = episRow;
                    }
                    cdata3.episode = _dtepStr;
                }
                //原创
                CIndexData cdata4 = new CIndexData();
                using (DataTable _dtInfo = cn.ExecQuery(@"SELECT top 1 * FROM T0004 ORDER BY rnd(C00016) DESC"))
                {
                    headlinesInfo hinfo = new headlinesInfo();
                    hinfo.id         = _dtInfo.Rows[0]["C00016"].ToString();
                    hinfo.subtitle   = Coding.ToUnicode(_dtInfo.Rows[0]["C00018"].ToString());
                    hinfo.title      = Coding.ToUnicode(_dtInfo.Rows[0]["C00017"].ToString());
                    hinfo.cover      = _dtInfo.Rows[0]["C00024"].ToString();
                    cdata4.headlines = hinfo;
                }
                using (DataTable _dtepList = cn.ExecQuery(@"SELECT top 15 * FROM T0004 ORDER BY rnd(C00016) DESC"))
                {
                    episodeList[] _dtepStr = new episodeList[_dtepList.Rows.Count];
                    for (int i = 0; i < _dtepList.Rows.Count; i++)
                    {
                        episodeList episRow = new episodeList();
                        episRow.id    = _dtepList.Rows[i]["C00016"].ToString();
                        episRow.title = Coding.ToUnicode(_dtepList.Rows[i]["C00017"].ToString());
                        episRow.last_update_chapter_name = Coding.ToUnicode(_dtepList.Rows[i]["C00022"].ToString());
                        episRow.cover = _dtepList.Rows[i]["C00024"].ToString();
                        _dtepStr[i]   = episRow;
                    }
                    cdata4.episode = _dtepStr;
                }


                CIndex cdex = new CIndex();
                cdex.index        = cdata;
                cdex.lianzai      = cdata1;
                cdex.new_key_huan = cdata2;
                cdex.wanjie       = cdata3;
                cdex.yuanchuang   = cdata4;
                string json_callback = JsonSerialize.jSerialize(cdex);
                context.Response.Write(json_callback.Replace(@"new_key_huan", "new"));
            }
        }
예제 #7
0
        public void ProcessRequest(HttpContext context)
        {
            //获取漫画基本信息
            string comic_id = context.Request.QueryString["comic_id"];  //漫画id

            //数据库的连接字符串
            using (
                CDBAccess cn =
                    new CDBAccess(System.Configuration.ConfigurationSettings.AppSettings["OledbStr"]))
            {
                //返回基本信息类
                ComicInforMation cimn = new ComicInforMation();
                cimn.result = 1;
                cimn.msg    = "OK";
                try
                {
                    Comicdata   cdata = new Comicdata();    //数据集data
                    InforMation imn   = new InforMation();  //基本信息实体类
                    //根据参数查询出基本信息
                    using (DataTable _dtInforMation = cn.ExecQuery("SELECT * FROM T0004 WHERE C00016=?",
                                                                   new OleDbParameter[] {
                        new OleDbParameter("@C00016", comic_id)
                    }))
                    {
                        if (_dtInforMation.Rows.Count > 0)
                        {
                            DataRow _drInforMation = _dtInforMation.Rows[0];
                            imn.id = _drInforMation["C00016"].ToString();
                            imn.last_update_chapter_name = Coding.ToUnicode(_drInforMation["C00022"].ToString());
                            imn.last_updatetime          = _drInforMation["C00023"].ToString();
                            imn.status       = Coding.ToUnicode(_drInforMation["C00021"].ToString());
                            imn.subtitle     = Coding.ToUnicode(_drInforMation["C00018"].ToString());
                            imn.title        = Coding.ToUnicode(_drInforMation["C00017"].ToString());
                            imn.types        = Coding.ToUnicode(_drInforMation["C00019"].ToString());
                            imn.zone         = Coding.ToUnicode(_drInforMation["C00020"].ToString());
                            imn.authors      = Coding.ToUnicode(_drInforMation["C00025"].ToString());
                            imn.cover        = _drInforMation["C00024"].ToString();
                            imn.description  = Coding.ToUnicode(_drInforMation["C00026"].ToString());
                            imn.direction    = _drInforMation["C00028"].ToString();
                            imn.first_letter = _drInforMation["C00027"].ToString();
                        }
                        else
                        {
                            throw new Exception();
                        }
                    }
                    cdata.info = imn;       //赋值基本信息
                    //赋值话信息
                    using (DataTable _dtword = cn.ExecQuery("select * from T0005 where C00030=? order by C00029 desc",
                                                            new OleDbParameter[] {
                        new OleDbParameter("@id", comic_id)
                    }))
                    {
                        wordList[] wlists = new wordList[_dtword.Rows.Count];
                        for (int i = 0; i < _dtword.Rows.Count; i++)
                        {
                            wordList wlistRow = new wordList();
                            wlistRow.id            = _dtword.Rows[i]["C00029"].ToString();
                            wlistRow.filesize      = _dtword.Rows[i]["C00033"].ToString();
                            wlistRow.comic_id      = _dtword.Rows[i]["C00030"].ToString();
                            wlistRow.chapter_order = _dtword.Rows[i]["C00032"].ToString();
                            wlistRow.chapter_name  = Coding.ToUnicode(_dtword.Rows[i]["C00031"].ToString());
                            wlists[i] = wlistRow;
                        }
                        cdata.list = wlists;
                    }


                    aloneList[] alist = new aloneList[0];
                    cdata.alone = alist;
                    //赋值similarList关联信息
                    using (DataTable _dtsimilar = cn.ExecQuery("SELECT top 10 * FROM T0004 ORDER BY rnd(C00016) DESC"))
                    {
                        similarList[] similar = new similarList[_dtsimilar.Rows.Count];
                        for (int i = 0; i < _dtsimilar.Rows.Count; i++)
                        {
                            similarList similarRow = new similarList();
                            similarRow.id    = _dtsimilar.Rows[i]["C00016"].ToString();
                            similarRow.cover = _dtsimilar.Rows[i]["C00024"].ToString();
                            similarRow.last_update_chapter_name = Coding.ToUnicode(_dtsimilar.Rows[i]["C00022"].ToString());
                            similarRow.title = Coding.ToUnicode(_dtsimilar.Rows[i]["C00017"].ToString());
                            similar[i]       = similarRow;
                        }
                        cdata.similar = similar;
                    }
                    cimn.data = cdata;
                }
                catch {
                }
                context.Response.ContentType = "text/plain";
                context.Response.Write(JsonSerialize.jSerialize(cimn));
            }
        }