complete method for weeklyDayOfweek...

This commit is contained in:
2025-06-15 19:44:09 +03:30
parent 9271cb5c66
commit fb1db062f3
32 changed files with 1875 additions and 1810 deletions

View File

@@ -14,8 +14,7 @@ public class BaseCustomizeEntity : EntityBase
}
public BaseCustomizeEntity(FridayPay fridayPay, OverTimePay overTimePay,
BaseYearsPay baseYearsPay, BonusesPay bonusesPay, NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit,
FridayWork fridayWork, HolidayWork holidayWork, BreakTime breakTime,int leavePermittedDays,List<WeeklyOffDay> weeklyOffDays)
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit, HolidayWork holidayWork, BreakTime breakTime,int leavePermittedDays,List<WeeklyOffDay> weeklyOffDays)
{
FridayPay = fridayPay;
@@ -31,7 +30,6 @@ public class BaseCustomizeEntity : EntityBase
FineAbsenceDeduction = fineAbsenceDeduction;
LateToWork = lateToWork;
EarlyExit = earlyExit;
FridayWork = fridayWork;
HolidayWork = holidayWork;
BreakTime = breakTime;
LeavePermittedDays = leavePermittedDays;
@@ -122,6 +120,16 @@ public class BaseCustomizeEntity : EntityBase
public BreakTime BreakTime { get; protected set; }
public List<WeeklyOffDay> WeeklyOffDays { get; set; }
public void FridayWorkToWeeklyDayOfWeek()
{
if (FridayWork == FridayWork.Default && !WeeklyOffDays.Any(x => x.DayOfWeek == DayOfWeek.Friday))
{
WeeklyOffDays.Add(new WeeklyOffDay(DayOfWeek.Friday));
}
}
}
public class WeeklyOffDay

View File

@@ -27,13 +27,13 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit, long employeeId,
long workshopId, double salary, long customizeWorkshopGroupSettingId,
ICollection<CustomizeWorkshopEmployeeSettingsShift> customizeWorkshopEmployeeSettingsShifts,
FridayWork fridayWork,
HolidayWork holidayWork, IrregularShift irregularShift, WorkshopShiftStatus workshopShiftStatus, BreakTime breakTime, int leavePermittedDays, ICollection<CustomizeRotatingShift> rotatingShifts
HolidayWork holidayWork, IrregularShift irregularShift, WorkshopShiftStatus workshopShiftStatus, BreakTime breakTime,
int leavePermittedDays, ICollection<CustomizeRotatingShift> rotatingShifts
, List<WeeklyOffDay> weeklyOffDays) :
base(fridayPay, overTimePay,
baseYearsPay, bonusesPay, nightWorkPay,
marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction, lateToWork,
earlyExit, fridayWork, holidayWork, breakTime, leavePermittedDays,weeklyOffDays)
earlyExit, holidayWork, breakTime, leavePermittedDays,weeklyOffDays)
{
CustomizeWorkshopGroupSettingId = customizeWorkshopGroupSettingId;
IsSettingChanged = false;
@@ -83,7 +83,6 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
/// <param name="fineAbsenceDeduction">جریمه غیبت</param>
/// <param name="lateToWork">تاخیر در ورود</param>
/// <param name="earlyExit">تعجیل درخروج</param>
/// <param name="fridayWork">آیا در روز های جمعه موظف به کار است</param>
/// <param name="holidayWork">آیا در تعطیلات رسمی موظف به کار است</param>
/// <param name="workshopIrregularShifts">نوع شیفت کاری </param>
/// <param name="workshopShiftStatus">آیا شیفت منظم است یا نا منظم</param>
@@ -92,7 +91,7 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction,
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit,
FridayWork fridayWork, HolidayWork holidayWork, IrregularShift irregularShift, bool isSettingChange, int leavePermittedDays)
HolidayWork holidayWork, IrregularShift irregularShift, bool isSettingChange, int leavePermittedDays)
{
SetValueObjects(fridayPay, overTimePay, baseYearsPay, bonusesPay
, nightWorkPay, marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction,
@@ -100,7 +99,6 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
Salary = salary;
IsSettingChanged = isSettingChange;
FridayWork = fridayWork;
HolidayWork = holidayWork;
LeavePermittedDays = leavePermittedDays;
}
@@ -113,8 +111,8 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
public void SimpleEdit(
ICollection<CustomizeWorkshopEmployeeSettingsShift> employeeSettingsShift,
IrregularShift irregularShift,
WorkshopShiftStatus workshopShiftStatus, BreakTime breakTime, bool isShiftChange, FridayWork fridayWork, HolidayWork holidayWork,
ICollection<CustomizeRotatingShift> rotatingShifts)
WorkshopShiftStatus workshopShiftStatus, BreakTime breakTime, bool isShiftChange,HolidayWork holidayWork,
ICollection<CustomizeRotatingShift> rotatingShifts,List<WeeklyOffDay> weeklyOffDays)
{
BreakTime = new BreakTime(breakTime.HasBreakTimeValue, breakTime.BreakTimeValue);
IsShiftChanged = isShiftChange;
@@ -127,9 +125,8 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
: new IrregularShift(irregularShift.StartTime, irregularShift.EndTime, irregularShift.WorkshopIrregularShifts);
CustomizeRotatingShifts = workshopShiftStatus == WorkshopShiftStatus.Rotating ? rotatingShifts : [];
FridayWork = fridayWork;
HolidayWork = holidayWork;
WeeklyOffDays = weeklyOffDays;
}
@@ -270,4 +267,6 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
IsShiftChanged = isShiftChange;
}
}

