Beispiel #1
0
 /// <summary>
 /// 输出模型
 /// </summary>
 /// <param name="QuestionReleaseDto"></param>
 /// <param name="QuestionReleaseInfo"></param>
 public QuestionReleaseOut(PagedResultDto <QuestionRelease> QuestionReleaseDto, QuestionReleaseIn QuestionReleaseInfo)
 {
     Items          = QuestionReleaseDto.Items;
     TotalCount     = QuestionReleaseDto.TotalCount;
     TotalPage      = QuestionReleaseDto.TotalCount / QuestionReleaseInfo.MaxResultCount;
     SkipCount      = QuestionReleaseInfo.SkipCount;
     MaxResultCount = QuestionReleaseInfo.MaxResultCount;
 }
Beispiel #2
0
 public async Task <IList <QuestionRelease> > QuestionReleaseList(QuestionReleaseIn QuestionReleaseInfo)
 {
     #region
     //var release = _repository.GetAll();
     //var doctor = _doctorrepository.GetAll();
     //var user = _userrepository.GetAll();
     //var QuestionReleases = from a in release
     //                join b in doctor on a.DoctorId equals b.Id
     //                join c in user on b.UserID equals c.Id
     //                where !a.IsDelete && !b.IsDelete
     //                select new QuestionReleaseOutList
     //                {
     //                    CreatedOn = b.CreatedOn,
     //                    CreatedBy = b.CreatedBy,
     //                    ModifyBy = b.ModifyBy,
     //                    ModifyOn = b.ModifyOn,
     //                    UserImage = c.UserImage,
     //                    DoctorName = b.DoctorName,
     //                    DescriptionTiltle = a.DescriptionTiltle,
     //                    Title = a.Title,
     //                    Answer = a.Answer,
     //                    TitleDetail = a.TitleDetail,
     //                    DoctorId = a.DoctorId,
     //                    ReadTotal = a.ReadTotal,
     //                    UpvoteTotal = a.UpvoteTotal,
     //                    TransTotal = a.TransTotal,
     //                    CollectTotal = a.CollectTotal,
     //                    CheckState = a.CheckState,
     //                    ClinicName = b.Department,
     //                    CheckRemark = a.CheckRemark,
     //                    Checker = a.Checker,
     //                    CheckTime = a.CheckTime,
     //                    DoctorTitle = b.Title,
     //                    Hospital = b.HospitalName,
     //                    Id = a.Id,
     //                };
     //QuestionReleases = QuestionReleases.Where(t => !t.IsDelete);
     //if (!string.IsNullOrEmpty(QuestionReleaseInfo.DescriptionTiltle))
     //{
     //    QuestionReleases = QuestionReleases.Where(t => t.DescriptionTiltle.Contains(QuestionReleaseInfo.DescriptionTiltle));
     //}
     //if (!string.IsNullOrEmpty(QuestionReleaseInfo.KeyWord))
     //{
     //    QuestionReleases = QuestionReleases.Where(t => t.DescriptionTiltle.Contains(QuestionReleaseInfo.KeyWord) || t.Answer.Contains(QuestionReleaseInfo.KeyWord) || t.Title.Contains(QuestionReleaseInfo.KeyWord) || t.TitleDetail.Contains(QuestionReleaseInfo.KeyWord));
     //}
     //DateTime StartTime = new DateTime();
     //DateTime EndTime = new DateTime();
     //if (!string.IsNullOrEmpty(QuestionReleaseInfo.StartTime))
     //{
     //    StartTime = DateTime.Parse(QuestionReleaseInfo.StartTime);
     //}
     //if (!string.IsNullOrEmpty(QuestionReleaseInfo.EndTime))
     //{
     //    EndTime = DateTime.Parse(QuestionReleaseInfo.EndTime).AddDays(+1);
     //}
     //if (!string.IsNullOrEmpty(QuestionReleaseInfo.StartTime))
     //{
     //    QuestionReleases = QuestionReleases.Where(a => a.CreatedOn >= StartTime && a.CreatedOn < EndTime);
     //}
     //return await QuestionReleases.ToListAsync();
     #endregion
     var query = _repository.GetAll().OrderByDescending(a => a.CreatedOn).Where(QuestionReleaseInfo.Expression);
     return(await query.ToListAsync());
 }