예제 #1
0
        public ActionResult Query(QueryTJDto dto)
        {
            Expression <Func <GonhuoShang, bool> > where = i => i.TTime >= dto.State && i.TTime <= dto.End;
            if (dto.gType != 9999)
            {
                where = where.And(i => i.GType == dto.gType);
            }
            if (!string.IsNullOrEmpty(dto.gname))
            {
                where = where.And(i => i.GName.IndexOf(dto.gname) != -1);
            }
            GetRequestPage(dto);
            var pageIndex = dto.PageIndex;
            var count     = 0;
            var pageCount = 0;
            var aniBll    = new GonhuoService();
            var lis       = aniBll.GetByWhereDesc(where, i => i.XTime, ref pageIndex, ref count, ref pageCount, 4);

            var aniType = new TypeService();
            var type    = aniType.GetAll();

            type.Insert(0, new GonHuoSModel.Type()
            {
                Tid = 9999, TName = "全部"
            });
            ViewBag.GType = new SelectList(type, "Tid", "TName");

            ViewBag.PageIndex = pageIndex;
            ViewBag.Count     = count;
            ViewBag.PageCount = pageCount;
            ViewBag.Gonhuo    = lis;
            ViewBag.dto1      = dto;
            return(View());
        }
예제 #2
0
        public ActionResult AddResult()
        {
            var aniType = new TypeService();
            var type    = aniType.GetAll();

            ViewBag.GType = new SelectList(type, "Tid", "TName");
            return(View());
        }
예제 #3
0
        public ActionResult UpdateResult(int id)
        {
            var a = new GonhuoService();
            var s = a.GetByWhere(i => i.Gid == id).SingleOrDefault();

            var aniType = new TypeService();
            var type    = aniType.GetAll();

            ViewBag.GType = new SelectList(type, "Tid", "TName", s.GType);
            return(View(s));
        }
예제 #4
0
        /// <summary>
        /// ajax查询所有
        /// </summary>
        /// <returns></returns>
        public ActionResult Queryssss()
        {
            var aniType = new TypeService();
            var type    = aniType.GetAll();

            type.Insert(0, new GonHuoSModel.Type()
            {
                Tid = 9999, TName = "全部"
            });
            ViewBag.GType = new SelectList(type, "Tid", "TName");
            return(View());
        }