cameraDirectLogin from admin - fix bug at GetWorkshopAbsentHistory
This commit is contained in:
@@ -154,7 +154,7 @@ public class RollCallApplication : IRollCallApplication
|
||||
public OperationResult ManualEdit(CreateOrEditEmployeeRollCall command)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
var activities = command.RollCallRecords.Select(x => (x.StartTime, x.EndTime));
|
||||
|
||||
DateTime date = command.DateFa.ToGeorgianDateTime();
|
||||
if (date == Tools.GetUndefinedDateTime())
|
||||
@@ -173,7 +173,7 @@ public class RollCallApplication : IRollCallApplication
|
||||
if (command.RollCallRecords == null || command.RollCallRecords.Count == 0)
|
||||
return operation.Failed("خطای سیستمی");
|
||||
|
||||
if (_leaveRepository.HasLeave(command.EmployeeId, command.WorkshopId, date))
|
||||
if (_leaveRepository.HasDailyLeave(command.EmployeeId, command.WorkshopId, date))
|
||||
return operation.Failed("در روز مرخصی کارمند نمی توانید حضور غیاب ثبت کنید");
|
||||
|
||||
var employeeStatuses = _rollCallEmployeeRepository.GetByEmployeeIdWithStatuses(command.EmployeeId)
|
||||
@@ -259,8 +259,17 @@ public class RollCallApplication : IRollCallApplication
|
||||
return operation.Failed("شروع رکورد حضور غیاب نمی تواند در روز های بعد از تاریخ تعیین شده باشد");
|
||||
|
||||
#endregion
|
||||
foreach (var activity in result)
|
||||
{
|
||||
|
||||
if (result == null || !result.All(x => employeeStatuses.Any(y => x.Start >= y.StartDateGr || x.End <= y.EndDateGr)))
|
||||
//مرخصی روزانه در بالا چک شده است
|
||||
var leave = _leaveRepository.GetByWorkshopIdEmployeeIdInDates(command.WorkshopId, command.EmployeeId, activity.Start, activity.End)
|
||||
.Where(x => x.PaidLeaveType == "ساعتی");
|
||||
if (leave.Any())
|
||||
return operation.Failed("کارمند در بازه انتخاب شده مرخصی ساعتی دارد");
|
||||
}
|
||||
|
||||
if (result == null || !result.All(x => employeeStatuses.Any(y => x.Start >= y.StartDateGr && x.End <= y.EndDateGr)))
|
||||
return operation.Failed("کارمند در بازه وارد شده غیر فعال است");
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user