Files
Backend-Api/CompanyManagment.Application/EmployeeInsurancListDataApplication.cs
2025-01-15 18:13:34 +03:30

59 lines
2.3 KiB
C#

using System;
using System.Collections.Generic;
using _0_Framework.Application;
using Company.Domain.EmployeeChildrenAgg;
using Company.Domain.EmployeeInsurancListDataAgg;
using CompanyManagment.App.Contracts.EmployeeInsurancListData;
namespace CompanyManagment.Application;
public class EmployeeInsurancListDataApplication : IEmployeeInsurancListDataApplication
{
private readonly IEmployeeInsurancListDataRepository _employeeInsurancListDataRepository;
public EmployeeInsurancListDataApplication(IEmployeeInsurancListDataRepository employeeInsurancListDataRepository)
{
_employeeInsurancListDataRepository = employeeInsurancListDataRepository;
}
public OperationResult Create(CreateEmployeeInsurancListData command)
{
var operation = new OperationResult();
if (command == null)
return operation.Failed("لطفا اطلاعات ورودی را تکمیل نمایید!");
var employeeInsurancListData = new EmployeeInsurancListData(command.InsuranceListId, command.EmployeeId, command.WorkingDays, command.DailyWage, command.MonthlySalary, command.MonthlyBenefits,
command.MonthlyBenefitsIncluded, command.BenefitsIncludedContinuous, command.BenefitsIncludedNonContinuous, command.InsuranceShare,
command.StartWorkDate,command.LeftWorkDate,command.JobId,command.IncludeStatus, command.BaseYears,command.MarriedAllowance);
_employeeInsurancListDataRepository.Create(employeeInsurancListData);
_employeeInsurancListDataRepository.SaveChanges();
return operation.Succcedded();
}
public OperationResult Edit(EditEmployeeInsurancListData command)
{
var operation = new OperationResult();
if (command == null)
return operation.Failed("لطفا اطلاعات ورودی را تکمیل نمایید!");
_employeeInsurancListDataRepository.Edit(command);
_employeeInsurancListDataRepository.SaveChanges();
return operation.Succcedded();
}
public DetailsEmployeeInsurancListData GetDetails(long id)
{
throw new NotImplementedException();
}
public List<EmployeeInsurancListDataViewModel> Search(EmployeeInsurancListDataSearchModel searchModel)
{
throw new NotImplementedException();
}
}