1234567891011121314151617181920212223242526272829303132333435 |
- using CZFW.Framework.Logic;
- using CZFW.Framework.Model.Entity;
- using CZKJ.GBRS2.Entity;
- using CZKJ.GBRS2.Interface;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace CZKJ.GBRS2.Logic
- {
- public class PriceAnnouncementLogic : LogicBase<PriceAnnouncementEntity>, IPriceAnnouncement
- {
- public IList<PriceAnnouncementEntity> GetTableList(int? typeId, int pageIndex, int pageSize, out int rowsCount)
- {
- IQueryable<PriceAnnouncementEntity> query = DbContext.Set<PriceAnnouncementEntity>();
- if (typeId.HasValue)
- {
- query = query.Where(x => x.Typeofinsuance == typeId);
- }
- rowsCount = query.Count();
- var result = query.Join(DbContext.Set<TypeEntity>(), x => x.Typeofinsuance, y => y.Id, (x, y) => new { x, y.Name }).OrderByDescending(x => x.x.DateTime).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList();
- return result.Select(x => new PriceAnnouncementEntity
- {
- TypeName = x.Name,
- Id = x.x.Id,
- Typeofinsuance = x.x.Typeofinsuance,
- DateTime = x.x.DateTime,
- DayInterestRate = x.x.DayInterestRate,
- YearInterestRate = x.x.YearInterestRate,
- }).ToList();
- }
- }
- }
|