482 lines
21 KiB
C#
482 lines
21 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using _0_Framework.Application;
|
|
using _0_Framework.InfraStructure;
|
|
using Company.Domain.LeaveAgg;
|
|
using CompanyManagment.App.Contracts.Checkout;
|
|
using CompanyManagment.App.Contracts.Leave;
|
|
|
|
namespace CompanyManagment.EFCore.Repository;
|
|
|
|
public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
|
{
|
|
private readonly CompanyContext _context;
|
|
public LeaveRepository(CompanyContext context) : base(context)
|
|
{
|
|
_context = context;
|
|
}
|
|
|
|
public EditLeave GetDetails(long id)
|
|
{
|
|
return _context.LeaveList.Select(x => new EditLeave()
|
|
{
|
|
Id = x.id,
|
|
StartLeave = x.StartLeave.ToFarsi(),
|
|
EndLeave = x.EndLeave.ToFarsi(),
|
|
StartLeaveGr = x.StartLeave,
|
|
EndLeaveGr = x.EndLeave,
|
|
WorkshopId = x.WorkshopId,
|
|
EmployeeId = x.EmployeeId,
|
|
LeaveHourses = x.LeaveHourses,
|
|
PaidLeaveType = x.PaidLeaveType,
|
|
LeaveType = x.LeaveType,
|
|
EmployeeFullName = x.EmployeeFullName,
|
|
WorkshopName = x.WorkshopName,
|
|
IsAccepted = x.IsAccepted,
|
|
Decription = x.Decription,
|
|
Year = x.Year,
|
|
Month = x.Month,
|
|
HasRollCall = x.HasShiftDuration,
|
|
}).FirstOrDefault(x => x.Id == id);
|
|
}
|
|
|
|
public List<LeaveViewModel> search(LeaveSearchModel searchModel)
|
|
{
|
|
var query = _context.LeaveList.Select(x => new LeaveViewModel()
|
|
{
|
|
Id = x.id,
|
|
StartLeave = x.StartLeave.ToFarsi(),
|
|
EndLeave = x.EndLeave.ToFarsi(),
|
|
StartLeaveGr = x.StartLeave,
|
|
EndLeaveGr = x.EndLeave,
|
|
WorkshopId = x.WorkshopId,
|
|
EmployeeId = x.EmployeeId,
|
|
LeaveHourses = x.LeaveHourses,
|
|
PaidLeaveType = x.PaidLeaveType,
|
|
LeaveType = x.LeaveType,
|
|
EmployeeFullName = x.EmployeeFullName,
|
|
WorkshopName = x.WorkshopName,
|
|
IsAccepted = x.IsAccepted,
|
|
Decription = x.Decription,
|
|
Year = x.Year,
|
|
Month = x.Month,
|
|
HasShiftDuration = x.HasShiftDuration,
|
|
ShiftDuration = x.ShiftDuration,
|
|
});
|
|
|
|
if (searchModel.WorkshopId != 0 && searchModel.EmployeeId != 0)
|
|
query = query.Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeeId == searchModel.EmployeeId);
|
|
|
|
if (!string.IsNullOrWhiteSpace(searchModel.LeaveType))
|
|
query = query.Where(x => x.LeaveType == searchModel.LeaveType);
|
|
|
|
if (!string.IsNullOrWhiteSpace(searchModel.PaidLeaveType))
|
|
query = query.Where(x => x.PaidLeaveType == searchModel.PaidLeaveType);
|
|
if (!string.IsNullOrWhiteSpace(searchModel.StartLeave) && !string.IsNullOrWhiteSpace(searchModel.EndLeave))
|
|
{
|
|
DateTime startSearch = searchModel.StartLeave.ToGeorgianDateTime();
|
|
DateTime endSearch = searchModel.EndLeave.ToGeorgianDateTime();
|
|
query = query.Where(x => (startSearch <= x.StartLeaveGr.Date && endSearch >= x.StartLeaveGr.Date) ||
|
|
(startSearch <= x.EndLeaveGr.Date && endSearch >= x.EndLeaveGr.Date) ||
|
|
(startSearch >= x.StartLeaveGr.Date && startSearch <= x.EndLeaveGr.Date) ||
|
|
(endSearch >= x.StartLeaveGr.Date && endSearch <= x.EndLeaveGr.Date));
|
|
}else if (searchModel.StartLeaveGr != null && searchModel.EndLeaveGr != null)
|
|
{
|
|
query = query.Where(x => (searchModel.StartLeaveGr <= x.StartLeaveGr.Date && searchModel.EndLeaveGr >= x.StartLeaveGr.Date) ||
|
|
(searchModel.StartLeaveGr <= x.EndLeaveGr.Date && searchModel.EndLeaveGr >= x.EndLeaveGr.Date) ||
|
|
(searchModel.StartLeaveGr >= x.StartLeaveGr.Date && searchModel.StartLeaveGr <= x.EndLeaveGr.Date) ||
|
|
(searchModel.EndLeaveGr >= x.StartLeaveGr.Date && searchModel.EndLeaveGr <= x.EndLeaveGr.Date));
|
|
}
|
|
if(searchModel.IsAccepted)
|
|
query = query.Where(x => x.IsAccepted == true);
|
|
return query.OrderByDescending(x => x.Id).ToList();
|
|
}
|
|
|
|
public List<LeaveMainViewModel> searchClient(LeaveSearchModel searchModel)
|
|
{
|
|
var leaveMainList = _context.LeaveList.Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeeId == searchModel.EmployeeId);
|
|
|
|
if (searchModel.LeaveType == "paidLeave")
|
|
leaveMainList = leaveMainList.Where(x => x.LeaveType == "استحقاقی");
|
|
|
|
if (searchModel.LeaveType == "sickLeave")
|
|
leaveMainList = leaveMainList.Where(x => x.LeaveType == "استعلاجی");
|
|
|
|
if (!string.IsNullOrWhiteSpace(searchModel.StartLeave) && !string.IsNullOrWhiteSpace(searchModel.EndLeave))
|
|
{
|
|
var start = searchModel.StartLeave.ToGeorgianDateTime();
|
|
var end = searchModel.EndLeave.ToGeorgianDateTime();
|
|
leaveMainList = leaveMainList.Where(x => x.StartLeave >= start && x.EndLeave <= end);
|
|
}
|
|
else if (searchModel.Year != 0 || searchModel.Month != 0)
|
|
{
|
|
if (searchModel.Year != 0)
|
|
leaveMainList = leaveMainList.Where(x => x.Year == searchModel.Year);
|
|
|
|
if (searchModel.Month != 0)
|
|
leaveMainList = leaveMainList.Where(x => x.Month == searchModel.Month);
|
|
}
|
|
|
|
var leaveList = leaveMainList.GroupBy(x => new { x.Year, x.Month })
|
|
.OrderByDescending(group => group.Key.Year)
|
|
.ThenByDescending(group => group.Key.Month)
|
|
.Select(group => new LeaveMainViewModel
|
|
{
|
|
Year = group.Key.Year,
|
|
Month = group.Key.Month,
|
|
MonthStr = group.Key.Month.ToFarsiMonthByIntNumber(),
|
|
LeaveList = group.Select(item => new LeaveViewModel
|
|
{
|
|
Id = item.id,
|
|
StartLeave = item.StartLeave.ToFarsi(),
|
|
EndLeave = item.EndLeave.ToFarsi(),
|
|
StartLeaveGr = item.StartLeave,
|
|
EndLeaveGr = item.EndLeave,
|
|
WorkshopId = item.WorkshopId,
|
|
EmployeeId = item.EmployeeId,
|
|
LeaveHourses = Tools.CalculateLeaveHoursAndDays(item.PaidLeaveType,item.LeaveHourses),
|
|
PaidLeaveType = item.PaidLeaveType,
|
|
LeaveType = item.LeaveType,
|
|
IsAccepted = item.IsAccepted,
|
|
Decription = item.Decription,
|
|
Year = item.Year,
|
|
Month = item.Month
|
|
}).OrderByDescending(x => x.StartLeaveGr).ToList()
|
|
}).ToList();
|
|
|
|
return leaveList;
|
|
}
|
|
|
|
public LeavePrintViewModel PrintOne(long id)
|
|
{
|
|
var leave = _context.LeaveList.Select(x => new LeavePrintViewModel()
|
|
{
|
|
Id = x.id,
|
|
ContractNo = "",
|
|
EmployeeId = x.EmployeeId,
|
|
EmployeeFullName = x.EmployeeFullName,
|
|
NationalCode = "",
|
|
WorkshopId = x.WorkshopId,
|
|
WorkshopName = x.WorkshopName,
|
|
StartLeave = x.StartLeave.ToFarsi(),
|
|
EndLeave = x.EndLeave.ToFarsi(),
|
|
StartLeaveGr = x.StartLeave,
|
|
EndLeaveGr = x.EndLeave,
|
|
LeaveType = x.LeaveType,
|
|
PaidLeaveType = x.PaidLeaveType,
|
|
LeaveHourses = Tools.CalculateLeaveHoursAndDays(x.PaidLeaveType, x.LeaveHourses),
|
|
IsAccepted = x.IsAccepted,
|
|
Decription = x.Decription,
|
|
EmployerList = new List<EmprViewModel>(),
|
|
}).SingleOrDefault(x => x.Id == id);
|
|
|
|
//leave.ContractNo = _context.Contracts.FirstOrDefault(x => x.ContarctStart <= leave.StartLeaveGr && x.ContractEnd > leave.StartLeaveGr
|
|
// && x.ContarctStart < leave.EndLeaveGr && x.ContractEnd > leave.EndLeaveGr
|
|
// && x.WorkshopIds == leave.WorkshopId && x.EmployeeId == leave.EmployeeId).ContractNo;
|
|
leave.ContractNo = _context.Contracts.FirstOrDefault(x=>x.ContarctStart <= leave.StartLeaveGr && x.ContractEnd >= leave.StartLeaveGr && x.EmployeeId == leave.EmployeeId && x.WorkshopIds == leave.WorkshopId)?.ContractNo;
|
|
|
|
var Employee = _context.Employees.SingleOrDefault(x => x.id == leave.EmployeeId);
|
|
leave.NationalCode = Employee.NationalCode;
|
|
|
|
var emp = _context.WorkshopEmployers.Where(x => x.WorkshopId == leave.WorkshopId).Select(x => x.EmployerId).ToList();
|
|
var employerlist = _context.Employers.Select(x => new EmprViewModel()
|
|
{
|
|
Id = x.id,
|
|
EmployerFullName = x.FName + " " + x.LName,
|
|
IsLegal = x.IsLegal,
|
|
}).Where(x => emp.Contains(x.Id)).ToList();
|
|
if (employerlist.Count > 0)
|
|
{
|
|
leave.EmployerList = employerlist;
|
|
}
|
|
else
|
|
{
|
|
leave.EmployerList = new List<EmprViewModel>();
|
|
}
|
|
|
|
return leave;
|
|
}
|
|
|
|
public List<LeavePrintViewModel> PrintAll(List<long> id)
|
|
{
|
|
var query = new List<LeavePrintViewModel>();
|
|
|
|
foreach (var item in id)
|
|
{
|
|
var leave = _context.LeaveList.Select(x => new LeavePrintViewModel
|
|
{
|
|
Id = x.id,
|
|
ContractNo = "",
|
|
EmployeeId = x.EmployeeId,
|
|
EmployeeFullName = x.EmployeeFullName,
|
|
NationalCode = "",
|
|
WorkshopId = x.WorkshopId,
|
|
WorkshopName = x.WorkshopName,
|
|
StartLeave = x.StartLeave.ToFarsi(),
|
|
EndLeave = x.EndLeave.ToFarsi(),
|
|
StartLeaveGr = x.StartLeave,
|
|
EndLeaveGr = x.EndLeave,
|
|
LeaveType = x.LeaveType,
|
|
PaidLeaveType = x.PaidLeaveType,
|
|
LeaveHourses = Tools.CalculateLeaveHoursAndDays(x.PaidLeaveType, x.LeaveHourses),
|
|
IsAccepted = x.IsAccepted,
|
|
Decription = x.Decription,
|
|
Year = x.Year,
|
|
Month = x.Month,
|
|
MonthGr = Tools.ToFarsiMonthByIntNumber(x.Month),
|
|
EmployerList = new List<EmprViewModel>()
|
|
}).SingleOrDefault(x => x.Id == item);
|
|
|
|
//leave.ContractNo = _context.Contracts.FirstOrDefault(x => x.ContarctStart <= leave.StartLeaveGr && x.ContractEnd > leave.StartLeaveGr
|
|
// && x.ContarctStart < leave.EndLeaveGr && x.ContractEnd > leave.EndLeaveGr
|
|
// && x.WorkshopIds == leave.WorkshopId && x.EmployeeId == leave.EmployeeId).ContractNo;
|
|
|
|
leave.ContractNo = _context.Contracts.FirstOrDefault(x => x.ContarctStart <= leave.StartLeaveGr
|
|
&& x.ContractEnd >= leave.StartLeaveGr && x.EmployeeId == leave.EmployeeId
|
|
&& x.WorkshopIds == leave.WorkshopId)?.ContractNo;
|
|
|
|
var Employee = _context.Employees.SingleOrDefault(x => x.id == leave.EmployeeId);
|
|
leave.NationalCode = Employee.NationalCode;
|
|
|
|
var emp = _context.WorkshopEmployers.Where(x => x.WorkshopId == leave.WorkshopId).Select(x => x.EmployerId).ToList();
|
|
var employerlist = _context.Employers.Select(x => new EmprViewModel()
|
|
{
|
|
Id = x.id,
|
|
EmployerFullName = x.FName + " " + x.LName,
|
|
IsLegal = x.IsLegal,
|
|
}).Where(x => emp.Contains(x.Id)).ToList();
|
|
if (employerlist.Count > 0)
|
|
{
|
|
leave.EmployerList = employerlist;
|
|
}
|
|
else
|
|
{
|
|
leave.EmployerList = new List<EmprViewModel>();
|
|
}
|
|
query.Add(leave);
|
|
}
|
|
query = query.OrderBy(x => x.Year).ThenBy(x => x.Month).ToList();
|
|
int printNumer = 0;
|
|
foreach (var rec in query)
|
|
{
|
|
printNumer += 1;
|
|
rec.PrintCounter = printNumer;
|
|
}
|
|
return query;
|
|
}
|
|
|
|
#region Vafa
|
|
|
|
public List<LeaveViewModel> LastLeaveMain(LeaveSearchModel searchModel)
|
|
{
|
|
var leaveMainList = _context.LeaveList.Where(x => x.WorkshopId == searchModel.WorkshopId);
|
|
|
|
if (searchModel.EmployeeId != 0)
|
|
leaveMainList = leaveMainList.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
|
|
|
if (searchModel.LeaveType == "paidLeave")
|
|
leaveMainList = leaveMainList.Where(x => x.LeaveType == "استحقاقی");
|
|
|
|
if (searchModel.LeaveType == "sickLeave")
|
|
leaveMainList = leaveMainList.Where(x => x.LeaveType == "استعلاجی");
|
|
|
|
if (!string.IsNullOrWhiteSpace(searchModel.StartLeave) && !string.IsNullOrWhiteSpace(searchModel.EndLeave))
|
|
{
|
|
var start = searchModel.StartLeave.ToGeorgianDateTime();
|
|
var end = searchModel.EndLeave.ToGeorgianDateTime();
|
|
leaveMainList = leaveMainList.Where(x => x.StartLeave >= start && x.EndLeave <= end);
|
|
}
|
|
else if (searchModel.Year != 0 || searchModel.Month != 0)
|
|
{
|
|
if (searchModel.Year != 0)
|
|
leaveMainList = leaveMainList.Where(x => x.Year == searchModel.Year);
|
|
|
|
if (searchModel.Month != 0)
|
|
leaveMainList = leaveMainList.Where(x => x.Month == searchModel.Month);
|
|
}
|
|
|
|
|
|
var leaveList = leaveMainList.Where(x => x.WorkshopId == searchModel.WorkshopId).Select(item => new LeaveViewModel()
|
|
{
|
|
Id = item.id,
|
|
StartLeave = item.StartLeave.ToFarsi(),
|
|
EndLeave = item.EndLeave.ToFarsi(),
|
|
StartLeaveGr = item.StartLeave,
|
|
EndLeaveGr = item.EndLeave,
|
|
WorkshopId = item.WorkshopId,
|
|
EmployeeId = item.EmployeeId,
|
|
EmployeeFullName = item.EmployeeFullName,
|
|
LeaveHourses = Tools.CalculateLeaveHoursAndDays(item.PaidLeaveType, item.LeaveHourses),
|
|
PaidLeaveType = item.PaidLeaveType,
|
|
LeaveType = item.LeaveType,
|
|
IsAccepted = item.IsAccepted,
|
|
Decription = item.Decription,
|
|
Year = item.Year,
|
|
Month = item.Month,
|
|
MonthStr = item.Month.ToFarsiMonthByIntNumber(),
|
|
CreationDate = item.CreationDate,
|
|
}).OrderByDescending(x => x.CreationDate).Skip(searchModel.PageIndex).Take(30).ToList();
|
|
|
|
return leaveList;
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
public bool CheckIfValidToEdit(long id)
|
|
{
|
|
var leave = _context.LeaveList.FirstOrDefault(x => x.id == id);
|
|
var checkoutExist = _context.CheckoutSet.Where(x => x.WorkshopId == leave.WorkshopId && x.EmployeeId == leave.EmployeeId)
|
|
.Where(x => leave.StartLeave <= x.ContractEnd).ToList();
|
|
if (checkoutExist.Count > 0)
|
|
{
|
|
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
public OperationResult RemoveLeave(long id)
|
|
{
|
|
var op = new OperationResult();
|
|
var item = _context.LeaveList.FirstOrDefault(x => x.id == id);
|
|
if (item != null)
|
|
{
|
|
var checkoutExist = _context.CheckoutSet.Where(x => x.WorkshopId == item.WorkshopId && x.EmployeeId == item.EmployeeId)
|
|
.Where(x => item.StartLeave <= x.ContractEnd).ToList();
|
|
if (checkoutExist.Count > 0)
|
|
{
|
|
|
|
return op.Failed("در بازه زمانی این مرخصی و یا بعد از آن فیش حقوقی وجود دارد");
|
|
}
|
|
else
|
|
{
|
|
|
|
_context.LeaveList.Remove(item);
|
|
|
|
_context.SaveChanges();
|
|
return op.Succcedded();
|
|
}
|
|
}
|
|
|
|
return op.Failed("موردی یافت نشد");
|
|
}
|
|
|
|
#region Pooya
|
|
public bool HasDailyLeave(long employeeId, long workshopId, DateTime date)
|
|
{
|
|
return _context.LeaveList
|
|
.Where(x => (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه") ||
|
|
x.LeaveType == "استعلاجی")
|
|
.FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId &&
|
|
x.StartLeave.Date <= date.Date && x.EndLeave.Date >= date.Date) != null;
|
|
|
|
}
|
|
public List<LeaveViewModel> GetByWorkshopIdEmployeeIdInDates(long workshopId, long employeeId, DateTime start, DateTime end)
|
|
{
|
|
return _context.LeaveList.Where(x => x.EmployeeId == employeeId && x.EndLeave >= start && x.StartLeave <= end)
|
|
.Select(x => new LeaveViewModel
|
|
{
|
|
EmployeeId = employeeId,
|
|
WorkshopId = workshopId,
|
|
PaidLeaveType = x.PaidLeaveType,
|
|
LeaveType = x.LeaveType,
|
|
StartLeaveGr = x.StartLeave,
|
|
EndLeaveGr = x.EndLeave,
|
|
LeaveHourses = x.LeaveHourses
|
|
}).ToList();
|
|
|
|
}
|
|
#endregion
|
|
|
|
public bool CheckContractExist(DateTime myDate, long employeeId, long workshopId)
|
|
{
|
|
var result = _context.Contracts.Any(x => x.ContarctStart <= myDate
|
|
&& x.ContractEnd >= myDate && x.EmployeeId == employeeId &&
|
|
x.WorkshopIds == workshopId && x.IsActiveString=="true");
|
|
return result;
|
|
}
|
|
|
|
public LeavErrorViewModel CheckErrors(DateTime startLeav, DateTime endLeav, long employeeId, long workshopId)
|
|
{
|
|
var res = new LeavErrorViewModel();
|
|
#region Check iF Has Checkout
|
|
//var checkoutExist = _context.CheckoutSet.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId)
|
|
// .Where(x => (startLeav >= x.ContractStart && startLeav <= x.ContractEnd && endLeav > x.ContractEnd) ||
|
|
// (startLeav >= x.ContractStart && endLeav <= x.ContractEnd) ||
|
|
// (startLeav < x.ContractStart && endLeav <= x.ContractEnd && endLeav >= x.ContractStart) ||
|
|
// (startLeav < x.ContractStart && endLeav > x.ContractEnd)).ToList();
|
|
var checkoutExist = _context.CheckoutSet.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId && startLeav <= x.ContractEnd).ToList();
|
|
if (checkoutExist.Count > 0)
|
|
{
|
|
res.HasChekout = true;
|
|
res.CheckoutErrMessage = "در بازه تاریخ وارد شده و یا بعد از آن فیش حقوقی وجود دارد";
|
|
return res;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Check If Has not Contract
|
|
|
|
var result = _context.Contracts.Where(x => x.WorkshopIds == workshopId && x.EmployeeId == employeeId)
|
|
.Where(x => (startLeav >= x.ContarctStart && startLeav <= x.ContractEnd && endLeav > x.ContractEnd) ||
|
|
(startLeav >= x.ContarctStart && endLeav <= x.ContractEnd) ||
|
|
(startLeav < x.ContarctStart && endLeav <= x.ContractEnd && endLeav >= x.ContarctStart) ||
|
|
(startLeav < x.ContarctStart && endLeav > x.ContractEnd)).ToList();
|
|
if (result.Count < 1)
|
|
{
|
|
res.HasNotContract = true;
|
|
res.ContractErrMessage = "در بازه تاریخ مرخصی وارد شده قراردادی وجود ندارد";
|
|
return res;
|
|
}
|
|
#endregion
|
|
|
|
#region Check LeftWork
|
|
|
|
var leftCheck = _context.LeftWorkList
|
|
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId)
|
|
.Where(x => x.StartWorkDate <= startLeav && x.LeftWorkDate > startLeav && x.StartWorkDate <= endLeav &&
|
|
x.LeftWorkDate > endLeav).ToList();
|
|
|
|
|
|
if (leftCheck.Count < 1)
|
|
{
|
|
|
|
res.HasLeftWork = true;
|
|
res.LeftWorlErrMessage = " پرسنل در بازه تاریخ وارد شده شروع بکار ندارد";
|
|
return res;
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
return res;
|
|
}
|
|
|
|
public LeaveViewModel LeavOnChekout(DateTime starContract, DateTime endContract, long employeeId, long workshopId)
|
|
{
|
|
return _context.LeaveList.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x =>
|
|
new LeaveViewModel()
|
|
{
|
|
Id = x.id,
|
|
StartLeaveGr = x.StartLeave,
|
|
EndLeaveGr = x.EndLeave,
|
|
WorkshopId = x.WorkshopId,
|
|
EmployeeId = x.EmployeeId,
|
|
LeaveHourses = x.LeaveHourses,
|
|
PaidLeaveType = x.PaidLeaveType,
|
|
LeaveType = x.LeaveType,
|
|
IsAccepted = x.IsAccepted,
|
|
Decription = x.Decription
|
|
|
|
}).FirstOrDefault(x =>
|
|
(starContract <= x.StartLeaveGr && endContract >= x.StartLeaveGr) ||
|
|
(starContract <= x.EndLeaveGr && endContract >= x.EndLeaveGr) ||
|
|
(starContract >= x.StartLeaveGr && starContract <= x.EndLeaveGr) ||
|
|
(endContract >= x.StartLeaveGr && endContract <= x.EndLeaveGr));
|
|
}
|
|
} |