HasShiftDuration - MandatoryCumpute
This commit is contained in:
@@ -24,4 +24,7 @@ public class LeaveViewModel
|
||||
public DateTime CreationDate { get; set; }
|
||||
|
||||
public int DayCounter { get; set; }
|
||||
|
||||
public TimeSpan ShiftDuration { get; set; }
|
||||
public bool HasShiftDuration { get; set; }
|
||||
}
|
||||
@@ -175,7 +175,7 @@ public class LeaveApplication : ILeaveApplication
|
||||
|
||||
var shiftStartDateTime = new DateTime(new DateOnly(), shiftStart);
|
||||
var shiftEndDateTime = new DateTime(new DateOnly(), shiftEnd);
|
||||
if (shiftEndDateTime < shiftStartDateTime)
|
||||
if (shiftEndDateTime <= shiftStartDateTime)
|
||||
shiftEndDateTime = shiftEndDateTime.AddDays(1);
|
||||
shiftDuration = shiftEndDateTime - shiftStartDateTime;
|
||||
hasShiftDuration = true;
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace CompanyManagment.Application
|
||||
//368 پیتزا امیر آماده سازی
|
||||
//367 پیتزا امیر رستوران
|
||||
//286 مرکز توان بخشی رسالت *
|
||||
bool skipRollCallByWorkshopId = workshopId is 11 or 585 or 604 or 605 or 368 or 367 or 286;
|
||||
bool skipRollCallByWorkshopId = workshopId is 11 or 585 or 604 or 605 or 368 or 367;
|
||||
|
||||
//#if DEBUG
|
||||
// skipRollCallByWorkshopId = workshopId is 11 or 585 or 604 or 605 or 368 or 367;
|
||||
|
||||
@@ -60,7 +60,9 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
IsAccepted = x.IsAccepted,
|
||||
Decription = x.Decription,
|
||||
Year = x.Year,
|
||||
Month = x.Month
|
||||
Month = x.Month,
|
||||
HasShiftDuration = x.HasShiftDuration,
|
||||
ShiftDuration = x.ShiftDuration,
|
||||
});
|
||||
|
||||
if (searchModel.WorkshopId != 0 && searchModel.EmployeeId != 0)
|
||||
|
||||
@@ -129,6 +129,11 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
var leaveSearchResult = _leaveRepository.search(leaveSearch);
|
||||
if (leaveSearchResult.Count > 0)
|
||||
{
|
||||
//if (leaveSearchResult.Any(x => x.HasShiftDuration))
|
||||
//{
|
||||
// TimeSpan totalLeave = new TimeSpan(leaveSearchResult.Sum(x => x.ShiftDuration.Ticks));
|
||||
//}
|
||||
|
||||
int leavingDayCout = 0;
|
||||
//مرخصی های مابین
|
||||
List<LeaveViewModel> beatweenCheckout = leaveSearchResult.Where(x => x.StartLeaveGr >= contractStart && x.EndLeaveGr <= contractEnd).Select(x => new LeaveViewModel()
|
||||
|
||||
Reference in New Issue
Block a user