merge from master
This commit is contained in:
@@ -32,20 +32,22 @@ public class UidService : IUidService
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
|
||||
var requestResult = await _httpClient.PostAsync("person/v2", contentType);
|
||||
try
|
||||
{
|
||||
var requestResult = await _httpClient.PostAsync("person/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<PersonalInfoResponse>();
|
||||
responseResult.BasicInformation.FirstName = responseResult.BasicInformation.FirstName.ToPersian();
|
||||
responseResult.BasicInformation.LastName = responseResult.BasicInformation.LastName.ToPersian();
|
||||
responseResult.BasicInformation.FatherName = responseResult.BasicInformation.FatherName.ToPersian();
|
||||
|
||||
if (responseResult.BasicInformation != null)
|
||||
{
|
||||
responseResult.BasicInformation.FirstName = responseResult.BasicInformation.FirstName?.ToPersian();
|
||||
responseResult.BasicInformation.LastName = responseResult.BasicInformation.LastName?.ToPersian();
|
||||
responseResult.BasicInformation.FatherName = responseResult.BasicInformation.FatherName?.ToPersian();
|
||||
}
|
||||
|
||||
return responseResult;
|
||||
}
|
||||
catch (Exception)
|
||||
catch
|
||||
{
|
||||
|
||||
return null;
|
||||
@@ -63,19 +65,12 @@ public class UidService : IUidService
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
try
|
||||
{
|
||||
var requestResult = await _httpClient.PostAsync("mobile/owner/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<MatchMobileWithNationalCodeResponse>();
|
||||
return responseResult;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
var requestResult = await _httpClient.PostAsync("mobile/owner/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
}
|
||||
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<MatchMobileWithNationalCodeResponse>();
|
||||
return responseResult;
|
||||
}
|
||||
}
|
||||
@@ -15,4 +15,5 @@ public interface ICustomizeWorkshopEmployeeSettingsRepository : IRepository<long
|
||||
List<CustomizeWorkshopEmployeeSettingsViewModel> GetEmployeeSettingNotInMainGroup(long entityWorkshopId);
|
||||
void RemoveByWorkshopIdAndEmployeeId(long workshopId, long employeeId);
|
||||
|
||||
bool CheckEmployeeShiftHasChanged(EditCustomizeEmployeeSettings command);
|
||||
}
|
||||
@@ -20,14 +20,14 @@ public class Employee : EntityBase
|
||||
{
|
||||
public Employee(string fName, string lName, string fatherName,
|
||||
DateTime dateOfBirth, DateTime dateOfIssue, string placeOfIssue,
|
||||
string nationalCode, string idNumber, string gender, string nationality,
|
||||
string nationalCode, string idNumber, string gender, string nationality, string idNumberSerial , string idNumberSeri ,
|
||||
string phone = null, string address = null, string state = null, string city = null,
|
||||
string maritalStatus = null, string militaryService = null, string levelOfEducation = null, string fieldOfStudy = null,
|
||||
string bankCardNumber = null, string bankBranch = null, string insuranceCode = null, string insuranceHistoryByYear = null,
|
||||
string insuranceHistoryByMonth = null, string numberOfChildren = null, string officePhone = null,
|
||||
string mclsUserName = null, string mclsPassword = null,
|
||||
string eserviceUserName = null, string eservicePassword = null,
|
||||
string taxOfficeUserName = null, string taxOfficepassword = null, string sanaUserName = null, string sanaPassword = null)
|
||||
string taxOfficeUserName = null, string taxOfficepassword = null, string sanaUserName = null, string sanaPassword = null )
|
||||
{
|
||||
FName = fName;
|
||||
LName = lName;
|
||||
@@ -146,6 +146,15 @@ public class Employee : EntityBase
|
||||
/// آیا پرسنل احراز هویت شده است
|
||||
/// </summary>
|
||||
public bool IsAuthorized { get; set; }
|
||||
/// <summary>
|
||||
/// سریال شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSerial { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// سری شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -234,5 +243,39 @@ public class Employee : EntityBase
|
||||
IsAuthorized = true;
|
||||
}
|
||||
|
||||
public void EditAuthorizeEmployee(DateTime dateOfIssue, string placeOfIssue,
|
||||
string phone, string address, string state, string citi,
|
||||
string maritalStatus, string militaryService, string levelOfEducation, string fieldOfStudy,
|
||||
string bankCardNumber, string bankBranch, string insuranceCode, string insuranceHistoryByYear,
|
||||
string insuranceHistoryByMonth, string numberOfChildren, string officePhone,
|
||||
string mclsUserName, string mclsPassword, string eserviceUserName, string eservicePassword, string taxOfficeUserName, string taxOfficepassword, string sanaUserName, string sanaPassword)
|
||||
{
|
||||
DateOfIssue = dateOfIssue;
|
||||
PlaceOfIssue = placeOfIssue;
|
||||
Phone = phone;
|
||||
Address = address;
|
||||
State = state;
|
||||
City = citi;
|
||||
MaritalStatus = maritalStatus;
|
||||
MilitaryService = militaryService;
|
||||
LevelOfEducation = levelOfEducation;
|
||||
FieldOfStudy = fieldOfStudy;
|
||||
BankCardNumber = bankCardNumber;
|
||||
BankBranch = bankBranch;
|
||||
InsuranceCode = insuranceCode;
|
||||
InsuranceHistoryByYear = insuranceHistoryByYear;
|
||||
InsuranceHistoryByMonth = insuranceHistoryByMonth;
|
||||
NumberOfChildren = numberOfChildren;
|
||||
OfficePhone = OfficePhone;
|
||||
MclsUserName = mclsUserName;
|
||||
MclsPassword = mclsPassword;
|
||||
EserviceUserName = eserviceUserName;
|
||||
EservicePassword = eservicePassword;
|
||||
TaxOfficeUserName = taxOfficeUserName;
|
||||
TaxOfficepassword = taxOfficepassword;
|
||||
SanaUserName = sanaUserName;
|
||||
SanaPassword = sanaPassword;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
|
||||
public class EmployeeAuthorizeTemp:EntityBase
|
||||
{
|
||||
public EmployeeAuthorizeTemp(Gender gender, string fName, string lName, string fatherName, DateTime birthDate, string nationalCode, string idNumber, string idNumberSerial, string idNumberSeri)
|
||||
{
|
||||
Gender = gender;
|
||||
FName = fName;
|
||||
LName = lName;
|
||||
FatherName = fatherName;
|
||||
BirthDate = birthDate;
|
||||
NationalCode = nationalCode;
|
||||
IdNumber = idNumber;
|
||||
IdNumberSerial = idNumberSerial;
|
||||
IdNumberSeri = idNumberSeri;
|
||||
}
|
||||
|
||||
public Gender Gender { get; private set; }
|
||||
public string FName { get; private set; }
|
||||
public string LName { get; private set; }
|
||||
public string FatherName { get; private set; }
|
||||
public DateTime BirthDate { get; private set; }
|
||||
/// <summary>
|
||||
/// کدملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
/// <summary>
|
||||
/// سریال شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSerial { get; set; }
|
||||
/// <summary>
|
||||
/// سری شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
|
||||
public interface IEmployeeAuthorizeTempRepository:IRepository<long,EmployeeAuthorizeTemp>
|
||||
{
|
||||
Task<EmployeeAuthorizeTemp> GetByNationalCode(string nationalCode);
|
||||
}
|
||||
@@ -87,6 +87,9 @@ namespace Company.Domain.RollCallAgg
|
||||
long workshopId);
|
||||
|
||||
Task<List<RollCall>> GetRollCallsInShiftDate(DateTime rollCallShiftDate, long employeeId, long workshopId);
|
||||
|
||||
Task<List<RollCall>> GetRollCallsUntilNowWithWorkshopIdEmployeeIds(long workshopId, List<long> employeeIds,
|
||||
DateTime fromDate);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ public class ComputingViewModel
|
||||
public string EmployeeFullName { get; set; }
|
||||
public string YearAndMonth { get; set; }
|
||||
|
||||
public bool HasRotatingShift { get; set; }
|
||||
|
||||
//public List<string> holidays;
|
||||
}
|
||||
@@ -2,8 +2,10 @@
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
||||
|
||||
@@ -34,7 +36,8 @@ public interface ICustomizeWorkshopSettingsApplication
|
||||
OperationResult EditSimpleRollCallGroupSetting(EditCustomizeWorkshopGroupSettings command);
|
||||
|
||||
#region Vafa
|
||||
OperationResult EditSimpleRollCallEmployeeSetting(EditCustomizeEmployeeSettings command);
|
||||
OperationResult EditSimpleRollCallEmployeeSetting(EditCustomizeEmployeeSettings command,
|
||||
List<ReCalculateRollCallValues> reCalculateCommand);
|
||||
#endregion
|
||||
|
||||
OperationResult RemoveGroupSettings(long employeeSettingsId);
|
||||
@@ -89,4 +92,10 @@ public interface ICustomizeWorkshopSettingsApplication
|
||||
|
||||
|
||||
bool HasAnyEmployeeWithoutGroup(long workshopId);
|
||||
|
||||
/// <summary>
|
||||
/// این متد چک میکند که آیا شیفت پرسنل تغییر کرده است یا نه
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool CheckEmployeeShiftHasChanged(EditCustomizeEmployeeSettings command);
|
||||
}
|
||||
@@ -94,4 +94,14 @@ public class CreateEmployee
|
||||
public long WorkshopId { get; set; }
|
||||
public long? PersonelCode { get; set; }
|
||||
|
||||
public bool IsAuthorized { get; set; }
|
||||
/// <summary>
|
||||
/// سریال شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSerial { get; set; }
|
||||
/// <summary>
|
||||
/// سری شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employee;
|
||||
|
||||
public class EmployeeDataFromApiViewModel
|
||||
{
|
||||
public Gender Gender { get; set; }
|
||||
public string FName { get; set; }
|
||||
public string LName { get; set; }
|
||||
public string FatherName { get; set; }
|
||||
public string BirthDate { get; set; }
|
||||
/// <summary>
|
||||
/// کدملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
/// <summary>
|
||||
/// سریال شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSerial { get; set; }
|
||||
/// <summary>
|
||||
/// سری شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
}
|
||||
@@ -75,6 +75,8 @@ public interface IEmployeeApplication
|
||||
|
||||
Task<List<EmployeeSelectListViewModel>> WorkedEmployeesInWorkshopSelectList(long workshopId);
|
||||
|
||||
Task<OperationResult<EmployeeDataFromApiViewModel>> GetEmployeeDataFromApi(string nationalCode, string birthDate);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -12,6 +12,7 @@ namespace CompanyManagment.App.Contracts.EmployeeDocuments
|
||||
public long WorkshopId { get; set; }
|
||||
public IFormFile PictureFile { get; set; }
|
||||
public DocumentItemLabel Label { get; set; }
|
||||
}
|
||||
public bool WithoutPicture { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,6 +42,9 @@ namespace CompanyManagment.App.Contracts.RollCall
|
||||
DateTime end);
|
||||
|
||||
List<RollCallsByDateViewModel> GetUndefinedRollCallWorkFlowsService(long workshopId, DateTime durationStart, DateTime durationEnd);
|
||||
|
||||
|
||||
|
||||
OperationResult RemoveEmployeeRollCallsInDate(long workshopId, long employeeId, string dateFa);
|
||||
|
||||
|
||||
@@ -114,5 +117,18 @@ namespace CompanyManagment.App.Contracts.RollCall
|
||||
|
||||
OperationResult SetModifyTypeToEditByEmployerForRollCallsInDate(long workshopId, long employeeId, string absenceDate);
|
||||
List<RollCallViewModel> GetWorkshopEmployeeRollCallsWithUndefinedForDate(long workshopId, long employeeId, string date);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// محاسبه مجدد مقادیر حضور غیاب
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
OperationResult RecalculateValues(long workshopId, List<ReCalculateRollCallValues> command);
|
||||
}
|
||||
public class ReCalculateRollCallValues
|
||||
{
|
||||
public long EmployeeId { get; set; }
|
||||
public string FromDate { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,5 +16,6 @@ public class RotatingShiftViewModel
|
||||
public bool IsEveningShift { get; set; }
|
||||
public bool IsNightShift { get; set; }
|
||||
public string RotatingDate { get; set; }
|
||||
public int WinRate { get; set; }
|
||||
|
||||
}
|
||||
@@ -17,6 +17,7 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Company.Domain.CustomizeCheckoutAgg.ValueObjects;
|
||||
using Company.Domain.CustomizeWorkshopGroupSettingsAgg;
|
||||
using Company.Domain.PersonnelCodeAgg;
|
||||
using CompanyManagment.App.Contracts.PersonnleCode;
|
||||
|
||||
@@ -33,9 +34,10 @@ namespace CompanyManagment.Application
|
||||
private readonly IContractRepository _contractRepository;
|
||||
private readonly IWorkshopRepository _workshopRepository;
|
||||
private readonly ICustomizeWorkshopSettingsRepository _customizeWorkshopSettingsRepository;
|
||||
private readonly ICustomizeWorkshopGroupSettingsRepository _customizeWorkshopGroupSettingsRepository;
|
||||
public CustomizeCheckoutApplication(ICustomizeCheckoutRepository customizeCheckoutRepository,
|
||||
IRollCallEmployeeStatusRepository rollCallEmployeeStatusRepository, ILeftWorkRepository leftWorkRepository, IEmployeeRepository employeeRepository,
|
||||
IRollCallMandatoryRepository rollCallMandatoryRepository, IContractRepository contractRepository, IWorkshopRepository workshopRepository, ICustomizeWorkshopSettingsRepository customizeWorkshopSettingsRepository, IPersonnelCodeRepository personnelCodeRepository)
|
||||
IRollCallMandatoryRepository rollCallMandatoryRepository, IContractRepository contractRepository, IWorkshopRepository workshopRepository, ICustomizeWorkshopSettingsRepository customizeWorkshopSettingsRepository, IPersonnelCodeRepository personnelCodeRepository, ICustomizeWorkshopGroupSettingsRepository customizeWorkshopGroupSettingsRepository)
|
||||
{
|
||||
_customizeCheckoutRepository = customizeCheckoutRepository;
|
||||
_rollCallEmployeeStatusRepository = rollCallEmployeeStatusRepository;
|
||||
@@ -46,6 +48,7 @@ namespace CompanyManagment.Application
|
||||
_workshopRepository = workshopRepository;
|
||||
_customizeWorkshopSettingsRepository = customizeWorkshopSettingsRepository;
|
||||
_personnelCodeRepository = personnelCodeRepository;
|
||||
_customizeWorkshopGroupSettingsRepository = customizeWorkshopGroupSettingsRepository;
|
||||
}
|
||||
|
||||
public List<CustomizeCheckoutViewModel> Search(SearchCustomizeCheckout searchModel)
|
||||
@@ -299,8 +302,8 @@ namespace CompanyManagment.Application
|
||||
|
||||
if (workshopId == 170)
|
||||
{
|
||||
List<long> employeesIds = [ 45084, 7980, 5976,45214,45215];
|
||||
foreach (var employeesId in employeesIds)
|
||||
var exceptionEmployeeIds =_customizeWorkshopGroupSettingsRepository.GetEmployeeSettingsByGroupSettingsId(117).Select(x=>x.EmployeeId).ToList();
|
||||
foreach (var employeesId in exceptionEmployeeIds)
|
||||
{
|
||||
|
||||
var status = new RollCallEmployeeStatusViewModel()
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
|
||||
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.ContractAgg;
|
||||
using Company.Domain.CustomizeCheckoutAgg.ValueObjects;
|
||||
using Company.Domain.CustomizeCheckoutTempAgg;
|
||||
@@ -21,6 +19,7 @@ using Company.Domain.CustomizeCheckoutTempAgg.ValueObjects;
|
||||
using Company.Domain.PersonnelCodeAgg;
|
||||
using CompanyManagment.App.Contracts.PersonnleCode;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
using Company.Domain.CustomizeWorkshopGroupSettingsAgg;
|
||||
|
||||
namespace CompanyManagment.Application
|
||||
{
|
||||
@@ -35,8 +34,10 @@ namespace CompanyManagment.Application
|
||||
private readonly IContractRepository _contractRepository;
|
||||
private readonly IPersonnelCodeRepository _personnelCodeRepository;
|
||||
private readonly ICustomizeWorkshopSettingsRepository _customizeWorkshopSettingsRepository;
|
||||
private readonly ICustomizeWorkshopGroupSettingsRepository _customizeWorkshopGroupSettingsRepository;
|
||||
|
||||
public CustomizeCheckoutTempApplication(IRollCallEmployeeStatusRepository rollCallEmployeeStatusRepository, ILeftWorkRepository leftWorkRepository, IEmployeeRepository employeeRepository, IRollCallMandatoryRepository rollCallMandatoryRepository, IContractRepository contractRepository, ICustomizeCheckoutTempRepository customizeCheckoutTempRepository, IWorkshopRepository workshopRepository, ICustomizeWorkshopSettingsRepository customizeWorkshopSettingsRepository, IPersonnelCodeRepository personnelCodeRepository)
|
||||
|
||||
public CustomizeCheckoutTempApplication(IRollCallEmployeeStatusRepository rollCallEmployeeStatusRepository, ILeftWorkRepository leftWorkRepository, IEmployeeRepository employeeRepository, IRollCallMandatoryRepository rollCallMandatoryRepository, IContractRepository contractRepository, ICustomizeCheckoutTempRepository customizeCheckoutTempRepository, IWorkshopRepository workshopRepository, ICustomizeWorkshopSettingsRepository customizeWorkshopSettingsRepository, IPersonnelCodeRepository personnelCodeRepository, ICustomizeWorkshopGroupSettingsRepository customizeWorkshopGroupSettingsRepository)
|
||||
{
|
||||
_rollCallEmployeeStatusRepository = rollCallEmployeeStatusRepository;
|
||||
_leftWorkRepository = leftWorkRepository;
|
||||
@@ -47,6 +48,7 @@ namespace CompanyManagment.Application
|
||||
_workshopRepository = workshopRepository;
|
||||
_customizeWorkshopSettingsRepository = customizeWorkshopSettingsRepository;
|
||||
_personnelCodeRepository = personnelCodeRepository;
|
||||
_customizeWorkshopGroupSettingsRepository = customizeWorkshopGroupSettingsRepository;
|
||||
}
|
||||
|
||||
public IEnumerable<CustomizeCheckoutViewModel> Search(SearchCustomizeCheckout searchModel)
|
||||
@@ -247,8 +249,8 @@ namespace CompanyManagment.Application
|
||||
|
||||
if (workshopId == 170)
|
||||
{
|
||||
List<long> employeesIds = [45084, 7980, 5976, 45214,45215];
|
||||
foreach (var employeesId in employeesIds)
|
||||
var exceptionEmployeeIds = _customizeWorkshopGroupSettingsRepository.GetEmployeeSettingsByGroupSettingsId(117).Select(x => x.EmployeeId).ToList();
|
||||
foreach (var employeesId in exceptionEmployeeIds)
|
||||
{
|
||||
|
||||
var status = new RollCallEmployeeStatusViewModel()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,6 +29,7 @@ using Company.Domain.RollCallEmployeeAgg;
|
||||
using Company.Domain.CustomizeWorkshopGroupSettingsAgg;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using CompanyManagment.App.Contracts.Employee.DTO;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
@@ -49,7 +50,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository;
|
||||
private readonly ICustomizeWorkshopSettingsApplication _customizeWorkshopSettingsApplication;
|
||||
private readonly IEmployeeDocumentsApplication _employeeDocumentsApplication;
|
||||
private readonly IEmployeeDocumentsRepository _employeeDocumentsRepository;
|
||||
private readonly IEmployeeBankInformationApplication _employeeBankInformationApplication;
|
||||
private readonly ILeftWorkTempRepository _leftWorkTempRepository;
|
||||
private readonly IUidService _uidService;
|
||||
@@ -58,8 +58,9 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
private readonly IPersonnelCodeRepository _personnelCodeRepository;
|
||||
private readonly IEmployeeClientTempRepository _employeeClientTempRepository;
|
||||
private readonly ICustomizeWorkshopGroupSettingsRepository _customizeWorkshopGroupSettingsRepository;
|
||||
private readonly IEmployeeAuthorizeTempRepository _employeeAuthorizeTempRepository;
|
||||
|
||||
public EmployeeAplication(IEmployeeRepository employeeRepository, CompanyContext context, IWorkshopRepository workShopRepository, IWebHostEnvironment webHostEnvironment, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, IRollCallEmployeeRepository rollCallEmployeeRepository, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IEmployeeDocumentsApplication employeeDocumentsApplication, IEmployeeDocumentsRepository employeeDocumentsRepository, IEmployeeBankInformationApplication employeeBankInformationApplication, ILeftWorkTempRepository leftWorkTempRepository, IUidService uidService, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository, IPersonnelCodeRepository personnelCodeRepository, IEmployeeClientTempRepository employeeClientTempRepository, ICustomizeWorkshopGroupSettingsRepository customizeWorkshopGroupSettingsRepository, ILeftWorkRepository leftWorkRepository) : base(context)
|
||||
public EmployeeAplication(IEmployeeRepository employeeRepository, CompanyContext context, IWorkshopRepository workShopRepository, IWebHostEnvironment webHostEnvironment, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, IRollCallEmployeeRepository rollCallEmployeeRepository, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IEmployeeDocumentsApplication employeeDocumentsApplication, IEmployeeDocumentsRepository employeeDocumentsRepository, IEmployeeBankInformationApplication employeeBankInformationApplication, ILeftWorkTempRepository leftWorkTempRepository, IUidService uidService, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository, IPersonnelCodeRepository personnelCodeRepository, IEmployeeClientTempRepository employeeClientTempRepository, ICustomizeWorkshopGroupSettingsRepository customizeWorkshopGroupSettingsRepository, ILeftWorkRepository leftWorkRepository, IEmployeeAuthorizeTempRepository employeeAuthorizeTempRepository) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
_WorkShopRepository = workShopRepository;
|
||||
@@ -68,15 +69,14 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||
_customizeWorkshopSettingsApplication = customizeWorkshopSettingsApplication;
|
||||
_employeeDocumentsApplication = employeeDocumentsApplication;
|
||||
_employeeDocumentsRepository = employeeDocumentsRepository;
|
||||
_employeeBankInformationApplication = employeeBankInformationApplication;
|
||||
_leftWorkTempRepository = leftWorkTempRepository;
|
||||
_uidService = uidService;
|
||||
_customizeWorkshopEmployeeSettingsRepository = customizeWorkshopEmployeeSettingsRepository;
|
||||
_personnelCodeRepository = personnelCodeRepository;
|
||||
_employeeClientTempRepository = employeeClientTempRepository;
|
||||
_customizeWorkshopGroupSettingsRepository = customizeWorkshopGroupSettingsRepository;
|
||||
_leftWorkRepository = leftWorkRepository;
|
||||
_employeeAuthorizeTempRepository = employeeAuthorizeTempRepository;
|
||||
_EmployeeRepository = employeeRepository;
|
||||
}
|
||||
|
||||
@@ -201,10 +201,10 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
var dateOfBirth = command.DateOfBirth != null ? command.DateOfBirth.ToGeorgianDateTime() : initial.ToGeorgianDateTime();
|
||||
var dateOfIssue = command.DateOfIssue != null ? command.DateOfIssue.ToGeorgianDateTime() : initial.ToGeorgianDateTime();
|
||||
|
||||
|
||||
|
||||
var employeeData = new Employee(command.FName, command.LName, command.FatherName, dateOfBirth,
|
||||
dateOfIssue,
|
||||
command.PlaceOfIssue, command.NationalCode, command.IdNumber, command.Gender, command.Nationality,
|
||||
command.PlaceOfIssue, command.NationalCode, command.IdNumber, command.Gender, command.Nationality, command.IdNumberSerial, command.IdNumberSeri,
|
||||
command.Phone, command.Address,
|
||||
command.State, command.City, command.MaritalStatus, command.MilitaryService, command.LevelOfEducation,
|
||||
command.FieldOfStudy, command.BankCardNumber,
|
||||
@@ -212,7 +212,10 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
command.InsuranceHistoryByMonth, command.NumberOfChildren, command.OfficePhone, command.MclsUserName, command.MclsPassword, command.EserviceUserName, command.EservicePassword,
|
||||
command.TaxOfficeUserName, command.TaxOfficepassword, command.SanaUserName, command.SanaPassword);
|
||||
|
||||
|
||||
if (command.IsAuthorized)
|
||||
{
|
||||
employeeData.Authorized();
|
||||
}
|
||||
_EmployeeRepository.Create(employeeData);
|
||||
_EmployeeRepository.SaveChanges();
|
||||
|
||||
@@ -1248,10 +1251,10 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
var idNumber = identityInfo.ShenasnamehNumber == "0" ? identityInfo.NationalId : identityInfo.ShenasnamehNumber;
|
||||
|
||||
var newEmployee = new Employee(basicInfo.FirstName, basicInfo.LastName, basicInfo.FatherName, apiBirthDate,
|
||||
dateOfIssue, null, identityInfo.NationalId, idNumber, gender, "ایرانی");
|
||||
dateOfIssue, null, identityInfo.NationalId, idNumber, gender, "ایرانی", identityInfo.ShenasnameSerial, identityInfo.ShenasnameSeri);
|
||||
newEmployee.Authorized();
|
||||
await _EmployeeRepository.CreateAsync(newEmployee);
|
||||
await _context.SaveChangesAsync();
|
||||
await _EmployeeRepository.SaveChangesAsync();
|
||||
|
||||
return op.Succcedded(new EmployeeByNationalCodeInWorkshopViewModel()
|
||||
{
|
||||
@@ -1484,15 +1487,25 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
{
|
||||
employee.Edit(command.FName, command.LName, command.FatherName, command.BirthDate.ToGeorgianDateTime(),
|
||||
employee.DateOfIssue, employee.PlaceOfIssue, command.NationalCode, command.IdNumber, command.Gender,
|
||||
command.Nationality,
|
||||
employee.Phone, employee.Address, employee.State, employee.City, employee.MaritalStatus,
|
||||
employee.MilitaryService,
|
||||
command.Nationality, employee.Phone, employee.Address, employee.State, employee.City,
|
||||
command.MaritalStatus, command.MilitaryService,
|
||||
employee.LevelOfEducation, employee.FieldOfStudy, employee.BankCardNumber, employee.BankBranch,
|
||||
employee.InsuranceCode, employee.InsuranceHistoryByYear, employee.InsuranceHistoryByMonth,
|
||||
employee.NumberOfChildren, employee.OfficePhone, employee.MclsUserName, employee.MclsPassword,
|
||||
employee.EserviceUserName, employee.EservicePassword, employee.TaxOfficeUserName,
|
||||
employee.TaxOfficepassword, employee.SanaUserName, employee.SanaPassword);
|
||||
}
|
||||
else
|
||||
{
|
||||
employee.EditAuthorizeEmployee(employee.DateOfIssue, employee.PlaceOfIssue,
|
||||
employee.Phone, employee.Address, employee.State, employee.City, command.MaritalStatus,
|
||||
command.MilitaryService, employee.LevelOfEducation, employee.FieldOfStudy,
|
||||
employee.BankCardNumber, employee.BankBranch, employee.InsuranceCode,
|
||||
employee.InsuranceHistoryByYear, employee.InsuranceHistoryByMonth, employee.NumberOfChildren,
|
||||
employee.OfficePhone, employee.MclsUserName, employee.MclsPassword,
|
||||
employee.EserviceUserName, employee.EservicePassword, employee.TaxOfficeUserName,
|
||||
employee.TaxOfficepassword, employee.SanaUserName, employee.SanaPassword);
|
||||
}
|
||||
await _EmployeeRepository.SaveChangesAsync();
|
||||
|
||||
return op.Succcedded();
|
||||
@@ -1503,5 +1516,105 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
return await _EmployeeRepository.WorkedEmployeesInWorkshopSelectList(workshopId);
|
||||
}
|
||||
|
||||
public async Task<OperationResult<EmployeeDataFromApiViewModel>> GetEmployeeDataFromApi(string nationalCode, string birthDate)
|
||||
{
|
||||
var op = new OperationResult<EmployeeDataFromApiViewModel>();
|
||||
var birthDateGr = birthDate.ToGeorgianDateTime();
|
||||
|
||||
if (_EmployeeRepository.Exists(x => x.NationalCode == nationalCode))
|
||||
{
|
||||
var employee = _EmployeeRepository.GetByNationalCode(nationalCode);
|
||||
|
||||
if (employee.IsAuthorized == false)
|
||||
{
|
||||
var apiResult = await _uidService.GetPersonalInfo(nationalCode, birthDate);
|
||||
|
||||
if (apiResult.ResponseContext.Status.Code != 0)
|
||||
{
|
||||
return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");
|
||||
}
|
||||
var basicInfo = apiResult.BasicInformation;
|
||||
var identityInfo = apiResult.IdentificationInformation;
|
||||
|
||||
var gender = basicInfo.GenderEnum switch
|
||||
{
|
||||
Gender.Female => "زن",
|
||||
Gender.Male => "مرد",
|
||||
_ => throw new AggregateException()
|
||||
};
|
||||
|
||||
var idNumber = identityInfo.ShenasnamehNumber == "0" ? identityInfo.NationalId : identityInfo.ShenasnamehNumber;
|
||||
employee.Edit(basicInfo.FirstName, basicInfo.LastName, basicInfo.FatherName, birthDateGr,
|
||||
employee.DateOfIssue, employee.PlaceOfIssue, identityInfo.NationalId, idNumber,
|
||||
gender, "ایرانی", employee.Phone, employee.Address, employee.State, employee.City,
|
||||
employee.MaritalStatus, employee.MilitaryService, employee.LevelOfEducation,
|
||||
employee.FieldOfStudy, employee.BankCardNumber, employee.BankBranch, employee.InsuranceCode, employee.InsuranceHistoryByYear,
|
||||
employee.InsuranceHistoryByMonth, employee.NumberOfChildren,
|
||||
employee.OfficePhone, employee.MclsUserName, employee.MclsPassword,
|
||||
employee.EserviceUserName, employee.EservicePassword, employee.TaxOfficeUserName,
|
||||
employee.TaxOfficepassword, employee.SanaUserName, employee.SanaPassword);
|
||||
|
||||
employee.Authorized();
|
||||
await _EmployeeRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
return op.Failed("این پرسنل در بانک اطلاعات موجود میباشد");
|
||||
}
|
||||
else
|
||||
{
|
||||
EmployeeDataFromApiViewModel data;
|
||||
if (_employeeAuthorizeTempRepository.Exists(x => x.NationalCode == nationalCode))
|
||||
{
|
||||
var employeeAuthorizeTemp = await _employeeAuthorizeTempRepository.GetByNationalCode(nationalCode);
|
||||
if (employeeAuthorizeTemp.BirthDate.ToFarsi() != birthDate)
|
||||
{
|
||||
return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");
|
||||
}
|
||||
|
||||
data = new EmployeeDataFromApiViewModel()
|
||||
{
|
||||
BirthDate = employeeAuthorizeTemp.BirthDate.ToFarsi(),
|
||||
NationalCode = employeeAuthorizeTemp.NationalCode,
|
||||
IdNumber = employeeAuthorizeTemp.IdNumber,
|
||||
FName = employeeAuthorizeTemp.FName,
|
||||
FatherName = employeeAuthorizeTemp.FatherName,
|
||||
Gender = employeeAuthorizeTemp.Gender,
|
||||
LName = employeeAuthorizeTemp.LName,
|
||||
};
|
||||
return op.Succcedded(data);
|
||||
}
|
||||
var apiResult = await _uidService.GetPersonalInfo(nationalCode, birthDate);
|
||||
|
||||
if (apiResult.ResponseContext.Status.Code != 0)
|
||||
{
|
||||
return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");
|
||||
}
|
||||
var basicInfo = apiResult.BasicInformation;
|
||||
var identityInfo = apiResult.IdentificationInformation;
|
||||
|
||||
data = new EmployeeDataFromApiViewModel()
|
||||
{
|
||||
BirthDate = identityInfo.BirthDate,
|
||||
NationalCode = identityInfo.NationalId,
|
||||
IdNumber = identityInfo.ShenasnamehNumber == "0" ? identityInfo.NationalId : identityInfo.ShenasnamehNumber,
|
||||
FatherName = basicInfo.FatherName,
|
||||
FName = basicInfo.FirstName,
|
||||
Gender = basicInfo.GenderEnum,
|
||||
LName = basicInfo.LastName,
|
||||
IdNumberSeri = identityInfo.ShenasnameSeri,
|
||||
IdNumberSerial = identityInfo.ShenasnameSerial
|
||||
};
|
||||
|
||||
var newAuthorizeTemp = new EmployeeAuthorizeTemp(data.Gender, data.FName, data.LName, data.FatherName, birthDateGr, data.NationalCode, data.IdNumber, data.IdNumberSerial, data.IdNumberSeri);
|
||||
await _employeeAuthorizeTempRepository.CreateAsync(newAuthorizeTemp);
|
||||
await _employeeAuthorizeTempRepository.SaveChangesAsync();
|
||||
|
||||
return op.Succcedded(data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -1414,27 +1414,42 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
var opCreate = Create(new CreateEmployeeDocuments()
|
||||
{ EmployeeId = employeeId, WorkshopId = workshopId });
|
||||
if (opCreate.IsSuccedded == false) return opCreate;
|
||||
entity = _employeeDocumentsRepository.GetByEmployeeIdWorkshopId(employeeId, workshopId);
|
||||
|
||||
if (opCreate.IsSuccedded == false)
|
||||
return opCreate;
|
||||
|
||||
entity = _employeeDocumentsRepository.GetByEmployeeIdWorkshopIdWithItems(employeeId, workshopId);
|
||||
}
|
||||
|
||||
List<EmployeeDocumentItem> newEntities = new();
|
||||
foreach (var item in command)
|
||||
{
|
||||
DeleteMultipleUnsubmittedDocumentsByLabel(entity, item.Label, uploaderType);
|
||||
long mediaId = 0;
|
||||
if (item.WithoutPicture)
|
||||
{
|
||||
var employeeDocumentItem =
|
||||
entity.EmployeeDocumentItemCollection.First(x => x.DocumentLabel == item.Label);
|
||||
mediaId = employeeDocumentItem.MediaId;
|
||||
}
|
||||
else
|
||||
{
|
||||
DeleteMultipleUnsubmittedDocumentsByLabel(entity, item.Label, uploaderType);
|
||||
|
||||
var mediaOpResult = UploadDocumentItemFile(item.PictureFile, item.Label.ToString(),
|
||||
$"temp/{workshopId}/{employeeId}");
|
||||
var mediaOpResult = UploadDocumentItemFile(item.PictureFile, item.Label.ToString(),
|
||||
$"temp/{workshopId}/{employeeId}");
|
||||
|
||||
if (mediaOpResult.IsSuccedded == false)
|
||||
return mediaOpResult;
|
||||
if (mediaOpResult.IsSuccedded == false)
|
||||
return mediaOpResult;
|
||||
|
||||
|
||||
//if the mediaId is already in use in our table return failed
|
||||
if (_employeeDocumentItemRepository.Exists(x => x.MediaId == mediaOpResult.SendId))
|
||||
return op.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
//if the mediaId is already in use in our table return failed
|
||||
if (_employeeDocumentItemRepository.Exists(x => x.MediaId == mediaOpResult.SendId))
|
||||
return op.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
var newEntity = new EmployeeDocumentItem(workshopId, employeeId, mediaOpResult.SendId, entity.id, item.Label, uploaderId, uploaderType, DocumentStatus.SubmittedByAdmin);
|
||||
mediaId = mediaOpResult.SendId;
|
||||
}
|
||||
|
||||
var newEntity = new EmployeeDocumentItem(workshopId, employeeId, mediaId, entity.id, item.Label, uploaderId, uploaderType, DocumentStatus.SubmittedByAdmin);
|
||||
newEntities.Add(newEntity);
|
||||
}
|
||||
|
||||
|
||||
@@ -1633,7 +1633,7 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
dateSaleryviewModel.StartDateGr = startDateGr;
|
||||
dateSaleryviewModel.EndDateGr = endDateGr;
|
||||
var _dateSalary = _dateSalaryRepository.GetDateSalaryViewModel(dateSaleryviewModel);
|
||||
if (_dateSalary != null)
|
||||
if (_dateSalary != null && _dateSalary.Id >0)
|
||||
{
|
||||
var dateSaleryItemviewModel = new DateSalaryItemSearchModel();
|
||||
dateSaleryItemviewModel.DateSalaryId = _dateSalary.Id;
|
||||
|
||||
@@ -8,6 +8,7 @@ using _0_Framework.Application;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.CustomizeCheckoutAgg;
|
||||
using Company.Domain.CustomizeCheckoutTempAgg;
|
||||
using Company.Domain.CustomizeWorkshopEmployeeSettingsAgg;
|
||||
using Company.Domain.CustomizeWorkshopSettingsAgg;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
@@ -24,7 +25,6 @@ namespace CompanyManagment.Application;
|
||||
public class RollCallApplication : IRollCallApplication
|
||||
{
|
||||
private readonly IRollCallRepository _rollCallRepository;
|
||||
private readonly IEmployeeApplication _employeeApplication;
|
||||
private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository;
|
||||
private readonly IEmployeeRepository _employeeRepository;
|
||||
private readonly ILeaveRepository _leaveRepository;
|
||||
@@ -33,11 +33,11 @@ public class RollCallApplication : IRollCallApplication
|
||||
private readonly IRollCallDomainService _rollCallDomainService;
|
||||
private readonly ICustomizeWorkshopSettingsRepository _customizeWorkshopSettingsRepository;
|
||||
private readonly ICustomizeWorkshopEmployeeSettingsRepository _customizeWorkshopEmployeeSettingsRepository;
|
||||
private readonly ICustomizeCheckoutTempRepository _customizeCheckoutTempRepository;
|
||||
|
||||
public RollCallApplication(IRollCallRepository rollCallRepository, IEmployeeApplication employeeApplication, IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, ILeaveRepository leaveRepository, ICustomizeCheckoutRepository customizeCheckoutRepository, ICheckoutRepository checkoutRepository, IRollCallDomainService rollCallDomainService, ICustomizeWorkshopSettingsRepository customizeWorkshopSettingsRepository, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository)
|
||||
public RollCallApplication(IRollCallRepository rollCallRepository, IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, ILeaveRepository leaveRepository, ICustomizeCheckoutRepository customizeCheckoutRepository, ICheckoutRepository checkoutRepository, IRollCallDomainService rollCallDomainService, ICustomizeWorkshopSettingsRepository customizeWorkshopSettingsRepository, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository, ICustomizeCheckoutTempRepository customizeCheckoutTempRepository)
|
||||
{
|
||||
_rollCallRepository = rollCallRepository;
|
||||
_employeeApplication = employeeApplication;
|
||||
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||
_employeeRepository = employeeRepository;
|
||||
_leaveRepository = leaveRepository;
|
||||
@@ -46,7 +46,8 @@ public class RollCallApplication : IRollCallApplication
|
||||
_rollCallDomainService = rollCallDomainService;
|
||||
_customizeWorkshopSettingsRepository = customizeWorkshopSettingsRepository;
|
||||
_customizeWorkshopEmployeeSettingsRepository = customizeWorkshopEmployeeSettingsRepository;
|
||||
}
|
||||
_customizeCheckoutTempRepository = customizeCheckoutTempRepository;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateRollCall command)
|
||||
{
|
||||
@@ -55,7 +56,7 @@ public class RollCallApplication : IRollCallApplication
|
||||
|
||||
var yearFa = Convert.ToInt32(startDateFa.Substring(0, 4));
|
||||
var monthFa = Convert.ToInt32(startDateFa.Substring(5, 2));
|
||||
var employeeName = _employeeApplication.GetDetails(command.EmployeeId).EmployeeFullName;
|
||||
var employeeName = _employeeRepository.GetDetails(command.EmployeeId).EmployeeFullName;
|
||||
var create = new RollCall(command.WorkshopId, command.EmployeeId, employeeName, command.StartDate.Value, null,
|
||||
yearFa, monthFa, _rollCallDomainService);
|
||||
_rollCallRepository.Create(create);
|
||||
@@ -772,4 +773,56 @@ public class RollCallApplication : IRollCallApplication
|
||||
{
|
||||
return _rollCallRepository.CheckRepeat(employeeId, workshopId);
|
||||
}
|
||||
|
||||
public OperationResult RecalculateValues(long workshopId, List<ReCalculateRollCallValues> commands)
|
||||
{
|
||||
var operationResult = new OperationResult();
|
||||
try
|
||||
{
|
||||
List<DateTime> fromDates = commands.Select(x => x.FromDate.ToGeorgianDateTime()).ToList();
|
||||
var employeeIds = commands.Select(x => x.EmployeeId).ToList();
|
||||
if (_checkoutRepository.Exists(x => x.WorkshopId == workshopId && employeeIds.Contains(x.EmployeeId) && fromDates.Any(a => a <= x.ContractStart)))
|
||||
{
|
||||
return operationResult.Failed("پرسنل بعد از تاریخ وارد شده دارای فیش رسمی است");
|
||||
}
|
||||
|
||||
if (_customizeCheckoutRepository.Exists(x => x.WorkshopId == workshopId && employeeIds.Contains(x.EmployeeId) && fromDates.Any(a => a <= x.ContractStart)))
|
||||
{
|
||||
return operationResult.Failed("پرسنل بعد از تاریخ وارد شده دارای فیش غیررسمی نهایی است");
|
||||
}
|
||||
|
||||
if (_customizeCheckoutTempRepository.Exists(x => x.WorkshopId == workshopId && employeeIds.Contains(x.EmployeeId) && fromDates.Any(a => a <= x.ContractStart)))
|
||||
{
|
||||
return operationResult.Failed("پرسنل بعد از تاریخ وارد شده دارای فیش غیررسمی موقت است");
|
||||
}
|
||||
|
||||
var oldestDate = commands.MinBy(x => x.FromDate).FromDate.ToGeorgianDateTime();
|
||||
|
||||
var allRollCalls = _rollCallRepository
|
||||
.GetRollCallsUntilNowWithWorkshopIdEmployeeIds(workshopId, commands.Select(x => x.EmployeeId).ToList(),
|
||||
oldestDate).GetAwaiter().GetResult();
|
||||
|
||||
|
||||
foreach (var command in commands)
|
||||
{
|
||||
var rollCalls = allRollCalls
|
||||
.Where(x => x.EmployeeId == command.EmployeeId && x.ShiftDate >= command.FromDate.ToGeorgianDateTime()).ToList();
|
||||
|
||||
foreach (var rollCall in rollCalls)
|
||||
{
|
||||
rollCall.ClearTimeDiff();
|
||||
_rollCallRepository.SaveChanges();
|
||||
rollCall.SetEndDateTime(rollCall.EndDate!.Value, _rollCallDomainService);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return operationResult.Succcedded();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return operationResult.Failed(e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,6 +23,7 @@ using Company.Domain.DateSalaryAgg;
|
||||
using Company.Domain.DateSalaryItemAgg;
|
||||
using Company.Domain.EmployeeAccountAgg;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Company.Domain.EmployeeBankInformationAgg;
|
||||
using Company.Domain.EmployeeChildrenAgg;
|
||||
using Company.Domain.EmployeeClientTempAgg;
|
||||
@@ -174,6 +175,7 @@ public class CompanyContext : DbContext
|
||||
public DbSet<EmployeeClientTemp> EmployeeClientTemps { get; set; }
|
||||
public DbSet<LeftWorkTemp> LeftWorkTemps { get; set; }
|
||||
|
||||
public DbSet<EmployeeAuthorizeTemp> EmployeeAuthorizeTemps { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Pooya
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class EmployeeAuthorizeTempMapping:IEntityTypeConfiguration<EmployeeAuthorizeTemp>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<EmployeeAuthorizeTemp> builder)
|
||||
{
|
||||
builder.ToTable("EmployeeAuthorizeTemps");
|
||||
builder.HasKey(x => x.id);
|
||||
|
||||
builder.Property(x => x.NationalCode).HasMaxLength(15);
|
||||
builder.Property(x => x.IdNumber).HasMaxLength(15);
|
||||
builder.Property(x => x.FName).HasMaxLength(100);
|
||||
builder.Property(x => x.LName).HasMaxLength(100);
|
||||
builder.Property(x => x.FatherName).HasMaxLength(100);
|
||||
builder.Property(x => x.Gender).HasConversion<string>().HasMaxLength(15);
|
||||
|
||||
builder.Property(x => x.IdNumberSerial).HasMaxLength(25);
|
||||
builder.Property(x => x.IdNumberSeri).HasMaxLength(25);
|
||||
|
||||
builder.HasIndex(x => x.NationalCode).IsUnique();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -80,9 +80,17 @@ public class EmployeeMapping : IEntityTypeConfiguration<Employee>
|
||||
.HasForeignKey(x => x.EmployeeId);
|
||||
|
||||
builder.HasMany(x => x.EmployeeBankInformationList).WithOne(x => x.Employee)
|
||||
.HasForeignKey(x => x.EmployeeId);
|
||||
.HasForeignKey(x => x.EmployeeId);
|
||||
|
||||
builder.Ignore(x => x.FullName);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mahan
|
||||
|
||||
builder.Property(x => x.IdNumberSerial).HasMaxLength(25);
|
||||
builder.Property(x => x.IdNumberSeri).HasMaxLength(25);
|
||||
|
||||
builder.Ignore(x => x.FullName);
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ partial class WorkshopMapping : IEntityTypeConfiguration<Workshop>
|
||||
|
||||
builder.HasMany(x => x.RollCallServicesList)
|
||||
.WithOne(x => x.Workshop)
|
||||
.HasForeignKey(x => x.AccountId);
|
||||
.HasForeignKey(x => x.WorkshopId);
|
||||
|
||||
builder.HasMany(x => x.TaxLeftWorkCategoryList)
|
||||
.WithOne(x => x.Workshop)
|
||||
|
||||
9471
CompanyManagment.EFCore/Migrations/20250501111715_add employeeAuthorizeTemp and add serialNumber.Designer.cs
generated
Normal file
9471
CompanyManagment.EFCore/Migrations/20250501111715_add employeeAuthorizeTemp and add serialNumber.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addemployeeAuthorizeTempandaddserialNumber : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "IdNumberSeri",
|
||||
table: "Employees",
|
||||
type: "nvarchar(25)",
|
||||
maxLength: 25,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "IdNumberSerial",
|
||||
table: "Employees",
|
||||
type: "nvarchar(25)",
|
||||
maxLength: 25,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EmployeeAuthorizeTemps",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Gender = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
|
||||
FName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
LName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
FatherName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
BirthDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
NationalCode = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: true),
|
||||
IdNumber = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: true),
|
||||
IdNumberSerial = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
|
||||
IdNumberSeri = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmployeeAuthorizeTemps", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeeAuthorizeTemps_NationalCode",
|
||||
table: "EmployeeAuthorizeTemps",
|
||||
column: "NationalCode",
|
||||
unique: true,
|
||||
filter: "[NationalCode] IS NOT NULL");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "EmployeeAuthorizeTemps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IdNumberSeri",
|
||||
table: "Employees");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IdNumberSerial",
|
||||
table: "Employees");
|
||||
}
|
||||
}
|
||||
}
|
||||
9407
CompanyManagment.EFCore/Migrations/20250503140454_changeRollCallServiceRelation.Designer.cs
generated
Normal file
9407
CompanyManagment.EFCore/Migrations/20250503140454_changeRollCallServiceRelation.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,60 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class changeRollCallServiceRelation : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_RollCallServices_Workshops_AccountId",
|
||||
table: "RollCallServices");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_RollCallServices_AccountId",
|
||||
table: "RollCallServices");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RollCallServices_WorkshopId",
|
||||
table: "RollCallServices",
|
||||
column: "WorkshopId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_RollCallServices_Workshops_WorkshopId",
|
||||
table: "RollCallServices",
|
||||
column: "WorkshopId",
|
||||
principalTable: "Workshops",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_RollCallServices_Workshops_WorkshopId",
|
||||
table: "RollCallServices");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_RollCallServices_WorkshopId",
|
||||
table: "RollCallServices");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RollCallServices_AccountId",
|
||||
table: "RollCallServices",
|
||||
column: "AccountId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_RollCallServices_Workshops_AccountId",
|
||||
table: "RollCallServices",
|
||||
column: "AccountId",
|
||||
principalTable: "Workshops",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1495,6 +1495,14 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("IdNumberSeri")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("IdNumberSerial")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("InsuranceCode")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
@@ -1591,6 +1599,62 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("Employees", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.EmployeeAuthorizeTempAgg.EmployeeAuthorizeTemp", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("FatherName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("Gender")
|
||||
.IsRequired()
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b.Property<string>("IdNumber")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b.Property<string>("IdNumberSeri")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("IdNumberSerial")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("LName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("NationalCode")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("NationalCode")
|
||||
.IsUnique()
|
||||
.HasFilter("[NationalCode] IS NOT NULL");
|
||||
|
||||
b.ToTable("EmployeeAuthorizeTemps", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.EmployeeBankInformationAgg.EmployeeBankInformation", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -4637,7 +4701,7 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("AccountId");
|
||||
b.HasIndex("WorkshopId");
|
||||
|
||||
b.ToTable("RollCallServices", (string)null);
|
||||
});
|
||||
@@ -8909,7 +8973,7 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop")
|
||||
.WithMany("RollCallServicesList")
|
||||
.HasForeignKey("AccountId")
|
||||
.HasForeignKey("WorkshopId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
|
||||
@@ -28,10 +28,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
|
||||
private readonly IEmployeeApplication _employeeApplication;
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
private readonly IContractApplication _contractApplication;
|
||||
private readonly IWorkingHoursApplication _workingHoursApplication;
|
||||
|
||||
private readonly IWorkingHoursTempApplication _workingHoursTempApplication;
|
||||
|
||||
private readonly IAuthHelper _authHelper;
|
||||
@@ -39,14 +36,9 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
private readonly ILeftWorkRepository _leftWorkRepository;
|
||||
private readonly IRollCallRepository _rollCallRepository;
|
||||
|
||||
public CheckoutRepository(IEmployeeApplication employeeApplication, IWorkshopApplication workshopApplication,
|
||||
IContractApplication contractApplication, IWorkingHoursApplication workingHoursApplication,
|
||||
IAuthHelper authHelper, CompanyContext context, IConfiguration configuration, ILeftWorkRepository leftWorkRepository, IWorkingHoursTempApplication workingHoursTempApplication, IRollCallRepository rollCallRepository) : base(context)
|
||||
public CheckoutRepository(IAuthHelper authHelper, CompanyContext context, IConfiguration configuration, ILeftWorkRepository leftWorkRepository, IWorkingHoursTempApplication workingHoursTempApplication, IRollCallRepository rollCallRepository) : base(context)
|
||||
{
|
||||
_employeeApplication = employeeApplication;
|
||||
_workshopApplication = workshopApplication;
|
||||
_contractApplication = contractApplication;
|
||||
_workingHoursApplication = workingHoursApplication;
|
||||
|
||||
_authHelper = authHelper;
|
||||
_context = context;
|
||||
_configuration = configuration;
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.CustomizeWorkshopEmployeeSettingsAgg;
|
||||
using Company.Domain.CustomizeWorkshopEmployeeSettingsAgg.Entities;
|
||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewModel;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
@@ -174,4 +177,65 @@ public class CustomizeWorkshopEmployeeSettingsRepository(CompanyContext companyC
|
||||
if (entity != null)
|
||||
Remove(entity);
|
||||
}
|
||||
|
||||
public bool CheckEmployeeShiftHasChanged(EditCustomizeEmployeeSettings command)
|
||||
{
|
||||
var employeeSettings = _companyContext.CustomizeWorkshopEmployeeSettings.Find(command.Id);
|
||||
if (employeeSettings == null)
|
||||
{
|
||||
throw new InvalidDataException();
|
||||
}
|
||||
|
||||
if (command.WorkshopShiftStatus != employeeSettings.WorkshopShiftStatus)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (employeeSettings.WorkshopShiftStatus)
|
||||
{
|
||||
case WorkshopShiftStatus.Irregular:
|
||||
if (command.IrregularShift != employeeSettings.IrregularShift)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case WorkshopShiftStatus.Rotating:
|
||||
var rotatingShift = command.CustomizeRotatingShifts
|
||||
.Select(x => new CustomizeRotatingShift(TimeOnly.Parse(x.StartTime), TimeOnly.Parse(x.EndTime)))
|
||||
.ToList();
|
||||
|
||||
if (!rotatingShift.All(x => employeeSettings.CustomizeRotatingShifts.Any(x.Equals)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case WorkshopShiftStatus.Regular:
|
||||
var employeesShifts =
|
||||
command.ShiftViewModel.Select(x =>
|
||||
{
|
||||
var placement = x.Placement switch
|
||||
{
|
||||
ShiftPlacement.First => "اول",
|
||||
ShiftPlacement.Second => "دوم",
|
||||
ShiftPlacement.Third => "سوم"
|
||||
};
|
||||
if (!TimeOnly.TryParseExact(x.StartTime, "HH:mm", out TimeOnly start))
|
||||
throw new InvalidDataException($"فرمت شروع نوبت{placement}نادرست است");
|
||||
if (!TimeOnly.TryParseExact(x.EndTime, "HH:mm", out TimeOnly end))
|
||||
throw new InvalidDataException($"فرمت پایان نوبت{placement}نادرست است");
|
||||
|
||||
|
||||
return new CustomizeWorkshopEmployeeSettingsShift(start, end, x.Placement);
|
||||
|
||||
}).ToList();
|
||||
if (!employeesShifts.All(x => employeeSettings.CustomizeWorkshopEmployeeSettingsShifts.Any(x.Equals)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -77,6 +77,7 @@ public class DateSalaryRepository : RepositoryBase<long, DateSalary>, IDateSalar
|
||||
var dateSalary = new DateSalary(command.StartDateFa, command.EndDateFa);
|
||||
Create(dateSalary);
|
||||
SaveChanges();
|
||||
command.DateSalaryItems = command.DateSalaryItems.Where(x => x.Salary > 0).ToList();
|
||||
foreach (var item in command.DateSalaryItems)
|
||||
{
|
||||
|
||||
@@ -104,7 +105,7 @@ public class DateSalaryRepository : RepositoryBase<long, DateSalary>, IDateSalar
|
||||
var dateSalary = Get(command.Id);
|
||||
dateSalary.Edit(command.StartDateFa, command.EndDateFa);
|
||||
SaveChanges();
|
||||
|
||||
command.DateSalaryItems = command.DateSalaryItems.Where(x => x.Salary > 0).ToList();
|
||||
foreach (var item in command.DateSalaryItems)
|
||||
{
|
||||
if (item.Id == 0)
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class EmployeeAuthorizeTempRepository:RepositoryBase<long,EmployeeAuthorizeTemp>, IEmployeeAuthorizeTempRepository
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
public EmployeeAuthorizeTempRepository(CompanyContext context) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public async Task<EmployeeAuthorizeTemp> GetByNationalCode(string nationalCode)
|
||||
{
|
||||
return await _context.EmployeeAuthorizeTemps.FirstOrDefaultAsync(x =>
|
||||
x.NationalCode == nationalCode);
|
||||
}
|
||||
}
|
||||
@@ -392,48 +392,122 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
||||
|
||||
public List<WorkshopWithEmployeeDocumentsViewModel> GetWorkshopsWithDocumentsAwaitingReviewForAdminWorkFlow(List<long> workshops)
|
||||
{
|
||||
var activeEmployees = _companyContext.LeftWorkList
|
||||
//var activeEmployees = _companyContext.LeftWorkList
|
||||
// .Where(x => workshops.Contains(x.WorkshopId) && x.LeftWorkDate.AddDays(-1) >= DateTime.Now)
|
||||
// .Select(x => new { x.WorkshopId, x.EmployeeId });
|
||||
|
||||
//var employeeClientTemp = _companyContext.EmployeeClientTemps.Where(x => workshops.Contains(x.WorkshopId))
|
||||
// .Select(x=> new { x.WorkshopId, x.EmployeeId });
|
||||
|
||||
//var query = _companyContext.EmployeeDocuments
|
||||
// .Where(x => workshops.Contains(x.WorkshopId) &&
|
||||
// (activeEmployees.Any(y => y.WorkshopId == x.WorkshopId && y.EmployeeId == x.EmployeeId) ||
|
||||
// employeeClientTemp.Any(temp =>
|
||||
// x.EmployeeId == temp.EmployeeId && temp.WorkshopId == x.WorkshopId)) &&
|
||||
// x.IsConfirmed == false)
|
||||
// .Include(x => x.Workshop).Include(x => x.EmployeeDocumentItemCollection).AsSplitQuery().AsNoTracking()
|
||||
// .Where(x => x.IsSentToChecker == false &&
|
||||
// (x.EmployeeDocumentItemCollection.Any(y =>
|
||||
// y.DocumentStatus == DocumentStatus.SubmittedByClient) ||
|
||||
// employeeClientTemp.Any(temp =>
|
||||
// x.EmployeeId == temp.EmployeeId && temp.WorkshopId == x.WorkshopId) || x.HasRejectedItems))
|
||||
// .GroupBy(x => x.WorkshopId).Select(x => new WorkshopWithEmployeeDocumentsViewModel()
|
||||
// {
|
||||
// WorkshopId = x.Key,
|
||||
// WorkshopFullName = x.FirstOrDefault().Workshop.WorkshopName,
|
||||
// EmployeesWithoutDocumentCount = x.Count()
|
||||
// });
|
||||
|
||||
|
||||
|
||||
//var workshopEmployers = _companyContext.WorkshopEmployers.Include(x => x.Employer).AsSplitQuery()
|
||||
// .Where(x => query.Any(y => y.WorkshopId == x.WorkshopId))
|
||||
// .GroupBy(x => x.WorkshopId).Select(x => x.FirstOrDefault()).ToList();
|
||||
|
||||
|
||||
|
||||
|
||||
//var result = query.ToList();
|
||||
|
||||
|
||||
//result.ForEach(x =>
|
||||
//{
|
||||
// var employer = workshopEmployers.FirstOrDefault(y => y.WorkshopId == x.WorkshopId)?.Employer;
|
||||
// x.EmployerName = employer.FullName;
|
||||
|
||||
// //x.SubmittedItems.ForEach(y=>y.PicturePath= medias.FirstOrDefault(z=>z.id == y.MediaId)?.Path ?? "");
|
||||
//});
|
||||
|
||||
//return result.Where(x => x.EmployeesWithoutDocumentCount > 0).OrderByDescending(x => x.EmployeesWithoutDocumentCount).ToList();
|
||||
|
||||
// یک بار keyها رو آماده میکنیم
|
||||
var activeEmployeeKeys = _companyContext.LeftWorkList
|
||||
.Where(x => workshops.Contains(x.WorkshopId) && x.LeftWorkDate.AddDays(-1) >= DateTime.Now)
|
||||
.Select(x => new { x.WorkshopId, x.EmployeeId });
|
||||
|
||||
var employeeClientTemp = _companyContext.EmployeeClientTemps.Where(x => workshops.Contains(x.WorkshopId));
|
||||
var employeeClientTempKeys = _companyContext.EmployeeClientTemps
|
||||
.Where(x => workshops.Contains(x.WorkshopId))
|
||||
.Select(x => new { x.WorkshopId, x.EmployeeId });
|
||||
|
||||
var query = _companyContext.EmployeeDocuments
|
||||
.Where(x => workshops.Contains(x.WorkshopId) &&
|
||||
(activeEmployees.Any(y => y.WorkshopId == x.WorkshopId && y.EmployeeId == x.EmployeeId) ||
|
||||
employeeClientTemp.Any(temp => x.EmployeeId == temp.EmployeeId && temp.WorkshopId == x.WorkshopId)) && x.IsConfirmed == false)
|
||||
.Include(x => x.Workshop).Include(x => x.EmployeeDocumentItemCollection)
|
||||
.Where(x => x.IsSentToChecker == false &&
|
||||
(x.EmployeeDocumentItemCollection.Any(y =>
|
||||
y.DocumentStatus == DocumentStatus.SubmittedByClient) || employeeClientTemp.Any(temp => x.EmployeeId == temp.EmployeeId && temp.WorkshopId == x.WorkshopId) || x.HasRejectedItems))
|
||||
.GroupBy(x => x.WorkshopId).Select(x => new WorkshopWithEmployeeDocumentsViewModel()
|
||||
var allValidKeys = activeEmployeeKeys
|
||||
.Union(employeeClientTempKeys);
|
||||
|
||||
// کوئری اصلی بدون Include و بدون GroupBy
|
||||
var employeeDocs = _companyContext.EmployeeDocuments
|
||||
.Where(x =>
|
||||
workshops.Contains(x.WorkshopId) &&
|
||||
allValidKeys.Any(k => k.WorkshopId == x.WorkshopId && k.EmployeeId == x.EmployeeId) &&
|
||||
!x.IsConfirmed &&
|
||||
!x.IsSentToChecker &&
|
||||
(
|
||||
x.EmployeeDocumentItemCollection.Any(y => y.DocumentStatus == DocumentStatus.SubmittedByClient) ||
|
||||
x.HasRejectedItems ||
|
||||
employeeClientTempKeys.Any(k => k.WorkshopId == x.WorkshopId && k.EmployeeId == x.EmployeeId)
|
||||
))
|
||||
.Select(x => new
|
||||
{
|
||||
WorkshopId = x.Key,
|
||||
WorkshopFullName = x.FirstOrDefault().Workshop.WorkshopName,
|
||||
EmployeesWithoutDocumentCount = x.Count()
|
||||
});
|
||||
x.WorkshopId,
|
||||
WorkshopName = x.Workshop.WorkshopName,
|
||||
x.EmployeeId
|
||||
})
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
|
||||
// Group در حافظه با سرعت بیشتر
|
||||
var grouped = employeeDocs
|
||||
.GroupBy(x => new { x.WorkshopId, x.WorkshopName })
|
||||
.Select(g => new WorkshopWithEmployeeDocumentsViewModel
|
||||
{
|
||||
WorkshopId = g.Key.WorkshopId,
|
||||
WorkshopFullName = g.Key.WorkshopName,
|
||||
EmployeesWithoutDocumentCount = g.Count()
|
||||
})
|
||||
.ToList();
|
||||
|
||||
// گرفتن کارفرماها فقط برای ورکشاپهایی که توی لیست بالا هستن
|
||||
var workshopIds = grouped.Select(x => x.WorkshopId).ToList();
|
||||
|
||||
var workshopEmployers = _companyContext.WorkshopEmployers.Include(x => x.Employer)
|
||||
.Where(x => query.Any(y => y.WorkshopId == x.WorkshopId))
|
||||
.GroupBy(x => x.WorkshopId).Select(x => x.FirstOrDefault()).ToList();
|
||||
var employers = _companyContext.WorkshopEmployers
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId))
|
||||
.Include(x => x.Employer)
|
||||
.AsSplitQuery()
|
||||
.AsNoTracking()
|
||||
.GroupBy(x => x.WorkshopId)
|
||||
.Select(g => g.FirstOrDefault())
|
||||
.ToList();
|
||||
|
||||
|
||||
|
||||
|
||||
var result = query.ToList();
|
||||
|
||||
|
||||
result.ForEach(x =>
|
||||
// اضافه کردن اسم کارفرما
|
||||
grouped.ForEach(x =>
|
||||
{
|
||||
var employer = workshopEmployers.FirstOrDefault(y => y.WorkshopId == x.WorkshopId)?.Employer;
|
||||
x.EmployerName = employer.FullName;
|
||||
|
||||
//x.SubmittedItems.ForEach(y=>y.PicturePath= medias.FirstOrDefault(z=>z.id == y.MediaId)?.Path ?? "");
|
||||
var employer = employers.FirstOrDefault(y => y.WorkshopId == x.WorkshopId)?.Employer;
|
||||
x.EmployerName = employer?.FullName;
|
||||
});
|
||||
|
||||
return result.Where(x => x.EmployeesWithoutDocumentCount > 0).OrderByDescending(x => x.EmployeesWithoutDocumentCount).ToList();
|
||||
// فیلتر نهایی
|
||||
return grouped
|
||||
.Where(x => x.EmployeesWithoutDocumentCount > 0)
|
||||
.OrderByDescending(x => x.EmployeesWithoutDocumentCount)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
|
||||
@@ -475,44 +549,83 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
||||
|
||||
public List<EmployeeDocumentsViewModel> GetByWorkshopIdWithItemsForAdminWorkFlow(long workshopId)
|
||||
{
|
||||
var activeEmployeesInWorkshop = _companyContext.LeftWorkList
|
||||
.Where(x => workshopId == x.WorkshopId && x.LeftWorkDate.AddDays(-1) >= DateTime.Today)
|
||||
.Include(x => x.Employee).ThenInclude(x => x.EmployeeDocuments)
|
||||
.Select(x => new { x.EmployeeId, FullName = x.Employee.FName + " " + x.Employee.LName, x.Employee.Gender });
|
||||
|
||||
var activeEmployeeIds = _companyContext.LeftWorkList
|
||||
.Where(x => x.WorkshopId == workshopId && x.LeftWorkDate.AddDays(-1) >= DateTime.Today)
|
||||
.Select(x => new
|
||||
{
|
||||
x.EmployeeId,
|
||||
FullName = x.Employee.FName + " " + x.Employee.LName,
|
||||
x.Employee.Gender
|
||||
}).ToList();
|
||||
|
||||
var activeEmployeeIdList = activeEmployeeIds.Select(x => x.EmployeeId).ToList();
|
||||
|
||||
|
||||
//var EDItemsList = _companyContext.EmployeeDocumentItems
|
||||
// .Where(x => x.WorkshopId == workshopId &&
|
||||
// x.DocumentStatus != DocumentStatus.Unsubmitted &&
|
||||
// activeEmployeeIdList.Contains(x.EmployeeId))
|
||||
// .Include(x => x.EmployeeDocuments)
|
||||
// .Where(x => x.EmployeeDocuments.IsSentToChecker == false &&
|
||||
// ((x.DocumentStatus == DocumentStatus.SubmittedByClient) ||
|
||||
// x.EmployeeDocuments.HasRejectedItems))
|
||||
// .GroupBy(x => new { x.EmployeeId, x.DocumentLabel })
|
||||
// .Select(x =>
|
||||
// x.Select(y => new
|
||||
// {
|
||||
// y.EmployeeDocumentId,
|
||||
// Id = y.id,
|
||||
// y.EmployeeDocuments.Gender,
|
||||
// y.DocumentLabel,
|
||||
// y.DocumentStatus,
|
||||
// y.MediaId,
|
||||
// y.RejectionReason,
|
||||
// y.EmployeeId,
|
||||
// y.CreationDate,
|
||||
// IsSentToChecker = y.EmployeeDocuments.IsSentToChecker,
|
||||
// y.EmployeeDocuments.IsConfirmed
|
||||
// }).OrderByDescending(y => y.CreationDate).First()).ToList();
|
||||
|
||||
var EDItemsList = _companyContext.EmployeeDocumentItems
|
||||
.Where(x => x.WorkshopId == workshopId && x.DocumentStatus != DocumentStatus.Unsubmitted &&
|
||||
activeEmployeesInWorkshop.Any(y => y.EmployeeId == x.EmployeeId))
|
||||
.Include(x => x.EmployeeDocuments)
|
||||
.Where(x => x.EmployeeDocuments.IsSentToChecker == false &&
|
||||
((x.DocumentStatus == DocumentStatus.SubmittedByClient) ||
|
||||
x.EmployeeDocuments.HasRejectedItems))
|
||||
.Where(x => x.WorkshopId == workshopId &&
|
||||
x.DocumentStatus != DocumentStatus.Unsubmitted &&
|
||||
activeEmployeeIdList.Contains(x.EmployeeId) &&
|
||||
x.EmployeeDocuments.IsSentToChecker == false &&
|
||||
(x.DocumentStatus == DocumentStatus.SubmittedByClient || x.EmployeeDocuments.HasRejectedItems))
|
||||
.Include(x=>x.EmployeeDocuments).ToList()
|
||||
.GroupBy(x => new { x.EmployeeId, x.DocumentLabel })
|
||||
.Select(x =>
|
||||
x.Select(y => new
|
||||
{
|
||||
y.EmployeeDocumentId,
|
||||
Id = y.id,
|
||||
y.EmployeeDocuments.Gender,
|
||||
y.DocumentLabel,
|
||||
y.DocumentStatus,
|
||||
y.MediaId,
|
||||
y.RejectionReason,
|
||||
y.EmployeeId,
|
||||
y.CreationDate,
|
||||
IsSentToChecker = y.EmployeeDocuments.IsSentToChecker,
|
||||
y.EmployeeDocuments.IsConfirmed
|
||||
}).OrderByDescending(y => y.CreationDate).First()).ToList();
|
||||
.Select(g => g.OrderByDescending(x => x.CreationDate).Select(y => new
|
||||
{
|
||||
y.EmployeeDocumentId,
|
||||
Id = y.id,
|
||||
y.EmployeeDocuments.Gender,
|
||||
y.DocumentLabel,
|
||||
y.DocumentStatus,
|
||||
y.MediaId,
|
||||
y.RejectionReason,
|
||||
y.EmployeeId,
|
||||
y.CreationDate,
|
||||
y.EmployeeDocuments.IsSentToChecker,
|
||||
y.EmployeeDocuments.IsConfirmed
|
||||
}).FirstOrDefault())
|
||||
.ToList();
|
||||
|
||||
var employeeClientTemp = _companyContext.EmployeeClientTemps.Where(x => x.WorkshopId == workshopId);
|
||||
var tempEmployees = _companyContext.Employees.Where(x => employeeClientTemp.Any(a => a.EmployeeId == x.id))
|
||||
.Select(x => new { EmployeeId = x.id, FullName = x.FName + " " + x.LName, x.Gender }).ToList();
|
||||
var tempEmployeeIds = _companyContext.EmployeeClientTemps
|
||||
.Where(x => x.WorkshopId == workshopId)
|
||||
.Select(x => x.EmployeeId)
|
||||
.ToList();
|
||||
|
||||
var tempEmployees = _companyContext.Employees
|
||||
.Where(x => tempEmployeeIds.Contains(x.id))
|
||||
.Select(x => new
|
||||
{
|
||||
EmployeeId = x.id,
|
||||
FullName = x.FName + " " + x.LName,
|
||||
x.Gender
|
||||
}).ToList();
|
||||
|
||||
var tempEmployeeDocuments = _companyContext.EmployeeDocuments
|
||||
.Where(x => x.WorkshopId == workshopId && employeeClientTemp.Any(e => e.EmployeeId == x.EmployeeId) &&
|
||||
.Where(x => x.WorkshopId == workshopId && tempEmployeeIds.Contains(x.EmployeeId) &&
|
||||
x.IsSentToChecker == false && x.IsConfirmed == false)
|
||||
.SelectMany(x => x.EmployeeDocumentItemCollection.DefaultIfEmpty(), // اگر خالی بود، مقدار پیشفرض ایجاد کن
|
||||
(documents, y) => new
|
||||
@@ -533,55 +646,57 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
||||
|
||||
|
||||
|
||||
var enumerable = EDItemsList.Concat(tempEmployeeDocuments);
|
||||
var activeEmployeesInWorkshopList = activeEmployeesInWorkshop.ToList().Concat(tempEmployees);
|
||||
//var enumerable = EDItemsList.Concat(tempEmployeeDocuments);
|
||||
//var activeEmployeesInWorkshopList = activeEmployeesInWorkshop.ToList().Concat(tempEmployees);
|
||||
|
||||
var allEmployeeDocuments = EDItemsList.Concat(tempEmployeeDocuments).ToList();
|
||||
var allEmployees = activeEmployeeIds.Concat(tempEmployees).ToList();
|
||||
|
||||
//get medias for current documents of employees
|
||||
var mediaIds = enumerable.Select(x => x.MediaId).ToList();
|
||||
var mediasList = _accountContext.Medias.Where(x => mediaIds.Contains(x.id))
|
||||
var mediaIds = allEmployeeDocuments.Select(x => x.MediaId).ToList();
|
||||
|
||||
var mediasList = _accountContext.Medias
|
||||
.Where(x => mediaIds.Contains(x.id))
|
||||
.Select(x => new MediaViewModel() { Id = x.id, Path = x.Path }).ToList();
|
||||
|
||||
|
||||
|
||||
var result = enumerable.GroupBy(x => x.EmployeeId)
|
||||
.Select(x =>
|
||||
var result = allEmployeeDocuments
|
||||
.GroupBy(x => x.EmployeeId)
|
||||
.Select(group =>
|
||||
{
|
||||
//var requiredDocs = EmployeeDocumentRequiredItems.GetByGender(x.Gender);
|
||||
var employeeLatestConfirmedDocuments = x
|
||||
var employee = allEmployees.First(e => e.EmployeeId == group.Key);
|
||||
|
||||
.Where(y => y.EmployeeId == x.Key && (y.DocumentStatus == DocumentStatus.SubmittedByClient || y.DocumentStatus == DocumentStatus.SubmittedByAdmin || y.DocumentStatus == DocumentStatus.Rejected))
|
||||
.Select(y => new EmployeeDocumentItemViewModel()
|
||||
var docs = group
|
||||
.Where(y => y.DocumentStatus == DocumentStatus.SubmittedByClient ||
|
||||
y.DocumentStatus == DocumentStatus.SubmittedByAdmin ||
|
||||
y.DocumentStatus == DocumentStatus.Rejected)
|
||||
.Select(y => new EmployeeDocumentItemViewModel
|
||||
{
|
||||
Status = y.DocumentStatus,
|
||||
MediaId = y.MediaId,
|
||||
DocumentItemLabel = y.DocumentLabel,
|
||||
Id = y.Id,
|
||||
RejectionMessage = y.RejectionReason,
|
||||
StatusString = y.DocumentStatus.ToString()
|
||||
}).ToList();
|
||||
|
||||
return new EmployeeDocumentsViewModel
|
||||
{
|
||||
Status = y.DocumentStatus,
|
||||
MediaId = y.MediaId,
|
||||
DocumentItemLabel = y.DocumentLabel,
|
||||
Id = y.Id,
|
||||
RejectionMessage = y.RejectionReason,
|
||||
StatusString = y.DocumentStatus.ToString()
|
||||
}).ToList();
|
||||
|
||||
|
||||
//var requiredItemsUploaded = employeeLatestConfirmedDocuments
|
||||
// .Where(y => requiredDocs.Contains(y.DocumentItemLabel)).Select(y => y.DocumentItemLabel)
|
||||
// .ToList();
|
||||
|
||||
return new EmployeeDocumentsViewModel()
|
||||
{
|
||||
EmployeeId = x.Key,
|
||||
IdCardPage1 = GetByLabelAndLoadMedia(employeeLatestConfirmedDocuments, mediasList, DocumentItemLabel.IdCardPage1),
|
||||
IdCardPage2 = GetByLabelAndLoadMedia(employeeLatestConfirmedDocuments, mediasList, DocumentItemLabel.IdCardPage2),
|
||||
IdCardPage3 = GetByLabelAndLoadMedia(employeeLatestConfirmedDocuments, mediasList, DocumentItemLabel.IdCardPage3),
|
||||
IdCardPage4 = GetByLabelAndLoadMedia(employeeLatestConfirmedDocuments, mediasList, DocumentItemLabel.IdCardPage4),
|
||||
EducationalDegree = GetByLabelAndLoadMedia(employeeLatestConfirmedDocuments, mediasList, DocumentItemLabel.EducationalDegree),
|
||||
EmployeeFullName = activeEmployeesInWorkshopList.First(y => y.EmployeeId == x.Key).FullName,
|
||||
NationalCardFront = GetByLabelAndLoadMedia(employeeLatestConfirmedDocuments, mediasList, DocumentItemLabel.NationalCardFront),
|
||||
NationalCardRear = GetByLabelAndLoadMedia(employeeLatestConfirmedDocuments, mediasList, DocumentItemLabel.NationalCardRear),
|
||||
MilitaryServiceCard = GetByLabelAndLoadMedia(employeeLatestConfirmedDocuments, mediasList, DocumentItemLabel.MilitaryServiceCard),
|
||||
EmployeePicture = GetByLabelAndLoadMedia(employeeLatestConfirmedDocuments, mediasList, DocumentItemLabel.EmployeePicture),
|
||||
//RequiredDocumentsUploaded = requiredItemsUploaded,
|
||||
//RequiredDocuments = requiredDocs
|
||||
EmployeeId = group.Key,
|
||||
IdCardPage1 = GetByLabelAndLoadMedia(docs, mediasList, DocumentItemLabel.IdCardPage1),
|
||||
IdCardPage2 = GetByLabelAndLoadMedia(docs, mediasList, DocumentItemLabel.IdCardPage2),
|
||||
IdCardPage3 = GetByLabelAndLoadMedia(docs, mediasList, DocumentItemLabel.IdCardPage3),
|
||||
IdCardPage4 = GetByLabelAndLoadMedia(docs, mediasList, DocumentItemLabel.IdCardPage4),
|
||||
EducationalDegree = GetByLabelAndLoadMedia(docs, mediasList, DocumentItemLabel.EducationalDegree),
|
||||
EmployeeFullName = employee.FullName,
|
||||
NationalCardFront = GetByLabelAndLoadMedia(docs, mediasList, DocumentItemLabel.NationalCardFront),
|
||||
NationalCardRear = GetByLabelAndLoadMedia(docs, mediasList, DocumentItemLabel.NationalCardRear),
|
||||
MilitaryServiceCard = GetByLabelAndLoadMedia(docs, mediasList, DocumentItemLabel.MilitaryServiceCard),
|
||||
EmployeePicture = GetByLabelAndLoadMedia(docs, mediasList, DocumentItemLabel.EmployeePicture),
|
||||
};
|
||||
}).ToList();
|
||||
})
|
||||
.ToList();
|
||||
|
||||
return result;
|
||||
|
||||
|
||||
@@ -450,7 +450,7 @@ public class EmployeeRepository : RepositoryBase<long, Employee>, IEmployeeRepos
|
||||
|
||||
var employeeData = new Employee(command.FName, command.LName, command.FatherName, dateOfBirth,
|
||||
dateOfIssue,
|
||||
command.PlaceOfIssue, command.NationalCode, command.IdNumber, command.Gender, command.Nationality,
|
||||
command.PlaceOfIssue, command.NationalCode, command.IdNumber, command.Gender, command.Nationality,command.IdNumberSerial,command.IdNumberSeri,
|
||||
command.Phone, command.Address,
|
||||
command.State, command.City, command.MaritalStatus, command.MilitaryService, command.LevelOfEducation,
|
||||
command.FieldOfStudy, command.BankCardNumber,
|
||||
|
||||
@@ -114,6 +114,146 @@ public class ReportRepository : IReportRepository
|
||||
// };
|
||||
|
||||
//}
|
||||
|
||||
//public async Task<AllReport> GetAllActiveWorkshopsNew(string year, string month)
|
||||
//{
|
||||
// var watch = System.Diagnostics.Stopwatch.StartNew();
|
||||
|
||||
// // Parse the start and end dates for the current and next months
|
||||
// #region FindMonthStartAndEnd
|
||||
|
||||
// string nowFa = $"{(DateTime.Now.ToFarsi()).Substring(0, 8)}01";
|
||||
|
||||
// if (!string.IsNullOrWhiteSpace(year) && !string.IsNullOrWhiteSpace(month))
|
||||
// nowFa = $"{year}/{month}/01";
|
||||
|
||||
|
||||
// var currentEndOfMonth = nowFa.FindeEndOfMonth();
|
||||
|
||||
// //شروع ماه جاری
|
||||
// var currentMonthStart = nowFa.ToGeorgianDateTime();
|
||||
// // پایان کاه جاری
|
||||
// var currentMonthEnd = currentEndOfMonth.ToGeorgianDateTime();
|
||||
|
||||
|
||||
|
||||
// int currentYear = Convert.ToInt32(nowFa.Substring(0, 4));
|
||||
// var currentMonth = Convert.ToInt32(nowFa.Substring(5, 2));
|
||||
// var nextMonthStartFa = new PersianDateTime(currentYear, currentMonth, 1).AddMonths(1);
|
||||
|
||||
// //شروع ماه بعد
|
||||
// var nextMonthStart = ($"{nextMonthStartFa}").ToGeorgianDateTime();
|
||||
// //پایان ماه بعد
|
||||
// var nextMonthEnd = (($"{nextMonthStartFa}").FindeEndOfMonth()).ToGeorgianDateTime();
|
||||
|
||||
|
||||
// #endregion
|
||||
|
||||
// // Preload data to reduce database calls
|
||||
// var accountLeftWorks = await _accountContext.AccountLeftWorks
|
||||
// .Where(x => x.RoleId == 5)
|
||||
// .ToListAsync();
|
||||
|
||||
// var leftWorkList = await _context.LeftWorkList
|
||||
// .Where(x => x.StartWorkDate <= nextMonthEnd && x.LeftWorkDate > currentMonthStart)
|
||||
// .ToListAsync();
|
||||
|
||||
// var institutionContracts = await _context.InstitutionContractSet
|
||||
// .Where(c => c.ContractStartGr <= nextMonthEnd && c.ContractEndGr >= currentMonthStart)
|
||||
// .ToListAsync();
|
||||
|
||||
// var accounts = await _accountContext.Accounts
|
||||
// .Where(x => x.RoleId == 5)
|
||||
// .ToListAsync();
|
||||
|
||||
// // Filter workshops
|
||||
// var activeWorkshops = await _context.WorkshopEmployers
|
||||
// .Include(x => x.Workshop)
|
||||
// .Include(x => x.Employer.ContractingParty)
|
||||
// .Where(x => x.Workshop.IsActiveString == "true" &&
|
||||
// x.Employer.ContractingParty.IsActiveString == "true" &&
|
||||
// x.Employer.ContractingParty.IsBlock != "true")
|
||||
// .ToListAsync();
|
||||
|
||||
// // Group workshops by contract type
|
||||
// var workshopsWithContracts = activeWorkshops
|
||||
// .Where(x => institutionContracts.Any(c => c.ContractingPartyId == x.Employer.ContractingPartyId))
|
||||
// .Select(x => x.WorkshopId)
|
||||
// .Distinct()
|
||||
// .ToList();
|
||||
|
||||
// var workshopsWithoutContracts = activeWorkshops
|
||||
// .Where(x => x.Employer.ContractingPartyId == 30428)
|
||||
// .Select(x => x.WorkshopId)
|
||||
// .Distinct()
|
||||
// .ToList();
|
||||
|
||||
// var allWorkshops = workshopsWithContracts.Concat(workshopsWithoutContracts).Distinct().ToList();
|
||||
|
||||
// // Calculate left works and contracts
|
||||
// var leftWorks = leftWorkList
|
||||
// .Where(x => allWorkshops.Contains(x.WorkshopId))
|
||||
// .ToList();
|
||||
|
||||
// var leftWorkEmployeeIds = leftWorks.Select(x => x.EmployeeId).ToHashSet();
|
||||
|
||||
// var contracts = await _context.Contracts
|
||||
// .Where(x => leftWorkEmployeeIds.Contains(x.EmployeeId) &&
|
||||
// x.ContarctStart.Date <= nextMonthEnd.Date &&
|
||||
// x.ContractEnd.Date > nextMonthStart.Date &&
|
||||
// x.IsActiveString == "true")
|
||||
// .ToListAsync();
|
||||
|
||||
// var signedContracts = contracts.Count(x => x.Signature == "1");
|
||||
|
||||
// // Calculate checkouts
|
||||
// var checkouts = await _context.CheckoutSet
|
||||
// .Where(x => leftWorkEmployeeIds.Contains(x.EmployeeId) &&
|
||||
// x.ContractStart.Date >= currentMonthStart.Date &&
|
||||
// x.ContractEnd.Date <= currentMonthEnd.Date &&
|
||||
// x.IsActiveString == "true")
|
||||
// .ToListAsync();
|
||||
|
||||
// var signedCheckouts = checkouts.Count(x => x.Signature == "1");
|
||||
|
||||
// // Calculate percentages
|
||||
// var contractToBe = leftWorks.Count;
|
||||
// var createdContracts = contracts.Count;
|
||||
// var checkoutToBe = leftWorks.Count;
|
||||
// var createdCheckouts = checkouts.Count;
|
||||
|
||||
// var contractPercent = contractToBe > 0 ? (createdContracts * 100) / contractToBe : 0;
|
||||
// var contractSignaturePercent = createdContracts > 0 ? (signedContracts * 100) / createdContracts : 0;
|
||||
// var checkoutPercent = checkoutToBe > 0 ? (createdCheckouts * 100) / checkoutToBe : 0;
|
||||
// var checkoutSignaturePercent = createdCheckouts > 0 ? (signedCheckouts * 100) / createdCheckouts : 0;
|
||||
|
||||
// // Prepare the final result
|
||||
// var finalResult = new AllReport
|
||||
// {
|
||||
// AllPercent = (contractPercent + contractSignaturePercent + checkoutPercent + checkoutSignaturePercent) / 4,
|
||||
// ContractPercent = contractPercent,
|
||||
// ContractSignaturePercent = contractSignaturePercent,
|
||||
// CheckoutPercent = checkoutPercent,
|
||||
// CheckoutSignaturePercent = checkoutSignaturePercent,
|
||||
// Year = $"{currentMonthStart.Year}",
|
||||
// Month = nowFa.Substring(5, 2),
|
||||
// AllContract = contractToBe,
|
||||
// ContractNotDone = contractToBe - createdContracts,
|
||||
// ContrcatDone = createdContracts,
|
||||
// ContractSignNotDone = createdContracts - signedContracts,
|
||||
// ContractSignDone = signedContracts,
|
||||
// AllCheckout = checkoutToBe,
|
||||
// CheckoutNotDone = checkoutToBe - createdCheckouts,
|
||||
// CheckoutDone = createdCheckouts,
|
||||
// CheckoutSignDone = signedCheckouts,
|
||||
// CheckoutSignNotDone = createdCheckouts - signedCheckouts
|
||||
// };
|
||||
|
||||
// Console.WriteLine("Optimized method execution time: " + watch.Elapsed);
|
||||
// return finalResult;
|
||||
//}
|
||||
|
||||
|
||||
public Task<AllReport> GetAllActiveWorkshopsNew(string year, string month)
|
||||
{
|
||||
var watch = System.Diagnostics.Stopwatch.StartNew();
|
||||
@@ -1951,16 +2091,24 @@ public class ReportRepository : IReportRepository
|
||||
{
|
||||
var contractSigned = workshop.Contracts2.Count(x => x.Signature == "1");
|
||||
var contractCreated = workshop.Contracts2.Count();
|
||||
int contractSignedPercent = 0;
|
||||
if (contractSigned > 0)
|
||||
{
|
||||
contractSignedPercent = workshop.Contracts2.Any(x => x.Signature == "0") ? ((contractSigned * 100) / contractCreated) : 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
contractSignedPercent = 0;
|
||||
}
|
||||
|
||||
var checkoutSignedPercent = workshop.Contracts2.Any(x => x.Signature == "0") ? ((contractSigned * 100) / contractCreated) : 100;
|
||||
if (checkoutSignedPercent < 100 && contractCreated > 0)
|
||||
if (contractSignedPercent < 100 && contractCreated > 0)
|
||||
{
|
||||
|
||||
var employeeNotDone =
|
||||
workshop.Contracts2.Where(x => x.Signature == "0").Select(l => new EmployeeNotDone()
|
||||
{
|
||||
Id = l.EmployeeId,
|
||||
EmployeeFullName = workshop.LeftWorks.FirstOrDefault(x=>x.EmployeeId == l.EmployeeId)!.EmployeeFullName,
|
||||
EmployeeFullName = workshop.LeftWorks.FirstOrDefault(x => x.EmployeeId == l.EmployeeId)!.EmployeeFullName,
|
||||
|
||||
}).ToList();
|
||||
return new workshopSearch()
|
||||
@@ -1968,7 +2116,7 @@ public class ReportRepository : IReportRepository
|
||||
Id = workshop.id,
|
||||
WorkshopFullName = workshop.WorkshopFullName,
|
||||
ArchiveCode = workshop.ArchiveCode,
|
||||
ContractSignPercent = checkoutSignedPercent,
|
||||
ContractSignPercent = contractSignedPercent,
|
||||
EmployeeNotDones = employeeNotDone
|
||||
};
|
||||
}
|
||||
|
||||
@@ -462,48 +462,98 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
|
||||
string shiftPayValue = "0";
|
||||
List<RotatingShiftViewModel> rotatingResultList = RotatingShiftCheck(groupedRollCall);
|
||||
var moriningCount = rotatingResultList.Count(x => x.IsMorningShift);
|
||||
var eveningCount = rotatingResultList.Count(x => x.IsEveningShift);
|
||||
var nightCount = rotatingResultList.Count(x => x.IsNightShift);
|
||||
|
||||
// شبکاری
|
||||
TimeSpan over22 = new TimeSpan(rotatingResultList.Sum(x => x.NightWorkSpan.Ticks));
|
||||
var RotatingfaName = new List<string>();
|
||||
if (command.ShiftWork != "1" && command.ShiftWork != "2" && command.ShiftWork != "4")//اگر چرخشی بود و منظم نبود
|
||||
{
|
||||
if (moriningCount > 0)
|
||||
RotatingfaName.Add("صبح");
|
||||
if (eveningCount > 0)
|
||||
RotatingfaName.Add("عصر");
|
||||
if (nightCount > 0)
|
||||
RotatingfaName.Add("شب");
|
||||
}
|
||||
else// اگر منظم و شیفتی بود
|
||||
{
|
||||
var totalDays = (int)(command.ContractEndGr - command.ContractStartGr).TotalDays + 1;
|
||||
int validCount = 0;
|
||||
if (totalDays <= 7) // زیر 7 روز باید حد اقل 2 تغییر شیفت داشته باشد
|
||||
{
|
||||
validCount = 2;
|
||||
}
|
||||
else if (totalDays >= 28) // بالای 28 روز حد اقل 8 تغییر شیفت
|
||||
{
|
||||
validCount = 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
// تناسب گیری - اگر برای 28 روز 8 تغییر پس برای ایکس روز چند تغییر لازم است
|
||||
validCount = (int)((totalDays * 8) / 28);
|
||||
}
|
||||
//if (command.ShiftWork != "1" && command.ShiftWork != "2" && command.ShiftWork != "4")//اگر چرخشی بود و منظم نبود
|
||||
//{
|
||||
// if (moriningCount > 0)
|
||||
// RotatingfaName.Add("صبح");
|
||||
// if (eveningCount > 0)
|
||||
// RotatingfaName.Add("عصر");
|
||||
// if (nightCount > 0)
|
||||
// RotatingfaName.Add("شب");
|
||||
//}
|
||||
//else// اگر منظم و شیفتی بود
|
||||
//{
|
||||
// var totalDays = (int)(command.ContractEndGr - command.ContractStartGr).TotalDays + 1;
|
||||
// int validCount = 0;
|
||||
// if (totalDays <= 7) // زیر 7 روز باید حد اقل 2 تغییر شیفت داشته باشد
|
||||
// {
|
||||
// validCount = 2;
|
||||
// }
|
||||
// else if (totalDays >= 28) // بالای 28 روز حد اقل 8 تغییر شیفت
|
||||
// {
|
||||
// validCount = 8;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // تناسب گیری - اگر برای 28 روز 8 تغییر پس برای ایکس روز چند تغییر لازم است
|
||||
// validCount = (int)((totalDays * 8) / 28);
|
||||
// }
|
||||
|
||||
if (moriningCount >= validCount)
|
||||
RotatingfaName.Add("صبح");
|
||||
if (eveningCount >= validCount)
|
||||
RotatingfaName.Add("عصر");
|
||||
if (nightCount >= validCount)
|
||||
RotatingfaName.Add("شب");
|
||||
// if (moriningCount >= validCount)
|
||||
// RotatingfaName.Add("صبح");
|
||||
// if (eveningCount >= validCount)
|
||||
// RotatingfaName.Add("عصر");
|
||||
// if (nightCount >= validCount)
|
||||
// RotatingfaName.Add("شب");
|
||||
|
||||
//}
|
||||
|
||||
int moriningCount = 0;
|
||||
int eveningCount = 0;
|
||||
int nightCount = 0;
|
||||
|
||||
int moriningWinRate = rotatingResultList.Where(x => x.IsMorningShift).Sum(x => x.WinRate);
|
||||
int eveningWinRate = rotatingResultList.Where(x => x.IsEveningShift).Sum(x => x.WinRate);
|
||||
int nightWinRate = rotatingResultList.Where(x => x.IsNightShift).Sum(x => x.WinRate);
|
||||
|
||||
|
||||
if (moriningWinRate > eveningWinRate && moriningWinRate > nightWinRate)
|
||||
{
|
||||
moriningCount = rotatingResultList.Count(x => x.IsMorningShift);
|
||||
eveningCount = rotatingResultList.Count(x => x.IsEveningShift && x.WinRate > 55);
|
||||
nightCount = rotatingResultList.Count(x => x.IsNightShift && x.WinRate > 55);
|
||||
}
|
||||
|
||||
if (eveningWinRate > moriningWinRate && eveningWinRate > nightWinRate)
|
||||
{
|
||||
moriningCount = rotatingResultList.Count(x => x.IsMorningShift && x.WinRate > 55);
|
||||
eveningCount = rotatingResultList.Count(x => x.IsEveningShift);
|
||||
nightCount = rotatingResultList.Count(x => x.IsNightShift && x.WinRate > 55);
|
||||
}
|
||||
|
||||
if (nightWinRate > moriningWinRate && nightWinRate > eveningWinRate)
|
||||
{
|
||||
moriningCount = rotatingResultList.Count(x => x.IsMorningShift && x.WinRate > 55);
|
||||
eveningCount = rotatingResultList.Count(x => x.IsEveningShift && x.WinRate > 55);
|
||||
nightCount = rotatingResultList.Count(x => x.IsNightShift);
|
||||
}
|
||||
|
||||
var totalDays = (int)(command.ContractEndGr - command.ContractStartGr).TotalDays + 1;
|
||||
int validCount = 0;
|
||||
if (totalDays <= 7) // زیر 7 روز باید حد اقل 2 تغییر شیفت داشته باشد
|
||||
{
|
||||
validCount = 2;
|
||||
}
|
||||
else if (totalDays >= 28) // بالای 28 روز حد اقل 8 تغییر شیفت
|
||||
{
|
||||
validCount = 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
// تناسب گیری - اگر برای 28 روز 8 تغییر پس برای ایکس روز چند تغییر لازم است
|
||||
validCount = (int)((totalDays * 8) / 28);
|
||||
}
|
||||
|
||||
if (moriningCount >= validCount)
|
||||
RotatingfaName.Add("صبح");
|
||||
if (eveningCount >= validCount)
|
||||
RotatingfaName.Add("عصر");
|
||||
if (nightCount >= validCount)
|
||||
RotatingfaName.Add("شب");
|
||||
var rotatingFaResult = "";
|
||||
if (RotatingfaName.Count > 1)// اگر تعداد شیفت های محاسبه شده بیش از یک بود
|
||||
{
|
||||
@@ -623,9 +673,41 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
|
||||
string shiftPayValue = "0";
|
||||
List<RotatingShiftViewModel> rotatingResultList = RotatingShiftCheck(groupedRollCall);
|
||||
var moriningCount = rotatingResultList.Count(x => x.IsMorningShift);
|
||||
var eveningCount = rotatingResultList.Count(x => x.IsEveningShift);
|
||||
var nightCount = rotatingResultList.Count(x => x.IsNightShift);
|
||||
int moriningCount = 0;
|
||||
int eveningCount = 0;
|
||||
int nightCount = 0;
|
||||
|
||||
int moriningWinRate = rotatingResultList.Where(x=>x.IsMorningShift).Sum(x => x.WinRate);
|
||||
int eveningWinRate = rotatingResultList.Where(x => x.IsEveningShift).Sum(x => x.WinRate);
|
||||
int nightWinRate = rotatingResultList.Where(x => x.IsNightShift).Sum(x => x.WinRate);
|
||||
|
||||
|
||||
if (moriningWinRate > eveningWinRate && moriningWinRate > nightWinRate)
|
||||
{
|
||||
moriningCount = rotatingResultList.Count(x => x.IsMorningShift);
|
||||
eveningCount = rotatingResultList.Count(x => x.IsEveningShift && x.WinRate > 55);
|
||||
nightCount = rotatingResultList.Count(x => x.IsNightShift && x.WinRate > 55);
|
||||
}
|
||||
|
||||
if (eveningWinRate > moriningWinRate && eveningWinRate > nightWinRate)
|
||||
{
|
||||
moriningCount = rotatingResultList.Count(x => x.IsMorningShift && x.WinRate > 55);
|
||||
eveningCount = rotatingResultList.Count(x => x.IsEveningShift);
|
||||
nightCount = rotatingResultList.Count(x => x.IsNightShift && x.WinRate > 55);
|
||||
}
|
||||
|
||||
if (nightWinRate > moriningWinRate && nightWinRate > eveningWinRate)
|
||||
{
|
||||
moriningCount = rotatingResultList.Count(x => x.IsMorningShift && x.WinRate > 55);
|
||||
eveningCount = rotatingResultList.Count(x => x.IsEveningShift && x.WinRate > 55);
|
||||
nightCount = rotatingResultList.Count(x => x.IsNightShift);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// شبکاری
|
||||
TimeSpan over22 = new TimeSpan(rotatingResultList.Sum(x => x.NightWorkSpan.Ticks));
|
||||
var RotatingfaName = new List<string>();
|
||||
@@ -1061,18 +1143,28 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
if (result.MorningWorkSpan > result.EveningWorkSpan
|
||||
|| result.MorningWorkSpan == result.EveningWorkSpan) // if morning bigerThan evening or equal
|
||||
{
|
||||
|
||||
if (result.MorningWorkSpan != nullWorkspan)
|
||||
{
|
||||
var sumSpan = result.MorningWorkSpan.Add(result.EveningWorkSpan);
|
||||
var sumSpanDouble = sumSpan.TotalMinutes;
|
||||
var winRate = (result.MorningWorkSpan.TotalMinutes * 100) / sumSpanDouble;
|
||||
result.WinRate = Convert.ToInt32(winRate);
|
||||
result.IsMorningShift = true;
|
||||
result.IsNightShift = false;
|
||||
result.IsEveningShift = false;
|
||||
result.RotatingShiftStatus = "صبح";
|
||||
|
||||
}
|
||||
|
||||
if (result.MorningWorkSpan < result.NightWorkSpan
|
||||
|| result.MorningWorkSpan == result.NightWorkSpan) // if night bigerThan morning or equal
|
||||
if (result.NightWorkSpan != nullWorkspan)
|
||||
{
|
||||
var sumSpan = result.MorningWorkSpan.Add(result.NightWorkSpan);
|
||||
var sumSpanDouble = sumSpan.TotalMinutes;
|
||||
var winRate = (result.NightWorkSpan.TotalMinutes * 100) / sumSpanDouble;
|
||||
result.WinRate = Convert.ToInt32(winRate);
|
||||
result.IsMorningShift = false;
|
||||
result.IsNightShift = true;
|
||||
result.IsEveningShift = false;
|
||||
@@ -1083,6 +1175,10 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
{
|
||||
if (result.EveningWorkSpan != nullWorkspan)
|
||||
{
|
||||
var sumSpan = result.MorningWorkSpan.Add(result.EveningWorkSpan);
|
||||
var sumSpanDouble = sumSpan.TotalMinutes;
|
||||
var winRate = (result.EveningWorkSpan.TotalMinutes * 100) / sumSpanDouble;
|
||||
result.WinRate = Convert.ToInt32(winRate);
|
||||
result.IsEveningShift = true;
|
||||
result.IsMorningShift = false;
|
||||
result.IsNightShift = false;
|
||||
@@ -1093,6 +1189,10 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
|| result.EveningWorkSpan == result.NightWorkSpan) // if night bigerThan evening or equal
|
||||
if (result.NightWorkSpan != nullWorkspan)
|
||||
{
|
||||
var sumSpan = result.EveningWorkSpan.Add(result.NightWorkSpan);
|
||||
var sumSpanDouble = sumSpan.TotalMinutes;
|
||||
var winRate = (result.NightWorkSpan.TotalMinutes * 100) / sumSpanDouble;
|
||||
result.WinRate = Convert.ToInt32(winRate);
|
||||
result.IsMorningShift = false;
|
||||
result.IsEveningShift = false;
|
||||
result.IsNightShift = true;
|
||||
@@ -1784,7 +1884,11 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
{
|
||||
var checkoutEnd = contractEnd;
|
||||
var checkoutStart = contractStart;
|
||||
if (employeeId is 45084 or 7980 or 5976 or 45214 or 45215)
|
||||
|
||||
var exceptionEmployees = _context.CustomizeWorkshopGroupSettings.Where(x => x.id == 117)
|
||||
.Include(x => x.CustomizeWorkshopEmployeeSettingsCollection).AsSplitQuery().FirstOrDefault()?.CustomizeWorkshopEmployeeSettingsCollection.Select(x => x.EmployeeId).ToList() ?? [];
|
||||
|
||||
if (exceptionEmployees.Contains(employeeId))
|
||||
{
|
||||
return CheckoutWithoutCalculationForKebabMahdi(workshopId, employeeId, contractStart, contractEnd);
|
||||
}
|
||||
|
||||
@@ -2049,5 +2049,12 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public async Task<List<RollCall>> GetRollCallsUntilNowWithWorkshopIdEmployeeIds(long workshopId, List<long> employeeIds, DateTime fromDate)
|
||||
{
|
||||
return await _context.RollCalls.Where(x =>
|
||||
x.ShiftDate >= fromDate && x.WorkshopId == workshopId && employeeIds.Contains(x.EmployeeId) &&
|
||||
x.EndDate != null).ToListAsync();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -205,6 +205,7 @@ using CompanyManagment.App.Contracts.EmployeeClientTemp;
|
||||
using CompanyManagment.App.Contracts.InstitutionPlan;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
|
||||
namespace PersonalContractingParty.Config;
|
||||
|
||||
@@ -423,6 +424,9 @@ public class PersonalBootstrapper
|
||||
|
||||
services.AddTransient<ILeftWorkTempRepository, LeftWorkTempRepository>();
|
||||
services.AddTransient<ILeftWorkTempApplication, LeftWorkTempApplication>();
|
||||
|
||||
services.AddTransient<IEmployeeAuthorizeTempRepository, EmployeeAuthorizeTempRepository>();
|
||||
|
||||
#endregion
|
||||
#region Pooya
|
||||
|
||||
|
||||
@@ -629,10 +629,15 @@
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90114" class="check-btn"> <span style="bottom: 2px;position: relative"> ویرایش </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="90115" class="check-btn"> <span style="bottom: 2px;position: relative"> حذف </span> </label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="90115" class="check-btn"> <span style="bottom: 2px;position: relative"> حذف </span> </label>
|
||||
</div>
|
||||
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="90116" class="check-btn"> <span style="bottom: 2px;position: relative"> وظایف دوره ای </span> </label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@*لیست درخواست ها*@
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
@@ -699,9 +704,12 @@
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90315" class="check-btn"> <span style="bottom: 2px;position: relative"> حذف عنوان </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90316" class="check-btn"> <span style="bottom: 2px;position: relative"> ویرایش عنوان </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90316" class="check-btn"> <span style="bottom: 2px;position: relative"> ویرایش عنوان </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90317" class="check-btn"> <span style="bottom: 2px;position: relative"> دکمه ایجاد وظیفه دوره ای </span> </label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -633,9 +633,13 @@
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90114" class="check-btn"> <span style="bottom: 2px;position: relative"> ویرایش </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="90115" class="check-btn"> <span style="bottom: 2px;position: relative"> حذف </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="90115" class="check-btn"> <span style="bottom: 2px;position: relative"> حذف </span> </label>
|
||||
</div>
|
||||
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="90116" class="check-btn"> <span style="bottom: 2px;position: relative"> وظایف دوره ای </span> </label>
|
||||
</div>
|
||||
</div>
|
||||
@*لیست درخواست ها*@
|
||||
<div class="child-check level3">
|
||||
@@ -703,9 +707,12 @@
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90315" class="check-btn"> <span style="bottom: 2px;position: relative"> حذف عنوان </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90316" class="check-btn"> <span style="bottom: 2px;position: relative"> ویرایش عنوان </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90316" class="check-btn"> <span style="bottom: 2px;position: relative"> ویرایش عنوان </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90317" class="check-btn"> <span style="bottom: 2px;position: relative"> دکمه ایجاد وظیفه دوره ای </span> </label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ using CompanyManagment.App.Contracts.Employer;
|
||||
using CompanyManagment.App.Contracts.Job;
|
||||
using CompanyManagment.App.Contracts.Leave;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
using CompanyManagment.App.Contracts.MandantoryHours;
|
||||
using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployeeStatus;
|
||||
@@ -52,9 +53,10 @@ public class IndexModel : PageModel
|
||||
private readonly IWorkingHoursTempApplication _workingHoursTempApplication;
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
private readonly IYearlySalaryApplication _yearlySalaryApplication;
|
||||
private readonly IYearlySalaryRepository _yearlySalaryRepository;
|
||||
private readonly IYearlySalaryRepository _yearlySalaryRepository;
|
||||
|
||||
public List<CheckoutViewModel> chekoutlist;
|
||||
|
||||
public List<CheckoutViewModel> chekoutlist;
|
||||
public List<ComputingViewModel> ComputingView;
|
||||
public List<ContractViweModel> Contracts2;
|
||||
public string employeeFullName;
|
||||
@@ -116,7 +118,7 @@ public class IndexModel : PageModel
|
||||
_employeeComputeOptionsApplication = employeeComputeOptionsApplication;
|
||||
_rollCallMandatoryApplication = rollCallMandatoryApplication;
|
||||
_rollCallEmployeeStatusApp = rollCallEmployeeStatusApp;
|
||||
}
|
||||
}
|
||||
|
||||
public string Message { get; set; }
|
||||
public bool falseCheck { get; set; }
|
||||
@@ -186,6 +188,7 @@ public class IndexModel : PageModel
|
||||
|
||||
result.EmployeeFullName = checkout.EmployeeFullName;
|
||||
result.YearAndMonth = $"{checkout.Month} {checkout.Year}";
|
||||
result.HasRotatingShift = result.RotatingStatus == "نوبت کاری ندارد" ? false : true;
|
||||
Console.WriteLine("ok");
|
||||
return Partial("./RotatingShiftReportDesktop", result);
|
||||
}
|
||||
@@ -6784,14 +6787,30 @@ public class IndexModel : PageModel
|
||||
var AllDaysCount = (conEnd - conStart).TotalDays + 1;
|
||||
var endContract = command.ContractEnd.ToGeorgianDateTime();
|
||||
var AllmandatoryDays = 0;
|
||||
for (var gDate = conStart; gDate <= endContract; gDate = gDate.AddDays(1))
|
||||
if (gDate.DayOfWeek != DayOfWeek.Friday)
|
||||
AllmandatoryDays += 1;
|
||||
int fridayCount = 0;
|
||||
int officialHolidayCount = 0;
|
||||
for (var gDate = conStart; gDate <= endContract; gDate = gDate.AddDays(1))
|
||||
{
|
||||
if (gDate.DayOfWeek != DayOfWeek.Friday)
|
||||
AllmandatoryDays += 1;
|
||||
if (gDate.DayOfWeek == DayOfWeek.Friday)
|
||||
fridayCount += 1;
|
||||
bool officialHoliday = _holidayItemRepository.GetHoliday(gDate);
|
||||
if (officialHoliday)
|
||||
officialHolidayCount += 1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
var mandatoryFixComplex = new TimeSpan(7, 20, 0).Multiply(AllmandatoryDays);
|
||||
var mandatoryFixShifts = new TimeSpan(7, 20, 0).Multiply(notHolidaysCount);
|
||||
|
||||
var allDays = (endContract - conStart).TotalDays + 1;
|
||||
var allDays = (int)(endContract - conStart).TotalDays + 1;
|
||||
int mondatoryDaysInMonth = allDays - (fridayCount + officialHolidayCount);
|
||||
var mandatoryFixShifts = new TimeSpan(7, 20, 0).Multiply(mondatoryDaysInMonth);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var jomeh2 = new TimeSpan();
|
||||
|
||||
@@ -53,7 +53,17 @@
|
||||
.rotateParntModal {
|
||||
height: 600px !important;
|
||||
}
|
||||
.noRotating{
|
||||
background-color: #fe8470;
|
||||
}
|
||||
.hasRotating{
|
||||
background-color: #1bff01;
|
||||
}
|
||||
|
||||
</style>
|
||||
string noRotating = "noRotating";
|
||||
string hasRotating = "hasRotating";
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +108,8 @@
|
||||
<div class="col-xs-3" style="text-align:left"> <h5>نوع ساعت کاری :</h5> </div>
|
||||
|
||||
|
||||
<div class="col-xs-3" style="text-align:right">
|
||||
<div class="col-xs-3 @(!Model.HasRotatingShift? @noRotating :@hasRotating )" style="text-align:right ">
|
||||
|
||||
<h5>@Model.RotatingStatus</h5>
|
||||
</div>
|
||||
<div class="col-xs-3" style="text-align:left">
|
||||
@@ -118,19 +129,8 @@
|
||||
<span style="padding: 0px 10px;"> نوبت شب </span>
|
||||
</div>
|
||||
<div id="rotatingList">
|
||||
@{
|
||||
if (@Model.RotatingStatus == "نوبت کاری ندارد")
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-xs-4"></div>
|
||||
<div class="col-xs-4">
|
||||
<h3>نوبت کاری ندارد</h3>
|
||||
</div>
|
||||
<div class="col-xs-4"></div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
@foreach (var item in @Model.RotatingResultList)
|
||||
{
|
||||
|
||||
@@ -163,9 +163,9 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -16,7 +16,8 @@
|
||||
</style>
|
||||
}
|
||||
|
||||
<link href="@Href("~/Admintheme/css/personelCreate.css")" rel="stylesheet"/>
|
||||
@* <link href="@Href("~/Admintheme/css/personelCreate.css")" rel="stylesheet"/> *@
|
||||
<link href="@Href("~/Admintheme/css/personelEdit.css")" rel="stylesheet"/>
|
||||
|
||||
<fieldset class="content-fieldset">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
@@ -565,12 +566,26 @@
|
||||
$(".listNext").click(function() {
|
||||
if ($("#divGender").find('input[type="radio"]:checked').length === 0) {
|
||||
// allInputsFilled = false;
|
||||
$.Notification.autoHideNotify('error', 'top right', 'خطا', "لطفا جنسیت را مشخص نمایید.");
|
||||
$("#divGender").addClass('errored');
|
||||
|
||||
setTimeout(function () {
|
||||
$("#divGender").removeClass('errored');
|
||||
}, 2500);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($("#divMarried").find('input[type="radio"]:checked').length === 0) {
|
||||
// allInputsFilled = false;
|
||||
// $("#divMarried").addClass('errored');
|
||||
|
||||
$.Notification.autoHideNotify('error', 'top right', 'خطا', "لطفا وضعیت تاهل را مشخص نمایید.");
|
||||
$("#divMarried").addClass('errored');
|
||||
|
||||
setTimeout(function () {
|
||||
$("#divMarried").removeClass('errored');
|
||||
}, 2500);
|
||||
return;
|
||||
}
|
||||
|
||||
const option1 = document.getElementById("city").options.selectedIndex;
|
||||
|
||||
@@ -1591,5 +1591,15 @@ public class IndexModel : PageModel
|
||||
});
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
public async Task<IActionResult> OnPostEmployeeDataFromApi(string nationalCode, string birthDate)
|
||||
{
|
||||
var result = await _employeeApplication.GetEmployeeDataFromApi(nationalCode, birthDate);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
data = result.Data
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,182 +1,188 @@
|
||||
@model List<CompanyManagment.App.Contracts.Percentage.PercentageViewModel>
|
||||
@model List<CompanyManagment.App.Contracts.Percentage.PercentageViewModel>
|
||||
|
||||
<link href="@Href("~/admintheme/css/information-insurance-jobs.css")" rel="stylesheet"/>
|
||||
<link href="@Href("~/admintheme/css/information-insurance-jobs.css")" rel="stylesheet" />
|
||||
@Html.AntiForgeryToken()
|
||||
<div class="container">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<div class="main-title">اطلاعات مربوط به مشاغل مقطوع </div>
|
||||
<div class="box">
|
||||
<form>
|
||||
<div class="form">
|
||||
<div class="col-md-6 inputs">
|
||||
<input type="text" id="fromDate" placeholder="تاریخ شروع" class="input upper-in date">
|
||||
</div>
|
||||
<div class="col-md-6 inputs">
|
||||
<input type="text" id="toDate" placeholder="تاریخ پایان" class="input upper-in date" style="direction: rtl;">
|
||||
</div>
|
||||
<div class="col-md-12 inputs" id="table-container">
|
||||
<table id="table" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="border-left: 0;">مبلغ </th>
|
||||
<th>ضریب</th>
|
||||
<th style="border-right: 0;"> #</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@{ var index = 1; }
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td class="col-md-6">
|
||||
<input id="txtMoney-@item.Id" class="items money" type="text" onkeyup="getMoneyValue(this);" placeholder=""/>
|
||||
<input class=" percentageId" type="hidden" value="@item.Id"/>
|
||||
</td>
|
||||
<td class="col-md-6">
|
||||
<input class="items percentItem" type="text" placeholder="" disabled="disabled" value="@item.Percent"/>
|
||||
</td>
|
||||
<td class="col-md-1">@index</td>
|
||||
</tr>
|
||||
index = index + 1;
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btns">
|
||||
<div class="col-md-5">
|
||||
<a href="#" class=" btn btn-modal" id="save">ذخیره</a>
|
||||
<button class="btn btn-modal" id="close" data-dismiss="modal">بستن</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<div class="main-title">اطلاعات مربوط به مشاغل مقطوع </div>
|
||||
<div class="box">
|
||||
<form>
|
||||
<div class="form">
|
||||
<div class="col-md-6 inputs">
|
||||
<input type="text" id="fromDate" placeholder="تاریخ شروع" class="input upper-in date">
|
||||
</div>
|
||||
<div class="col-md-6 inputs">
|
||||
<input type="text" id="toDate" placeholder="تاریخ پایان" class="input upper-in date" style="direction: rtl;">
|
||||
</div>
|
||||
<div class="col-md-12 inputs" id="table-container">
|
||||
<table id="table" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="border-left: 0;">مبلغ </th>
|
||||
<th>ضریب</th>
|
||||
<th style="border-right: 0;"> #</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@{
|
||||
var index = 1;
|
||||
}
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td class="col-md-6">
|
||||
<input id="txtMoney-@item.Id" class="items money" type="text" onkeyup="getMoneyValue(this);" placeholder="" />
|
||||
<input class=" percentageId" type="hidden" value="@item.Id" />
|
||||
</td>
|
||||
<td class="col-md-6">
|
||||
<input class="items percentItem" type="text" placeholder="" disabled="disabled" value="@item.Percent" />
|
||||
</td>
|
||||
<td class="col-md-1">@index</td>
|
||||
</tr>
|
||||
index = index + 1;
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btns">
|
||||
<div class="col-md-5">
|
||||
<a href="#" class=" btn btn-modal" id="save">ذخیره</a>
|
||||
<button class="btn btn-modal" id="close" data-dismiss="modal">بستن</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="~/AdminTheme/js/numeral.min.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
$(".date").mask("0000/00/00");
|
||||
});
|
||||
$(document).ready(function() {
|
||||
$(".date").mask("0000/00/00");
|
||||
});
|
||||
|
||||
|
||||
$(".date").keyup(function() {
|
||||
const value = $(this).val();
|
||||
const lengthValue = value.length;
|
||||
$(".date").keyup(function() {
|
||||
const value = $(this).val();
|
||||
const lengthValue = value.length;
|
||||
|
||||
if (lengthValue == 10) {
|
||||
if (!dateValidCheck(this)) {
|
||||
$(this).addClass("errored");
|
||||
} else {
|
||||
$(this).removeClass("errored");
|
||||
}
|
||||
}
|
||||
if (lengthValue == 10) {
|
||||
if (!dateValidCheck(this)) {
|
||||
$(this).addClass("errored");
|
||||
} else {
|
||||
$(this).removeClass("errored");
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function getMoneyValue(element) {
|
||||
const text = getNumberValue($(element).val());
|
||||
const textMoney = numeral(text).format();
|
||||
const id = $(element).attr('id');
|
||||
function getMoneyValue(element) {
|
||||
const text = getNumberValue($(element).val());
|
||||
const textMoney = numeral(text).format();
|
||||
const id = $(element).attr('id');
|
||||
|
||||
$(`#${id}`).val(textMoney);
|
||||
}
|
||||
$(`#${id}`).val(textMoney);
|
||||
}
|
||||
|
||||
|
||||
$("#save").click(function() {
|
||||
$("#save").click(function() {
|
||||
|
||||
if (checkEmpty()) {
|
||||
const fromDate = $("#fromDate").val();
|
||||
const toDate = $("#toDate").val();
|
||||
if (fromDate != '' && !checkLength(fromDate, 10)) {
|
||||
if (!dateValidCheckByValue($("#fromDate"))) {
|
||||
$("#fromDate").addClass("errored");
|
||||
} else {
|
||||
$("#fromDate").removeClass("errored");
|
||||
}
|
||||
}
|
||||
if (toDate != '' && !checkLength(toDate, 10)) {
|
||||
if (!dateValidCheckByValue($("#toDate"))) {
|
||||
$("#toDate").addClass("errored");
|
||||
} else {
|
||||
$("#toDate").removeClass("errored");
|
||||
}
|
||||
}
|
||||
if ((fromDate != '' && checkLength(fromDate, 10)) && (toDate != '' && checkLength(toDate, 10)) && toDate < fromDate) {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', 'تاریخ پایان نمی تواند کمتر از تاریخ شروع باشد.');
|
||||
return;
|
||||
} else if (toDate == fromDate) {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', 'تاریخ پایان نمی تواند مساوی با تاریخ شروع باشد.');
|
||||
return;
|
||||
} else {
|
||||
if (checkEmpty()) {
|
||||
const fromDate = $("#fromDate").val();
|
||||
const toDate = $("#toDate").val();
|
||||
if (fromDate != '' && !checkLength(fromDate, 10)) {
|
||||
if (!dateValidCheckByValue($("#fromDate"))) {
|
||||
$("#fromDate").addClass("errored");
|
||||
} else {
|
||||
$("#fromDate").removeClass("errored");
|
||||
}
|
||||
}
|
||||
if (toDate != '' && !checkLength(toDate, 10)) {
|
||||
if (!dateValidCheckByValue($("#toDate"))) {
|
||||
$("#toDate").addClass("errored");
|
||||
} else {
|
||||
$("#toDate").removeClass("errored");
|
||||
}
|
||||
}
|
||||
if ((fromDate != '' && checkLength(fromDate, 10)) && (toDate != '' && checkLength(toDate, 10)) && toDate < fromDate) {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', 'تاریخ پایان نمی تواند کمتر از تاریخ شروع باشد.');
|
||||
return;
|
||||
} else if (toDate == fromDate) {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', 'تاریخ پایان نمی تواند مساوی با تاریخ شروع باشد.');
|
||||
return;
|
||||
} else {
|
||||
|
||||
var dateSalaryItemsList = [];
|
||||
$('#table tbody tr').each(function(index) {
|
||||
var dateSalaryItemsList = [];
|
||||
$('#table tbody tr').each(function(index) {
|
||||
|
||||
const dateSalaryItems = {};
|
||||
dateSalaryItems.Salary = getNumberValue($(this).find('input.money').val());
|
||||
dateSalaryItems.Percent = $(this).find('input.percentItem').val();
|
||||
dateSalaryItems.PercentageId = $(this).find('input.percentageId').val();
|
||||
dateSalaryItems.DateSalaryId = 0;
|
||||
const dateSalaryItems = {};
|
||||
dateSalaryItems.Salary = getNumberValue($(this).find('input.money').val());
|
||||
dateSalaryItems.Percent = $(this).find('input.percentItem').val();
|
||||
dateSalaryItems.PercentageId = $(this).find('input.percentageId').val();
|
||||
dateSalaryItems.DateSalaryId = 0;
|
||||
|
||||
dateSalaryItemsList.push(dateSalaryItems);
|
||||
});
|
||||
const command = {};
|
||||
command.StartDateFa = fromDate;
|
||||
command.EndDateFa = toDate;
|
||||
command.DateSalaryItems = dateSalaryItemsList;
|
||||
dateSalaryItemsList.push(dateSalaryItems);
|
||||
});
|
||||
const command = {};
|
||||
command.StartDateFa = fromDate;
|
||||
command.EndDateFa = toDate;
|
||||
command.DateSalaryItems = dateSalaryItemsList;
|
||||
|
||||
// console.log(command);
|
||||
// console.log(command);
|
||||
|
||||
$.ajax({
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/InsuranceJob/Index", "CreateDateSalaryItem")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: command,
|
||||
success: function(response) {
|
||||
if (response.isSuccedded) {
|
||||
$("#MainModal").modal('toggle');
|
||||
$.Notification.autoHideNotify('success', 'top right', 'پیام سیستم ', response.message);
|
||||
} else {
|
||||
$.Notification.autoHideNotify('error', 'top right', response.message);
|
||||
}
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
$.ajax({
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/InsuranceJob/Index", "CreateDateSalaryItem")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: command,
|
||||
success: function(response) {
|
||||
if (response.isSuccedded) {
|
||||
$("#MainModal").modal('toggle');
|
||||
$.Notification.autoHideNotify('success', 'top right', 'پیام سیستم ', response.message);
|
||||
setTimeout(function () {
|
||||
window.location.reload();
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
} else {
|
||||
$.Notification.autoHideNotify('error', 'top right', response.message);
|
||||
}
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function checkEmpty() {
|
||||
const fromDate = $("#fromDate").val();
|
||||
const toDate = $("#toDate").val();
|
||||
function checkEmpty() {
|
||||
const fromDate = $("#fromDate").val();
|
||||
const toDate = $("#toDate").val();
|
||||
|
||||
var result = true;
|
||||
var result = true;
|
||||
|
||||
if (fromDate == '') {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', 'تاریخ شروع نمی تواند خالی باشد.');
|
||||
result = false;
|
||||
} else if (toDate == '') {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', 'تاریخ پایان نمی تواند خالی باشد.');
|
||||
result = false;
|
||||
} else {
|
||||
$('#table tbody tr').each(function(index) {
|
||||
if ($(this).find('input.money').val() == '') {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', `مبلغ در ردیف ${index + 1}وارد نشده است.`);
|
||||
result = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
if (fromDate == '') {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', 'تاریخ شروع نمی تواند خالی باشد.');
|
||||
result = false;
|
||||
} else if (toDate == '') {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', 'تاریخ پایان نمی تواند خالی باشد.');
|
||||
result = false;
|
||||
} else {
|
||||
// $('#table tbody tr').each(function(index) {
|
||||
// if ($(this).find('input.money').val() == '') {
|
||||
// $.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', `مبلغ در ردیف ${index + 1}وارد نشده است.`);
|
||||
// result = false;
|
||||
// }
|
||||
// });
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
@@ -169,6 +169,7 @@
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', 'تاریخ پایان نمی تواند خالی باشد.');
|
||||
result = false;
|
||||
} else {
|
||||
|
||||
$('#table tbody tr').each(function(index) {
|
||||
if ($(this).find('input.money').val() == '' || $(this).find('input.money').val() == '0') {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', `مبلغ در ردیف ${index + 1}وارد نشده است.`);
|
||||
|
||||
@@ -176,12 +176,12 @@
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', 'تاریخ پایان نمی تواند خالی باشد.');
|
||||
result = false;
|
||||
} else {
|
||||
$('#table tbody tr').each(function(index) {
|
||||
if ($(this).find('input.money').val() == '' || $(this).find('input.money').val() == '0') {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', `مبلغ در ردیف ${index + 1}وارد نشده است.`);
|
||||
result = false;
|
||||
}
|
||||
});
|
||||
// $('#table tbody tr').each(function(index) {
|
||||
// if ($(this).find('input.money').val() == '' || $(this).find('input.money').val() == '0') {
|
||||
// $.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', `مبلغ در ردیف ${index + 1}وارد نشده است.`);
|
||||
// result = false;
|
||||
// }
|
||||
// });
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
@@ -221,54 +222,54 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.RollCall
|
||||
return Partial("ModalEditEmployeeFromGroup", command);
|
||||
}
|
||||
|
||||
public IActionResult OnPostChangeEditEmployee(EditCustomizeEmployeeSettings command, long workshopId)
|
||||
{
|
||||
command.WorkshopId = workshopId;
|
||||
OperationResult result = _customizeWorkshopSettingsApplication.EditSimpleRollCallEmployeeSetting(command);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
public IActionResult OnPostChangeEditEmployee(EditCustomizeEmployeeSettings command, long workshopId, List<ReCalculateRollCallValues> reCalculateCommand)
|
||||
{
|
||||
command.WorkshopId = workshopId;
|
||||
OperationResult result = _customizeWorkshopSettingsApplication.EditSimpleRollCallEmployeeSetting(command, reCalculateCommand);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
|
||||
// public IActionResult OnGetGroupingSetting(long groupId)
|
||||
// {
|
||||
// var command = _customizeWorkshopSettingsApplication.GetCustomizeWorkshopGroupSettingsDetails(groupId);
|
||||
// public IActionResult OnGetGroupingSetting(long groupId)
|
||||
// {
|
||||
// var command = _customizeWorkshopSettingsApplication.GetCustomizeWorkshopGroupSettingsDetails(groupId);
|
||||
|
||||
// return Partial("ModalSettingGroup", command);
|
||||
//}
|
||||
// return Partial("ModalSettingGroup", command);
|
||||
//}
|
||||
|
||||
// public IActionResult OnPostGroupingSetting(EditCustomizeWorkshopGroupSettings command)
|
||||
// {
|
||||
// command.EmployeeIds = _customizeWorkshopSettingsApplication.GetEmployeeSettingsByGroupSettingsId(command.Id).Select(x => x.EmployeeId).ToList();
|
||||
// OperationResult result = _customizeWorkshopSettingsApplication.EditRollCallGroupSetting(command);
|
||||
// public IActionResult OnPostGroupingSetting(EditCustomizeWorkshopGroupSettings command)
|
||||
// {
|
||||
// command.EmployeeIds = _customizeWorkshopSettingsApplication.GetEmployeeSettingsByGroupSettingsId(command.Id).Select(x => x.EmployeeId).ToList();
|
||||
// OperationResult result = _customizeWorkshopSettingsApplication.EditRollCallGroupSetting(command);
|
||||
|
||||
// return new JsonResult(new
|
||||
// {
|
||||
// isSuccess = result.IsSuccedded,
|
||||
// message = result.Message
|
||||
// });
|
||||
//}
|
||||
// return new JsonResult(new
|
||||
// {
|
||||
// isSuccess = result.IsSuccedded,
|
||||
// message = result.Message
|
||||
// });
|
||||
//}
|
||||
|
||||
//public IActionResult OnGetGroupingEmployeeSetting(long customizeEmployeeId, List<long> employeeId)
|
||||
// {
|
||||
// var command = _customizeWorkshopSettingsApplication.GetCustomizeEmployeeSettingsDetails(customizeEmployeeId);
|
||||
// command.EmployeeIds = employeeId;
|
||||
//public IActionResult OnGetGroupingEmployeeSetting(long customizeEmployeeId, List<long> employeeId)
|
||||
// {
|
||||
// var command = _customizeWorkshopSettingsApplication.GetCustomizeEmployeeSettingsDetails(customizeEmployeeId);
|
||||
// command.EmployeeIds = employeeId;
|
||||
|
||||
// return Partial("ModalSettingGroupEmployee", command);
|
||||
// }
|
||||
// return Partial("ModalSettingGroupEmployee", command);
|
||||
// }
|
||||
|
||||
// public IActionResult OnPostGroupingEmployeeSetting(EditCustomizeEmployeeSettings command)
|
||||
// {
|
||||
// command.WorkshopId = _workshopId;
|
||||
// OperationResult result = _customizeWorkshopSettingsApplication.EditRollCallEmployeeSettings(command);
|
||||
// public IActionResult OnPostGroupingEmployeeSetting(EditCustomizeEmployeeSettings command)
|
||||
// {
|
||||
// command.WorkshopId = _workshopId;
|
||||
// OperationResult result = _customizeWorkshopSettingsApplication.EditRollCallEmployeeSettings(command);
|
||||
|
||||
// return new JsonResult(new
|
||||
// {
|
||||
// isSuccess = result.IsSuccedded,
|
||||
// message = result.Message
|
||||
// });
|
||||
//}
|
||||
}
|
||||
// return new JsonResult(new
|
||||
// {
|
||||
// isSuccess = result.IsSuccedded,
|
||||
// message = result.Message
|
||||
// });
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<input type="radio" class="tm-selection-rad" name="Command.HasSchedule" id="normalTask" value="false" autocomplete="off">
|
||||
<label class="btn btn-outline-primary d-flex justify-content-center radio-btn" for="normalTask">وظیفه معمولی</label>
|
||||
</div>
|
||||
<div class="form-check form-checked selectRadioBox">
|
||||
<div permission="90310" class="form-check form-checked selectRadioBox">
|
||||
<input type="radio" class="tm-selection-rad" name="Command.HasSchedule" value="true" id="scheduleTask" autocomplete="off">
|
||||
<label class="btn btn-outline-primary d-flex justify-content-center radio-btn" for="scheduleTask">وظیفه دوره ای</label>
|
||||
</div>
|
||||
|
||||
@@ -89,7 +89,8 @@
|
||||
<button type="button" class="btnTaskFilter btnTicketRequestList me-1" id="btnTicketRequestList">لیست درخواست های تیکت
|
||||
<span class="badge bg-danger rounded-pill me-1 " id="badgeTicketRequesttCount1"></span>
|
||||
</button>
|
||||
<button type="button" class="btnTaskFilter btnScheduleTask me-1" id="btnScheduleTask">وظایف دوره ای
|
||||
<button permission="90116" type="button" class="btnTaskFilter btnScheduleTask me-1" id="btnScheduleTask">
|
||||
وظایف دوره ای
|
||||
<span class="badge bg-danger rounded-pill me-1 " id="badgeScheduleTaskCount1"></span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -119,7 +120,8 @@
|
||||
<button type="button" class="btnTaskFilter btnTicketRequestList me-1" id="btnTicketRequestList">لیست درخواست های تیکت
|
||||
<span class="badge bg-danger rounded-pill me-1 " id="badgeTicketRequesttCount2"></span>
|
||||
</button>
|
||||
<button type="button" class="btnTaskFilter btnTicketRequestList me-1" id="btnScheduleTask">وظایف دوره ای
|
||||
<button permission="90116" type="button" class="btnTaskFilter btnTicketRequestList me-1" id="btnScheduleTask">
|
||||
وظایف دوره ای
|
||||
<span class="badge bg-danger rounded-pill me-1 " id="badgeScheduleTaskCount2"></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
<label class="titleForm2">
|
||||
نظام وظیفه
|
||||
</label>
|
||||
<select class="form-select form-select-sm" id="militaryStatus" asp-for="@Model.MilitaryService">
|
||||
<select class="form-select form-select-sm" id="militaryStatus" name="Command.MilitaryService" asp-for="@Model.MilitaryService">
|
||||
<option value="">انتخاب ...</option>
|
||||
<option value="مشمول">مشمول</option>
|
||||
<option value="پایان خدمت">پایان خدمت</option>
|
||||
|
||||
@@ -222,49 +222,51 @@
|
||||
@if (@Model.RollCallViewModels.ActiveEmployees.Any())
|
||||
{
|
||||
|
||||
<!-- Advance Search Box -->
|
||||
<div class="search-box bg-white d-block d-md-none p-1">
|
||||
<button class="btn-search w-100" type="button" data-bs-toggle="modal" data-bs-target="#searchModal">
|
||||
<span>جستجو پیشرفته</span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="11" cy="11" r="6" stroke="white" />
|
||||
<path d="M20 20L17 17" stroke="white" stroke-linecap="round" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<!-- End Advance Search Box -->
|
||||
<div class="col-12 px-3">
|
||||
<!-- Advance Search Box -->
|
||||
<div class="search-box bg-white d-block d-md-none">
|
||||
<button class="btn-search w-100" type="button" data-bs-toggle="modal" data-bs-target="#searchModal">
|
||||
<span>جستجو پیشرفته</span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="11" cy="11" r="6" stroke="white" />
|
||||
<path d="M20 20L17 17" stroke="white" stroke-linecap="round" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<!-- End Advance Search Box -->
|
||||
|
||||
|
||||
<div class="row d-flex align-items-center mb-1 p-1">
|
||||
<div class="col-12 col-md-4">
|
||||
<div class="d-flex align-items-center gap-1">
|
||||
<button type="button" class="btn-search text-nowrap d-flex align-items-center justify-content-center" onclick="addWorkTime()">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 25 25" fill="none">
|
||||
<circle cx="12.5" cy="12.5" r="8.775" stroke="white" stroke-width="2" stroke-opacity="0.84"></circle>
|
||||
<path d="M12.5 8.3335L12.5 16.6668" stroke="white" stroke-width="2" stroke-linecap="round"></path>
|
||||
<path d="M16.6667 12.5L8.33342 12.5" stroke="white" stroke-width="2" stroke-linecap="round"></path>
|
||||
</svg>
|
||||
<span class="mx-1">افزودن حضور و غیاب</span>
|
||||
</button>
|
||||
|
||||
<div class="col-6 col-xl-6 position-relative">
|
||||
<input type="text" class="form-control" id="search" placeholder="جستجو ...">
|
||||
<button type="button" id="clear-search" class="close-btn-search d-none">
|
||||
<svg width="20" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
|
||||
<div class="row d-flex align-items-center mt-1">
|
||||
<div class="col-12 col-md-4">
|
||||
<div class="d-flex align-items-center gap-1">
|
||||
<button type="button" class="btn-search text-nowrap d-flex align-items-center justify-content-center" onclick="addWorkTime()">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 25 25" fill="none">
|
||||
<circle cx="12.5" cy="12.5" r="8.775" stroke="white" stroke-width="2" stroke-opacity="0.84"></circle>
|
||||
<path d="M12.5 8.3335L12.5 16.6668" stroke="white" stroke-width="2" stroke-linecap="round"></path>
|
||||
<path d="M16.6667 12.5L8.33342 12.5" stroke="white" stroke-width="2" stroke-linecap="round"></path>
|
||||
</svg>
|
||||
<span class="mx-1">افزودن حضور و غیاب</span>
|
||||
</button>
|
||||
|
||||
<div class="col-6 col-xl-6 position-relative">
|
||||
<input type="text" class="form-control" id="search" placeholder="جستجو ...">
|
||||
<button type="button" id="clear-search" class="close-btn-search d-none">
|
||||
<svg width="20" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-none d-md-block text-center">
|
||||
<span class="textListTitle">لیست سوابق حضور و غیاب</span>
|
||||
</div>
|
||||
<div class="col-4 d-none d-md-block text-center">
|
||||
<span class="textListTitle">لیست سوابق حضور و غیاب</span>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-4 d-block text-center text-md-end">
|
||||
<div class="textListTitle mt-3 mt-md-0">
|
||||
<span id="sumTimeWork" style="display: none"></span>
|
||||
<div class="col-12 col-md-4 d-block text-center text-md-end">
|
||||
<div class="textListTitle mt-3 mt-md-0">
|
||||
<span id="sumTimeWork" style="display: none"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -16,6 +16,7 @@ using CompanyManagment.App.Contracts.RollCallEmployee;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using CompanyManagement.Infrastructure.Excel.CWS;
|
||||
using CompanyManagement.Infrastructure.Excel.EmployeeBankInfo;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
|
||||
namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
{
|
||||
@@ -30,13 +31,14 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
private readonly ICustomizeWorkshopSettingsApplication _customizeWorkshopSettingsApplication;
|
||||
private readonly IHttpContextAccessor _contextAccessor;
|
||||
private readonly IAuthHelper _authHelper;
|
||||
private readonly IRollCallApplication _rollCallApplication;
|
||||
public bool GroupedAllEmployees;
|
||||
private readonly long _workshopId;
|
||||
public string WorkshopFullName;
|
||||
public CustomizeWorkshopSettingsViewModel RollCallWorkshopSettings;
|
||||
public List<RollCallEmployeeViewModel> RollCallEmployeeList;
|
||||
|
||||
public GroupingModel(IPasswordHasher passwordHasher, IWorkshopApplication workshopApplication, ICustomizeWorkshopSettingsApplication rollCallWorkshopSettingsApplication, IEmployeeApplication employeeApplication, IHttpContextAccessor contextAccessor, IAuthHelper authHelper, IRollCallEmployeeApplication rollCallEmployeeApplication)
|
||||
public GroupingModel(IPasswordHasher passwordHasher, IWorkshopApplication workshopApplication, ICustomizeWorkshopSettingsApplication rollCallWorkshopSettingsApplication, IEmployeeApplication employeeApplication, IHttpContextAccessor contextAccessor, IAuthHelper authHelper, IRollCallEmployeeApplication rollCallEmployeeApplication, IRollCallApplication rollCallApplication)
|
||||
{
|
||||
_passwordHasher = passwordHasher;
|
||||
_workshopApplication = workshopApplication;
|
||||
@@ -45,6 +47,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
_contextAccessor = contextAccessor;
|
||||
_authHelper = authHelper;
|
||||
_rollCallEmployeeApplication = rollCallEmployeeApplication;
|
||||
_rollCallApplication = rollCallApplication;
|
||||
var workshopHash = _contextAccessor.HttpContext?.User.FindFirstValue("WorkshopSlug");
|
||||
_workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
|
||||
@@ -244,10 +247,21 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
return Partial("ModalEditEmployeeFromGroup", command);
|
||||
}
|
||||
|
||||
public IActionResult OnPostChangeEditEmployee(EditCustomizeEmployeeSettings command)
|
||||
public IActionResult OnGetEmployeesHaveToChange(long groupId, bool isChange)
|
||||
{
|
||||
command.WorkshopId = _workshopId;
|
||||
OperationResult result = _customizeWorkshopSettingsApplication.EditSimpleRollCallEmployeeSetting(command);
|
||||
var result = _customizeWorkshopSettingsApplication.GetEmployeeSettingsByGroupSettingsId(groupId)
|
||||
.Where(x => x.IsSettingChanged = isChange).ToList();
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = result
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostChangeEditEmployee(EditCustomizeEmployeeSettings command, List<ReCalculateRollCallValues> reCalculateCommand)
|
||||
{
|
||||
command.WorkshopId = _workshopId;
|
||||
OperationResult result = _customizeWorkshopSettingsApplication.EditSimpleRollCallEmployeeSetting(command, reCalculateCommand);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
@@ -255,6 +269,26 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetEmployeeSettingsHasChangedValue(EditCustomizeEmployeeSettings command)
|
||||
{
|
||||
var employeeChange = _customizeWorkshopSettingsApplication.CheckEmployeeShiftHasChanged(command);
|
||||
return new JsonResult(new
|
||||
{
|
||||
data = employeeChange
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostReCalculateValues(List<ReCalculateRollCallValues> command)
|
||||
{
|
||||
var result = _rollCallApplication.RecalculateValues(_workshopId, command);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnGetDownloadExcel()
|
||||
{
|
||||
var groupData = _customizeWorkshopSettingsApplication.GetWorkshopSettingsByWorkshopIdForAdmin(_workshopId);
|
||||
|
||||
@@ -12,434 +12,454 @@
|
||||
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header d-block text-center mb-0 pb-0">
|
||||
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<h6>ویرایش ساعت کاری پرسنل @Model.EmployeeFullName</h6>
|
||||
</div>
|
||||
<div class="modal-body pt-2">
|
||||
<div class="modal-header d-block text-center mb-0 pb-0">
|
||||
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<h6>ویرایش ساعت کاری پرسنل @Model.EmployeeFullName</h6>
|
||||
</div>
|
||||
<div class="modal-body pt-2">
|
||||
|
||||
<form role="form" method="post" name="edit-employee-form" id="edit-employee-form" autocomplete="off">
|
||||
<form role="form" method="post" name="edit-employee-form" id="edit-employee-form" autocomplete="off">
|
||||
|
||||
<input type="hidden" name="Command.Id" value="@Model.Id" />
|
||||
<input type="hidden" name="Command.Id" value="@Model.Id" />
|
||||
|
||||
@foreach (var itemEmployee in Model.EmployeeIds)
|
||||
{
|
||||
<input type="hidden" name="Command.EmployeeIds[@indexEmployee]" value="@itemEmployee" />
|
||||
indexEmployee++;
|
||||
}
|
||||
@foreach (var itemEmployee in Model.EmployeeIds)
|
||||
{
|
||||
<input type="hidden" name="Command.EmployeeIds[@indexEmployee]" value="@itemEmployee" />
|
||||
indexEmployee++;
|
||||
}
|
||||
|
||||
|
||||
<div class="container p-0 m-0">
|
||||
<div class="container p-0 m-0">
|
||||
|
||||
<div class="row">
|
||||
<div class="lableCheckBreakTime">نام گروه</div>
|
||||
<div class="col-12 d-flex align-items-center">
|
||||
<input type="text" class="form-control" value="@Model.NameGroup" placeholder="نام گروه را وارد نمایید" disabled="disabled" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="lableCheckBreakTime">نام گروه</div>
|
||||
<div class="col-12 d-flex align-items-center">
|
||||
<input type="text" class="form-control" value="@Model.NameGroup" placeholder="نام گروه را وارد نمایید" disabled="disabled" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row p-0">
|
||||
<div class="d-flex flex-column align-items-center justify-content-center h-100">
|
||||
<div class="d-flex align-items-center justify-content-center mt-3 mb-1">
|
||||
<p class="m-0">ساعات کاری پرسنل را مشخص نمائید</p>
|
||||
</div>
|
||||
<div class="btn-workTimeOption-container align-items-center justify-content-center w-100">
|
||||
<input type="radio" value="Regular" name="Command.workshopShiftStatus" id="organized" class="radio-workTimeOption">
|
||||
<label for="organized" class="radio-label-workTimeOption w-100">منظم</label>
|
||||
<div class="row p-0">
|
||||
<div class="d-flex flex-column align-items-center justify-content-center h-100">
|
||||
<div class="d-flex align-items-center justify-content-center mt-3 mb-1">
|
||||
<p class="m-0">ساعات کاری پرسنل را مشخص نمائید</p>
|
||||
</div>
|
||||
<div class="btn-workTimeOption-container align-items-center justify-content-center w-100">
|
||||
<input type="radio" value="Regular" name="Command.workshopShiftStatus" id="organized" class="radio-workTimeOption">
|
||||
<label for="organized" class="radio-label-workTimeOption w-100">منظم</label>
|
||||
|
||||
<input type="radio" value="Rotating" name="Command.workshopShiftStatus" id="rotating_shift" class="radio-workTimeOption">
|
||||
<label for="rotating_shift" class="radio-label-workTimeOption w-100">گردشی</label>
|
||||
<input type="radio" value="Rotating" name="Command.workshopShiftStatus" id="rotating_shift" class="radio-workTimeOption">
|
||||
<label for="rotating_shift" class="radio-label-workTimeOption w-100">گردشی</label>
|
||||
|
||||
<input type="radio" value="Irregular" name="Command.workshopShiftStatus" id="disorganized" class="radio-workTimeOption">
|
||||
<label for="disorganized" class="radio-label-workTimeOption w-100">مختلط</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="radio" value="Irregular" name="Command.workshopShiftStatus" id="disorganized" class="radio-workTimeOption">
|
||||
<label for="disorganized" class="radio-label-workTimeOption w-100">مختلط</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-2" id="step_workTimeOption" style="height: 0; display: none">
|
||||
<div class="col-12" id="appendChildTimeWorkHtml">
|
||||
<div class="row mt-2" id="step_workTimeOption" style="height: 0; display: none">
|
||||
<div class="col-12" id="appendChildTimeWorkHtml">
|
||||
|
||||
@if (Model.ShiftViewModel.Any())
|
||||
{
|
||||
@foreach (var item in Model.ShiftViewModel)
|
||||
{
|
||||
<div class="groupBox">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-3 d-flex align-items-center">
|
||||
<input type="hidden" name="Command.ShiftViewModel[@iteration].Placement" value="@item.Placement"/>
|
||||
<div class="timeWorkTitle">
|
||||
@(item.Placement.ToString() == "First" ? "نوبت اول" : (item.Placement.ToString() == "Second" ? "نوبت دوم" : "نوبت سوم"))
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.ShiftViewModel[@iteration].StartTime" value="@item.StartTime" placeholder="00:00" style="direction: ltr;"/>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.ShiftViewModel[@iteration].EndTime" value="@item.EndTime" placeholder="00:00" style="direction: ltr;"/>
|
||||
</div>
|
||||
@if (iteration == 0)
|
||||
{
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
<button type="button" class="btnRemoveTimeWork">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white"/>
|
||||
<path d="M6.875 11H15.125" stroke="white"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
iteration++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="groupBox">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
|
||||
<div class="col-3 d-flex align-items-center">
|
||||
<input type="hidden" name="Command.ShiftViewModel[0].Placement" value="First"/>
|
||||
<div class="timeWorkTitle">
|
||||
نوبت اول
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.ShiftViewModel[0].StartTime" value="" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.ShiftViewModel[0].EndTime" value="" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
|
||||
@if (Model.ShiftViewModel.Any())
|
||||
{
|
||||
@foreach (var item in Model.ShiftViewModel)
|
||||
{
|
||||
<div class="groupBox">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-3 d-flex align-items-center">
|
||||
<input type="hidden" name="Command.ShiftViewModel[@iteration].Placement" value="@item.Placement"/>
|
||||
<div class="timeWorkTitle">
|
||||
@(item.Placement.ToString() == "First" ? "نوبت اول" : (item.Placement.ToString() == "Second" ? "نوبت دوم" : "نوبت سوم"))
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center justify-content-center w-100 my-2">
|
||||
<button type="button" class="btnAddTimeWork @(Model.ShiftViewModel.Count() == 3 ? "d-none" : "")">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white"/>
|
||||
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round"/>
|
||||
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round"/>
|
||||
</svg>
|
||||
@if (Model.ShiftViewModel.Count() == 2)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWork">افزودن نوبت سوم</div>
|
||||
}
|
||||
else if (Model.ShiftViewModel.Count() == 1)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWork">افزودن نوبت دوم</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWork"></div>
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<p class="m-0" id="ShowSettingMessage"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.ShiftViewModel[@iteration].StartTime" value="@item.StartTime" placeholder="00:00" style="direction: ltr;"/>
|
||||
</div>
|
||||
|
||||
<div class="row mt-2" id="step_workTimeOptionRotatingShift" style="height: 0; display: none">
|
||||
<div class="col-12" id="appendChildTimeWorkHtmlRS">
|
||||
|
||||
@if (Model.CustomizeRotatingShifts.Any())
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.ShiftViewModel[@iteration].EndTime" value="@item.EndTime" placeholder="00:00" style="direction: ltr;"/>
|
||||
</div>
|
||||
@if (iteration == 0)
|
||||
{
|
||||
@foreach (var item in Model.CustomizeRotatingShifts)
|
||||
{
|
||||
|
||||
<div class="groupBoxRS">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-3 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">
|
||||
@if (iterationRS == 0)
|
||||
{
|
||||
@("نوبت اول")
|
||||
}
|
||||
else if (iterationRS == 1)
|
||||
{
|
||||
@("نوبت دوم")
|
||||
}
|
||||
else if (iterationRS == 2)
|
||||
{
|
||||
@("نوبت سوم")
|
||||
}
|
||||
else if (iterationRS == 3)
|
||||
{
|
||||
@("نوبت چهارم")
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTimeRS" name="Command.CustomizeRotatingShifts[@iterationRS].StartTime" value="@item.StartTime" placeholder="00:00" style="direction: ltr;" />
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTimeRS" name="Command.CustomizeRotatingShifts[@iterationRS].EndTime" value="@item.EndTime" placeholder="00:00" style="direction: ltr;" />
|
||||
</div>
|
||||
@if (iterationRS == 0)
|
||||
{
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
<button type="button" class="btnRemoveTimeWorkRS">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white" />
|
||||
<path d="M6.875 11H15.125" stroke="white" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@{
|
||||
iterationRS++;
|
||||
}
|
||||
</div>
|
||||
}
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="groupBoxRS">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-3 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">نوبت اول</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTimeRS" id="startDateTimeRS" name="Command.CustomizeRotatingShifts[0].StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTimeRS" id="endDateTimeRS" name="Command.CustomizeRotatingShifts[0].EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
<button type="button" class="btnRemoveTimeWork">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white"/>
|
||||
<path d="M6.875 11H15.125" stroke="white"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-center w-100 my-2">
|
||||
<button type="button" class="btnAddTimeWorkRS @(Model.CustomizeRotatingShifts.Count() == 4 ? "d-none" : "")">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white"/>
|
||||
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round"/>
|
||||
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
iteration++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="groupBox">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
|
||||
@if (Model.CustomizeRotatingShifts.Count() == 1)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWorkRS">افزودن نوبت دوم</div>
|
||||
}
|
||||
else if (Model.CustomizeRotatingShifts.Count() == 2)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWorkRS">افزودن نوبت سوم</div>
|
||||
}
|
||||
else if (Model.CustomizeRotatingShifts.Count() == 3)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWorkRS">افزودن نوبت چهارم</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWorkRS"></div>
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<p class="m-0" id="ShowSettingMessageRS"></p>
|
||||
<div class="col-3 d-flex align-items-center">
|
||||
<input type="hidden" name="Command.ShiftViewModel[0].Placement" value="First"/>
|
||||
<div class="timeWorkTitle">
|
||||
نوبت اول
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row p-0" id="step_workTimeOptionIrregular" style="height: 0; gap: 12px; @(Model.WorkshopShiftStatus == WorkshopShiftStatus.Regular ? "display: none" : "")">
|
||||
|
||||
<div class="btn-workTimeOption-container align-items-center justify-content-center mt-4">
|
||||
<input type="radio" id="TwelveTwentyFour" value="@WorkshopIrregularShifts.TwelveTwentyFour" name="Command.IrregularShift.WorkshopIrregularShifts" class="radio-workTimeOption" @(Model.IrregularShift.WorkshopIrregularShifts == WorkshopIrregularShifts.TwelveTwentyFour ? "checked" : "")>
|
||||
<label for="TwelveTwentyFour" class="radio-label-workTimeOption w-100 outlineDate">12 ساعت کار 24 ساعت استراحت</label>
|
||||
|
||||
<input type="radio" id="TwentyFourTwentyFour" value="@WorkshopIrregularShifts.TwentyFourTwentyFour" name="Command.IrregularShift.WorkshopIrregularShifts" class="radio-workTimeOption" @(Model.IrregularShift.WorkshopIrregularShifts == WorkshopIrregularShifts.TwentyFourTwentyFour ? "checked" : "")>
|
||||
<label for="TwentyFourTwentyFour" class="radio-label-workTimeOption w-100 outlineDate">24 ساعت کار 24 ساعت استراحت</label>
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.ShiftViewModel[0].StartTime" value="" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="btn-workTimeOption-container align-items-center justify-content-center">
|
||||
<input type="radio" id="TwelveThirtySix" value="@WorkshopIrregularShifts.TwelveThirtySix" name="Command.IrregularShift.WorkshopIrregularShifts" class="radio-workTimeOption" @(Model.IrregularShift.WorkshopIrregularShifts == WorkshopIrregularShifts.TwelveThirtySix ? "checked" : "")>
|
||||
<label for="TwelveThirtySix" class="radio-label-workTimeOption w-100 outlineDate">12 ساعت کار 36 ساعت استراحت</label>
|
||||
|
||||
<input type="radio" id="TwentyFourFortyEight" value="@WorkshopIrregularShifts.TwentyFourFortyEight" name="Command.IrregularShift.WorkshopIrregularShifts" class="radio-workTimeOption" @(Model.IrregularShift.WorkshopIrregularShifts == WorkshopIrregularShifts.TwentyFourFortyEight ? "checked" : "")>
|
||||
<label for="TwentyFourFortyEight" class="radio-label-workTimeOption w-100 outlineDate">24 ساعت کار 48 ساعت استراحت</label>
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTime" name="Command.ShiftViewModel[0].EndTime" value="" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="hrLine"></div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="groupBoxIrregular @(Model.WorkshopShiftStatus != WorkshopShiftStatus.Regular ? "" : "disable")" id="irregularShiftsDateTime">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-2 d-flex align-items-center">
|
||||
<div class="timeWorkTitle"></div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTimeIrregular" id="irregularShiftsStartDateTime" value="@Model.IrregularShift.StartTime.ToString("HH:mm")" name="Command.IrregularShift.StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTimeIrregular" id="irregularShiftsEndDateTime" value="@Model.IrregularShift.EndTime.ToString("HH:mm")" name="Command.IrregularShift.EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
<div class="col-2 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<div class="container my-2">
|
||||
<div class="row breack-time">
|
||||
<div>
|
||||
<div class="d-flex align-items-center my-1 breakTimeDiv">
|
||||
<input type="checkbox" id="BreakTimeFirst" name="BreakTime.hasBreakTimeValue" class="form-check-input" @(Model.BreakTime.BreakTimeType == BreakTimeType.WithoutTime ? "checked" : "")>
|
||||
<label for="BreakTimeFirst" class="lableCheckBreakTime">
|
||||
این پرسنل دارای ساعت استراحت نامشخص می باشد با انتخاب این تیک پرسنل باید برای استراحت ورود و خروج ثبت کند.
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-center w-100 my-2">
|
||||
<button type="button" class="btnAddTimeWork @(Model.ShiftViewModel.Count() == 3 ? "d-none" : "")">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white"/>
|
||||
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round"/>
|
||||
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round"/>
|
||||
</svg>
|
||||
@if (Model.ShiftViewModel.Count() == 2)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWork">افزودن نوبت سوم</div>
|
||||
}
|
||||
else if (Model.ShiftViewModel.Count() == 1)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWork">افزودن نوبت دوم</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWork"></div>
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<p class="m-0" id="ShowSettingMessage"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="d-block">
|
||||
<div class="d-flex align-items-center my-1 breakTimeDiv">
|
||||
<input type="checkbox" id="BreakTime" name="BreakTime.hasBreakTimeValue" class="form-check-input" @(Model.BreakTime.BreakTimeType == BreakTimeType.WithTime ? "checked" : "")>
|
||||
<label for="BreakTime" class="lableCheckBreakTime">
|
||||
این پرسنل دارای ساعت استراحت ثابت روزانه می باشد که بصورت خودکار در فیش حقوقی محاسبه می گردد:
|
||||
</label>
|
||||
</div>
|
||||
<div class="row mt-2" id="step_workTimeOptionRotatingShift" style="height: 0; display: none">
|
||||
<div class="col-12" id="appendChildTimeWorkHtmlRS">
|
||||
|
||||
<div class="d-flex align-items-center justify-content-center my-1 mt-3 @(Model.BreakTime.BreakTimeType == BreakTimeType.None || Model.BreakTime.BreakTimeType == BreakTimeType.WithoutTime ? "disable" : "")" id="computeTime">
|
||||
<div class="position-relative">
|
||||
<label for="hour" class="position-absolute" style="bottom: 25px; font-size: 13px; font-weight: 700; right: 5px; background-color: #fff; padding: 0 4px;">ساعت</label>
|
||||
<select id="hour" asp-for="@Model.BreakTime.BreakTimeValue.Hour" name="selectCheckBreakTime" class="form-select selectCheckBreakTime">
|
||||
<option value="0" selected>ساعت</option>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
</select>
|
||||
</div>
|
||||
<span class="mx-1">:</span>
|
||||
<div class="position-relative">
|
||||
<label for="min" class="position-absolute" style="bottom: 25px; font-size: 13px; font-weight: 700; right: 5px; background-color: #fff; padding: 0 4px;">دقیقه</label>
|
||||
<select id="min" asp-for="@Model.BreakTime.BreakTimeValue.Minute" name="selectCheckBreakTime" class="form-select selectCheckBreakTime">
|
||||
<option value="00" selected>دقیقه</option>
|
||||
<option value="5">5</option>
|
||||
<option value="10">10</option>
|
||||
<option value="15">15</option>
|
||||
<option value="20">20</option>
|
||||
<option value="25">25</option>
|
||||
<option value="30">30</option>
|
||||
<option value="35">35</option>
|
||||
<option value="40">40</option>
|
||||
<option value="45">45</option>
|
||||
<option value="50">50</option>
|
||||
<option value="55">55</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" id="TimeOnly" name="Command.BreakTime.BreakTimeValue" value="@Model.BreakTime.BreakTimeValue.ToString("HH:mm")"/>
|
||||
@* <span class="mx-1" id="computeTimeText"></span> *@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (Model.CustomizeRotatingShifts.Any())
|
||||
{
|
||||
@foreach (var item in Model.CustomizeRotatingShifts)
|
||||
{
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="col-12">
|
||||
<div class="lableCheckBreakTime text-center">وضعیت فعالیت مجموعه در روز های جمعه و تعطیلات رسمی</div>
|
||||
<div class="row extraOptionBorder">
|
||||
|
||||
<div class="col-6 p-0">
|
||||
<div class="group-container">
|
||||
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
|
||||
<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 class="col-6 p-0">
|
||||
<div class="group-container">
|
||||
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های تعطیلات رسمی</div> *@
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="HolidayWork" id="OffDays1" class="form-check-input Main-Radio" @(Model.HolidayWork == HolidayWork.Default ? "checked" : "") value="@((int)(HolidayWork.Default))" />
|
||||
<label for="OffDays1" class="lableCheckBreakTime">پرسنل در ایام تعطیل رسمی کار نمیکند.</label>
|
||||
</div>
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="HolidayWork" id="OffDays2" class="form-check-input Main-Radio" @(Model.HolidayWork == HolidayWork.WorkInHolidays ? "checked" : "") value="@((int)(HolidayWork.WorkInHolidays))" />
|
||||
<label for="OffDays2" class="lableCheckBreakTime">پرسنل در ایام تعطیل رسمی کار میکند.</label>
|
||||
</div>
|
||||
<div class="groupBoxRS">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-3 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">
|
||||
@if (iterationRS == 0)
|
||||
{
|
||||
@("نوبت اول")
|
||||
}
|
||||
else if (iterationRS == 1)
|
||||
{
|
||||
@("نوبت دوم")
|
||||
}
|
||||
else if (iterationRS == 2)
|
||||
{
|
||||
@("نوبت سوم")
|
||||
}
|
||||
else if (iterationRS == 3)
|
||||
{
|
||||
@("نوبت چهارم")
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTimeRS" name="Command.CustomizeRotatingShifts[@iterationRS].StartTime" value="@item.StartTime" placeholder="00:00" style="direction: ltr;" />
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTimeRS" name="Command.CustomizeRotatingShifts[@iterationRS].EndTime" value="@item.EndTime" placeholder="00:00" style="direction: ltr;" />
|
||||
</div>
|
||||
@if (iterationRS == 0)
|
||||
{
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
<button type="button" class="btnRemoveTimeWork">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white" />
|
||||
<path d="M6.875 11H15.125" stroke="white" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@{
|
||||
iterationRS++;
|
||||
}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="groupBoxRS">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-3 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">نوبت اول</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTimeRS" id="startDateTimeRS" name="Command.CustomizeRotatingShifts[0].StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTimeRS" id="endDateTimeRS" name="Command.CustomizeRotatingShifts[0].EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
<div class="col-1 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-center w-100 my-2">
|
||||
<button type="button" class="btnAddTimeWorkRS @(Model.CustomizeRotatingShifts.Count() == 4 ? "d-none" : "")">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white"/>
|
||||
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round"/>
|
||||
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
||||
<div class="container m-0">
|
||||
<div class="row">
|
||||
<div class="col-6 text-end">
|
||||
<button type="button" class="btn-cancel2 d-flex justify-content-center w-100">انصراف</button>
|
||||
@if (Model.CustomizeRotatingShifts.Count() == 1)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWorkRS">افزودن نوبت دوم</div>
|
||||
}
|
||||
else if (Model.CustomizeRotatingShifts.Count() == 2)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWorkRS">افزودن نوبت سوم</div>
|
||||
}
|
||||
else if (Model.CustomizeRotatingShifts.Count() == 3)
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWorkRS">افزودن نوبت چهارم</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mx-1 btnAppendChildTimeWorkRS"></div>
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<p class="m-0" id="ShowSettingMessageRS"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row p-0" id="step_workTimeOptionIrregular" style="height: 0; gap: 12px; @(Model.WorkshopShiftStatus == WorkshopShiftStatus.Regular ? "display: none" : "")">
|
||||
|
||||
<div class="btn-workTimeOption-container align-items-center justify-content-center mt-4">
|
||||
<input type="radio" id="TwelveTwentyFour" value="@WorkshopIrregularShifts.TwelveTwentyFour" name="Command.IrregularShift.WorkshopIrregularShifts" class="radio-workTimeOption" @(Model.IrregularShift.WorkshopIrregularShifts == WorkshopIrregularShifts.TwelveTwentyFour ? "checked" : "")>
|
||||
<label for="TwelveTwentyFour" class="radio-label-workTimeOption w-100 outlineDate">12 ساعت کار 24 ساعت استراحت</label>
|
||||
|
||||
<input type="radio" id="TwentyFourTwentyFour" value="@WorkshopIrregularShifts.TwentyFourTwentyFour" name="Command.IrregularShift.WorkshopIrregularShifts" class="radio-workTimeOption" @(Model.IrregularShift.WorkshopIrregularShifts == WorkshopIrregularShifts.TwentyFourTwentyFour ? "checked" : "")>
|
||||
<label for="TwentyFourTwentyFour" class="radio-label-workTimeOption w-100 outlineDate">24 ساعت کار 24 ساعت استراحت</label>
|
||||
</div>
|
||||
|
||||
<div class="btn-workTimeOption-container align-items-center justify-content-center">
|
||||
<input type="radio" id="TwelveThirtySix" value="@WorkshopIrregularShifts.TwelveThirtySix" name="Command.IrregularShift.WorkshopIrregularShifts" class="radio-workTimeOption" @(Model.IrregularShift.WorkshopIrregularShifts == WorkshopIrregularShifts.TwelveThirtySix ? "checked" : "")>
|
||||
<label for="TwelveThirtySix" class="radio-label-workTimeOption w-100 outlineDate">12 ساعت کار 36 ساعت استراحت</label>
|
||||
|
||||
<input type="radio" id="TwentyFourFortyEight" value="@WorkshopIrregularShifts.TwentyFourFortyEight" name="Command.IrregularShift.WorkshopIrregularShifts" class="radio-workTimeOption" @(Model.IrregularShift.WorkshopIrregularShifts == WorkshopIrregularShifts.TwentyFourFortyEight ? "checked" : "")>
|
||||
<label for="TwentyFourFortyEight" class="radio-label-workTimeOption w-100 outlineDate">24 ساعت کار 48 ساعت استراحت</label>
|
||||
</div>
|
||||
|
||||
<div class="hrLine"></div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="groupBoxIrregular @(Model.WorkshopShiftStatus != WorkshopShiftStatus.Regular ? "" : "disable")" id="irregularShiftsDateTime">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-2 d-flex align-items-center">
|
||||
<div class="timeWorkTitle"></div>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="button" id="btnSave" class="btn-register w-100" onclick="ajaxEditEmployeeSaveData()">ثبت ویرایش</button>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">از</div>
|
||||
<input type="text" class="form-control text-center dateTimeIrregular" id="irregularShiftsStartDateTime" value="@Model.IrregularShift.StartTime.ToString("HH:mm")" name="Command.IrregularShift.StartTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<div class="timeWorkTitle">الی</div>
|
||||
<input type="text" class="form-control text-center dateTimeIrregular" id="irregularShiftsEndDateTime" value="@Model.IrregularShift.EndTime.ToString("HH:mm")" name="Command.IrregularShift.EndTime" placeholder="00:00" style="direction: ltr;">
|
||||
</div>
|
||||
<div class="col-2 d-flex align-items-center justify-content-end">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<div class="container my-2">
|
||||
<div class="row breack-time">
|
||||
<div>
|
||||
<div class="d-flex align-items-center my-1 breakTimeDiv">
|
||||
<input type="checkbox" id="BreakTimeFirst" name="BreakTime.hasBreakTimeValue" class="form-check-input" @(Model.BreakTime.BreakTimeType == BreakTimeType.WithoutTime ? "checked" : "")>
|
||||
<label for="BreakTimeFirst" class="lableCheckBreakTime">
|
||||
این پرسنل دارای ساعت استراحت نامشخص می باشد با انتخاب این تیک پرسنل باید برای استراحت ورود و خروج ثبت کند.
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-block">
|
||||
<div class="d-flex align-items-center my-1 breakTimeDiv">
|
||||
<input type="checkbox" id="BreakTime" name="BreakTime.hasBreakTimeValue" class="form-check-input" @(Model.BreakTime.BreakTimeType == BreakTimeType.WithTime ? "checked" : "")>
|
||||
<label for="BreakTime" class="lableCheckBreakTime">
|
||||
این پرسنل دارای ساعت استراحت ثابت روزانه می باشد که بصورت خودکار در فیش حقوقی محاسبه می گردد:
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center justify-content-center my-1 mt-3 @(Model.BreakTime.BreakTimeType == BreakTimeType.None || Model.BreakTime.BreakTimeType == BreakTimeType.WithoutTime ? "disable" : "")" id="computeTime">
|
||||
<div class="position-relative">
|
||||
<label for="hour" class="position-absolute" style="bottom: 25px; font-size: 13px; font-weight: 700; right: 5px; background-color: #fff; padding: 0 4px;">ساعت</label>
|
||||
<select id="hour" asp-for="@Model.BreakTime.BreakTimeValue.Hour" name="selectCheckBreakTime" class="form-select selectCheckBreakTime">
|
||||
<option value="0" selected>ساعت</option>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
</select>
|
||||
</div>
|
||||
<span class="mx-1">:</span>
|
||||
<div class="position-relative">
|
||||
<label for="min" class="position-absolute" style="bottom: 25px; font-size: 13px; font-weight: 700; right: 5px; background-color: #fff; padding: 0 4px;">دقیقه</label>
|
||||
<select id="min" asp-for="@Model.BreakTime.BreakTimeValue.Minute" name="selectCheckBreakTime" class="form-select selectCheckBreakTime">
|
||||
<option value="00" selected>دقیقه</option>
|
||||
<option value="5">5</option>
|
||||
<option value="10">10</option>
|
||||
<option value="15">15</option>
|
||||
<option value="20">20</option>
|
||||
<option value="25">25</option>
|
||||
<option value="30">30</option>
|
||||
<option value="35">35</option>
|
||||
<option value="40">40</option>
|
||||
<option value="45">45</option>
|
||||
<option value="50">50</option>
|
||||
<option value="55">55</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" id="TimeOnly" name="Command.BreakTime.BreakTimeValue" value="@Model.BreakTime.BreakTimeValue.ToString("HH:mm")"/>
|
||||
@* <span class="mx-1" id="computeTimeText"></span> *@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="col-12">
|
||||
<div class="lableCheckBreakTime text-center">وضعیت فعالیت مجموعه در روز های جمعه و تعطیلات رسمی</div>
|
||||
<div class="row extraOptionBorder">
|
||||
|
||||
<div class="col-6 p-0">
|
||||
<div class="group-container">
|
||||
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های جمعه</div> *@
|
||||
<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 class="col-6 p-0">
|
||||
<div class="group-container">
|
||||
@* <div class="lableCheckBreakTime">وضعیت فعالیت مجموعه در روز های تعطیلات رسمی</div> *@
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="HolidayWork" id="OffDays1" class="form-check-input Main-Radio" @(Model.HolidayWork == HolidayWork.Default ? "checked" : "") value="@((int)(HolidayWork.Default))" />
|
||||
<label for="OffDays1" class="lableCheckBreakTime">پرسنل در ایام تعطیل رسمی کار نمیکند.</label>
|
||||
</div>
|
||||
<div class="d-flex form-group my-1 group">
|
||||
<input type="radio" name="HolidayWork" id="OffDays2" class="form-check-input Main-Radio" @(Model.HolidayWork == HolidayWork.WorkInHolidays ? "checked" : "") value="@((int)(HolidayWork.WorkInHolidays))" />
|
||||
<label for="OffDays2" class="lableCheckBreakTime">پرسنل در ایام تعطیل رسمی کار میکند.</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="container m-0">
|
||||
<div class="row">
|
||||
<div class="col-6 text-end">
|
||||
<button type="button" class="btn-cancel2 d-flex justify-content-center w-100">انصراف</button>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="button" id="btnSave" class="btn-register w-100 position-relative" onclick="ajaxEditEmployeeSaveData()">
|
||||
<span class="text-nowrap">ثبت ویرایش</span>
|
||||
<div class="spinner-loading loading" style="display: none;">
|
||||
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- مودال -->
|
||||
<div id="ConfirmModal" style="display: none" data-bs-backdrop="static" aria-hidden="true" tabindex="-1">
|
||||
<div class="modal-dialog modal-dialog-centered ConfirmSection">
|
||||
<div class="" id="ModalConfirmChange">
|
||||
<partial name="_Partials/ConfirmEmployeeTimeChangeModal" model="Model.EmployeeFullName" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- مودال -->
|
||||
|
||||
|
||||
<script src="~/assetsclient/libs/cleave/cleave.min.js"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
||||
var ajaxPostChangeEditEmployee = `@Url.Page("./Grouping", "ChangeEditEmployee")`;
|
||||
var ajaxReCalculateValuesUrl = `@Url.Page("./Grouping", "ReCalculateValues")`;
|
||||
var ajaxEmployeeSettingsHasChangedValueUrl = `@Url.Page("./Grouping", "EmployeeSettingsHasChangedValue")`;
|
||||
|
||||
var indexShiftViewModel = Number(@iteration);
|
||||
var indexShiftViewModelRS = Number(@iterationRS);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<label for="organized" class="radio-label-workTimeOption w-100">منظم</label>
|
||||
|
||||
<input type="radio" value="Rotating" name="workshopShiftStatus" id="rotating_shift" class="radio-workTimeOption">
|
||||
<label for="rotating_shift" class=" radio-label-workTimeOption w-100" >گردشی</label>
|
||||
<label for="rotating_shift" class="radio-label-workTimeOption w-100">گردشی</label>
|
||||
|
||||
<input type="radio" value="Irregular" name="workshopShiftStatus" id="disorganized" class="radio-workTimeOption">
|
||||
<label for="disorganized" class="radio-label-workTimeOption w-100">مختلط</label>
|
||||
@@ -257,7 +257,7 @@
|
||||
}
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-center w-100 my-2">
|
||||
<button type="button" class="btnAddTimeWorkRS @(Model.ShiftViewModel.Count() == 4 ? "d-none" : "")">
|
||||
<button type="button" class="btnAddTimeWorkRS @(Model.CustomizeRotatingShiftsViewModels.Count() == 4 ? "d-none" : "")">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="11" cy="11" r="8.25" stroke="white"/>
|
||||
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round"/>
|
||||
@@ -439,7 +439,12 @@
|
||||
<button type="button" class="btn-cancel2 d-flex align-items-center justify-content-center w-100">انصراف</button>
|
||||
</div>
|
||||
<div class="col-6 text-start">
|
||||
<button type="button" id="btnSave" class="btn-register d-flex align-items-center justify-content-center w-100" onclick="ajaxEditGroupingSaveData()">ثبت ویرایش</button>
|
||||
<button type="button" id="btnSave" class="btn-register d-flex align-items-center justify-content-center w-100" onclick="ajaxEditGroupingSaveData()">
|
||||
<span class="text-nowrap">ثبت ویرایش</span>
|
||||
<div class="spinner-loading loading" style="display: none;">
|
||||
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -457,6 +462,17 @@
|
||||
</div>
|
||||
<!-- مودال -->
|
||||
|
||||
|
||||
<!-- مودال تاییده -->
|
||||
<div id="ConfirmModal" style="display: none">
|
||||
<div class="modal-dialog modal-dialog-centered ConfirmSection">
|
||||
<div class="" id="ModalConfirmChange">
|
||||
<partial name="_Partials/ConfirmEditGroupTimeChangeModal" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- مودال تاییده -->
|
||||
|
||||
<script src="~/assetsclient/libs/cleave/cleave.min.js"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
@@ -468,6 +484,7 @@
|
||||
var groupId = Number(@Model.Id);
|
||||
|
||||
var IsRegularWorkshop = @(Model.WorkshopShiftStatus == WorkshopShiftStatus.Regular ? 0 : Model.WorkshopShiftStatus == WorkshopShiftStatus.Irregular ? 1 : 2);
|
||||
var ajaxReCalculateValuesUrl = `@Url.Page("./Grouping", "ReCalculateValues")`;
|
||||
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/modaleditgroup.js?ver=@clientVersion"></script>
|
||||
@@ -0,0 +1,65 @@
|
||||
@using _0_Framework.Application
|
||||
@{
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
<link href="~/assetsclient/pages/RollCall/css/ConfirmEditGroupTimeChangeModal.css?ver=@clientVersion" rel="stylesheet" />
|
||||
}
|
||||
|
||||
<div class="modal-content" style="height: auto;" id="modalEmplyeeTimeChange" style="display: none">
|
||||
<div class="modal-header d-block text-center position-relative">
|
||||
<button type="button" class="btn-close position-absolute text-start closeConfirmModal2"></button>
|
||||
<div class="modal-header d-flex flex-column " id="morakhasiEstehghaghiModalLabel" style="font-size: 19px; padding: 0 20px !important;">
|
||||
<span class="header-title mb-4 "> تغییرات ساعت کار پرسنل به صورت گروهی : </span>
|
||||
<span class="header-description">
|
||||
تاریخ تغییرات ساعت کاری را میتوانید بصورت انفرادی در منوی
|
||||
ذیل انجام دهید :
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-body pt-0">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="cardModal2">
|
||||
|
||||
<div class="cardModal2-content">
|
||||
<div class="Table d-flex flex-column gap-2">
|
||||
<div class="TableHeader d-flex w-100 justify-content-between align-items-center px-3 " style="background: linear-gradient(180deg, #41D1D1 0%, #2CD0D0 100%); height: 49px; border-radius: 5px; position: sticky;top: 0; ">
|
||||
|
||||
<div class="d-flex gap-3">
|
||||
<div class="TableHeaderCell text-white" style="font-size: 14px; font-weight: 400">ردیف</div>
|
||||
<div class="TableHeaderCell text-white" style="font-size: 14px; font-weight: 400">نام پرسنل</div>
|
||||
</div>
|
||||
|
||||
<input
|
||||
id="initialDateInput"
|
||||
type="text" value="" class="form-control m-0 py-0 dateInput" style="width: 120px; height: 36px; text-align: center; font-size: 16px; color: #5C5C5C; font-weight: 500; border: 2px solid #C6C6C6; direction: ltr">
|
||||
|
||||
</div>
|
||||
|
||||
@* load employees *@
|
||||
<div class="TableRow d-flex flex-column gap-2" id="employeeTable">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer d-flex gap-2 justify-content-center pt-0 pb-3">
|
||||
<button class="btn-quit flex-grow-1 closeConfirmModal2">انصراف</button>
|
||||
<button class="btn-confirm flex-grow-1" onclick="ajaxSaveSubmit()">
|
||||
<span>تایید</span>
|
||||
<div class="spinner-loading loading" style="display: none;">
|
||||
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
||||
var dateNow = `@DateTime.Now.ToFarsi()`;
|
||||
var loadEmployeesIsSettingChangeAjax = '@Url.Page("./Grouping", "EmployeeIsChangeList")';
|
||||
</script>
|
||||
@@ -23,11 +23,11 @@
|
||||
<div class="mt-3 d-flex align-items-center justify-content-between">
|
||||
<p class="m-0">آیا تغییرات کنونی شامل پرسنل بالا بشود؟</p>
|
||||
<div class="form-group my-1">
|
||||
<input type="radio" name="IsShiftChanged" id="YesConfirm" class="form-check-input" value="true" />
|
||||
<input type="radio" name="IsShiftChanged" id="YesConfirm" class="form-check-input modal2" value="true" />
|
||||
<label for="YesConfirm">بله</label>
|
||||
</div>
|
||||
<div class="form-group my-1">
|
||||
<input type="radio" name="IsShiftChanged" id="NotConfirm" class="form-check-input" value="false"/>
|
||||
<input type="radio" name="IsShiftChanged" id="NotConfirm" class="form-check-input modal2" value="false" />
|
||||
<label for="NotConfirm">خیر</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,6 +41,7 @@
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="position-relative">
|
||||
@* ajaxConfirm() *@
|
||||
<button type="button" class="btn-primary w-100 disable" id="finalSaveRollCallSetting" onclick="ajaxSaveSubmit()">ثبت نهایی</button>
|
||||
<div class="spinner-loading loading" style="display: none;">
|
||||
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
||||
@@ -55,6 +56,7 @@
|
||||
|
||||
<script>
|
||||
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
||||
var loadEmployeesIsSettingChangeAjax = '@Url.Page("./Grouping", "EmployeeIsChangeList")';
|
||||
var loadEmployeesIsSettingChangeAjax = '@Url.Page("./Grouping", "EmployeeIsChangeList")';
|
||||
var ajaxEmployeesHaveToChangeUrl = `@Url.Page("./Grouping", "EmployeesHaveToChange")`;
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/rollcall/js/confirmemployeechange.js?ver=@clientVersion"></script>
|
||||
@@ -0,0 +1,65 @@
|
||||
@model string
|
||||
@using _0_Framework.Application
|
||||
@{
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
<link href="~/assetsclient/pages/RollCall/css/ConfirmEmployeeTimeChangeModal.css?ver=@clientVersion" rel="stylesheet" />
|
||||
}
|
||||
|
||||
|
||||
<div class="modal-content" style="height: auto;" id="modalConfirm">
|
||||
|
||||
<div class="modal-header d-block text-center position-relative">
|
||||
<button type="button" class="btn-close position-absolute text-start closeConfirmModal"></button>
|
||||
<div class="modal-title d-flex flex-column justify-content-center " id="morakhasiEstehghaghiModalLabel" style="font-size: 19px;">
|
||||
<div class="header-title"> تغییرات ساعت کاری پرسنل</div>
|
||||
<div class="header-title">@Model</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="card">
|
||||
|
||||
<div class="card-content">
|
||||
<h3 class="card-title">از تاریخ ذیل تغییرات اعمال میگردد</h3>
|
||||
<div class="flex-container d-flex justify-content-center align-items-center">
|
||||
<input type="text" class="form-control m-0 py-0 dateModal" name="Command.FromDate"
|
||||
style="width: 120px; height: 36px; text-align: center; font-size: 16px; color: #5C5C5C; font-weight: 500; border: 2px solid #C6C6C6; direction: ltr">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer d-flex gap-2 justify-content-center">
|
||||
<button class="btn-quit flex-grow-1 closeConfirmModal">انصراف</button>
|
||||
<button class="btn-confirm flex-grow-1 position-relative" onclick="postChangeEditEmployee()">
|
||||
<span class="text-nowrap">تایید</span>
|
||||
<div class="spinner-loading loading" id="ConfirmRecalculationLoading" style="display: none;">
|
||||
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
||||
var dateNow = `@DateTime.Now.ToFarsi()`;
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
new Cleave('.dateModal', {
|
||||
date: true,
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
|
||||
$('.dateModal').val(dateNow);
|
||||
|
||||
$(".closeConfirmModal").on("click", function () {
|
||||
$('#ConfirmModal').hide();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
@@ -8,6 +8,13 @@
|
||||
.modal .modal-dialog .modal-content{
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.disable {
|
||||
filter: grayscale(100%);
|
||||
pointer-events: none;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
@media(min-width: 1650px) {
|
||||
.modal-dialog {
|
||||
margin: auto;
|
||||
@@ -74,7 +81,7 @@
|
||||
}
|
||||
|
||||
.form {
|
||||
position: absolute;
|
||||
/*position: absolute;*/
|
||||
font-size: 1.2rem;
|
||||
width: 100%;
|
||||
}
|
||||
@@ -135,17 +142,31 @@
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.form1, .listForm1 {
|
||||
.formInit {
|
||||
margin-top: 30px;
|
||||
width: 96%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.formInit .formSection {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 30px;
|
||||
height: 45vh;
|
||||
}
|
||||
|
||||
.form1, .listForm1 {
|
||||
/*left: 1200px;*/
|
||||
margin-top: 30px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.form2, .listForm2 {
|
||||
left: 1200px;
|
||||
/*left: 1200px;*/
|
||||
margin-top: 30px;
|
||||
}
|
||||
.form3, .listForm3 {
|
||||
right: 1200px;
|
||||
/*right: 1200px;*/
|
||||
padding: 0 10px;
|
||||
margin: 0;
|
||||
margin-top: 30px;
|
||||
@@ -188,13 +209,15 @@
|
||||
padding: 7px;
|
||||
text-align: center;
|
||||
margin: 0 3px 0 3px;
|
||||
width: 33.33%;
|
||||
/*width: 33.33%;*/
|
||||
width: 25%;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.progressBar {
|
||||
position: absolute;
|
||||
width: 33.33%;
|
||||
/*width: 33.33%;*/
|
||||
width: 25%;
|
||||
background: linear-gradient(90deg, rgba(15,149,0,1) 0%, rgba(53,189,37,1) 18%, rgba(68,207,52,1) 47%, rgba(73,214,57,1) 82%, rgba(15,149,0,1) 100%);
|
||||
height: 103%;
|
||||
right: -1px;
|
||||
|
||||
827
ServiceHost/wwwroot/AdminTheme/css/personelEdit.css
Normal file
827
ServiceHost/wwwroot/AdminTheme/css/personelEdit.css
Normal file
@@ -0,0 +1,827 @@
|
||||
.modal-dialog {
|
||||
width: 55%;
|
||||
margin: 30px auto;
|
||||
}
|
||||
|
||||
#MainModal {
|
||||
backdrop-filter: blur(8px);
|
||||
}
|
||||
|
||||
.modal .modal-dialog .modal-content {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
@media(min-width: 1650px) {
|
||||
.modal-dialog {
|
||||
margin: auto;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%) !important;
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1580px) {
|
||||
.modal-dialog {
|
||||
width: 60%;
|
||||
}
|
||||
}
|
||||
|
||||
.modal .modal-dialog .modal-content {
|
||||
border-radius: 18px;
|
||||
min-height: 68rem;
|
||||
background: #ebebeb;
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
.modal .modal-dialog .modal-content {
|
||||
min-height: 80rem;
|
||||
}
|
||||
}
|
||||
|
||||
.form-box {
|
||||
position: relative;
|
||||
padding: 40px 20px;
|
||||
top: 5rem;
|
||||
border: 1px solid #d1d1d1;
|
||||
position: relative;
|
||||
border-radius: 1rem;
|
||||
overflow: hidden;
|
||||
min-height: 57rem;
|
||||
}
|
||||
|
||||
.main-title {
|
||||
position: absolute;
|
||||
width: 17rem;
|
||||
font-size: 1.7rem;
|
||||
background-color: inherit;
|
||||
left: 49%;
|
||||
top: 7px;
|
||||
margin-left: -100px;
|
||||
text-align: center;
|
||||
color: black;
|
||||
border: 1px solid #00000030;
|
||||
border-radius: 9px;
|
||||
padding: 2px 0px;
|
||||
}
|
||||
|
||||
.ltr {
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
.close {
|
||||
margin-top: 12px;
|
||||
margin-left: -19px;
|
||||
font-size: 26px;
|
||||
position: absolute;
|
||||
right: 25px;
|
||||
}
|
||||
|
||||
.form {
|
||||
position: absolute;
|
||||
font-size: 1.2rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.input-type {
|
||||
padding: 0px 8px;
|
||||
}
|
||||
|
||||
.nationality-type {
|
||||
padding: 0.7px 4px;
|
||||
}
|
||||
|
||||
.duty-condition {
|
||||
position: relative;
|
||||
top: -5px;
|
||||
}
|
||||
|
||||
.loc-box {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.loc-text {
|
||||
height: 182px;
|
||||
}
|
||||
|
||||
.insInput {
|
||||
background-color: #d4e9ff;
|
||||
}
|
||||
|
||||
.insInputDate label {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.content-fieldset {
|
||||
width: 95%;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.radio-sections {
|
||||
padding: 15px 7px !important;
|
||||
background: #ffffff6b;
|
||||
border-radius: 7px;
|
||||
border: 1px solid #0000004a;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: space-evenly;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.form1 .form-group, .listForm1 .form-group {
|
||||
justify-content: space-around;
|
||||
padding: 15px 5px 15px 0;
|
||||
border: 1px solid #e3e3e3;
|
||||
box-shadow: 0px 0px 4px 0px #a7a7a7;
|
||||
background: #e5e5e5;
|
||||
border-radius: 7px;
|
||||
margin: 0;
|
||||
margin-bottom: 15px !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.form1, .listForm1 {
|
||||
margin-top: 30px;
|
||||
width: 96%;
|
||||
}
|
||||
|
||||
.form2, .listForm2 {
|
||||
left: 1200px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.form3, .listForm3 {
|
||||
right: 1200px;
|
||||
padding: 0 10px;
|
||||
margin: 0;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.flexible-wrap {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.form3 legend, .listForm3 legend {
|
||||
margin-bottom: 5px;
|
||||
font-size: 16px;
|
||||
border-bottom: 0px;
|
||||
color: #505458;
|
||||
width: 130px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.form3 fieldset, .listForm3 fieldset {
|
||||
border: 1px solid #999797;
|
||||
border-radius: 10px;
|
||||
padding: 5px 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.steps {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row-reverse;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0;
|
||||
height: 42px;
|
||||
border: 1px solid #36292947;
|
||||
border-top-right-radius: 7px;
|
||||
border-top-left-radius: 7px;
|
||||
box-shadow: 0 2px 5px 0 rgb(104 106 106 / 49%), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
.step {
|
||||
padding: 7px;
|
||||
text-align: center;
|
||||
margin: 0 3px 0 3px;
|
||||
width: 33.33%;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.progressBar {
|
||||
position: absolute;
|
||||
width: 33.33%;
|
||||
background: linear-gradient(90deg, rgba(15,149,0,1) 0%, rgba(53,189,37,1) 18%, rgba(68,207,52,1) 47%, rgba(73,214,57,1) 82%, rgba(15,149,0,1) 100%);
|
||||
height: 103%;
|
||||
right: -1px;
|
||||
top: -1px;
|
||||
transition: 1s;
|
||||
}
|
||||
|
||||
.progressBar:after {
|
||||
content: '';
|
||||
border-top: 20px solid transparent;
|
||||
border-bottom: 20px solid transparent;
|
||||
position: absolute;
|
||||
left: -19px;
|
||||
top: 1px;
|
||||
border-right: 20px solid #0f9500;
|
||||
}
|
||||
|
||||
.radio-box {
|
||||
font-size: 12px;
|
||||
border-radius: 10px;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(15, 1fr);
|
||||
}
|
||||
|
||||
.radio-label {
|
||||
grid-column: 1/7;
|
||||
grid-row: 1;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.radio-input {
|
||||
grid-column: 7 / 16;
|
||||
grid-row: 1;
|
||||
text-align: left;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(15, 1fr);
|
||||
}
|
||||
|
||||
.radio-input label:first-child {
|
||||
grid-column: 1 / 8;
|
||||
}
|
||||
|
||||
.radio-input label:nth-child(2) {
|
||||
grid-column: 8 / 16;
|
||||
}
|
||||
|
||||
.radio-input.nationality {
|
||||
grid-column: 5 / 16;
|
||||
}
|
||||
|
||||
.radio-input.nationality label:first-child {
|
||||
grid-column: 1 / 7;
|
||||
}
|
||||
|
||||
.radio-input.nationality label:nth-child(2) {
|
||||
grid-column: 7 / 16;
|
||||
}
|
||||
|
||||
.form-box input[type="radio"] {
|
||||
margin: 2px 0px;
|
||||
}
|
||||
|
||||
.form-box .radio-input input[type="radio"] {
|
||||
margin: 0 4px 0px 4px;
|
||||
transform: translate(0px,4px);
|
||||
}
|
||||
|
||||
.inputs-box {
|
||||
float: left;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.inputs {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.input {
|
||||
border: 1px solid #0000004a;
|
||||
border-radius: 7px;
|
||||
padding: 7px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.input:focus {
|
||||
box-shadow: 0 2px 5px 0 rgb(136 137 141), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
|
||||
#save {
|
||||
background-color: #0f9500;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#close {
|
||||
background-color: white;
|
||||
color: #323030;
|
||||
}
|
||||
|
||||
.btn-modal {
|
||||
padding: 1rem 0;
|
||||
border-radius: 20px;
|
||||
border: none;
|
||||
font-size: 12px;
|
||||
width: 9rem;
|
||||
}
|
||||
|
||||
.btns {
|
||||
position: absolute;
|
||||
display: inline-flex;
|
||||
bottom: 12px;
|
||||
width: 100%;
|
||||
justify-content: flex-end;
|
||||
margin-right: 50px;
|
||||
}
|
||||
|
||||
.btns-2 {
|
||||
bottom: 15px;
|
||||
margin-right: 17px;
|
||||
}
|
||||
|
||||
.btn-modal.pre, .btn-modal.listPrev {
|
||||
border-top-left-radius: 0px;
|
||||
border-bottom-left-radius: 0px;
|
||||
background-color: #c7c0c0ba;
|
||||
color: #000000b8;
|
||||
margin-left: -4px;
|
||||
}
|
||||
|
||||
.btn-modal.next, .btn-modal.listNext {
|
||||
border-top-right-radius: 0px;
|
||||
border-bottom-right-radius: 0px;
|
||||
margin-left: -4px;
|
||||
border-right: 1px solid #817b7b;
|
||||
background-color: white;
|
||||
color: #1e88b3;
|
||||
}
|
||||
|
||||
.btns-left {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.btn-rounded {
|
||||
border-radius: 2em;
|
||||
padding: 6px 10px;
|
||||
}
|
||||
|
||||
.form-footer-btns {
|
||||
position: absolute;
|
||||
bottom: 5px;
|
||||
left: 40%;
|
||||
}
|
||||
|
||||
.form-footer {
|
||||
padding: 15px;
|
||||
text-align: right;
|
||||
float: left;
|
||||
border-top: 0;
|
||||
position: absolute;
|
||||
bottom: -5px;
|
||||
left: 5px;
|
||||
}
|
||||
|
||||
#divEdit .form-footer {
|
||||
bottom: 5px;
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
.children-box {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
#children-container {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 18rem;
|
||||
overflow-y: auto;
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: #f2f2f2 transparent;
|
||||
direction: ltr;
|
||||
border: 1px solid #9b97976e;
|
||||
border-radius: 10px 10px 7px 7px;
|
||||
padding: 10px 0;
|
||||
background-color: #dbdadaba;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
#children {
|
||||
border-collapse: separate !important;
|
||||
position: relative;
|
||||
top: -10px;
|
||||
width: 100%;
|
||||
background: whitesmoke;
|
||||
text-align: center;
|
||||
border-radius: 10px;
|
||||
border: none !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
#children th {
|
||||
text-align: center;
|
||||
color: white;
|
||||
position: sticky;
|
||||
top: -10px;
|
||||
z-index: 20;
|
||||
background-color: #404040;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
#children th, td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
#children th:nth-child(2n) {
|
||||
border-left: 1px solid #fff;
|
||||
}
|
||||
|
||||
#children tr:nth-child(2n) {
|
||||
background-color: #e3e3e3;
|
||||
}
|
||||
|
||||
#children th:nth-child(2n) {
|
||||
border-left: 1px solid #fff;
|
||||
}
|
||||
|
||||
|
||||
#children td:nth-child(2n) {
|
||||
border-left: 1px solid #fff;
|
||||
border-right: 1px solid #9b979721;
|
||||
}
|
||||
|
||||
#children td:nth-child(2n+1) {
|
||||
border-left: 1px solid #9b979721;
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
#children td {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#children th:first-child {
|
||||
border-radius: 7px 0px 0px 0px;
|
||||
-moz-border-radius: 7px 0px 0px 0px;
|
||||
-webkit-border-radius: 7px 0px 0px 0px;
|
||||
}
|
||||
|
||||
#children th:last-child {
|
||||
border-left: 1px solid #fff;
|
||||
border-radius: 0px 7px 0 0;
|
||||
-moz-border-radius: 0px 7px 0 0;
|
||||
-webkit-border-radius: 0px 7px 0 0;
|
||||
}
|
||||
|
||||
#children tbody tr {
|
||||
min-height: 68px;
|
||||
}
|
||||
|
||||
#children-container.hide-scrollbar::-webkit-scrollbar {
|
||||
width: 0px;
|
||||
}
|
||||
|
||||
#children-container::-webkit-scrollbar {
|
||||
width: 7px;
|
||||
height: 5px;
|
||||
}
|
||||
|
||||
#children-container::-webkit-scrollbar-track {
|
||||
background-color: #f2f2f2;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
#children-container::-webkit-scrollbar-thumb {
|
||||
background-color: #ccc;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
#children-container::-webkit-scrollbar-thumb:hover {
|
||||
background-color: #aaa;
|
||||
}
|
||||
|
||||
.children-box .add {
|
||||
cursor: pointer;
|
||||
padding: 8px 6px;
|
||||
border-radius: 16px;
|
||||
border: 2px solid #0f9500;
|
||||
background: white;
|
||||
color: #0f9500;
|
||||
font-size: 10px;
|
||||
width: 9rem;
|
||||
}
|
||||
|
||||
.d-flex {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.trash {
|
||||
color: #c91d1d;
|
||||
font-size: 22px;
|
||||
position: relative;
|
||||
left: -7px;
|
||||
top: 5px;
|
||||
}
|
||||
|
||||
.add:hover {
|
||||
background: #0f9500;
|
||||
color: white;
|
||||
border: 2px solid #0f9500;
|
||||
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
.items, .items1 {
|
||||
border: 1px solid #c7c7c7;
|
||||
border-radius: 5px;
|
||||
padding: 5px 0px;
|
||||
background-color: white;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.green {
|
||||
background-color: #e0ffe0;
|
||||
}
|
||||
|
||||
.modal-content2 {
|
||||
background-color: whitesmoke;
|
||||
border: 1px solid #a5a5a59e;
|
||||
border-radius: 18px;
|
||||
margin-top: 300px;
|
||||
padding: 0px 30px;
|
||||
}
|
||||
|
||||
.modal .modal-dialoge .modal-content2 .modal-body {
|
||||
padding: 50px 20px;
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
.modal-dialoge {
|
||||
padding: 0px 180px;
|
||||
}
|
||||
|
||||
.error-icon {
|
||||
position: absolute;
|
||||
left: 15px;
|
||||
top: 40px;
|
||||
font-size: 16px;
|
||||
color: red;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
font-size: 1rem;
|
||||
color: red;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.input-div {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.education {
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
.errored, .patternMisMatch {
|
||||
animation: shake 300ms;
|
||||
box-shadow: inset 0 0 2px #eb3434, 0 0 5px #eb3434 !important;
|
||||
border: 1px solid #eb3434 !important;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
@media (max-width: 1550px) and (min-width:1441px) {
|
||||
.education {
|
||||
height: 33px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1550px) {
|
||||
.modal-content {
|
||||
height: 680px !important;
|
||||
}
|
||||
|
||||
.box {
|
||||
font-size: 12px;
|
||||
height: 575px;
|
||||
top: 40px;
|
||||
}
|
||||
|
||||
.inputs {
|
||||
padding: 6px 8px;
|
||||
}
|
||||
|
||||
.btn-modal {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.main-title {
|
||||
width: 185px;
|
||||
font-size: 17px;
|
||||
left: 52%;
|
||||
top: 5px;
|
||||
}
|
||||
|
||||
.trash {
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@media (max-width: 1440px) {
|
||||
|
||||
#progress:after {
|
||||
border-top: 17px solid transparent;
|
||||
border-bottom: 17px solid transparent;
|
||||
}
|
||||
|
||||
.inputs {
|
||||
padding: 8px 10px;
|
||||
}
|
||||
|
||||
.education {
|
||||
height: 29px;
|
||||
}
|
||||
|
||||
.btn-modal {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.main-title {
|
||||
width: 169px;
|
||||
font-size: 15px;
|
||||
left: 53%;
|
||||
top: 3px;
|
||||
}
|
||||
|
||||
.radio-sections {
|
||||
padding: 8px 5px !important;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.nationality-type {
|
||||
padding: 0px 2px;
|
||||
}
|
||||
|
||||
.input-type {
|
||||
padding: 0px 5px;
|
||||
}
|
||||
|
||||
.duty-condition {
|
||||
top: -9px;
|
||||
}
|
||||
|
||||
.loc-box {
|
||||
margin-top: 9px;
|
||||
}
|
||||
|
||||
#children-container, .loc-text {
|
||||
height: 136px;
|
||||
}
|
||||
|
||||
#children th, td {
|
||||
padding: 5px 8px;
|
||||
}
|
||||
|
||||
#children th {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.radio-box {
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
.form-box {
|
||||
min-height: 69rem;
|
||||
}
|
||||
|
||||
.form1, .listForm1 {
|
||||
width: 93%;
|
||||
}
|
||||
|
||||
.radio-input.nationality label:first-child {
|
||||
grid-column: 1 / 9;
|
||||
}
|
||||
|
||||
.radio-input.nationality label:nth-child(2) {
|
||||
grid-column: 9 / 16;
|
||||
}
|
||||
|
||||
#employee-panel .name-th {
|
||||
max-width: 55px;
|
||||
}
|
||||
|
||||
#employee-panel .Lname-th {
|
||||
max-width: 85px;
|
||||
}
|
||||
|
||||
#employee-panel .code-th {
|
||||
max-width: 55px;
|
||||
}
|
||||
|
||||
#employee-panel .insurance-th {
|
||||
max-width: 50px;
|
||||
}
|
||||
|
||||
#employee-panel #datatable tbody tr td {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.modal-dialog {
|
||||
width: 75%;
|
||||
}
|
||||
/* .operationBtns a {
|
||||
width: 3.8rem;
|
||||
height: 3.6rem;
|
||||
}*/
|
||||
#employee-panel .code-th {
|
||||
max-width: 65px;
|
||||
}
|
||||
|
||||
#employee-panel .Lname-th {
|
||||
max-width: 75px;
|
||||
}
|
||||
|
||||
.Lname-td .fulltext {
|
||||
max-width: 68px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.form-box {
|
||||
min-height: 85rem;
|
||||
padding: 40px 10px;
|
||||
}
|
||||
|
||||
.radio-box, .step {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.modal .modal-dialog .modal-content {
|
||||
min-height: 96rem;
|
||||
}
|
||||
|
||||
.form1 .form-group, .listForm1 .form-group {
|
||||
padding: 8px 5px 8px 0;
|
||||
}
|
||||
|
||||
.modal-dialog {
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.form3 fieldset, .listForm3 fieldset {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.form {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.input-type {
|
||||
padding: 0px 3px;
|
||||
}
|
||||
|
||||
.loc-text {
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
.radio-input.nationality, .radio-input {
|
||||
grid-column: 5 / 16;
|
||||
}
|
||||
|
||||
.radio-input.nationality label:first-child {
|
||||
grid-column: 1 / 8;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) and (min-width:490px ) {
|
||||
.Lname-td .fulltext {
|
||||
max-width: 80px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 450px) {
|
||||
.form-box {
|
||||
min-height: 86rem;
|
||||
}
|
||||
|
||||
.form-footer-btns {
|
||||
left: 25%;
|
||||
}
|
||||
|
||||
.name-td .fulltext {
|
||||
max-width: 75px;
|
||||
}
|
||||
|
||||
.modal .modal-dialog .modal-content {
|
||||
min-height: 96rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 390px) {
|
||||
|
||||
.name-td .fulltext {
|
||||
max-width: 65px;
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,40 @@ var idCardPage3;
|
||||
var idCardPage4;
|
||||
var uploadFileCount = UploadedCount;
|
||||
var command = [];
|
||||
var allPicture = [
|
||||
{
|
||||
'label': 0,
|
||||
'changeImage': false
|
||||
},
|
||||
{
|
||||
'label': 1,
|
||||
'changeImage': false
|
||||
},
|
||||
{
|
||||
'label': 2,
|
||||
'changeImage': false
|
||||
},
|
||||
{
|
||||
'label': 3,
|
||||
'changeImage': false
|
||||
},
|
||||
{
|
||||
'label': 4,
|
||||
'changeImage': false
|
||||
},
|
||||
{
|
||||
'label': 5,
|
||||
'changeImage': false
|
||||
},
|
||||
{
|
||||
'label': 6,
|
||||
'changeImage': false
|
||||
},
|
||||
{
|
||||
'label': 7,
|
||||
'changeImage': false
|
||||
},
|
||||
]
|
||||
|
||||
var pendingMessage = `<div class="pendingMessage">بررسی</div>`;
|
||||
var pendingIcon = `<svg width="24" height="24" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11 19.25C15.5563 19.25 19.25 15.5563 19.25 11C19.25 6.44365 15.5563 2.75 11 2.75C6.44365 2.75 2.75 6.44365 2.75 11C2.75 15.5563 6.44365 19.25 11 19.25Z" fill="#FDBA74"/><path d="M11.4168 14.6667C11.4168 14.8968 11.2303 15.0833 11.0002 15.0833C10.77 15.0833 10.5835 14.8968 10.5835 14.6667C10.5835 14.4365 10.77 14.25 11.0002 14.25C11.2303 14.25 11.4168 14.4365 11.4168 14.6667Z" fill="white" stroke="white"/><path d="M11 11.916V6.41602V11.916Z" fill="white"/><path d="M11 11.916V6.41602" stroke="white" stroke-width="1.5" stroke-linecap="round"/></svg>`;
|
||||
@@ -191,10 +225,14 @@ $(document).ready(function () {
|
||||
} else {
|
||||
let picturesPart = {
|
||||
Label: label,
|
||||
PictureFile: newFile
|
||||
PictureFile: newFile,
|
||||
};
|
||||
command.push(picturesPart);
|
||||
}
|
||||
|
||||
var getChangeIndex = allPicture.findIndex(item => item.label === indexFileValue);
|
||||
allPicture[getChangeIndex].changeImage = true;
|
||||
|
||||
};
|
||||
|
||||
reader.readAsDataURL(fileInputFile);
|
||||
@@ -348,12 +386,15 @@ $(document).ready(function () {
|
||||
.then(res => res.blob())
|
||||
.then(blob => {
|
||||
|
||||
var getChangeIndex = allPicture.findIndex(item => item.label === indexFileValue);
|
||||
|
||||
const fileName = `image_${indexFileValue || Date.now()}.png`;
|
||||
const newFile = new File([blob], fileName, { type: blob.type });
|
||||
|
||||
const picturesPart = {
|
||||
Label: label,
|
||||
PictureFile: newFile
|
||||
PictureFile: newFile,
|
||||
WithoutPicture: allPicture[getChangeIndex].changeImage === true ? false : true
|
||||
};
|
||||
|
||||
const existingIndex = command.findIndex(item => item.Label === label);
|
||||
@@ -363,6 +404,8 @@ $(document).ready(function () {
|
||||
command.push(picturesPart);
|
||||
}
|
||||
|
||||
console.log(command);
|
||||
|
||||
$button.addClass('disable');
|
||||
|
||||
pdBox.addClass('pending');
|
||||
@@ -658,6 +701,9 @@ function uploadCanvasAsFile(canvas, fileName, indexFileValue, label) {
|
||||
command.push(picturesPart);
|
||||
}
|
||||
|
||||
var getChangeIndex = allPicture.findIndex(item => item.label === indexFileValue);
|
||||
allPicture[getChangeIndex].changeImage = true;
|
||||
|
||||
showLoadingAnimation(indexFileValue);
|
||||
|
||||
}, "image/png");
|
||||
@@ -749,6 +795,7 @@ function saveSubmit(id) {
|
||||
command.forEach((item, index) => {
|
||||
formData.append(`command[${index}].Label`, item.Label);
|
||||
formData.append(`command[${index}].PictureFile`, item.PictureFile);
|
||||
formData.append(`command[${index}].WithoutPicture`, item.WithoutPicture);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
#modalEmplyeeTimeChange {
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.sweet-alert {
|
||||
font-family: 'IranSans' !important
|
||||
}
|
||||
|
||||
#ConfirmModal {
|
||||
width: 100%;
|
||||
background: #00000085;
|
||||
position: fixed;
|
||||
height: 100vh;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 20000;
|
||||
}
|
||||
|
||||
.ConfirmSection {
|
||||
max-width: max-content;
|
||||
}
|
||||
|
||||
|
||||
.btn-add {
|
||||
font-size: 10px;
|
||||
font-weight: 500;
|
||||
background-color: #84CC16;
|
||||
color: #FFFFFF;
|
||||
border-radius: 7px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
transition: ease-in-out .3s;
|
||||
margin: 0 5px 0 0;
|
||||
}
|
||||
|
||||
.btn-add:hover {
|
||||
background-color: #5f9213;
|
||||
}
|
||||
|
||||
|
||||
.btnPosition {
|
||||
outline: 1px solid #138989;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.active {
|
||||
outline: 1px solid transparent;
|
||||
}
|
||||
|
||||
.btn-register {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
background-color: #84CC16;
|
||||
color: #FFFFFF;
|
||||
border-radius: 8px;
|
||||
padding: 10px 60px;
|
||||
}
|
||||
|
||||
.btn-register:hover {
|
||||
background-color: #5f9213;
|
||||
}
|
||||
|
||||
.btn-cancel2 {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
background-color: #1F2937;
|
||||
color: #FFFFFF;
|
||||
border-radius: 8px;
|
||||
padding: 10px 70px;
|
||||
}
|
||||
|
||||
.btn-cancel2:hover {
|
||||
background-color: #121820;
|
||||
}
|
||||
|
||||
.items {
|
||||
border: 1px solid #D9D9D9;
|
||||
padding: 5px;
|
||||
border-radius: 8px;
|
||||
margin: 4px 0;
|
||||
cursor: pointer;
|
||||
transition: all ease-in-out .3s;
|
||||
}
|
||||
|
||||
.items:hover {
|
||||
border: 1px solid #148989;
|
||||
}
|
||||
|
||||
.items.checked-item {
|
||||
border: 1px solid #148989;
|
||||
}
|
||||
|
||||
.searchItem {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #535353;
|
||||
}
|
||||
|
||||
.btn-edit-subject {
|
||||
border: 1px solid transparent;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
padding: 3px 1px;
|
||||
color: #009EE2;
|
||||
margin: auto 4px auto 1px;
|
||||
background-color: rgba(52, 209, 209, 0.20);
|
||||
box-shadow: 0;
|
||||
transition: ease .2s;
|
||||
}
|
||||
|
||||
.btn-edit-subject:hover {
|
||||
background-color: rgba(52, 209, 209, 0.40);
|
||||
}
|
||||
|
||||
.btn-remove-subject {
|
||||
border: 1px solid transparent;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
padding: 3px 1px;
|
||||
color: #FF5151;
|
||||
margin: auto 4px auto 1px;
|
||||
background: rgba(209, 50, 50, 0.15);
|
||||
transition: ease .2s;
|
||||
}
|
||||
|
||||
.btn-remove-subject:hover {
|
||||
background-color: rgba(209, 50, 50, 0.25);
|
||||
}
|
||||
|
||||
.header-title {
|
||||
font-size: 17px;
|
||||
line-height: 32px;
|
||||
font-weight: 700;
|
||||
color: #000000;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.header-description {
|
||||
font-size: 17px;
|
||||
line-height: 24px;
|
||||
font-weight: 400;
|
||||
color: #000000;
|
||||
text-align: right
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.cardModal2 {
|
||||
background: #F5F5F5;
|
||||
border-radius: 10px;
|
||||
width: 100%;
|
||||
height: 372px;
|
||||
overflow: hidden;
|
||||
border: 1px solid #E7E7E7
|
||||
}
|
||||
|
||||
|
||||
.cardModal2-content {
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
height: 400px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.btn-quit {
|
||||
background-color: #292D32;
|
||||
color: white;
|
||||
height: 46px;
|
||||
border-radius: 6px;
|
||||
transition: 0.15s linear;
|
||||
font-size: 17px;
|
||||
line-height: 100%;
|
||||
font-weight: 500
|
||||
}
|
||||
|
||||
.btn-confirm {
|
||||
background-color: #84CC16;
|
||||
color: white;
|
||||
height: 46px;
|
||||
border-radius: 6px;
|
||||
transition: 0.15s linear;
|
||||
font-size: 17px;
|
||||
line-height: 100%;
|
||||
font-weight: 500
|
||||
}
|
||||
|
||||
.btn-confirm:hover {
|
||||
background-color: #5f9213;
|
||||
}
|
||||
|
||||
.btn-quit:hover {
|
||||
background-color: #121820;
|
||||
}
|
||||
|
||||
input.form-control:focus {
|
||||
border-color: #C6C6C6;
|
||||
box-shadow: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
|
||||
input:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.btn-card {
|
||||
color: #0B5959;
|
||||
width: 33px;
|
||||
height: 33px;
|
||||
border-radius: 3px;
|
||||
background-color: #57E3E340;
|
||||
font-size: 14px;
|
||||
line-height: 29px;
|
||||
}
|
||||
@@ -0,0 +1,264 @@
|
||||
.sweet-alert {
|
||||
font-family: 'IranSans' !important
|
||||
}
|
||||
|
||||
#ConfirmModal {
|
||||
width: 100%;
|
||||
background: #00000085;
|
||||
position: fixed;
|
||||
height: 100vh;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.ConfirmSection {
|
||||
max-width: max-content;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.employee-item {
|
||||
width: 100%;
|
||||
height: 160px;
|
||||
margin: 16px 0 0 0;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 10px;
|
||||
overflow-y: scroll;
|
||||
padding: 10px;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.employee-item ul {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.employee-item ul li {
|
||||
list-style: decimal;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.btn-add {
|
||||
font-size: 10px;
|
||||
font-weight: 500;
|
||||
background-color: #84CC16;
|
||||
color: #FFFFFF;
|
||||
border-radius: 7px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
transition: ease-in-out .3s;
|
||||
margin: 0 5px 0 0;
|
||||
}
|
||||
|
||||
.btn-add:hover {
|
||||
background-color: #5f9213;
|
||||
}
|
||||
|
||||
|
||||
.btnPosition {
|
||||
outline: 1px solid #138989;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.active {
|
||||
outline: 1px solid transparent;
|
||||
}
|
||||
|
||||
.btn-register {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
background-color: #84CC16;
|
||||
color: #FFFFFF;
|
||||
border-radius: 8px;
|
||||
padding: 10px 60px;
|
||||
}
|
||||
|
||||
.btn-register:hover {
|
||||
background-color: #5f9213;
|
||||
}
|
||||
|
||||
.btn-cancel2 {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
background-color: #1F2937;
|
||||
color: #FFFFFF;
|
||||
border-radius: 8px;
|
||||
padding: 10px 70px;
|
||||
}
|
||||
|
||||
.btn-cancel2:hover {
|
||||
background-color: #121820;
|
||||
}
|
||||
|
||||
.items {
|
||||
border: 1px solid #D9D9D9;
|
||||
padding: 5px;
|
||||
border-radius: 8px;
|
||||
margin: 4px 0;
|
||||
cursor: pointer;
|
||||
transition: all ease-in-out .3s;
|
||||
}
|
||||
|
||||
.items:hover {
|
||||
border: 1px solid #148989;
|
||||
}
|
||||
|
||||
.items.checked-item {
|
||||
border: 1px solid #148989;
|
||||
}
|
||||
|
||||
.searchItem {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #535353;
|
||||
}
|
||||
|
||||
.btn-edit-subject {
|
||||
border: 1px solid transparent;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
padding: 3px 1px;
|
||||
color: #009EE2;
|
||||
margin: auto 4px auto 1px;
|
||||
background-color: rgba(52, 209, 209, 0.20);
|
||||
box-shadow: 0;
|
||||
transition: ease .2s;
|
||||
}
|
||||
|
||||
.btn-edit-subject:hover {
|
||||
background-color: rgba(52, 209, 209, 0.40);
|
||||
}
|
||||
|
||||
.btn-remove-subject {
|
||||
border: 1px solid transparent;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
padding: 3px 1px;
|
||||
color: #FF5151;
|
||||
margin: auto 4px auto 1px;
|
||||
background: rgba(209, 50, 50, 0.15);
|
||||
transition: ease .2s;
|
||||
}
|
||||
|
||||
.btn-remove-subject:hover {
|
||||
background-color: rgba(209, 50, 50, 0.25);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.header-title {
|
||||
font-size: 17px;
|
||||
line-height: 32px;
|
||||
font-weight: 700;
|
||||
color: #000000;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.header-description {
|
||||
font-size: 17px;
|
||||
line-height: 24px;
|
||||
font-weight: 400;
|
||||
color: #000000;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
|
||||
|
||||
.card {
|
||||
background: #F5F5F5;
|
||||
border-radius: 10px;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
border: 1px solid #E7E7E7
|
||||
}
|
||||
|
||||
|
||||
.card-content {
|
||||
padding: 10px;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 16px;
|
||||
margin-bottom: 15px;
|
||||
font-weight: 400;
|
||||
line-height: 24px;
|
||||
color: #000000
|
||||
}
|
||||
|
||||
.card-text {
|
||||
margin: 10px 0;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 109px;
|
||||
height: 36px;
|
||||
color: #5C5C5C !important;
|
||||
background-color: white;
|
||||
border: 2px solid #C6C6C6;
|
||||
border-radius: 6px;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
margin: 0 auto
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
background-color: white;
|
||||
border-color: #C6C6C6;
|
||||
}
|
||||
|
||||
.btn-quit {
|
||||
background-color: #292D32;
|
||||
color: white;
|
||||
border-radius: 6px;
|
||||
transition: 0.15s linear;
|
||||
font-size: 16px;
|
||||
line-height: 100%;
|
||||
font-weight: 500;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.btn-confirm {
|
||||
background-color: #84CC16;
|
||||
color: white;
|
||||
border-radius: 6px;
|
||||
transition: 0.15s linear;
|
||||
font-size: 16px;
|
||||
line-height: 100%;
|
||||
font-weight: 500;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.btn-confirm:hover {
|
||||
background-color: #5f9213;
|
||||
}
|
||||
|
||||
.btn-quit:hover {
|
||||
background-color: #121820;
|
||||
}
|
||||
|
||||
|
||||
input.form-control:focus {
|
||||
border-color: #C6C6C6;
|
||||
box-shadow: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
|
||||
input:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#modalConfirm {
|
||||
width: 450px;
|
||||
}
|
||||
|
||||
@media (max-width: 526px) {
|
||||
#modalConfirm {
|
||||
width: 350px;
|
||||
}
|
||||
}
|
||||
@@ -840,7 +840,7 @@ function caseHistoryLoadAjax() {
|
||||
html += `<div class="width3 d-block d-md-none" style="width:1% !important;border-right: 1px dashed #CACACA;padding: 0 20px 0 7px;white-space: nowrap;">`;
|
||||
item.rollCallTimesList.forEach(function (itemTime) {
|
||||
let { timeDiff, cssClass } = getTimeDiffData(itemTime.entryTimeDifferences);
|
||||
html += ` <span class="${cssClass}">${timeDiff}</span>`;
|
||||
html += ` <div class="${cssClass}">${timeDiff}</div>`;
|
||||
});
|
||||
|
||||
html += `</div>`;
|
||||
@@ -880,7 +880,7 @@ function caseHistoryLoadAjax() {
|
||||
html += `<div class="width3 d-block d-md-none" style="width:1% !important;padding: 0 0 0 20px;white-space: nowrap;">`;
|
||||
item.rollCallTimesList.forEach(function (itemTime) {
|
||||
let { timeDiff, cssClass } = getTimeDiffData(itemTime.exitTimeDifferences);
|
||||
html += ` <span class="${cssClass}">${timeDiff}</span>`;
|
||||
html += ` <div class="${cssClass}">${timeDiff}</div>`;
|
||||
});
|
||||
|
||||
html += `</div>`;
|
||||
|
||||
@@ -1,9 +1,22 @@
|
||||
$(document).ready(function () {
|
||||
$(".closeConfirmModal").on("click", function () {
|
||||
$('#ConfirmEmployeeModal').hide();
|
||||
});
|
||||
$(".closeConfirmModal2").on("click", function () {
|
||||
$('#ConfirmModal').hide();
|
||||
});
|
||||
|
||||
loadEmployeeIsChangeAjax();
|
||||
// const cleave = new Cleave('.dateInput', {
|
||||
// date: true,
|
||||
// datePattern: ['Y', 'm', 'd'],
|
||||
// });
|
||||
|
||||
new Cleave('.dateInput', {
|
||||
date: true,
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
|
||||
loadEmployeeIsChangeAjax();
|
||||
});
|
||||
|
||||
function loadEmployeeIsChangeAjax() {
|
||||
@@ -51,4 +64,69 @@ function loadEmployeeIsChangeAjax() {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function ajaxConfirm() {
|
||||
$('#ConfirmModal').show();
|
||||
employeeList();
|
||||
}
|
||||
|
||||
|
||||
function employeeList() {
|
||||
var htmlEmployeeList = ``;
|
||||
var isChange = $('.modal2:checked').val();
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
contentType: 'charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: ajaxEmployeesHaveToChangeUrl,
|
||||
data: { 'groupId': groupId, 'isChange': isChange },
|
||||
headers: { "RequestVerificationToken": `${antiForgeryToken}` },
|
||||
success: function (response) {
|
||||
var employeeList = response.data;
|
||||
var index = 1;
|
||||
if (response.success) {
|
||||
employeeList.forEach(function (item) {
|
||||
htmlEmployeeList += `<div class="TaleRowCell d-flex w-100 justify-content-between align-items-center px-3 " style="background: #F1FFFF; height: 49px; border-radius: 5px">
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<span class="btn-card">${index++}</span>
|
||||
<span style="color: #0B5959; font-size: 14px; font-weight: 400; text-align: right">${item.name}</span>
|
||||
</div>
|
||||
<input type="hidden" name="EmployeeId[]" value="${item.employeeId}" />
|
||||
<input type="text" class="form-control m-0 py-0 dateInput"
|
||||
name="FromDate[]"
|
||||
value=""
|
||||
style="width: 120px; height: 36px; text-align: center; font-size: 16px; color: #5C5C5C; font-weight: 500; border: 2px solid #C6C6C6; direction: ltr" />
|
||||
</div>`;
|
||||
});
|
||||
|
||||
$('#employeeTable').html(htmlEmployeeList);
|
||||
|
||||
|
||||
|
||||
$('.dateInput').each(function () {
|
||||
new Cleave(this, {
|
||||
date: true,
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
|
||||
$(this).val(dateNow);
|
||||
});
|
||||
}
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#initialDateInput').on('input', function () {
|
||||
new Cleave('.dateInput', {
|
||||
date: true,
|
||||
datePattern: ['Y', 'm', 'd']
|
||||
});
|
||||
$('.dateInput').val($(this).val());
|
||||
});
|
||||
@@ -1,4 +1,5 @@
|
||||
$(document).ready(function () {
|
||||
var ajaxService = new AjaxService(antiForgeryToken);
|
||||
$(document).ready(function () {
|
||||
$(document).on("click", ".btn-cancel2", function () {
|
||||
$('#MainModal').modal('toggle');
|
||||
});
|
||||
@@ -494,6 +495,8 @@
|
||||
// Update Remove button enable/disable state
|
||||
updateRemoveButtonsRS();
|
||||
});
|
||||
|
||||
saveDataLocal();
|
||||
});
|
||||
|
||||
|
||||
@@ -736,7 +739,7 @@ function timeValidCheck(value) {
|
||||
}
|
||||
//******************** برای نوشتن تاریخ ********************
|
||||
|
||||
function ajaxEditEmployeeSaveData() {
|
||||
async function ajaxEditEmployeeSaveData() {
|
||||
if ($('#BreakTime').prop('checked')) {
|
||||
if ($('#hour').val() === "0" && $('#min').val() === "00") {
|
||||
showAlert('لطفا ساعت یا دقیقه استراحت را مشخص نمایید', $('#hour, #min'));
|
||||
@@ -744,7 +747,25 @@ function ajaxEditEmployeeSaveData() {
|
||||
}
|
||||
}
|
||||
|
||||
var data = $('#edit-employee-form').serializeArray();
|
||||
saveDataLocal();
|
||||
|
||||
try {
|
||||
const responseCheckCal = await checkEmployeeSettingsHasChangedValue(saveData);
|
||||
|
||||
if (responseCheckCal) {
|
||||
$('#ConfirmModal').show();
|
||||
} else {
|
||||
postChangeEditEmployee();
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
}
|
||||
|
||||
// save all data
|
||||
var saveData = {};
|
||||
function saveDataLocal() {
|
||||
var hasBreakTime = "false";
|
||||
if ($('#BreakTime').prop('checked')) {
|
||||
hasBreakTime = $("#BreakTime").prop("checked") ? "true" : "false";
|
||||
@@ -753,7 +774,7 @@ function ajaxEditEmployeeSaveData() {
|
||||
}
|
||||
//var hasBreakTime = $("#BreakTime").prop("checked") ? "true" : "false";
|
||||
var breakTimeValue = $("#TimeOnly").val();
|
||||
|
||||
|
||||
|
||||
var FridayWork = "Default";
|
||||
if ($('#Friday1').prop('checked')) {
|
||||
@@ -761,7 +782,7 @@ function ajaxEditEmployeeSaveData() {
|
||||
} else if ($('#Friday2').prop('checked')) {
|
||||
FridayWork = "WorkInFriday";
|
||||
}
|
||||
|
||||
|
||||
|
||||
var HolidayWork = "Default";
|
||||
if ($('#OffDays1').prop('checked')) {
|
||||
@@ -771,45 +792,96 @@ function ajaxEditEmployeeSaveData() {
|
||||
}
|
||||
|
||||
|
||||
data.push({ name: 'Command.BreakTime.HasBreakTimeValue', value: hasBreakTime });
|
||||
data.push({ name: 'Command.BreakTime.BreakTimeValue', value: breakTimeValue });
|
||||
data.push({ name: 'Command.FridayWork', value: FridayWork });
|
||||
data.push({ name: 'Command.HolidayWork', value: HolidayWork });
|
||||
var formData = $('#edit-employee-form').serializeArray();
|
||||
|
||||
var requestData = $.param(data);
|
||||
formData.forEach(function (item) {
|
||||
saveData[item.name] = item.value;
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
|
||||
saveData['Command.BreakTime.HasBreakTimeValue'] = hasBreakTime;
|
||||
saveData['Command.BreakTime.BreakTimeValue'] = breakTimeValue;
|
||||
saveData['Command.FridayWork'] = FridayWork;
|
||||
saveData['Command.HolidayWork'] = HolidayWork;
|
||||
|
||||
//data.push({ name: 'Command.BreakTime.HasBreakTimeValue', value: hasBreakTime });
|
||||
//data.push({ name: 'Command.BreakTime.BreakTimeValue', value: breakTimeValue });
|
||||
//data.push({ name: 'Command.FridayWork', value: FridayWork });
|
||||
//data.push({ name: 'Command.HolidayWork', value: HolidayWork });
|
||||
|
||||
//var requestData = $.param(data);
|
||||
}
|
||||
|
||||
var hasChangedValueEmployeeSettings = false;
|
||||
async function checkEmployeeSettingsHasChangedValue(command) {
|
||||
try {
|
||||
const response = await $.ajax({
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: ajaxEmployeeSettingsHasChangedValueUrl,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: command
|
||||
});
|
||||
hasChangedValueEmployeeSettings = response.data;
|
||||
return response.data;
|
||||
} catch (e) {
|
||||
console.error('Error:', e);
|
||||
if (e.responseJSON) console.error('Response JSON:', e.responseJSON);
|
||||
if (e.responseText) console.error('Response Text:', e.responseText);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function postChangeEditEmployee() {
|
||||
$('#ConfirmRecalculationLoading').show();
|
||||
$('.btn-confirm').addClass('disable');
|
||||
|
||||
var command = [
|
||||
{
|
||||
EmployeeId: $('[name="Command.EmployeeIds[0]"]').val(),
|
||||
FromDate: $('[name="Command.FromDate"]').val()
|
||||
}
|
||||
];
|
||||
|
||||
if (!hasChangedValueEmployeeSettings) {
|
||||
command = [];
|
||||
}
|
||||
|
||||
const response = await $.ajax({
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: ajaxPostChangeEditEmployee,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: requestData,
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
isShiftChangedGlobal = true;
|
||||
|
||||
$('.alert-success-msg').show();
|
||||
$('.alert-success-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-success-msg').hide();
|
||||
$('.alert-success-msg p').text('');
|
||||
}, 2000);
|
||||
|
||||
loadDataAjax();
|
||||
$('#btn-register').addClass('disable');
|
||||
$('#MainModal').modal('hide');
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
}
|
||||
},
|
||||
error: function (err) {
|
||||
console.log(err);
|
||||
}
|
||||
data: { ...saveData, reCalculateCommand: command }
|
||||
});
|
||||
}
|
||||
|
||||
if (response.success) {
|
||||
isShiftChangedGlobal = true;
|
||||
|
||||
|
||||
$('.alert-success-msg').show();
|
||||
$('.alert-success-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-success-msg').hide();
|
||||
$('.alert-success-msg p').text('');
|
||||
}, 2000);
|
||||
|
||||
loadDataAjax();
|
||||
$('#btn-register').addClass('disable');
|
||||
$('#MainModal').modal('hide');
|
||||
|
||||
$('#ConfirmRecalculationLoading').hide();
|
||||
$('.btn-confirm').removeClass('disable');
|
||||
//}
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
$('#ConfirmRecalculationLoading').hide();
|
||||
$('.btn-confirm').removeClass('disable');
|
||||
}
|
||||
}
|
||||
@@ -764,7 +764,7 @@ $('#YesConfirm, #NotConfirm').on('change', function () {
|
||||
$('#finalSaveRollCallSetting').removeClass('disable');
|
||||
});
|
||||
|
||||
function ajaxSaveSubmit() {
|
||||
async function ajaxSaveSubmit() {
|
||||
if ($('#BreakTime').prop('checked')) {
|
||||
if ($('#hour').val() === "0" && $('#min').val() === "00") {
|
||||
showAlert('لطفا ساعت یا دقیقه استراحت را مشخص نمایید', $('#hour, #min'));
|
||||
@@ -812,45 +812,113 @@ function ajaxSaveSubmit() {
|
||||
data.push({ name: 'HolidayWork', value: HolidayWork });
|
||||
|
||||
data.push({ name: 'IsShiftChanged', value: isShiftChanged });
|
||||
|
||||
|
||||
|
||||
var requestData = $.param(data);
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: ajaxEditGroupSave,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: requestData,
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
$('.alert-success-msg').show();
|
||||
$('.alert-success-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-success-msg').hide();
|
||||
$('.alert-success-msg p').text('');
|
||||
}, 2000);
|
||||
|
||||
loadDataAjax();
|
||||
$('#btnSave').removeClass('disable');
|
||||
$('#btn-register').addClass('disable');
|
||||
$('#MainModal').modal('hide');
|
||||
} else {
|
||||
$('#btnSave').removeClass('disable');
|
||||
$('#finalSaveRollCallSetting').removeClass('disable');
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
}
|
||||
},
|
||||
error: function (err) {
|
||||
$('#btnSave').removeClass('disable');
|
||||
$('#finalSaveRollCallSetting').removeClass('disable');
|
||||
console.log(err);
|
||||
}
|
||||
|
||||
var commandGroup = [];
|
||||
|
||||
$('input[name="EmployeeId[]"]').each(function (index) {
|
||||
var employeeId = $(this).val();
|
||||
var fromDate = $('input[name="FromDate[]"]').eq(index).val();
|
||||
|
||||
commandGroup.push({
|
||||
EmployeeId: employeeId,
|
||||
FromDate: fromDate
|
||||
});
|
||||
});
|
||||
|
||||
// console.log(commandGroup);
|
||||
|
||||
try {
|
||||
const response = await $.ajax({
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: ajaxEditGroupSave,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: requestData
|
||||
});
|
||||
|
||||
if (response.success) {
|
||||
//const responseSaveCal = await saveReCalculateValues(commandGroup);
|
||||
//if (responseSaveCal) {
|
||||
// loadDataAjax();
|
||||
// $('#btn-register').addClass('disable');
|
||||
// $('#MainModal').modal('hide');
|
||||
//}
|
||||
loadDataAjax();
|
||||
$('#btnSave').removeClass('disable');
|
||||
$('#btn-register').addClass('disable');
|
||||
$('#MainModal').modal('hide');
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
$('#btn-register').removeClass('disable');
|
||||
$('#finalSaveRollCallSetting').removeClass('disable');
|
||||
}
|
||||
} catch (err) {
|
||||
$('#btn-register').removeClass('disable');
|
||||
$('#finalSaveRollCallSetting').removeClass('disable');
|
||||
console.log(err);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
async function saveReCalculateValues(command) {
|
||||
|
||||
var btnConfirm = $('.btn-confirm').addClass('disable');
|
||||
var btnQuit = $('.btn-quit').addClass('disable');
|
||||
var loading = $('.btn-confirm .loading').show();
|
||||
|
||||
try {
|
||||
// const response = await ajaxService.post(ajaxReCalculateValuesUrl, { command: command }, true);
|
||||
const response = await $.ajax({
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: ajaxReCalculateValuesUrl,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: { command: command },
|
||||
});
|
||||
if (response.success) {
|
||||
$('.alert-success-msg').show();
|
||||
$('.alert-success-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-success-msg').hide();
|
||||
$('.alert-success-msg p').text('');
|
||||
}, 2000);
|
||||
|
||||
btnConfirm.removeClass("disable");
|
||||
btnQuit.removeClass("disable");
|
||||
loading.hide();
|
||||
|
||||
loadDataAjax();
|
||||
$('#MainModal').modal('hide');
|
||||
|
||||
return true;
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text(response.message);
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
|
||||
btnConfirm.removeClass("disable");
|
||||
btnQuit.removeClass("disable");
|
||||
loading.hide();
|
||||
|
||||
return false;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Error:', e);
|
||||
if (e.responseJSON) console.error('Response JSON:', e.responseJSON);
|
||||
if (e.responseText) console.error('Response Text:', e.responseText);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user