View File

@@ -27,12 +27,12 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
FridayPay fridayPay, OverTimePay overTimePay, BaseYearsPay baseYearsPay,
BonusesPay bonusesPay, NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction,
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit, FridayWork fridayWork,
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit,
HolidayWork holidayWork, BreakTime breakTime, WorkshopShiftStatus workshopShiftStatus, IrregularShift irregularShift, int leavePermittedDays,
ICollection<CustomizeRotatingShift> rotatingShifts, List<WeeklyOffDay> weeklyOffDays) :
base(fridayPay, overTimePay, baseYearsPay, bonusesPay, nightWorkPay,
marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction, lateToWork,
earlyExit, fridayWork, holidayWork, breakTime, leavePermittedDays,weeklyOffDays)
earlyExit, holidayWork, breakTime, leavePermittedDays,weeklyOffDays)
{
GroupName = groupName;
Salary = salary;
@@ -77,7 +77,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, FamilyAllowance familyAllowance,
LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction,
LateToWork lateToWork, EarlyExit earlyExit,
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts, FridayWork fridayWork,
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts,
HolidayWork holidayWork, IrregularShift irregularShift, ICollection<CustomizeRotatingShift> rotatingShifts,
WorkshopShiftStatus workshopShiftStatus, long customizeWorkshopSettingId, BreakTime breakTime, int leavePermittedDays)
{
@@ -97,7 +97,6 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
FineAbsenceDeduction = fineAbsenceDeduction;
LateToWork = lateToWork;
EarlyExit = earlyExit;
FridayWork = fridayWork;
HolidayWork = holidayWork;
LeavePermittedDays = leavePermittedDays;
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
@@ -124,7 +123,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
OverTimePay overTimePay, BaseYearsPay baseYearsPay, BonusesPay bonusesPay, ShiftPay shiftPay,
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, FamilyAllowance familyAllowance,
LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction,
LateToWork lateToWork, EarlyExit earlyExit, FridayWork fridayWork, HolidayWork holidayWork, bool isSettingChange, int leavePermittedDays)
LateToWork lateToWork, EarlyExit earlyExit, HolidayWork holidayWork, bool isSettingChange, int leavePermittedDays)
{
GroupName = groupName;
Salary = salary;
@@ -141,7 +140,6 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
FineAbsenceDeduction = fineAbsenceDeduction;
LateToWork = lateToWork;
EarlyExit = earlyExit;
FridayWork = fridayWork;
HolidayWork = holidayWork;
IsSettingChange = isSettingChange;
LeavePermittedDays = leavePermittedDays;
@@ -155,7 +153,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
{
item.EditEmployees(Salary, FridayPay, OverTimePay, BaseYearsPay, BonusesPay
, NightWorkPay, MarriedAllowance, ShiftPay, FamilyAllowance, LeavePay, InsuranceDeduction, FineAbsenceDeduction,
LateToWork, EarlyExit, FridayWork, HolidayWork, IrregularShift, false, leavePermittedDays);
LateToWork, EarlyExit, HolidayWork, IrregularShift, false, leavePermittedDays);
}
}
public void EditAndOverwriteOnAllEmployees(string groupName, double salary,
@@ -163,14 +161,13 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
OverTimePay overTimePay, BaseYearsPay baseYearsPay, BonusesPay bonusesPay, ShiftPay shiftPay,
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, FamilyAllowance familyAllowance,
LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction,
LateToWork lateToWork, EarlyExit earlyExit, FridayWork fridayWork, HolidayWork holidayWork, bool isSettingChange, int leavePermittedDays)
LateToWork lateToWork, EarlyExit earlyExit, HolidayWork holidayWork, bool isSettingChange, int leavePermittedDays)
{
SetValueObjects(fridayPay, overTimePay, baseYearsPay, bonusesPay
, nightWorkPay, marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction,
lateToWork, earlyExit);
GroupName = groupName;
Salary = salary;
FridayWork = fridayWork;
HolidayWork = holidayWork;
IsSettingChange = isSettingChange;
LeavePermittedDays = leavePermittedDays;
@@ -183,7 +180,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
{
item.EditEmployees(Salary, FridayPay, OverTimePay, BaseYearsPay, BonusesPay
, NightWorkPay, MarriedAllowance, ShiftPay, FamilyAllowance, LeavePay, InsuranceDeduction, FineAbsenceDeduction,
LateToWork, EarlyExit, FridayWork, HolidayWork, IrregularShift, false, leavePermittedDays);
LateToWork, EarlyExit, HolidayWork, IrregularShift, false, leavePermittedDays);
}
}
@@ -196,7 +193,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
public void EditSimpleAndOverwriteOnEmployee(string groupName, IEnumerable<long> employeeIds,
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts, WorkshopShiftStatus workshopShiftStatus,
IrregularShift irregularShift, BreakTime breakTime, bool isShiftChange, FridayWork fridayWork, HolidayWork holidayWork, ICollection<CustomizeRotatingShift> rotatingShifts)
IrregularShift irregularShift, BreakTime breakTime, bool isShiftChange, HolidayWork holidayWork, ICollection<CustomizeRotatingShift> rotatingShifts, List<WeeklyOffDay> weeklyOffDays)
{
GroupName = groupName;
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
@@ -210,9 +207,11 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
BreakTime = new BreakTime(breakTime.HasBreakTimeValue, breakTime.BreakTimeValue);
IsShiftChange = isShiftChange;
FridayWork = fridayWork;
HolidayWork = holidayWork;
WeeklyOffDays = weeklyOffDays;
//var employeeSettingsShift = customizeWorkshopGroupSettingsShifts
// .Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList();
if (isShiftChange)
@@ -228,15 +227,15 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
.ToList();
item.SimpleEdit(customizeWorkshopGroupSettingsShifts
.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList(),
IrregularShift, WorkshopShiftStatus, BreakTime, false, FridayWork, HolidayWork, newRotatingShifts);
IrregularShift, WorkshopShiftStatus, BreakTime, false, HolidayWork, newRotatingShifts,WeeklyOffDays.ToList());
}
}
public void EditSimpleAndOverwriteOnAllEmployees(string groupName,
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts,
WorkshopShiftStatus workshopShiftStatus, IrregularShift irregularShift, BreakTime breakTime, bool isShiftChange,
FridayWork fridayWork, HolidayWork holidayWork, ICollection<CustomizeRotatingShift> rotatingShifts)
WorkshopShiftStatus workshopShiftStatus, IrregularShift irregularShift, BreakTime breakTime, bool isShiftChange,
HolidayWork holidayWork, ICollection<CustomizeRotatingShift> rotatingShifts ,List<WeeklyOffDay> weeklyOffDays)
{
GroupName = groupName;
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
@@ -252,8 +251,8 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
BreakTime = new BreakTime(breakTime.HasBreakTimeValue, breakTime.BreakTimeValue);
IsShiftChange = isShiftChange;
HolidayWork = holidayWork;
FridayWork = fridayWork;
WeeklyOffDays = weeklyOffDays;
//var employeeSettingsShift = customizeWorkshopGroupSettingsShifts
// .Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList();
@@ -263,7 +262,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
.ToList();
item.SimpleEdit(customizeWorkshopGroupSettingsShifts
.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList(),
irregularShift, workshopShiftStatus, breakTime, false, FridayWork, HolidayWork, newRotatingShifts);
irregularShift, workshopShiftStatus, breakTime, false, HolidayWork, newRotatingShifts,WeeklyOffDays.ToList());
}
}
@@ -305,7 +304,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
var customizeWorkshopEmployeeSettings = new CustomizeWorkshopEmployeeSettings(fridayPay, overTimePay, baseYearsPay, bonusesPay, nightWorkPay,
marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction, lateToWork,
earlyExit, employeeId, workshopId, Salary, id, shifts, FridayWork, HolidayWork, irregularShift,
earlyExit, employeeId, workshopId, Salary, id, shifts, HolidayWork, irregularShift,
WorkshopShiftStatus, breakTime, LeavePermittedDays, rotatingShift, weeklyOffDays);
CustomizeWorkshopEmployeeSettingsCollection.Add(customizeWorkshopEmployeeSettings);

