Compare commits
4 Commits
83b045c2b1
...
Feature/CW
| Author | SHA1 | Date | |
|---|---|---|---|
| fb1db062f3 | |||
| 9271cb5c66 | |||
| aee7e5ce82 | |||
| 97b4c7dc66 |
@@ -1,4 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
using Microsoft.EntityFrameworkCore.Design.Internal;
|
||||
@@ -12,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)
|
||||
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit, HolidayWork holidayWork, BreakTime breakTime,int leavePermittedDays,List<WeeklyOffDay> weeklyOffDays)
|
||||
{
|
||||
|
||||
FridayPay = fridayPay;
|
||||
@@ -29,10 +30,10 @@ public class BaseCustomizeEntity : EntityBase
|
||||
FineAbsenceDeduction = fineAbsenceDeduction;
|
||||
LateToWork = lateToWork;
|
||||
EarlyExit = earlyExit;
|
||||
FridayWork = fridayWork;
|
||||
HolidayWork = holidayWork;
|
||||
BreakTime = breakTime;
|
||||
LeavePermittedDays = leavePermittedDays;
|
||||
WeeklyOffDays = weeklyOffDays.Select(x=> new WeeklyOffDay(x.DayOfWeek)).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -117,4 +118,28 @@ 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
|
||||
{
|
||||
public WeeklyOffDay(DayOfWeek dayOfWeek)
|
||||
{
|
||||
DayOfWeek = dayOfWeek;
|
||||
}
|
||||
|
||||
public long Id { get; set; }
|
||||
public DayOfWeek DayOfWeek { get; set; }
|
||||
public long ParentId { get; set; }
|
||||
}
|
||||
@@ -27,12 +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)
|
||||
earlyExit, holidayWork, breakTime, leavePermittedDays,weeklyOffDays)
|
||||
{
|
||||
CustomizeWorkshopGroupSettingId = customizeWorkshopGroupSettingId;
|
||||
IsSettingChanged = false;
|
||||
@@ -82,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>
|
||||
@@ -91,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,
|
||||
@@ -99,7 +99,6 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
||||
|
||||
Salary = salary;
|
||||
IsSettingChanged = isSettingChange;
|
||||
FridayWork = fridayWork;
|
||||
HolidayWork = holidayWork;
|
||||
LeavePermittedDays = leavePermittedDays;
|
||||
}
|
||||
@@ -112,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;
|
||||
@@ -126,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -269,4 +267,6 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
||||
|
||||
IsShiftChanged = isShiftChange;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -27,11 +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,
|
||||
HolidayWork holidayWork, BreakTime breakTime, WorkshopShiftStatus workshopShiftStatus, IrregularShift irregularShift, int leavePermittedDays, ICollection<CustomizeRotatingShift> rotatingShifts) :
|
||||
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)
|
||||
earlyExit, holidayWork, breakTime, leavePermittedDays,weeklyOffDays)
|
||||
{
|
||||
GroupName = groupName;
|
||||
Salary = salary;
|
||||
@@ -76,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)
|
||||
{
|
||||
@@ -96,7 +97,6 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
|
||||
FineAbsenceDeduction = fineAbsenceDeduction;
|
||||
LateToWork = lateToWork;
|
||||
EarlyExit = earlyExit;
|
||||
FridayWork = fridayWork;
|
||||
HolidayWork = holidayWork;
|
||||
LeavePermittedDays = leavePermittedDays;
|
||||
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
|
||||
@@ -123,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;
|
||||
@@ -140,7 +140,6 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
|
||||
FineAbsenceDeduction = fineAbsenceDeduction;
|
||||
LateToWork = lateToWork;
|
||||
EarlyExit = earlyExit;
|
||||
FridayWork = fridayWork;
|
||||
HolidayWork = holidayWork;
|
||||
IsSettingChange = isSettingChange;
|
||||
LeavePermittedDays = leavePermittedDays;
|
||||
@@ -154,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,
|
||||
@@ -162,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;
|
||||
@@ -182,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,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 : [];
|
||||
@@ -209,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)
|
||||
@@ -227,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 : [];
|
||||
@@ -251,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();
|
||||
|
||||
@@ -262,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());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -298,13 +298,14 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
|
||||
IrregularShift irregularShift = new(IrregularShift.StartTime, IrregularShift.EndTime,
|
||||
IrregularShift.WorkshopIrregularShifts);
|
||||
BreakTime breakTime = new(BreakTime.HasBreakTimeValue, BreakTime.BreakTimeValue);
|
||||
List<WeeklyOffDay> weeklyOffDays = WeeklyOffDays.Select(x => new WeeklyOffDay(x.DayOfWeek)).ToList();
|
||||
|
||||
var rotatingShift = CustomizeRotatingShifts.Select(x => new CustomizeRotatingShift(x.StartTime, x.EndTime)).ToList();
|
||||
|
||||
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,
|
||||
WorkshopShiftStatus, breakTime, LeavePermittedDays, rotatingShift);
|
||||
earlyExit, employeeId, workshopId, Salary, id, shifts, HolidayWork, irregularShift,
|
||||
WorkshopShiftStatus, breakTime, LeavePermittedDays, rotatingShift, weeklyOffDays);
|
||||
|
||||
CustomizeWorkshopEmployeeSettingsCollection.Add(customizeWorkshopEmployeeSettings);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
|
||||
|
||||
public CustomizeWorkshopSettings(long workshopId,
|
||||
ICollection<CustomizeWorkshopSettingsShift> customizeWorkshopSettingsShifts, int leavePermittedDays,
|
||||
WorkshopShiftStatus workshopShiftStatus,FridayWork fridayWork,HolidayWork holidayWork)
|
||||
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);
|
||||
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
@@ -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.Enums;
|
||||
@@ -20,16 +21,18 @@ public class CreateCustomizeWorkshopSettings
|
||||
public BreakTime BreakTime { 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> OffDays { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -228,7 +228,14 @@ public class CustomizeWorkshopEmployeeSettingsMapping : IEntityTypeConfiguration
|
||||
|
||||
});
|
||||
|
||||
builder.OwnsMany(x => x.CustomizeRotatingShifts);
|
||||
builder.OwnsMany(x => x.WeeklyOffDays, offDay =>
|
||||
{
|
||||
offDay.HasKey(x => x.Id);
|
||||
offDay.Property(x => x.DayOfWeek).HasConversion<string>().HasMaxLength(15);
|
||||
offDay.WithOwner().HasForeignKey(x => x.ParentId);
|
||||
});
|
||||
|
||||
builder.OwnsMany(x => x.CustomizeRotatingShifts);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -227,7 +227,15 @@ public class CustomizeWorkshopGroupSettingsMapping : IEntityTypeConfiguration<Cu
|
||||
|
||||
});
|
||||
|
||||
builder.OwnsMany(x => x.CustomizeRotatingShifts);
|
||||
|
||||
builder.OwnsMany(x => x.WeeklyOffDays, offDay =>
|
||||
{
|
||||
offDay.HasKey(x => x.Id);
|
||||
offDay.Property(x => x.DayOfWeek).HasConversion<string>().HasMaxLength(15);
|
||||
offDay.WithOwner().HasForeignKey(x => x.ParentId);
|
||||
});
|
||||
|
||||
builder.OwnsMany(x => x.CustomizeRotatingShifts);
|
||||
|
||||
|
||||
builder.HasOne(x => x.CustomizeWorkshopSettings).WithMany(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
|
||||
@@ -221,6 +221,12 @@ public class CustomizeWorkshopSettingsMapping:IEntityTypeConfiguration<Customize
|
||||
|
||||
|
||||
});
|
||||
builder.OwnsMany(x => x.WeeklyOffDays, offDay =>
|
||||
{
|
||||
offDay.HasKey(x => x.Id);
|
||||
offDay.Property(x => x.DayOfWeek).HasConversion<string>().HasMaxLength(15);
|
||||
offDay.WithOwner().HasForeignKey(x => x.ParentId);
|
||||
});
|
||||
|
||||
|
||||
builder.HasMany(x => x.CustomizeWorkshopGroupSettingsCollection).WithOne(x => x.CustomizeWorkshopSettings)
|
||||
|
||||
9744
CompanyManagment.EFCore/Migrations/20250602161025_add offDays to cws.Designer.cs
generated
Normal file
9744
CompanyManagment.EFCore/Migrations/20250602161025_add offDays to cws.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,106 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addoffDaystocws : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CustomizeWorkshopEmployeeSettings_WeeklyOffDays",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
DayOfWeek = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
|
||||
ParentId = table.Column<long>(type: "bigint", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CustomizeWorkshopEmployeeSettings_WeeklyOffDays", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_CustomizeWorkshopEmployeeSettings_WeeklyOffDays_CustomizeWorkshopEmployeeSettings_ParentId",
|
||||
column: x => x.ParentId,
|
||||
principalTable: "CustomizeWorkshopEmployeeSettings",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CustomizeWorkshopGroupSettings_WeeklyOffDays",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
DayOfWeek = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
|
||||
ParentId = table.Column<long>(type: "bigint", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CustomizeWorkshopGroupSettings_WeeklyOffDays", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_CustomizeWorkshopGroupSettings_WeeklyOffDays_CustomizeWorkshopGroupSettings_ParentId",
|
||||
column: x => x.ParentId,
|
||||
principalTable: "CustomizeWorkshopGroupSettings",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CustomizeWorkshopSettings_WeeklyOffDays",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
DayOfWeek = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
|
||||
ParentId = table.Column<long>(type: "bigint", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CustomizeWorkshopSettings_WeeklyOffDays", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_CustomizeWorkshopSettings_WeeklyOffDays_CustomizeWorkshopSettings_ParentId",
|
||||
column: x => x.ParentId,
|
||||
principalTable: "CustomizeWorkshopSettings",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CustomizeWorkshopEmployeeSettings_WeeklyOffDays_ParentId",
|
||||
table: "CustomizeWorkshopEmployeeSettings_WeeklyOffDays",
|
||||
column: "ParentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CustomizeWorkshopGroupSettings_WeeklyOffDays_ParentId",
|
||||
table: "CustomizeWorkshopGroupSettings_WeeklyOffDays",
|
||||
column: "ParentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CustomizeWorkshopSettings_WeeklyOffDays_ParentId",
|
||||
table: "CustomizeWorkshopSettings_WeeklyOffDays",
|
||||
column: "ParentId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "CustomizeWorkshopEmployeeSettings_WeeklyOffDays");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "CustomizeWorkshopGroupSettings_WeeklyOffDays");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "CustomizeWorkshopSettings_WeeklyOffDays");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7433,6 +7433,32 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasForeignKey("CustomizeWorkshopEmployeeSettingsid");
|
||||
});
|
||||
|
||||
b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.Base.WeeklyOffDay", "WeeklyOffDays", b1 =>
|
||||
{
|
||||
b1.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
|
||||
|
||||
b1.Property<string>("DayOfWeek")
|
||||
.IsRequired()
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.Property<long>("ParentId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.HasKey("Id");
|
||||
|
||||
b1.HasIndex("ParentId");
|
||||
|
||||
b1.ToTable("CustomizeWorkshopEmployeeSettings_WeeklyOffDays");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("ParentId");
|
||||
});
|
||||
|
||||
b.Navigation("BaseYearsPay");
|
||||
|
||||
b.Navigation("BonusesPay");
|
||||
@@ -7468,6 +7494,8 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("OverTimePay");
|
||||
|
||||
b.Navigation("ShiftPay");
|
||||
|
||||
b.Navigation("WeeklyOffDays");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.CustomizeWorkshopGroupSettingsAgg.Entities.CustomizeWorkshopGroupSettings", b =>
|
||||
@@ -7991,6 +8019,32 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasForeignKey("CustomizeWorkshopGroupSettingsid");
|
||||
});
|
||||
|
||||
b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.Base.WeeklyOffDay", "WeeklyOffDays", b1 =>
|
||||
{
|
||||
b1.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
|
||||
|
||||
b1.Property<string>("DayOfWeek")
|
||||
.IsRequired()
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.Property<long>("ParentId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.HasKey("Id");
|
||||
|
||||
b1.HasIndex("ParentId");
|
||||
|
||||
b1.ToTable("CustomizeWorkshopGroupSettings_WeeklyOffDays");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("ParentId");
|
||||
});
|
||||
|
||||
b.Navigation("BaseYearsPay");
|
||||
|
||||
b.Navigation("BonusesPay");
|
||||
@@ -8026,6 +8080,8 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("OverTimePay");
|
||||
|
||||
b.Navigation("ShiftPay");
|
||||
|
||||
b.Navigation("WeeklyOffDays");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.CustomizeWorkshopSettingsAgg.Entities.CustomizeWorkshopSettings", b =>
|
||||
@@ -8476,6 +8532,32 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasForeignKey("CustomizeWorkshopSettingsid");
|
||||
});
|
||||
|
||||
b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.Base.WeeklyOffDay", "WeeklyOffDays", b1 =>
|
||||
{
|
||||
b1.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
|
||||
|
||||
b1.Property<string>("DayOfWeek")
|
||||
.IsRequired()
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.Property<long>("ParentId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.HasKey("Id");
|
||||
|
||||
b1.HasIndex("ParentId");
|
||||
|
||||
b1.ToTable("CustomizeWorkshopSettings_WeeklyOffDays");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("ParentId");
|
||||
});
|
||||
|
||||
b.Navigation("BaseYearsPay");
|
||||
|
||||
b.Navigation("BonusesPay");
|
||||
@@ -8504,6 +8586,8 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
|
||||
b.Navigation("ShiftPay");
|
||||
|
||||
b.Navigation("WeeklyOffDays");
|
||||
|
||||
b.Navigation("Workshop");
|
||||
});
|
||||
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;",
|
||||
|
||||
Reference in New Issue
Block a user