Exemplo n.º 1
0
        public ActionResult GetRelatedUserZy(int pageIndex, int pageSize)
        {
            int totalCount = 0;

            int[]         RUsers = B_User.GetRelatedUser(UserId);
            List <dto_Zy> list   = B_Zy.GetZyList(RUsers, pageIndex, pageSize, out totalCount);

            if (list != null)
            {
                List <int> ids = B_Answer.GetSubmitedZyIds(UserId, list.Select(a => a.Id).ToArray());
                foreach (var l in list)
                {
                    l.NewId = IdNamingHelper.Encrypt(IdNamingHelper.IdTypeEnum.Zy, l.Id);
                    string subName = "";
                    Const.Subjects.TryGetValue(l.SubjectId, out subName);
                    l.SubjectName = subName;
                    l.TypeName    = l.Type == 0 ? "题库" : "自传";
                    dto_User u = B_UserRedis.GetUser(l.UserId);
                    l.UserName = u.UserName;
                    l.TrueName = u.TrueName;
                    l.Submited = ids == null ? false : ids.Exists(a => a == l.Id);
                    //隐藏真实Id
                    l.Id = 0;
                }
            }
            ViewBag.RelateUserCount = RUsers == null ? 0 : RUsers.Length;
            ViewBag.ZyList          = list;
            ViewBag.PageCount       = Util.GetTotalPageCount(totalCount, pageSize);
            return(PartialView());
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取我新建的作业
        /// </summary>
        /// <param name="lastId"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        public ActionResult GetMyZy(long lastId, int count)
        {
            int           last = lastId == 0 ? 99999999 : IdNamingHelper.Decrypt(IdNamingHelper.IdTypeEnum.Zy, lastId);
            List <dto_Zy> list = B_Zy.GetZyList(UserId, last, count);

            if (list != null)
            {
                foreach (var l in list)
                {
                    //隐藏真实Id
                    l.NewId = IdNamingHelper.Encrypt(IdNamingHelper.IdTypeEnum.Zy, l.Id);
                    string subName = "";
                    Const.Subjects.TryGetValue(l.SubjectId, out subName);
                    l.SubjectName = subName;
                    l.TypeName    = l.Type == 0 ? "题库" : "自传";
                    l.Id          = 0;
                }
            }

            ViewBag.ZyList = list;
            return(PartialView());
        }
Exemplo n.º 3
0
        public ActionResult GetMyZy(int pageIndex, int pageSize)
        {
            int           totalCount = 0;
            List <dto_Zy> list       = B_Zy.GetZyList(UserId, pageIndex, pageSize, out totalCount);

            if (list != null)
            {
                foreach (var l in list)
                {
                    //隐藏真实Id
                    l.NewId = IdNamingHelper.Encrypt(IdNamingHelper.IdTypeEnum.Zy, l.Id);
                    string subName = "";
                    Const.Subjects.TryGetValue(l.SubjectId, out subName);
                    l.SubjectName = subName;
                    l.TypeName    = l.Type == 0 ? "题库" : "自传";
                    l.Id          = 0;
                }
            }

            ViewBag.ZyList    = list;
            ViewBag.PageCount = Util.GetTotalPageCount(totalCount, pageSize);
            return(PartialView());
        }