View File

@@ -17,7 +17,7 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
public CustomizeWorkshopSettings(long workshopId,
ICollection<CustomizeWorkshopSettingsShift> customizeWorkshopSettingsShifts, int leavePermittedDays,
WorkshopShiftStatus workshopShiftStatus,FridayWork fridayWork,HolidayWork holidayWork, List<WeeklyOffDay> weeklyOffDays)
WorkshopShiftStatus workshopShiftStatus,HolidayWork holidayWork, List<WeeklyOffDay> weeklyOffDays)
{
FridayPay = new FridayPay(FridayPayType.None, 0);
OverTimePay = new OverTimePay(OverTimePayType.None, 0);
@@ -38,11 +38,10 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
OverTimeThresholdMinute = 0;
Currency = Currency.Rial;
MaxMonthDays = MaxMonthDays.Default;
FridayWork = fridayWork;
HolidayWork = holidayWork;
BonusesPaysInEndOfMonth = BonusesPaysInEndOfYear.EndOfYear;
WorkshopShiftStatus = workshopShiftStatus;
WeeklyOffDays = weeklyOffDays;
HolidayWork = holidayWork;
if (workshopShiftStatus == WorkshopShiftStatus.Irregular)
return;
@@ -92,8 +91,7 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
public void Edit(FridayPay fridayPay, OverTimePay overTimePay, BaseYearsPay baseYearsPay, BonusesPay bonusesPay,
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction,
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit,
FridayWork fridayWork, HolidayWork holidayWork, BonusesPaysInEndOfYear bonusesPaysInEndOfYear,
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit, HolidayWork holidayWork, BonusesPaysInEndOfYear bonusesPaysInEndOfYear,
int leavePermittedDays, BaseYearsPayInEndOfYear baseYearsPayInEndOfYear, int overTimeThresholdMinute)
{
FridayPay = fridayPay;
@@ -109,7 +107,6 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
FineAbsenceDeduction = fineAbsenceDeduction;
LateToWork = lateToWork;
EarlyExit = earlyExit;
FridayWork = fridayWork;
HolidayWork = holidayWork;
BonusesPaysInEndOfMonth = bonusesPaysInEndOfYear;
LeavePermittedDays = leavePermittedDays;
@@ -127,19 +124,18 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
}
public void ChangeWorkshopShifts(ICollection<CustomizeWorkshopSettingsShift> customizeWorkshopSettingsShifts,
WorkshopShiftStatus workshopShiftStatus,FridayWork fridayWork,HolidayWork holidayWork)
WorkshopShiftStatus workshopShiftStatus,HolidayWork holidayWork, List<WeeklyOffDay> weeklyOffDays)
{
WorkshopShiftStatus = workshopShiftStatus;
HolidayWork = holidayWork;
FridayWork = fridayWork;
CustomizeWorkshopSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopSettingsShifts : new List<CustomizeWorkshopSettingsShift>();
WeeklyOffDays = weeklyOffDays;
if (workshopShiftStatus == WorkshopShiftStatus.Regular)
{
var date = new DateOnly();
var firstStartShift = new DateTime(date, CustomizeWorkshopSettingsShifts.MinBy(x => x.Placement).StartTime);
var lastEndShift = new DateTime(date, CustomizeWorkshopSettingsShifts.MaxBy(x => x.Placement).EndTime);
if (lastEndShift > firstStartShift)
firstStartShift = firstStartShift.AddDays(1);
var offSet = (firstStartShift - lastEndShift).Divide(2);

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
@@ -16,8 +17,9 @@ public class CreateCustomizeWorkshopGroupSettings
public IrregularShift IrregularShift { get; set; }
public BreakTime BreakTime { get; set; }
public int LeavePermittedDays { get; set; }
public FridayWork FridayWork { get; set; }
//public FridayWork FridayWork { get; set; }
public HolidayWork HolidayWork { get; set; }
public List<DayOfWeek> OffDayOfWeeks { get; set; }
public ICollection<CustomizeRotatingShiftsViewModel> CustomizeRotatingShiftsViewModels { get; set; }
}

View File

@@ -21,10 +21,10 @@ public class CreateCustomizeWorkshopSettings
public BreakTime BreakTime { get; set; }
/// <summary>
/// آیا جمعه کار میکند یا نه
/// </summary>
public FridayWork FridayWork { get; set; }
///// <summary>
///// آیا جمعه کار میکند یا نه
///// </summary>
//public FridayWork FridayWork { get; set; }
/// <summary>
/// آیا در روز های تعطیل کار میکند

View File

@@ -1,4 +1,5 @@
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using System;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
using System.Collections.Generic;
@@ -20,7 +21,8 @@ public class CustomizeWorkshopEmployeeSettingsViewModel
public bool ChangeSettingEmployeeShiftIsChange { get; set; }
public BreakTime BreakTime { get; set; }
public HolidayWork HolidayWork { get; set; }
public FridayWork FridayWork { get; set; }
//public FridayWork FridayWork { get; set; }
public int LeavePermittedDays { get; set; }
public ICollection<CustomizeRotatingShiftsViewModel> CustomizeRotatingShiftsViewModels { get; set; }
public List<DayOfWeek> WeeklyOffDays { get; set; }
}

