Esempio n. 1
0
        public void OnGet(string id, string type = "")
        {
            int page     = 1;
            var listPage = Request.Query["page"];

            if (!string.IsNullOrEmpty(listPage))
            {
                page = Convert.ToInt32(listPage);
            }
            pageIndex = page;

            User = _memberService.GetModelAsync(m => m.Guid == id).Result.data;
            var groupGuid  = User.Grade;
            var groupModel = _groupService.GetModelAsync(m => m.Guid == groupGuid).Result.data;

            GroupName = groupModel.Name;

            QuestionCount = _questionsService.CountAsync(m => m.UserGuid == id).Result.data.Count;

            AnswerCount = _answerService.CountAsync(m => m.UserGuid == id).Result.data.Count;

            Types = type;
            if (type == "")
            {
                QuestionList = _questionsService.GetPagesAsync(new PageParm()
                {
                    page = page
                }, m => m.UserGuid == id, m => m.AddTime, DbOrderEnum.Desc).Result.data;
            }
            else
            {
                AnswerList = _answerService.GetUserCenterAnswer(new PageParm()
                {
                    page = page, guid = id
                }).Result.data;
            }
        }
Esempio n. 2
0
 public async Task <IActionResult> GetPages([FromBody] ParmString obj)
 {
     return(Ok(await _groupService.GetModelAsync(m => m.Guid == obj.parm)));
 }