/// <summary>
        /// 通过标签名称获取贫家 报告列表
        /// </summary>
        /// <param name="id">leafid</param>
        /// <returns>对象</returns>
        public ActionResult GetReportListByTagName(int id)
        {
            string tagName   = "";
            int    pageIndex = 1;
            int    pageSize  = 10;

            if (Request["tagname"] != "" && !string.IsNullOrEmpty(Request["tagname"]))
            {
                tagName = Request["tagname"];
            }
            ViewBag.RootId = id;
            if (Request["pageindex"] != null && Request["pageindex"] != "")
            {
                pageIndex = Convert.ToInt32(Request["pageindex"]);      //当前页码
            }
            if (Request["pagesize"] != null && Request["pagesize"] != "")
            {
                pageSize = Convert.ToInt32(Request["pagesize"]);       //页容量
            }
            ReportInfoViewModel model  = new ReportInfoViewModel();
            ChnLeafInfo         chLeaf = new ChnLeafInfo()
            {
                LeafId = id
            };

            model.LeafInfo = chLeaf;
            List <ReportBasicInfo> reports;
            int totalNum = 10;

            using (DFClient client = new DFClient())
            {
                if (tagName == "" && string.IsNullOrEmpty(tagName))
                {
                    reports = client.GetCensorReportListByLeafId(out totalNum, chLeaf.LeafId, pageIndex, pageSize, new Dictionary <string, string>(), "DelivedDate", false);
                }
                else if (tagName == "其他")
                {
                    reports = client.GetCensorReportListByLeafIdWithOutTagName(out totalNum, chLeaf.LeafId, pageIndex, pageSize, new Dictionary <string, string>(), "DelivedDate", false);
                }
                else
                {
                    reports = client.GetCensorReportListByLeafIdandTagName(out totalNum, chLeaf.LeafId, tagName, pageIndex, pageSize, new Dictionary <string, string>(), "DelivedDate", false);
                }
                model.Total     = totalNum;
                model.PageIndex = pageIndex;
                List <ReportBasicInfo> newList = new List <ReportBasicInfo>();
                //通过判断将置顶数据优先显示
                var ttop    = (from r in reports where (r.IsTop == true && DateTime.Now >= (r.TopStartDate) && DateTime.Now <= (r.TopEndDate)) select r).ToList();
                var tnottop = (from r in reports where (r.IsTop == false || (r.IsTop == true && (DateTime.Now <(r.TopStartDate) || DateTime.Now> (r.TopEndDate)))) select r).ToList();
                newList.AddRange(ttop);
                newList.AddRange(tnottop);
                model.BasicInfos = newList;
                client.Close();
            }
            return(Json(model));
        }
        public ActionResult ReportList(int chnid, int leafid)
        {
            leafid = leafid > 10000000 ? (leafid - 10000000) : leafid;

            int pageIndex = 1;
            int pageSize  = 25;

            ViewBag.RootId = leafid;

            if (Request["pageindex"] != null && Request["pageindex"] != "")
            {
                pageIndex = Convert.ToInt32(Request["pageindex"]);      //当前页码
            }
            if (Request["pagesize"] != null && Request["pagesize"] != "")
            {
                pageSize = Convert.ToInt32(Request["pagesize"]);       //页容量
            }
            ReportInfoViewModel model  = new ReportInfoViewModel();
            ChnLeafInfo         chLeaf = new ChnLeafInfo()
            {
                LeafId = leafid
            };

            model.LeafInfo = chLeaf;
            List <ReportBasicInfo> reports;
            int totalNum = 10;

            using (DFClient client = new DFClient())
            {
                List <ReportTagInfo>   tagList    = client.GetAllReportTagList(chLeaf.LeafId);
                List <ReportBasicInfo> TOPreports = client.GetTopCensorReportListByLeafId(chLeaf.LeafId);
                reports       = client.GetCensorReportListByLeafId(out totalNum, chLeaf.LeafId, pageIndex, pageSize - TOPreports.Count, new Dictionary <string, string>(), "DelivedDate", false);
                ViewBag.Total = totalNum;
                List <ReportBasicInfo> newList = new List <ReportBasicInfo>();
                newList.AddRange(TOPreports);
                newList.AddRange(reports);
                model.BasicInfos = newList;
                model.TagInfos   = tagList;


                this.ViewBag.NameP = client.GetChannelInfo(chnid).ChnName;
                this.ViewBag.NameC = client.GetLeafInfo(chnid, leafid).ChnName;

                client.Close();
            }


            return(View(model));
        }
        /// <summary>
        /// 通过筛选获取评价报告信息
        /// </summary>
        /// <param name="id">叶子ID</param>
        /// <returns>json串</returns>
        public ActionResult GetReportListByFilters(int id)
        {
            int pageIndex = 1;
            int pageSize  = 10;

            if (Request["pageindex"] != null && Request["pageindex"] != "")
            {
                pageIndex = Convert.ToInt32(Request["pageindex"]);             //当前页码
            }
            if (Request["pagesize"] != null && Request["pagesize"] != "")
            {
                pageSize = Convert.ToInt32(Request["pagesize"]);               //页容量
            }
            var condition              = GetCondition();
            ReportInfoViewModel model  = new ReportInfoViewModel();
            ChnLeafInfo         chLeaf = new ChnLeafInfo()
            {
                LeafId = id
            };

            model.LeafInfo = chLeaf;
            List <ReportBasicInfo> reports;
            int totalNum = 10;

            using (DFClient client = new DFClient())
            {
                reports         = client.GetCensorReportListByLeafId(out totalNum, chLeaf.LeafId, pageIndex, pageSize, condition, "", true);
                model.Total     = totalNum;
                model.PageIndex = pageIndex;
                List <ReportBasicInfo> newList = new List <ReportBasicInfo>();
                //通过判断将置顶数据优先显示
                var ttop    = (from r in reports where (r.IsTop == true && DateTime.Now >= (r.TopStartDate) && DateTime.Now <= (r.TopEndDate)) select r).ToList();
                var tnottop = (from r in reports where (r.IsTop == false || (r.IsTop == true && (DateTime.Now <(r.TopStartDate) || DateTime.Now> (r.TopEndDate)))) select r).ToList();
                newList.AddRange(ttop);
                newList.AddRange(tnottop);
                model.BasicInfos = newList;
                client.Close();
            }
            return(Json(model, JsonRequestBehavior.AllowGet));
        }
        public ActionResult GetReportDetails(int id, long docid)
        {
            var model = new ReportInfoViewModel();
            ReportDetailInfo      detail       = new ReportDetailInfo();
            List <ReportFileInfo> fileInfoList = new List <ReportFileInfo>();

            using (DFClient client = new DFClient())
            {
                detail       = client.GetReportDetailInfo(docid, id);
                fileInfoList = client.GetReportFileList(docid);
                //获取详细信息
                client.Close();
            }
            if (detail == null || fileInfoList == null)
            {
                return(Redirect("/home/error"));
            }
            model.DetailInfo = detail;
            model.FileInfos  = fileInfoList;
            ViewBag.Title    = detail.Subject;
            return(View(model));
        }