View File

@@ -1,4 +1,5 @@
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using System;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewModel;
using System.Collections.Generic;
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
@@ -72,17 +73,19 @@ public class EditCustomizeEmployeeSettings:CreateCustomizeEmployeeSettings
/// </summary>
public EarlyExitViewModel EarlyExit { get; set; }
/// <summary>
/// آیا جمعه کار میکند یا نه
/// </summary>
public FridayWork FridayWork { get; set; }
///// <summary>
///// آیا جمعه کار میکند یا نه
///// </summary>
//public FridayWork FridayWork { get; set; }
/// <summary>
/// آیا در روز های تعطیل کار میکند
/// </summary>
public HolidayWork HolidayWork { get; set; }
public long Id { get; set; }
public List<DayOfWeek> WeeklyOffDays { get; set; }
public long Id { get; set; }
public string Salary { get; set; }
public string NameGroup { get; set; }
public string EmployeeFullName { get; set; }
@@ -91,4 +94,5 @@ public class EditCustomizeEmployeeSettings:CreateCustomizeEmployeeSettings
public IEnumerable<CustomizeWorkshopShiftViewModel> ShiftViewModel { get; set; }
public ICollection<CustomizeRotatingShiftsViewModel> CustomizeRotatingShifts{ get; set; }
public BreakTime BreakTime { get; set; }
}

