예제 #1
0
        public ActionResult GetSubmitedZy(int pageIndex, int pageSize)
        {
            int           totalCount = 0;
            List <dto_Zy> list       = null;
            List <int>    ids        = B_Answer.GetSubmitedZyIds(UserId, pageIndex, pageSize, out totalCount);

            if (ids != null)
            {
                list = new List <dto_Zy>();
                ids.ForEach(a =>
                {
                    list.Add(B_ZyRedis.GetZy(a));
                });
            }
            if (list != null)
            {
                foreach (var l in list)
                {
                    //隐藏真实Id
                    l.NewId = IdNamingHelper.Encrypt(IdNamingHelper.IdTypeEnum.Zy, l.Id);

                    dto_User u = B_UserRedis.GetUser(l.UserId);
                    l.UserName = u.UserName;
                    l.TrueName = u.TrueName;
                    l.Id       = 0;
                }
            }

            ViewBag.ZyList    = list;
            ViewBag.PageCount = Util.GetTotalPageCount(totalCount, pageSize);
            return(PartialView());
        }
예제 #2
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());
        }
예제 #3
0
        /// <summary>
        /// 获取已提交作业
        /// </summary>
        /// <param name="lastId"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        public ActionResult GetSubmitedZy(long lastId, int count)
        {
            int           last = lastId == 0 ? 99999999 : IdNamingHelper.Decrypt(IdNamingHelper.IdTypeEnum.Zy, lastId);
            List <dto_Zy> list = null;
            List <int>    ids  = B_Answer.GetSubmitedZyIds(UserId, last, count);

            if (ids != null)
            {
                list = new List <dto_Zy>();
                ids.ForEach(a =>
                {
                    list.Add(B_ZyRedis.GetZy(a));
                });
            }
            if (list != null)
            {
                foreach (var l in list)
                {
                    //隐藏真实Id
                    l.NewId = IdNamingHelper.Encrypt(IdNamingHelper.IdTypeEnum.Zy, l.Id);

                    dto_User u = B_UserRedis.GetUser(l.UserId);
                    l.UserName = u.UserName;
                    l.TrueName = u.TrueName;
                    l.Id       = 0;
                }
            }

            ViewBag.ZyList = list;
            return(PartialView());
        }