38 lines
1.5 KiB
C#
38 lines
1.5 KiB
C#
using System.Collections.Generic;
|
|
using _0_Framework.Application;
|
|
using Company.Domain.WorkingHoursTempItemAgg;
|
|
using CompanyManagment.App.Contracts.WorkingHoursTempItem;
|
|
|
|
namespace CompanyManagment.Application;
|
|
|
|
public class WorkingHoursTempItemApplication : IWorkingHoursTempItemApplication
|
|
{
|
|
private readonly IWorkingHoursTempItemRepository _workingHoursTempItemRepository;
|
|
|
|
public WorkingHoursTempItemApplication(IWorkingHoursTempItemRepository workingHoursTempItemRepository)
|
|
{
|
|
_workingHoursTempItemRepository = workingHoursTempItemRepository;
|
|
}
|
|
|
|
public OperationResult Create(CreateWorkingHoursTempItem command)
|
|
{
|
|
var opration = new OperationResult();
|
|
var creatTempItems = new WorkingHoursTempItem(command.WeekNumber, command.DayOfWork, command.Start1,
|
|
command.End1,
|
|
command.RestTime, command.Start2, command.End2, command.ComplexStart, command.ComplexEnd,
|
|
command.WorkingHoursTempId);
|
|
_workingHoursTempItemRepository.Create(creatTempItems);
|
|
_workingHoursTempItemRepository.SaveChanges();
|
|
return opration.Succcedded();
|
|
}
|
|
|
|
public List<WorkingHoursTempItemViweModel> GetTempItemByWorkingHourstempId(long workingHoursTempId)
|
|
{
|
|
return _workingHoursTempItemRepository.GetTempItemByWorkingHourstempId(workingHoursTempId);
|
|
}
|
|
|
|
public List<long> GetLongsByWorkingHoursTempId(long workingHoursTempId)
|
|
{
|
|
return _workingHoursTempItemRepository.GetLongsByWorkingHoursTempId(workingHoursTempId);
|
|
}
|
|
} |