private string GetList(ART_DOCUMENT_SW sw)
        {
            var    list      = ART_DOCUMENTCls.getModelList(sw).ToList();
            string str       = "";
            int    newSCount = 0;

            foreach (var v in list)
            {
                newSCount++;
                str += "<li>\r\n";
                str += "<div class=\"text\"><a href='/ArtDocument/DocShow?ID=" + v.ARTID + "' target=\"_blank\">" + v.ARTTITLE + "</a></div>";
                str += "<div class=\"right\">" + v.ARTTIME + "</div>";
                str += "</li>";
            }
            for (int i = 0; i < Convert.ToInt16(ConfigCls.getTopNewsTopCount()) - newSCount; i++)
            {
                str += "<li>\r\n";
                //str += "<p style=\"color:red;\">暂无消息</p>";

                str += "<div class=\"text\"></div>";
                str += "<div class=\"right\"></div>";
                str += "</li>";
            }
            return(str);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 文档管理Ajax列表
        /// </summary>
        /// <returns></returns>
        public ActionResult getDocIndexAjax()
        {
            string PageSize = Request.Params["PageSize"];

            if (PageSize == "0")
            {
                PageSize = ConfigCls.getTableDefaultPageSize();
            }
            string          Page       = Request.Params["Page"];
            string          EMAILTITLE = Request.Params["TITLE"];
            string          tid        = Request.Params["tid"];
            string          BYORGNO    = Request.Params["BYORGNO"];
            string          FIRELEVEL  = Request.Params["FIRELEVEL"];
            int             total      = 0;
            ART_DOCUMENT_SW sw         = new ART_DOCUMENT_SW {
                curPage = int.Parse(Page), pageSize = int.Parse(PageSize), ARTTITLE = EMAILTITLE, ARTTYPEID = tid
            };
            var           result = ART_DOCUMENTCls.getModelList(sw, out total);
            StringBuilder sb     = new StringBuilder();

            sb.AppendFormat("<table cellpadding=\"0\" cellspacing=\"0\">");
            sb.AppendFormat("<thead>");
            sb.AppendFormat("<tr>");
            sb.AppendFormat("<th style='width:10%;'>序号</th>");
            sb.AppendFormat("<th style='width:10%;'>单位</th>");
            sb.AppendFormat("<th style='width:30%;'>标题</th>");
            sb.AppendFormat("<th style='width:15%;'>添加人</th>");
            sb.AppendFormat("<th style='width:15%;'>时间</th>");
            sb.AppendFormat("</tr>");
            sb.AppendFormat("</thead>");
            sb.AppendFormat("<tbody>");
            int i = 0;

            foreach (var v in result)
            {
                if (i % 2 == 0)
                {
                    sb.AppendFormat("<tr>");
                }
                else
                {
                    sb.AppendFormat("<tr class='row1'>");
                }
                sb.AppendFormat("<td class=\"center\">{0}</td>", (i + 1).ToString());
                sb.AppendFormat("<td class=\"center\">{0}</td>", v.orgName);// v.ARTTYPENAME);
                sb.AppendFormat("<td class=\"left\"><a href=\"/ArtDocument/DocShow?ID={1}\" target='_blank'>{0}</a></td>", v.ARTTITLE, v.ARTID);
                sb.AppendFormat("<td class=\"left\">{0}</td>", v.ARTADDUSERName);
                sb.AppendFormat("<td class=\"center\">{0}</td>", v.ARTTIME);
                sb.AppendFormat("</td>");
                sb.AppendFormat("</tr>");
                i++;
            }
            sb.AppendFormat("</tbody>");
            sb.AppendFormat("</table>");
            string pageInfo = PagerCls.getPagerInfoAjax(new PagerSW {
                curPage = sw.curPage, pageSize = sw.pageSize, rowCount = total
            });

            return(Content(JsonConvert.SerializeObject(new MessagePagerAjax(true, sb.ToString(), pageInfo)), "text/html;charset=UTF-8"));;
        }
Exemplo n.º 3
0
        /// <summary>
        /// 组合表格
        /// </summary>
        /// <param name="sw"></param>
        /// <param name="total"></param>
        /// <returns></returns>
        private string getDocBigListStr(ART_DOCUMENT_SW sw, string typeid, out int total)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("<table cellpadding=\"0\" cellspacing=\"0\">");
            sb.AppendFormat("<thead>");
            sb.AppendFormat("<tr>");
            sb.AppendFormat("<th style='width:10%;'>序号</th>");
            sb.AppendFormat("<th style='width:10%;'>类别</th>");
            sb.AppendFormat("<th style='width:30%;'>标题</th>");
            sb.AppendFormat("<th style='width:15%;'>添加人</th>");
            sb.AppendFormat("<th style='width:15%;'>时间</th>");
            sb.AppendFormat("<th style='width:20%;'>管理</th>");
            sb.AppendFormat("</tr>");
            sb.AppendFormat("</thead>");
            sb.AppendFormat("<tbody>");
            var result = ART_DOCUMENTCls.getModelList(sw, out total);
            int i      = 0;

            foreach (var v in result)
            {
                if (i % 2 == 0)
                {
                    sb.AppendFormat("<tr>");
                }
                else
                {
                    sb.AppendFormat("<tr class='row1'>");
                }
                sb.AppendFormat("<td class=\"center\">{0}</td>", (i + 1).ToString());
                sb.AppendFormat("<td class=\"center\">{0}</td>", v.ARTTYPENAME);// v.ARTTYPENAME);
                sb.AppendFormat("<td class=\"left\"><a href=\"/ArtDocument/DocShow?ID={1}\" target='_blank'>{0}</a></td>", v.ARTTITLE, v.ARTID);
                sb.AppendFormat("<td class=\"left\">{0}</td>", v.ARTADDUSERName);
                sb.AppendFormat("<td class=\"center\">{0}</td>", v.ARTTIME);
                sb.AppendFormat("<td class=\"center\">");
                sb.AppendFormat("<a href='#' onclick=\"Mdy('{0}','{1}')\" class=\"searchBox_01 LinkMdy\">修改</a>", v.ARTID, typeid);
                sb.AppendFormat("&nbsp;<a href='#' onclick='Manager({0})' class=\"searchBox_01 LinkDel\">删除</a>", v.ARTID);
                sb.AppendFormat("</td>");
                sb.AppendFormat("</tr>");
                i++;
            }
            sb.AppendFormat("</tbody>");
            sb.AppendFormat("</table>");
            return(sb.ToString());
        }
        private List <ART_DOCUMENT_Model> GetList1(ART_DOCUMENT_SW sw)
        {
            var list = ART_DOCUMENTCls.getModelList(sw).ToList();

            return(list);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 文档管理Ajax列表
        /// </summary>
        /// <returns></returns>
        public ActionResult getDocDefaultAjax()
        {
            string PageSize = Request.Params["PageSize"];

            if (PageSize == "0")
            {
                PageSize = ConfigCls.getTableDefaultPageSize();
            }
            string Page       = Request.Params["Page"];
            string EMAILTITLE = Request.Params["TITLE"];
            string typeID     = (string.IsNullOrEmpty(Request.Params["typeID"])) ? "" : Request.Params["typeID"].ToString();
            string bigTypeID  = "";// (string.IsNullOrEmpty(Request.Params["ArtTID"])) ? "" : Request.Params["ArtTID"].ToString();

            if (typeID == "006101")
            {
                bigTypeID = "013";                    //通告公告
            }
            if (typeID == "006102")
            {
                bigTypeID = "014";                    //防火百科
            }
            if (typeID == "006103")
            {
                bigTypeID = "015";                    //帮助
            }
            if (typeID == "006024")
            {
                bigTypeID = "031";                    //有害生物
            }
            int             total = 0;
            ART_DOCUMENT_SW sw    = new ART_DOCUMENT_SW {
                curPage = int.Parse(Page), pageSize = int.Parse(PageSize), ARTTITLE = EMAILTITLE, ARTBigTYPEID = bigTypeID, BYORGNO = SystemCls.getCurUserOrgNo()
            };
            var           result = ART_DOCUMENTCls.getModelList(sw, out total);
            StringBuilder sb     = new StringBuilder();

            sb.AppendFormat("<table cellpadding=\"0\" cellspacing=\"0\">");
            sb.AppendFormat("<thead>");
            sb.AppendFormat("<tr>");
            sb.AppendFormat("<th style='width:10%;'>序号</th>");
            sb.AppendFormat("<th style='width:10%;'>类别</th>");
            sb.AppendFormat("<th style='width:30%;'>标题</th>");
            sb.AppendFormat("<th style='width:15%;'>添加人</th>");
            sb.AppendFormat("<th style='width:15%;'>时间</th>");
            sb.AppendFormat("<th style='width:20%;'>管理</th>");
            sb.AppendFormat("</tr>");
            sb.AppendFormat("</thead>");
            sb.AppendFormat("<tbody>");
            int i = 0;

            foreach (var v in result)
            {
                if (i % 2 == 0)
                {
                    sb.AppendFormat("<tr>");
                }
                else
                {
                    sb.AppendFormat("<tr class='row1'>");
                }
                sb.AppendFormat("<td class=\"center\">{0}</td>", (i + 1).ToString());
                sb.AppendFormat("<td class=\"center\">{0}</td>", v.ARTTYPENAME);// v.ARTTYPENAME);
                sb.AppendFormat("<td class=\"left\"><a href=\"/ArtDocument/DocShow?ID={1}\" target='_blank'>{0}</a></td>", v.ARTTITLE, v.ARTID);
                sb.AppendFormat("<td class=\"center\">{0}</td>", v.ARTADDUSERName);
                sb.AppendFormat("<td class=\"center\">{0}</td>", v.ARTTIME);
                sb.AppendFormat("<td class=\"center\">");
                sb.AppendFormat("<a href='#' onclick=\"Mdy('{0}','{1}')\" class=\"searchBox_01 LinkMdy\">修改</a>", v.ARTID, typeID);
                sb.AppendFormat("&nbsp;<a href='#' onclick='Manager({0})' class=\"searchBox_01 LinkDel\">删除</a>", v.ARTID);
                sb.AppendFormat("</td>");
                sb.AppendFormat("</tr>");
                i++;
            }
            sb.AppendFormat("</tbody>");
            sb.AppendFormat("</table>");
            string pageInfo = PagerCls.getPagerInfoAjax(new PagerSW {
                curPage = sw.curPage, pageSize = sw.pageSize, rowCount = total
            });

            return(Content(JsonConvert.SerializeObject(new MessagePagerAjax(true, sb.ToString(), pageInfo)), "text/html;charset=UTF-8"));;
        }