View File

@@ -1,6 +1,8 @@
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using System;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewModel;
using System.Collections.Generic;
using _0_Framework.Domain.CustomizeCheckoutShared.Base;
namespace CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
@@ -75,16 +77,18 @@ public class EditCustomizeWorkshopGroupSettings : CreateCustomizeWorkshopGroupSe
/// </summary>
public EarlyExitViewModel EarlyExit { get; set; }
/// <summary>
/// آیا جمعه کار میکند یا نه
/// </summary>
public FridayWork FridayWork { get; set; }
///// <summary>
///// آیا جمعه کار میکند یا نه
///// </summary>
//public FridayWork FridayWork { get; set; }
/// <summary>
/// آیا در روز های تعطیل کار میکند
/// </summary>
public HolidayWork HolidayWork { get; set; }
//public List<DayOfWeek> WeeklyOffDays { get; set; }
public bool IsShiftChanged { get; set; }
public bool IsSettingChanged { get; set; }
}

View File

@@ -1,4 +1,5 @@
using _0_Framework.Application;
using System;
using _0_Framework.Application;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
using CompanyManagment.App.Contracts.Employee;
@@ -51,11 +52,14 @@ public interface ICustomizeWorkshopSettingsApplication
/// </summary>
/// <param name="shiftViewModels">شیفت هت</param>
/// <param name="customizeWorkshopSettingsId">آیدی تنظیمات کارگاه</param>
/// <param name="replaceChangedGroups"></param>
/// <param name="workshopShiftStatus"></param>
/// <param name="holidayWork"></param>
/// <param name="weeklyOffDays"></param>
/// <param name="replaceChangedGroups"></param>
/// <returns></returns>
OperationResult EditWorkshopSettingShifts(List<CustomizeWorkshopShiftViewModel> shiftViewModels,
long customizeWorkshopSettingsId,WorkshopShiftStatus workshopShiftStatus,FridayWork fridayWork,HolidayWork holidayWork);
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus,
HolidayWork holidayWork, List<DayOfWeek> weeklyOffDays);
// It will Get the Workshop Settings with its groups and the employees of groups.
CustomizeWorkshopSettingsViewModel GetWorkshopSettingsByWorkshopId(long workshopId, AuthViewModel auth);

View File

@@ -26,7 +26,6 @@ public class CustomizeWorkshopEmployeeSettingsRepository(CompanyContext companyC
return new();
return new EditCustomizeEmployeeSettings()
{
FridayWork = entity.FridayWork,
FridayPay = new() { FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
LateToWork = new()
{

View File

@@ -265,7 +265,7 @@ public class CustomizeWorkshopGroupSettingsRepository(CompanyContext companyCont
var entity = _companyContext.CustomizeWorkshopGroupSettings.AsSplitQuery().FirstOrDefault(x => x.id == groupId);
return new EditCustomizeWorkshopGroupSettings()
{
FridayWork = entity.FridayWork,
//FridayWork = entity.FridayWork,
FridayPay = new (){ FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
LateToWork = new()
{
@@ -338,8 +338,8 @@ public class CustomizeWorkshopGroupSettingsRepository(CompanyContext companyCont
{
EndTime = x.EndTime.ToString("HH:mm"),
StartTime = x.StartTime.ToString("HH:mm")
}).ToList()
}).ToList(),
OffDayOfWeeks = entity.WeeklyOffDays.Select(x=>x.DayOfWeek).ToList()
};
}

View File

@@ -159,7 +159,6 @@ public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext,
return new();
var viewModel = new EditCustomizeWorkshopSettings()
{
FridayWork = entity.FridayWork,
FridayPay = new() { FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
LateToWork = new()
{
@@ -234,7 +233,8 @@ public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext,
LeavePermittedDays = entity.LeavePermittedDays,
BaseYearsPayInEndOfYear = entity.BaseYearsPayInEndOfYear,
WorkshopId = entity.WorkshopId,
WorkshopShiftStatus = entity.WorkshopShiftStatus
WorkshopShiftStatus = entity.WorkshopShiftStatus,
OffDays = entity.WeeklyOffDays.Select(x=>x.DayOfWeek).ToList()
};
return viewModel;
@@ -261,8 +261,8 @@ public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext,
Id = entity.id,
WorkshopId = entity.WorkshopId,
WorkshopShiftStatus = entity.WorkshopShiftStatus,
FridayWork = entity.FridayWork,
HolidayWork = entity.HolidayWork
HolidayWork = entity.HolidayWork,
OffDays = entity.WeeklyOffDays.Select(x=>x.DayOfWeek).ToList()
};
}

View File

@@ -228,7 +228,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.RollCall
}
public IActionResult OnPostEditSettingWorkTime(List<CustomizeWorkshopShiftViewModel> shiftViewModels,
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus, long workshopId,FridayWork fridayWork,HolidayWork holidayWork)
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus, long workshopId,FridayWork fridayWork,HolidayWork holidayWork,List<DayOfWeek> offDayOfWeeks)
{
if (workshopId < 1)
return new JsonResult(new
@@ -240,7 +240,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.RollCall
//Todo:Vafa!!
//Todo: Vafa : to in ja bool replaceChange group ro ezafe kon. hatman ham workshopShiftStatus az front pas bede be in.
var result = _customizeWorkshopSettingsApplication
.EditWorkshopSettingShifts(shiftViewModels, customizeWorkshopSettingsId, workshopShiftStatus, fridayWork, holidayWork);
.EditWorkshopSettingShifts(shiftViewModels, customizeWorkshopSettingsId, workshopShiftStatus, holidayWork, offDayOfWeeks);
return new JsonResult(new
{

View File

@@ -58,14 +58,14 @@
<div class="col-12 group-container">
<div class="titleSettingRollCall">وضعیت فعالیت مجموعه در روز های جمعه</div>
<div class="form-group my-1 group">
@* <div class="form-group my-1 group">
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
<label for="Friday1">پرسنل در روزهای جمعه کار نمی‌کند.</label>
</div>
<div class="form-group my-1 group">
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
<label for="Friday2">پرسنل در روزهای جمعه کار می‌کند.</label>
</div>
</div> *@
</div>
<div class="col-12">

View File

@@ -56,14 +56,14 @@
<div class="col-12 group-container">
<div class="titleSettingRollCall">وضعیت فعالیت مجموعه در روز های جمعه</div>
<div class="form-group my-1 group">
@* <div class="form-group my-1 group">
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
<label for="Friday1">پرسنل در روزهای جمعه کار نمی‌کند.</label>
</div>
<div class="form-group my-1 group">
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
<label for="Friday2">پرسنل در روزهای جمعه کار می‌کند.</label>
</div>
</div> *@
</div>
<div class="col-12">

View File

@@ -29,14 +29,14 @@
<div class="col-12 group-container">
<div class="titleSettingRollCall">وضعیت فعالیت مجموعه در روز های جمعه</div>
<div class="form-group my-1 group">
@* <div class="form-group my-1 group">
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
<label for="Friday1">پرسنل در روزهای جمعه کار نمی‌کند.</label>
</div>
<div class="form-group my-1 group">
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
<label for="Friday2">پرسنل در روزهای جمعه کار می‌کند.</label>
</div>
</div> *@
</div>
<div class="col-12">

View File

@@ -240,9 +240,10 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
BreakTime = employee.BreakTime,
WorkshopShiftStatus = employee.WorkshopShiftStatus,
IrregularShift = employee.IrregularShift,
FridayWork = employee.FridayWork,
//FridayWork = employee.FridayWork,
HolidayWork = employee.HolidayWork,
CustomizeRotatingShifts = employee.CustomizeRotatingShiftsViewModels
CustomizeRotatingShifts = employee.CustomizeRotatingShiftsViewModels,
WeeklyOffDays = employee.WeeklyOffDays
};
return Partial("ModalEditEmployeeFromGroup", command);
}

View File

@@ -310,7 +310,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
}
public IActionResult OnPostEditSettingWorkTime(List<CustomizeWorkshopShiftViewModel> shiftViewModels,
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus,FridayWork fridayWork,HolidayWork holidayWork)
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus,FridayWork fridayWork,HolidayWork holidayWork,List<DayOfWeek> offDayOfWeeks)
{
var workshopHash = User.FindFirstValue("WorkshopSlug");
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
@@ -324,7 +324,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
//Todo:Vafa!!
//Todo: Vafa : to in ja bool replaceChange group ro ezafe kon. hatman ham workshopShiftStatus az front pas bede be in.
var result = _customizeWorkshopSettingsApplication
.EditWorkshopSettingShifts(shiftViewModels, customizeWorkshopSettingsId, workshopShiftStatus,fridayWork, holidayWork);
.EditWorkshopSettingShifts(shiftViewModels, customizeWorkshopSettingsId, workshopShiftStatus, holidayWork, offDayOfWeeks);
return new JsonResult(new
{

View File

@@ -230,14 +230,14 @@
<div class="col-6 p-0">
<div class="group-container">
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
<div class="d-flex form-group my-1 group">
@* <div class="d-flex form-group my-1 group">
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))"/>
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمی‌کند.</label>
</div>
<div class="d-flex form-group my-1 group">
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))"/>
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار می‌کند.</label>
</div>
</div> *@
</div>
</div>

View File

@@ -389,14 +389,14 @@
<div class="col-6 p-0">
<div class="group-container">
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
<div class="d-flex form-group my-1 group">
@* <div class="d-flex form-group my-1 group">
<input type="radio" name="FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمی‌کند.</label>
</div>
<div class="d-flex form-group my-1 group">
<input type="radio" name="FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار می‌کند.</label>
</div>
</div> *@
</div>
</div>

View File

@@ -400,14 +400,14 @@
<div class="col-6 p-0">
<div class="group-container">
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
<div class="d-flex form-group my-1 group">
@* <div class="d-flex form-group my-1 group">
<input type="radio" name="FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمی‌کند.</label>
</div>
<div class="d-flex form-group my-1 group">
<input type="radio" name="FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار می‌کند.</label>
</div>
</div> *@
</div>
</div>

View File

@@ -162,14 +162,14 @@
<div class="col-6 p-0">
<div class="group-container">
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
<div class="d-flex form-group my-1 group">
@* <div class="d-flex form-group my-1 group">
<input type="radio" name="FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))"/>
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمی‌کند.</label>
</div>
<div class="d-flex form-group my-1 group">
<input type="radio" name="FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))"/>
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار می‌کند.</label>
</div>
</div> *@
</div>
</div>

View File

@@ -103,7 +103,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall._WorkshopSetting
}
public IActionResult OnPostEditSettingWorkTime(List<CustomizeWorkshopShiftViewModel> shiftViewModels,
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus, FridayWork fridayWork, HolidayWork holidayWork)
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus, FridayWork fridayWork, HolidayWork holidayWork,List<DayOfWeek> offDayOfWeeks)
{
var workshopHash = User.FindFirstValue("WorkshopSlug");
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
@@ -115,7 +115,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall._WorkshopSetting
});
var result = _customizeWorkshopSettingsApplication
.EditWorkshopSettingShifts(shiftViewModels, customizeWorkshopSettingsId, workshopShiftStatus, fridayWork, holidayWork);
.EditWorkshopSettingShifts(shiftViewModels, customizeWorkshopSettingsId, workshopShiftStatus, holidayWork, offDayOfWeeks);
return new JsonResult(new
{

View File

@@ -98,14 +98,14 @@
<div class="col-6 p-0">
<div class="group-container">
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
<div class="d-flex form-group my-1 group">
@* <div class="d-flex form-group my-1 group">
<input type="radio" name="FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمی‌کند.</label>
</div>
<div class="d-flex form-group my-1 group">
<input type="radio" name="FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار می‌کند.</label>
</div>
</div> *@
</div>
</div>

View File

@@ -162,14 +162,14 @@
<div class="col-6 p-0">
<div class="group-container">
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
<div class="d-flex form-group my-1 group">
@* <div class="d-flex form-group my-1 group">
<input type="radio" name="FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))"/>
<label for="Friday1" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار نمی‌کند.</label>
</div>
<div class="d-flex form-group my-1 group">
<input type="radio" name="FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))"/>
<label for="Friday2" class="lableCheckBreakTime">پرسنل در روزهای جمعه کار می‌کند.</label>
</div>
</div> *@
</div>
</div>

View File

@@ -15,14 +15,14 @@
</div>
<div class="col-12 group-container">
<div class="titleSettingRollCall">تعطیلات جمعه</div>
<div class="form-group my-1 group">
@* <div class="form-group my-1 group">
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
<label for="Friday1">پرسنل در روزهای جمعه کار نمی‌کند.</label>
</div>
<div class="form-group my-1 group">
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
<label for="Friday2">پرسنل در روزهای جمعه کار می‌کند.</label>
</div>
</div> *@
</div>
<div class="col-12">

View File

@@ -16,14 +16,14 @@
</div>
<div class="col-12 group-container">
<div class="titleSettingRollCall">تعطیلات جمعه</div>
<div class="form-group my-1 group">
@* <div class="form-group my-1 group">
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
<label for="Friday1">پرسنل در روزهای جمعه کار نمی‌کند.</label>
</div>
<div class="form-group my-1 group">
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
<label for="Friday2">پرسنل در روزهای جمعه کار می‌کند.</label>
</div>
</div> *@
</div>
<div class="col-12">

View File

@@ -14,14 +14,14 @@
</div>
<div class="col-12 group-container">
<div class="titleSettingRollCall">تعطیلات جمعه</div>
<div class="form-group my-1 group">
@* <div class="form-group my-1 group">
<input type="radio" name="Command.FridayWork" id="Friday1" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.Default ? "checked" : "") value="@((int)(FridayWork.Default))" />
<label for="Friday1">پرسنل در روزهای جمعه کار نمی‌کند.</label>
</div>
<div class="form-group my-1 group">
<input type="radio" name="Command.FridayWork" id="Friday2" class="form-check-input Main-Radio" @(Model.FridayWork == FridayWork.WorkInFriday ? "checked" : "") value="@((int)(FridayWork.WorkInFriday))" />
<label for="Friday2">پرسنل در روزهای جمعه کار می‌کند.</label>
</div>
</div> *@
</div>
<div class="col-12">

View File

@@ -1,6 +1,8 @@
using System.Diagnostics;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using CompanyManagment.App.Contracts.AdminMonthlyOverview;
using CompanyManagment.EFCore;
using Microsoft.EntityFrameworkCore;
using ServiceHost.Areas.AdminNew.Pages.Company.RollCall;
namespace ServiceHost.Test;
@@ -18,9 +20,38 @@ public class Tester
public async Task Test()
{
// await AdminMonthlyOverviewTest();
// await AdminMonthlyOverviewTest();
//await ChangeFridayWorkToWeeklyDayOfWeek();
}
private async Task ChangeFridayWorkToWeeklyDayOfWeek()
{
var employeeSettingsEnumerable =await _companyContext.CustomizeWorkshopEmployeeSettings.Where(x=>x.FridayWork ==FridayWork.Default).ToListAsync();
foreach (var employeeSetting in employeeSettingsEnumerable)
{
employeeSetting.FridayWorkToWeeklyDayOfWeek();
}
var groupSettings = await _companyContext.CustomizeWorkshopGroupSettings
.Where(x => x.FridayWork == FridayWork.Default).ToListAsync();
foreach (var groupSetting in groupSettings)
{
groupSetting.FridayWorkToWeeklyDayOfWeek();
}
var workshopSettings = await _companyContext.CustomizeWorkshopSettings
.Where(x => x.FridayWork == FridayWork.Default).ToListAsync();
foreach (var workshopSetting in workshopSettings)
{
workshopSetting.FridayWorkToWeeklyDayOfWeek();
}
await _companyContext.SaveChangesAsync();
}
private async Task AdminMonthlyOverviewTest()
{
var acc = _companyContext.WorkshopAccounts.FirstOrDefault(x => x.AccountId == 322);

View File

@@ -12,8 +12,8 @@
//"MesbahDb": "Data Source=DESKTOP-NUE119G\\MSNEW;Initial Catalog=Mesbah_db;Integrated Security=True"
//server
//"MesbahDb": "Data Source=171.22.24.15;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]is[3019]#@ATt;TrustServerCertificate=true;",
//"MesbahDb": "Data Source=171.22.24.15;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;",
//local
"MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;",