ต้นแบบการทำรายงาน
This commit is contained in:
parent
3332af583b
commit
3c11d1b5a1
6 changed files with 83 additions and 5 deletions
|
|
@ -0,0 +1,63 @@
|
|||
using BMA.EHR.Application.Common.Interfaces;
|
||||
using BMA.EHR.Domain.Extensions;
|
||||
using BMA.EHR.Domain.Models.Retirement;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BMA.EHR.Application.Repositories.Reports
|
||||
{
|
||||
public class RetireReportRepository
|
||||
{
|
||||
#region " Fields "
|
||||
|
||||
private readonly IApplicationDBContext _dbContext;
|
||||
|
||||
#endregion
|
||||
|
||||
#region " Constructor and Destructor "
|
||||
|
||||
public RetireReportRepository(IApplicationDBContext dbContext)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region " Methods "
|
||||
|
||||
public async Task<List<RetirementPeriod>> GetListRetirePeriodAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 1. query
|
||||
var data = await _dbContext.Set<RetirementPeriod>()
|
||||
.Include(x => x.RetirementPeriodHistorys)
|
||||
.Include(x => x.RetirementProfiles)
|
||||
.ThenInclude(x => x.Profile)
|
||||
.ToListAsync();
|
||||
|
||||
// 2. data not found throw exception
|
||||
|
||||
|
||||
// 3. Load Report File
|
||||
|
||||
|
||||
|
||||
return data;
|
||||
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue