예제 #1
0
        public static string QueryFristNews()
        {
            string              r    = "";
            NB_NewsBll          sicb = new NB_NewsBll();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                string dw = "";
                if (iv.u.dcode.Trim() != "")
                {
                    dw = " and dcode = '" + iv.u.dcode.Substring(0, 8) + "'";
                }
                else
                {
                }
                List <NB_News> lnb = sicb.QueryList(" and cdate>'" + iv.u.ecdate + "' and ((nvrange='all' " + dw + " ) or (nvrange='seldep' and id in(select nid from NB_DepNews where dcode='" + iv.u.dcode + "') ))and id not in(select nid from NB_NewsReader where ename='" + iv.u.ename + "') order by id desc");
                if (lnb != null)
                {
                    r = js.Serialize(lnb[0]);
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
예제 #2
0
        public static ArrayList CustQueryRoleList(string curpage, string pagesize)
        {
            ArrayList          r    = new ArrayList();
            BusiEventButtonBll bebb = new BusiEventButtonBll();
            NB_NewsBll         sub  = new NB_NewsBll();
            List <NB_News>     lsr  = new List <NB_News>();

            StringBuilder where = new StringBuilder();
            SessionUserValidate iv = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                int rcount = 0;
                int pcount = 0;
                if (iv.u.rcode != "xtgl")
                {
                    where.AppendFormat(" and ( id in(select nid from NB_DepNews where dcode='{0}') or rtype='a' )   ", iv.u.dcode);
                }
                lsr = sub.QueryList(Convert.ToInt32(curpage), Convert.ToInt32(pagesize), where.ToString(), "id desc", ref rcount, ref pcount);
                if (lsr != null)
                {
                    r.Add(pcount);
                    foreach (NB_News s in lsr)
                    {
                        ArrayList al = new ArrayList();
                        al.Add(s.id);
                        al.Add(s.ntitle);
                        al.Add(s.ntype);
                        al.Add(s.nstate == true ? "显示" : "关闭");
                        al.Add(s.maker);
                        al.Add(s.cdate);
                        al.Add(bebb.QueryBtnListItems("0175", iv.u.rcode, "LX", s.id.ToString()));
                        r.Add(al);
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
예제 #3
0
        public static ArrayList CustQueryListAll(string curpage, string pagesize)
        {
            ArrayList           r    = new ArrayList();
            BusiEventButtonBll  bebb = new BusiEventButtonBll();
            NB_NewsBll          sub  = new NB_NewsBll();
            List <NB_News>      lsr  = new List <NB_News>();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                int rcount = 0;
                int pcount = 0;

                lsr = sub.QueryList(Convert.ToInt32(curpage), Convert.ToInt32(pagesize), " ", "id desc", ref rcount, ref pcount);
                if (lsr != null)
                {
                    r.Add(pcount);
                    foreach (NB_News s in lsr)
                    {
                        ArrayList al = new ArrayList();
                        al.Add(s.id);
                        al.Add(s.ntitle);
                        al.Add(s.ntype);
                        al.Add(s.nstate == true ? "显示" : "关闭");
                        al.Add(s.maker);
                        al.Add(s.cdate);
                        al.Add(bebb.QueryBtnListItems("0176", iv.u.rcode, "LX", s.id.ToString()));
                        r.Add(al);
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }