Merge branch 'master' of https://github.com/samsyntax24/OriginalGozareshgir
This commit is contained in:
@@ -14,5 +14,8 @@ namespace CompanyManagment.App.Contracts.Leave
|
||||
public string LeftWorlErrMessage { get; set; }
|
||||
public bool HasNotContract { get; set; }
|
||||
public string ContractErrMessage { get; set; }
|
||||
|
||||
public bool HasHolidayError { get; set; }
|
||||
public string HolidayErrorMessage { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +96,8 @@ public class LeaveApplication : ILeaveApplication
|
||||
return op.Failed(checkErr.ContractErrMessage);
|
||||
if (checkErr.HasLeftWork)
|
||||
return op.Failed(checkErr.LeftWorlErrMessage);
|
||||
if (checkErr.HasHolidayError)
|
||||
return op.Failed(checkErr.HolidayErrorMessage);
|
||||
|
||||
if (start > end)
|
||||
return op.Failed("تارخ شروع از پایان بزرگتر است");
|
||||
@@ -304,6 +306,8 @@ public class LeaveApplication : ILeaveApplication
|
||||
return op.Failed(checkErr.CheckoutErrMessage);
|
||||
if (checkErr.HasLeftWork)
|
||||
return op.Failed(checkErr.LeftWorlErrMessage);
|
||||
if (checkErr.HasHolidayError)
|
||||
return op.Failed(checkErr.HolidayErrorMessage);
|
||||
if (start > end)
|
||||
return op.Failed("تارخ شروع از پایان بزرگتر است");
|
||||
|
||||
|
||||
@@ -454,6 +454,17 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
|
||||
#endregion
|
||||
|
||||
#region HolidayError
|
||||
|
||||
if (_context.HolidayItems.Any(x => startLeav.Date == x.Holidaydate.Date) ||
|
||||
startLeav.DayOfWeek == DayOfWeek.Friday)
|
||||
{
|
||||
res.HasHolidayError = true;
|
||||
res.HolidayErrorMessage = "شما نمیتوانید در روز های تعطیل مرخصی ثبت کنید";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user