64 lines
1.9 KiB
C#
64 lines
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using _0_Framework.Application;
|
|
using _0_Framework.InfraStructure;
|
|
using Company.Domain.InsuranceEmployeeInfoAgg;
|
|
|
|
using CompanyManagment.App.Contracts.InsuranceEmployeeInfo;
|
|
|
|
|
|
namespace CompanyManagment.EFCore.Repository;
|
|
|
|
public class InsuranceEmployeeInfoRepository : RepositoryBase<long, InsuranceEmployeeInfo>, IInsuranceEmployeeInfoRepository
|
|
{
|
|
private readonly CompanyContext _context;
|
|
public InsuranceEmployeeInfoRepository(CompanyContext context) : base(context)
|
|
{
|
|
_context = context;
|
|
|
|
}
|
|
|
|
|
|
public OperationResult Create(CreateInsuranceEmployeeInfo command)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public OperationResult Edit(EditInsuranceEmployeeInfo command)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public DetailsInsuranceEmployeeInfo GetDetails(long id)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public List<InsuranceEmployeeInfoViewModel> Search(InsuranceEmployeeInfoSearchModel searchModel)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public DetailsInsuranceEmployeeInfo GetDetailsByEmployeeId(long employeeId)
|
|
{
|
|
return _context.InsuranceEmployeeInformationSet.Select(x => new DetailsInsuranceEmployeeInfo
|
|
{
|
|
Id = x.id,
|
|
EmployeeId = x.EmployeeId,
|
|
FName = x.FName,
|
|
LName = x.LName,
|
|
FatherName = x.FatherName,
|
|
DateOfBirth = x.DateOfBirth.ToFarsi(),
|
|
DateOfIssue = x.DateOfIssue.ToFarsi(),
|
|
DateOfBirthGr = x.DateOfBirth,
|
|
DateOfIssueGr = x.DateOfIssue,
|
|
PlaceOfIssue = x.PlaceOfIssue,
|
|
NationalCode = x.NationalCode,
|
|
IdNumber = x.IdNumber,
|
|
Gender = x.Gender,
|
|
InsuranceCode = x.InsuranceCode,
|
|
|
|
}).FirstOrDefault(x => x.EmployeeId == employeeId);
|
|
}
|
|
} |