Beispiel #1
0
    private void GetArtListByKey()
    {
        if (Request["key"] == null)
        {
            ErrMsg("参数错误!");
            return;
        }
        string          key   = Server.UrlDecode(Request["key"]);
        int             start = Convert.ToInt32(Request["start"]);
        int             need  = Convert.ToInt32(Request["need"]);
        List <InfoItem> arts  = ibll.SearchAriticle(key, start, need);
        List <uniart>   list  = new List <uniart>();

        if (arts.Count > 0)
        {
            ToArt(ref list, arts);
            unipctrl pc = new unipctrl();
            pc.total = ibll.GetSearchAmount(key);
            pc.start = start;
            pc.need  = need;
            SucRltPCtrl(list, pc);
            return;
        }
        ErrMsg("没有搜索到任何数据!");
    }
Beispiel #2
0
    private void GetArtListByCls(int sta)
    {
        if (string.IsNullOrEmpty(Request["cl"]))
        {
            ErrMsg("参数错误!");
            return;
        }
        int             cls   = Convert.ToInt32(Request["cl"]);
        int             start = Convert.ToInt32(Request["start"]);
        int             need  = Convert.ToInt32(Request["need"]);
        List <InfoItem> arts;

        if (sta == -1)
        {
            arts = ibll.GetPubArticlesTitleByClass(cls, start, need);
        }
        else if (sta == -2)
        {
            arts = ibll.GetAllArticlesTitleByClass(cls, start, need);
        }
        else if (sta == 1)
        {
            arts = ibll.GetPubArticlesByClass(cls, start, need);
        }
        else
        {
            arts = new List <InfoItem>();
        }
        List <uniart> list = new List <uniart>();

        ToArt(ref list, arts);
        unipctrl pc = new unipctrl();

        pc.total = ibll.GetPubArticleNumberByClass(cls);
        pc.start = start;
        pc.need  = need;
        SucRltPCtrl(list, pc);
    }
Beispiel #3
0
 protected void SucRltPCtrl(object data, unipctrl pc)
 {
     JsRet(1, "ok", CodeJson(data), "{\"total\":\"" + pc.total + "\",\"start\":\"" + pc.start + "\",\"need\":\"" + pc.need + "\",\"name\":\"" + pc.name + "\"}");
 }