add workshopSetting page in client

This commit is contained in:
SamSys
2025-05-05 22:07:01 +03:30
41 changed files with 13996 additions and 1881 deletions

View File

@@ -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()

View File

@@ -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()

View File

@@ -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;

View File

@@ -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)

File diff suppressed because it is too large Load Diff

View File

@@ -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);
}
}
}

View File

@@ -4745,7 +4745,7 @@ namespace CompanyManagment.EFCore.Migrations
b.HasKey("id");
b.HasIndex("AccountId");
b.HasIndex("WorkshopId");
b.ToTable("RollCallServices", (string)null);
});
@@ -9028,7 +9028,7 @@ namespace CompanyManagment.EFCore.Migrations
{
b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop")
.WithMany("RollCallServicesList")
.HasForeignKey("AccountId")
.HasForeignKey("WorkshopId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();

View File

@@ -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)

View File

@@ -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
};
}

View File

@@ -1884,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);
}

View File

@@ -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"> &nbsp;<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"> &nbsp;<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"> &nbsp;<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"> &nbsp;<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"> &nbsp;<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"> &nbsp;<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"> &nbsp;<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"> &nbsp;<span style="bottom: 2px;position: relative"> دکمه ایجاد وظیفه دوره ای </span> </label>
</div>
</div>
</div>

View File

@@ -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"> &nbsp;<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"> &nbsp;<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"> &nbsp;<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"> &nbsp;<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"> &nbsp;<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"> &nbsp;<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"> &nbsp;<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"> &nbsp;<span style="bottom: 2px;position: relative"> دکمه ایجاد وظیفه دوره ای </span> </label>
</div>
</div>
</div>

View File

@@ -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; }
@@ -6785,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();

View File

@@ -69,17 +69,17 @@
</div>
<div class="right col-lg-4 col-md-6 col-sm-6 col-xs-12">
<div id="divMarried" class="form-group flexible-div oblig2">
<div class="radio-box">
<label class="radio-label">وضعیت تاهل <span style="color: red;">*</span></label>
<div class="radio-input">
<label>
متاهل<input type="radio" value="متاهل" asp-for="MaritalStatus" name="MaritalStatus">
</label>
<label>
مجرد<input type="radio" value="مجرد" asp-for="MaritalStatus" name="MaritalStatus">
</label>
</div>
</div>
<div class="radio-box">
<label class="radio-label">وضعیت تاهل <span style="color: red;">*</span></label>
<div class="radio-input">
<label>
متاهل<input type="radio" value="متاهل" asp-for="MaritalStatus" name="MaritalStatus">
</label>
<label>
مجرد<input type="radio" value="مجرد" asp-for="MaritalStatus" name="MaritalStatus">
</label>
</div>
</div>
</div>
</div>
<div class="right col-lg-3 col-md-6 col-sm-6 col-xs-12">
@@ -545,36 +545,35 @@
}
var birthday = $('#iniDateOfBirth').val();
var codeMelli = $('#iniCodeMelli').val();
var codeMelli = $('#iniCodeMelli').val();
try {
const response = await $.ajax({
url: loadUidInfo,
url: loadUidInfo,
method: 'POST',
data: { nationalCode: codeMelli, birthDate: birthday },
headers: { "RequestVerificationToken": antiForgeryToken }
data: { nationalCode: codeMelli, birthDate: birthday },
headers: { "RequestVerificationToken": antiForgeryToken }
});
console.log(response);
if (response.success) {
if (response.success) {
$('#IsAuthorized').val(true);
$('#name').val(response.data.fName);
$('#family').val(response.data.lName);
$('#FatherName').val(response.data.fatherName);
$('#DateOfBirth').val(response.data.birthDate);
$('#code-melli').val(response.data.nationalCode);
$('#FatherName').val(response.data.fatherName);
$('#DateOfBirth').val(response.data.birthDate);
$('#code-melli').val(response.data.nationalCode);
$('#IdNumber').val(response.data.idNumber);
$('#IdNumberSerial').val(response.data.idNumberSerial);
$('#IdNumberSeri').val(response.data.idNumberSeri);
$('#IdNumberSerial').val(response.data.idNumberSerial);
$('#IdNumberSeri').val(response.data.idNumberSeri);
if (response.data.gender === 0) {
$('#GenderMale').prop('checked', true);
} else if (response.data.gender === 1) {
$('#GenderFemale').prop('checked', true);
}
} else {
$.Notification.autoHideNotify('error', 'top right', 'خطا', response.message);
return;
}
$.Notification.autoHideNotify('error', 'top right', 'خطا', response.message);
return;
}
currentStep++;
showStep(currentStep);
@@ -582,6 +581,30 @@
$.Notification.autoHideNotify('error', 'top right', 'خطا', "ارسال اطلاعات با مشکل مواجه شد.");
return;
}
} else if (currentStep === 1) {
if ($(".form1 #divGender").find('input[type="radio"]:checked').length === 0) {
$.Notification.autoHideNotify('error', 'top right', 'خطا', "لطفا جنسیت را مشخص نمایید.");
$(".form1 #divGender").addClass('errored');
setTimeout(function () {
$(".form1 #divGender").removeClass('errored');
}, 2500);
return;
}
if ($(".form1 #divMarried").find('input[type="radio"]:checked').length === 0) {
$.Notification.autoHideNotify('error', 'top right', 'خطا', "لطفا وضعیت تاهل را مشخص نمایید.");
$(".form1 #divMarried").addClass('errored');
setTimeout(function () {
$(".form1 #divMarried").removeClass('errored');
}, 2500);
return;
}
currentStep++;
showStep(currentStep);
} else {
if (validateStep(currentStep)) {
if (currentStep < steps.length - 1) {

View File

@@ -566,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;

View File

@@ -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>

View File

@@ -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}وارد نشده است.`);

View File

@@ -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;
}

View File

@@ -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>

View File

@@ -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>

View File

@@ -1,216 +0,0 @@
using System.Security.Claims;
using _0_Framework.Application;
using _0_Framework.Infrastructure;
using AccountManagement.Application;
using AccountManagement.Application.Contracts.Account;
using AccountManagement.Application.Contracts.CameraAccount;
using AccountManagement.Application.Contracts.SubAccount;
using CompanyManagment.App.Contracts.Workshop;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace ServiceHost.Areas.Client.Pages.Company.RollCall
{
[Authorize]
[NeedsPermission(SubAccountPermissionHelper.CameraAccountSettingsPermissionCode)]
public class CameraAccountsModel : PageModel
{
public string Mess { get; set; }
private readonly IAuthHelper _authHelper;
private readonly IAccountApplication _accountApplication;
private readonly IWorkshopApplication _workshopApplication;
private readonly IPasswordHasher _passwordHasher;
private readonly ICameraAccountApplication _cameraAccountApplication;
private readonly IHttpContextAccessor _contextAccessor;
private readonly ISubAccountApplication _subAccountApplication;
private readonly long _workshopId;
public string WorkshopFullName;
public CameraAccountsModel(IAuthHelper authHelper, IPasswordHasher passwordHasher, ICameraAccountApplication cameraAccountApplication, IAccountApplication accountApplication, IWorkshopApplication workshopApplication, IHttpContextAccessor contextAccessor, ISubAccountApplication subAccountApplication)
{
_authHelper = authHelper;
_passwordHasher = passwordHasher;
_cameraAccountApplication = cameraAccountApplication;
_accountApplication = accountApplication;
_workshopApplication = workshopApplication;
_contextAccessor = contextAccessor;
_subAccountApplication = subAccountApplication;
var workshopHash = _contextAccessor.HttpContext?.User.FindFirstValue("WorkshopSlug");
_workshopId = _passwordHasher.SlugDecrypt(workshopHash);
if (_workshopId < 1)
throw new InvalidDataException("اختلال در کارگاه");
}
public void OnGet()
{
WorkshopFullName = _workshopApplication.GetDetails(_workshopId).WorkshopFullName;
}
public IActionResult OnPostSendSms()
{
var accountInfo = _authHelper.CurrentAccountInfo();
if (accountInfo.SubAccountId == 0)
{
var accountId = accountInfo.Id;
var result = _accountApplication.Search(new AccountSearchModel() { Id = accountId }).FirstOrDefault();
if (result != null)
{
_accountApplication.SendVerifyCodeToChangingPass(result.Mobile, accountId);
return new JsonResult(new
{
isSuccess = true
});
}
}
else
{
var result = _subAccountApplication.GetDetails(accountInfo.SubAccountId);
if (result != null && result != default)
{
_subAccountApplication.SendVerifyCodeForPasswordChange(result.PhoneNumber, accountInfo.SubAccountId);
return new JsonResult(new
{
isSuccess = true
});
}
}
return new JsonResult(new
{
isSuccess = false
});
}
public IActionResult OnPostCheckCode(string code)
{
var accountInfo = _authHelper.CurrentAccountInfo();
if (accountInfo.SubAccountId == 0)
{
var accountId = accountInfo.Id;
var result = _accountApplication.Search(new AccountSearchModel() { Id = accountId }).FirstOrDefault();
var verfiyResult = _accountApplication.GetByVerifyCode(code, result.Mobile);
if (verfiyResult != null)
{
return new JsonResult(new
{
exist = true,
});
}
}
else
{
var subAccountId = accountInfo.SubAccountId;
var result = _subAccountApplication.GetDetails(accountInfo.SubAccountId);
if (result != null && result != default)
{
var verfiyResult = _subAccountApplication.GetByVerifyCodeAndPhoneNumber(code, result.PhoneNumber);
if (verfiyResult != null)
{
return new JsonResult(new
{
exist = true,
});
}
}
}
return new JsonResult(new
{
exist = false,
});
}
#region Camera Account
public IActionResult OnGetCameraAccounts()
{
var authModel = _authHelper.CurrentAccountInfo();
List<(long Id, string Name)> workshops = authModel.WorkshopList.Select(x => (x.Id, x.Name)).ToList();
var result = _cameraAccountApplication.GetAllByWorkshopIdAndAccountId(authModel.Id, workshops);
return new JsonResult(new
{
success = true,
data = result
});
}
public IActionResult OnGetChangeCameraPassword(long id)
{
var camera = _cameraAccountApplication.GetDetails(id);
var command = new CameraAccountViewModel()
{
Id = id,
Username = camera.Username,
WorkshopName = camera.WorkshopName,
};
return Partial("ModalCameraAccountChangePassword", command);
}
public IActionResult OnPostChangeCameraPassword(ChangePassword command)
{
var result = _cameraAccountApplication.ChangePass(command);
return new JsonResult(new
{
success = result.IsSuccedded,
message = result.Message
});
}
public IActionResult OnGetCameraValidation(string password, string rePassword)
{
if (string.IsNullOrWhiteSpace(password) || string.IsNullOrWhiteSpace(rePassword))
{
return new JsonResult(new
{
success = false,
message = "رمز عبور و تکرار آن نباید خالی باشد"
});
}
if (password != rePassword)
{
return new JsonResult(new
{
success = false,
message = "رمز عبور یکسان نیست",
});
}
if (password.Length < 8)
{
return new JsonResult(new
{
success = false,
message = "رمز عبور نمی تواند کمتر از 8 کاراکتر باشد",
});
}
return new JsonResult(new
{
success = true,
});
}
public IActionResult OnPostCameraAccountChangeStatus(long id, string type)
{
OperationResult result = type == "active" ? _cameraAccountApplication.Active(id) : _cameraAccountApplication.DeActive(id);
return new JsonResult(new
{
success = result.IsSuccedded,
message = result.Message
});
}
#endregion
}
}

View File

@@ -1,5 +1,5 @@
@page
@model ServiceHost.Areas.Client.Pages.Company.RollCall.CameraAccountsModel
@model ServiceHost.Areas.Client.Pages.Company.RollCall.CameraAccounts.IndexModel
@{
string clientVersion = _0_Framework.Application.Version.StyleVersion;
@@ -201,12 +201,12 @@
<script src="~/AssetsClient/js/dropdown.js?ver=@clientVersion"></script>
<script>
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
var loadCameraAccountsAjax = `@Url.Page("CameraAccounts", "CameraAccounts")`;
var changeCameraAccountStatusAjax = `@Url.Page("./CameraAccounts", "CameraAccountChangeStatus")`;
var loadCameraAccountsAjax = `@Url.Page("./Index", "CameraAccounts")`;
var changeCameraAccountStatusAjax = `@Url.Page("./Index", "CameraAccountChangeStatus")`;
// check and show modal Camera Account And Workshop Setting
var statusCameraAccountAndWorkshopSettingUrl = `@Url.Page("./Index", "StatusCameraAccountAndWorkshopSetting")`;
var saveCameraAccountUrl = `@Url.Page("./Index", "SaveCameraAccountAndWorkshopSetting")`;
var statusCameraAccountAndWorkshopSettingUrl = `@Url.Page("./../Index", "StatusCameraAccountAndWorkshopSetting")`;
var modalCreateCameraAccountUrl = `@Url.Page("./Index", "CreateCameraAccount")`;
</script>
<script src="~/assetsclient/pages/RollCall/js/CameraAccounts.js?ver=@clientVersion"></script>
}

View File

@@ -0,0 +1,263 @@
using _0_Framework.Application;
using AccountManagement.Application.Contracts.Account;
using AccountManagement.Application.Contracts.CameraAccount;
using AccountManagement.Application.Contracts.SubAccount;
using CompanyManagment.App.Contracts.Workshop;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Security.Claims;
using _0_Framework.Infrastructure;
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
using CompanyManagment.App.Contracts.RollCall;
using CompanyManagment.Application;
using System.Transactions;
namespace ServiceHost.Areas.Client.Pages.Company.RollCall.CameraAccounts
{
[Authorize]
[NeedsPermission(SubAccountPermissionHelper.CameraAccountSettingsPermissionCode)]
public class IndexModel : PageModel
{
public string Mess { get; set; }
private readonly IAuthHelper _authHelper;
private readonly IAccountApplication _accountApplication;
private readonly IWorkshopApplication _workshopApplication;
private readonly IPasswordHasher _passwordHasher;
private readonly ICameraAccountApplication _cameraAccountApplication;
private readonly IHttpContextAccessor _contextAccessor;
private readonly ISubAccountApplication _subAccountApplication;
private readonly long _workshopId;
public string WorkshopFullName;
public bool HasCamera;
public IndexModel(IAuthHelper authHelper, IPasswordHasher passwordHasher, ICameraAccountApplication cameraAccountApplication, IAccountApplication accountApplication, IWorkshopApplication workshopApplication, IHttpContextAccessor contextAccessor, ISubAccountApplication subAccountApplication)
{
_authHelper = authHelper;
_passwordHasher = passwordHasher;
_cameraAccountApplication = cameraAccountApplication;
_accountApplication = accountApplication;
_workshopApplication = workshopApplication;
_contextAccessor = contextAccessor;
_subAccountApplication = subAccountApplication;
var workshopHash = _contextAccessor.HttpContext?.User.FindFirstValue("WorkshopSlug");
_workshopId = _passwordHasher.SlugDecrypt(workshopHash);
if (_workshopId < 1)
throw new InvalidDataException("اختلال در کارگاه");
}
public void OnGet()
{
var accountId = _authHelper.CurrentAccountId();
WorkshopFullName = _workshopApplication.GetDetails(_workshopId).WorkshopFullName;
HasCamera = _cameraAccountApplication.HasCameraAccount(_workshopId, accountId);
}
public IActionResult OnPostSendSms()
{
var accountInfo = _authHelper.CurrentAccountInfo();
if (accountInfo.SubAccountId == 0)
{
var accountId = accountInfo.Id;
var result = _accountApplication.Search(new AccountSearchModel() { Id = accountId }).FirstOrDefault();
if (result != null)
{
_accountApplication.SendVerifyCodeToChangingPass(result.Mobile, accountId);
return new JsonResult(new
{
isSuccess = true
});
}
}
else
{
var result = _subAccountApplication.GetDetails(accountInfo.SubAccountId);
if (result != null && result != default)
{
_subAccountApplication.SendVerifyCodeForPasswordChange(result.PhoneNumber, accountInfo.SubAccountId);
return new JsonResult(new
{
isSuccess = true
});
}
}
return new JsonResult(new
{
isSuccess = false
});
}
public IActionResult OnPostCheckCode(string code)
{
var accountInfo = _authHelper.CurrentAccountInfo();
if (accountInfo.SubAccountId == 0)
{
var accountId = accountInfo.Id;
var result = _accountApplication.Search(new AccountSearchModel() { Id = accountId }).FirstOrDefault();
var verfiyResult = _accountApplication.GetByVerifyCode(code, result.Mobile);
if (verfiyResult != null)
{
return new JsonResult(new
{
exist = true,
});
}
}
else
{
var subAccountId = accountInfo.SubAccountId;
var result = _subAccountApplication.GetDetails(accountInfo.SubAccountId);
if (result != null && result != default)
{
var verfiyResult = _subAccountApplication.GetByVerifyCodeAndPhoneNumber(code, result.PhoneNumber);
if (verfiyResult != null)
{
return new JsonResult(new
{
exist = true,
});
}
}
}
return new JsonResult(new
{
exist = false,
});
}
#region Create Camera
public IActionResult OnGetCreateCameraAccount()
{
var command = new CreateCameraAccount();
command.WorkshopName = _workshopApplication.GetWorkshopFullname(_workshopId);
return Partial("_Partials/ModalCreateAccountSetting", command);
}
public IActionResult OnPostCreateCameraAccount(CreateCameraAccount command)
{
var createAccountCommand = new CreateCameraAccount()
{
WorkshopId = _workshopId,
AccountId = _authHelper.CurrentAccountId(),
Username = command.Username,
Password = command.Password,
RePassword = command.RePassword,
WorkshopName = _workshopApplication.GetDetails(_workshopId).WorkshopFullName,
IsActiveString = "true",
};
var result = _cameraAccountApplication.Create(createAccountCommand);
return new JsonResult(new
{
Success = result.IsSuccedded,
message = result.Message,
});
}
#endregion
#region Camera Account
public IActionResult OnGetCameraAccounts()
{
var authModel = _authHelper.CurrentAccountInfo();
List<(long Id, string Name)> workshops = authModel.WorkshopList.Select(x => (x.Id, x.Name)).ToList();
var result = _cameraAccountApplication.GetAllByWorkshopIdAndAccountId(authModel.Id, workshops);
return new JsonResult(new
{
success = true,
data = result
});
}
public IActionResult OnGetChangeCameraPassword(long id)
{
var camera = _cameraAccountApplication.GetDetails(id);
var command = new CameraAccountViewModel()
{
Id = id,
Username = camera.Username,
WorkshopName = camera.WorkshopName,
};
return Partial("_Partials/ModalCameraAccountChangePassword", command);
}
public IActionResult OnPostChangeCameraPassword(ChangePassword command)
{
var result = _cameraAccountApplication.ChangePass(command);
return new JsonResult(new
{
success = result.IsSuccedded,
message = result.Message
});
}
public IActionResult OnGetCameraValidation(string password, string rePassword)
{
if (string.IsNullOrWhiteSpace(password) || string.IsNullOrWhiteSpace(rePassword))
{
return new JsonResult(new
{
success = false,
message = "رمز عبور و تکرار آن نباید خالی باشد"
});
}
if (password != rePassword)
{
return new JsonResult(new
{
success = false,
message = "رمز عبور یکسان نیست",
});
}
if (password.Length < 8)
{
return new JsonResult(new
{
success = false,
message = "رمز عبور نمی تواند کمتر از 8 کاراکتر باشد",
});
}
return new JsonResult(new
{
success = true,
});
}
public IActionResult OnPostCameraAccountChangeStatus(long id, string type)
{
OperationResult result = type == "active" ? _cameraAccountApplication.Active(id) : _cameraAccountApplication.DeActive(id);
return new JsonResult(new
{
success = result.IsSuccedded,
message = result.Message
});
}
#endregion
public IActionResult OnGetCheckAccount(string username)
{
var result = _cameraAccountApplication.CheckUsername(username);
return new JsonResult(new
{
Success = result.IsSuccedded,
message = result.IsSuccedded ? "نام کاربری با مورد تاییداست" : result.Message,
});
}
}
}

View File

@@ -0,0 +1,185 @@
@model AccountManagement.Application.Contracts.CameraAccount.CameraAccountViewModel
@{
string clientVersion = _0_Framework.Application.Version.StyleVersion;
<link href="~/assetsclient/pages/profile/css/modalcameraaccountchangepassword.css" rel="stylesheet" />
}
<form role="form" method="post" name="create-form2" id="create-form2" autocomplete="off">
<div class="modal-content">
<div class="modal-header d-block text-center">
<svg width="56" height="56" viewBox="0 0 66 66" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M57.5025 30.5801C57.5025 44.0276 47.74 56.6226 34.4025 60.3076C33.495 60.5551 32.505 60.5551 31.5975 60.3076C18.26 56.6226 8.4975 44.0276 8.4975 30.5801V18.5075C8.4975 16.2525 10.2025 13.695 12.32 12.8425L27.6375 6.57263C31.075 5.17013 34.9525 5.17013 38.39 6.57263L53.7075 12.8425C55.7975 13.695 57.53 16.2525 57.53 18.5075L57.5025 30.5801Z" stroke="url(#paint0_linear_320_3375)" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
<path d="M33 34.375C36.0376 34.375 38.5 31.9126 38.5 28.875C38.5 25.8374 36.0376 23.375 33 23.375C29.9624 23.375 27.5 25.8374 27.5 28.875C27.5 31.9126 29.9624 34.375 33 34.375Z" stroke="url(#paint1_linear_320_3375)" stroke-width="3" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
<path d="M33 34.375V42.625" stroke="url(#paint2_linear_320_3375)" stroke-width="3" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
<defs>
<linearGradient id="paint0_linear_320_3375" x1="33.0138" y1="5.52075" x2="33.0138" y2="60.4932" gradientUnits="userSpaceOnUse">
<stop stop-color="#2EC0C0" />
<stop offset="1" stop-color="#087373" />
</linearGradient>
<linearGradient id="paint1_linear_320_3375" x1="33" y1="23.375" x2="33" y2="34.375" gradientUnits="userSpaceOnUse">
<stop stop-color="#2EC0C0" />
<stop offset="1" stop-color="#087373" />
</linearGradient>
<linearGradient id="paint2_linear_320_3375" x1="33.5" y1="34.375" x2="33.5" y2="42.625" gradientUnits="userSpaceOnUse">
<stop stop-color="#087373" />
<stop offset="1" stop-color="#2EC0C0" />
</linearGradient>
</defs>
</svg>
<h5 class="modal-title text-center" id="profilePasswordModalLabel">تغییر رمز دوربین</h5>
<h6 class="modal-title text-center">@Model.WorkshopName</h6>
</div>
<div class="modal-body">
<div id="codeDiv" style="display: none">
<div class="otp" style="display: none">
<input type="text" id="n0" class="form-control codeInput" placeholder="-" maxlength="1" autocomplete="off" autofocus data-next="1">
<input type="text" id="n1" class="form-control codeInput" placeholder="-" maxlength="1" autocomplete="off" data-next="2">
<input type="text" id="n2" class="form-control codeInput" placeholder="-" maxlength="1" autocomplete="off" data-next="3">
<input type="text" id="n3" class="form-control codeInput" placeholder="-" maxlength="1" autocomplete="off" data-next="4">
<input type="text" id="n4" class="form-control codeInput" placeholder="-" maxlength="1" autocomplete="off" data-next="5">
<input type="text" id="n5" class="form-control codeInput" placeholder="-" maxlength="1" autocomplete="off">
</div>
<div class="text-center mt-2">
<div id="msg">
<p class="m-0">با کلیک بروی دکمه "دریافت کد"، کد یکبار مصرف برای شما ارسال میگردد.</p></div>
<div class="align-items-center justify-content-center" id="timerCount" style="display: none">
<div>
<p class="m-0">برای تغییر رمز ابتدا کد دریافتی را وارد کنید</p></div>
<p class="mx-1">زمان باقی مانده تا انقضاء کد دریافتی</p>
<p class="countdown" id="timer"></p>
</div>
</div>
</div>
<div class="text-center loading" style="display: none">
<div class="spinner-border" role="status">
<span class="visually-hidden">Loading...</span>
</div>
</div>
<div class="container p-0 m-0" id="form">
<div class="row">
<input type="hidden" name="Command.Id" value="@Model.Id" />
<div class="col-12">
<div class="d-flex align-items-center justify-content-between" style="background: #e8e8e8;padding: 7px; border: 1px solid #E1E1E1;border-radius: 10px;">
<span style="font-size: 13px;color: #626262;">حساب کاربری</span>
<span style="font-size: 13px;color: #626262;">@Model.Username</span>
</div>
</div>
<div class="col-12">
<div class="form-group text-start my-2">
<label for="signupInputPassword">گذرواژه</label>
<div class="position-relative">
<button type="button" class="position-absolute top-0 start-0 m-1 bg-transparent" onclick="passFunction()">
<svg class="eyeShow" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.58 11.9999C15.58 13.9799 13.98 15.5799 12 15.5799C10.02 15.5799 8.42004 13.9799 8.42004 11.9999C8.42004 10.0199 10.02 8.41992 12 8.41992C13.98 8.41992 15.58 10.0199 15.58 11.9999Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M12 20.27C15.53 20.27 18.82 18.19 21.11 14.59C22.01 13.18 22.01 10.81 21.11 9.39997C18.82 5.79997 15.53 3.71997 12 3.71997C8.46997 3.71997 5.17997 5.79997 2.88997 9.39997C1.98997 10.81 1.98997 13.18 2.88997 14.59C5.17997 18.19 8.46997 20.27 12 20.27Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<svg class="eyeClose" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.53 9.46992L9.47004 14.5299C8.82004 13.8799 8.42004 12.9899 8.42004 11.9999C8.42004 10.0199 10.02 8.41992 12 8.41992C12.99 8.41992 13.88 8.81992 14.53 9.46992Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M17.82 5.76998C16.07 4.44998 14.07 3.72998 12 3.72998C8.46997 3.72998 5.17997 5.80998 2.88997 9.40998C1.98997 10.82 1.98997 13.19 2.88997 14.6C3.67997 15.84 4.59997 16.91 5.59997 17.77" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M8.42004 19.5299C9.56004 20.0099 10.77 20.2699 12 20.2699C15.53 20.2699 18.82 18.1899 21.11 14.5899C22.01 13.1799 22.01 10.8099 21.11 9.39993C20.78 8.87993 20.42 8.38993 20.05 7.92993" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M15.5099 12.7C15.2499 14.11 14.0999 15.26 12.6899 15.52" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9.47 14.53L2 22" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M22 2L14.53 9.47" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
<input name="Command.Password" type="password" autocomplete="new-password" class="form-control mb-1" id="signupInputPassword" aria-describedby="passwordHelp" placeholder="رمز جدید" style="direction: ltr;" />
<div class="input-icon-right peek-password-button" data-peek-password="signupInputPassword">
<span class="peek-password-icon icon-visibility d-none"></span>
</div>
</div>
<div class="password-strength-group" data-strength="">
<div id="password-strength-meter" class="password-strength-meter" style="direction: ltr;">
<div class="meter-block"></div>
<div class="meter-block"></div>
<div class="meter-block"></div>
<div class="meter-block"></div>
</div>
<div class="password-strength-message">
<div class="message-item">
ضعیف
</div>
<div class="message-item">
متوسط
</div>
<div class="message-item">
خوب
</div>
<div class="message-item">
عالی
</div>
</div>
</div>
</div>
</div>
<div class="col-12">
<div class="form-group mt-3">
<div class="position-relative">
<input type="password" name="Command.RePassword" class="form-control" id="repeat_password" placeholder="تکرار گذرواژه" style="direction: ltr;"/>
<button type="button" class="position-absolute top-0 start-0 m-1 bg-transparent" onclick="rePassFunction()">
<svg class="reEyeShow" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.58 11.9999C15.58 13.9799 13.98 15.5799 12 15.5799C10.02 15.5799 8.42004 13.9799 8.42004 11.9999C8.42004 10.0199 10.02 8.41992 12 8.41992C13.98 8.41992 15.58 10.0199 15.58 11.9999Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M12 20.27C15.53 20.27 18.82 18.19 21.11 14.59C22.01 13.18 22.01 10.81 21.11 9.39997C18.82 5.79997 15.53 3.71997 12 3.71997C8.46997 3.71997 5.17997 5.79997 2.88997 9.39997C1.98997 10.81 1.98997 13.18 2.88997 14.59C5.17997 18.19 8.46997 20.27 12 20.27Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<svg class="reEyeClose" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.53 9.46992L9.47004 14.5299C8.82004 13.8799 8.42004 12.9899 8.42004 11.9999C8.42004 10.0199 10.02 8.41992 12 8.41992C12.99 8.41992 13.88 8.81992 14.53 9.46992Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M17.82 5.76998C16.07 4.44998 14.07 3.72998 12 3.72998C8.46997 3.72998 5.17997 5.80998 2.88997 9.40998C1.98997 10.82 1.98997 13.19 2.88997 14.6C3.67997 15.84 4.59997 16.91 5.59997 17.77" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M8.42004 19.5299C9.56004 20.0099 10.77 20.2699 12 20.2699C15.53 20.2699 18.82 18.1899 21.11 14.5899C22.01 13.1799 22.01 10.8099 21.11 9.39993C20.78 8.87993 20.42 8.38993 20.05 7.92993" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M15.5099 12.7C15.2499 14.11 14.0999 15.26 12.6899 15.52" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9.47 14.53L2 22" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M22 2L14.53 9.47" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
<div id="passwordErrorMessage" class="text-danger" style="text-align: start; font-size: 12px; position: absolute; bottom: -20px;"></div>
</div>
</div>
</div>
<div class="ShowMessage d-none">
<p class="m-0" id="ShowAccountMessage"></p>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<div class="container m-0">
<div class="row">
<div class="col-6 text-end">
<button type="button" class="btn-cancel2 justify-content-center w-100" id="prev-step" data-bs-dismiss="modal" aria-label="Close">انصراف</button>
</div>
<div class="col-6 text-start">
<button type="button" class="btn-primary w-100" id="sentCode" style="display: none" onclick="handleSmsReceiverClick()">دریافت کد مجدد</button>
<button type="button" class="btn-primary w-100 disable" id="submit" style="display: none" onclick="changePasswordCameraAccount()">تایید کد</button>
<button type="button" class="btn-primary w-100" id="btnSmsReceiver">ثبت ویرایش</button>
</div>
</div>
</div>
</div>
</div>
</form>
<script>
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
var saveCameraAccountPasswordChangeAjax = `@Url.Page("./Index", "ChangeCameraPassword")`;
var sendSmsAjax = `@Url.Page("./Index", "SendSms")`;
var checkCodeAjax = `@Url.Page("./Index", "CheckCode")`;
var ajaxCameraValidation = `@Url.Page("./Index", "CameraValidation")`;
</script>
<script src="~/assetsclient/pages/RollCall/js/ModalCameraAccountChangePassword.js?ver=@clientVersion"></script>

View File

@@ -0,0 +1,171 @@
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model AccountManagement.Application.Contracts.CameraAccount.CreateCameraAccount
@{
string clientVersion = _0_Framework.Application.Version.StyleVersion;
<link rel="stylesheet" href="~/AssetsClient/css/rollcall-package.css">
<link href="~/assetsclient/pages/rollcall/css/modalcreateaccountsetting.css?ver=@clientVersion" rel="stylesheet" />
}
<form role="form" method="post" name="create-form" id="create-form" autocomplete="off">
<div class="modal-content">
<div class="modal-header d-block text-center">
<svg width="56" height="56" viewBox="0 0 66 66" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M57.5025 30.5801C57.5025 44.0276 47.74 56.6226 34.4025 60.3076C33.495 60.5551 32.505 60.5551 31.5975 60.3076C18.26 56.6226 8.4975 44.0276 8.4975 30.5801V18.5075C8.4975 16.2525 10.2025 13.695 12.32 12.8425L27.6375 6.57263C31.075 5.17013 34.9525 5.17013 38.39 6.57263L53.7075 12.8425C55.7975 13.695 57.53 16.2525 57.53 18.5075L57.5025 30.5801Z" stroke="url(#paint0_linear_320_3375)" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
<path d="M33 34.375C36.0376 34.375 38.5 31.9126 38.5 28.875C38.5 25.8374 36.0376 23.375 33 23.375C29.9624 23.375 27.5 25.8374 27.5 28.875C27.5 31.9126 29.9624 34.375 33 34.375Z" stroke="url(#paint1_linear_320_3375)" stroke-width="3" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
<path d="M33 34.375V42.625" stroke="url(#paint2_linear_320_3375)" stroke-width="3" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round" />
<defs>
<linearGradient id="paint0_linear_320_3375" x1="33.0138" y1="5.52075" x2="33.0138" y2="60.4932" gradientUnits="userSpaceOnUse">
<stop stop-color="#2EC0C0" />
<stop offset="1" stop-color="#087373" />
</linearGradient>
<linearGradient id="paint1_linear_320_3375" x1="33" y1="23.375" x2="33" y2="34.375" gradientUnits="userSpaceOnUse">
<stop stop-color="#2EC0C0" />
<stop offset="1" stop-color="#087373" />
</linearGradient>
<linearGradient id="paint2_linear_320_3375" x1="33.5" y1="34.375" x2="33.5" y2="42.625" gradientUnits="userSpaceOnUse">
<stop stop-color="#087373" />
<stop offset="1" stop-color="#2EC0C0" />
</linearGradient>
</defs>
</svg>
<h5 class="modal-title text-center" id="profilePasswordModalLabel">ساخت اکانت جدید</h5>
<h6 class="modal-title text-center">@Model.WorkshopName</h6>
</div>
<div class="modal-body">
<div class="container p-0 m-0" id="step-form1">
<div class="row">
<div class="col-12">
<div class="form-group text-start">
<label for="username">حساب کاربری</label>
<div class="position-relative">
<input type="text" class="form-control" id="username" asp-for="Username" placeholder="" style="direction: ltr;" />
<div class="position-absolute top-0 start-0 m-1 bg-transparent">
<div class="spinner-border spinner-border-sm m-1 d-none" id="loadingSpinner" role="status">
<span class="visually-hidden">Loading...</span>
</div>
<svg id="successSvg" class="d-none" width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="14" cy="14" r="10.5" stroke="#65A30D" stroke-width="1.5"/>
<path d="M9.33342 14L12.8334 17.5L18.6667 10.5" stroke="#65A30D" stroke-width="1.5" stroke-linecap="round"/>
</svg>
<svg id="errorSvg" class="d-none" width="28" height="28" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
<path stroke="#ef4444" stroke-linecap="round" stroke-linejoin="round" d="m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>
</svg>
</div>
</div>
</div>
</div>
<div class="col-12">
<div class="form-group text-start my-2">
<label for="signupInputPassword">گذرواژه</label>
<div class="position-relative">
<input asp-for="Password" type="password" class="form-control mb-1" id="signupInputPassword" aria-describedby="passwordHelp" placeholder="رمز جدید" style="direction: ltr;" />
<button type="button" class="position-absolute top-0 start-0 m-1 bg-transparent" onclick="passFunction()">
<svg class="eyeShow" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.58 11.9999C15.58 13.9799 13.98 15.5799 12 15.5799C10.02 15.5799 8.42004 13.9799 8.42004 11.9999C8.42004 10.0199 10.02 8.41992 12 8.41992C13.98 8.41992 15.58 10.0199 15.58 11.9999Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
<path d="M12 20.27C15.53 20.27 18.82 18.19 21.11 14.59C22.01 13.18 22.01 10.81 21.11 9.39997C18.82 5.79997 15.53 3.71997 12 3.71997C8.46997 3.71997 5.17997 5.79997 2.88997 9.39997C1.98997 10.81 1.98997 13.18 2.88997 14.59C5.17997 18.19 8.46997 20.27 12 20.27Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<svg class="eyeClose" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.53 9.46992L9.47004 14.5299C8.82004 13.8799 8.42004 12.9899 8.42004 11.9999C8.42004 10.0199 10.02 8.41992 12 8.41992C12.99 8.41992 13.88 8.81992 14.53 9.46992Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
<path d="M17.82 5.76998C16.07 4.44998 14.07 3.72998 12 3.72998C8.46997 3.72998 5.17997 5.80998 2.88997 9.40998C1.98997 10.82 1.98997 13.19 2.88997 14.6C3.67997 15.84 4.59997 16.91 5.59997 17.77" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
<path d="M8.42004 19.5299C9.56004 20.0099 10.77 20.2699 12 20.2699C15.53 20.2699 18.82 18.1899 21.11 14.5899C22.01 13.1799 22.01 10.8099 21.11 9.39993C20.78 8.87993 20.42 8.38993 20.05 7.92993" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
<path d="M15.5099 12.7C15.2499 14.11 14.0999 15.26 12.6899 15.52" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
<path d="M9.47 14.53L2 22" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
<path d="M22 2L14.53 9.47" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</button>
<div class="input-icon-right peek-password-button" data-peek-password="signupInputPassword">
<span class="peek-password-icon icon-visibility d-none"></span>
</div>
</div>
<div class="password-strength-group" data-strength="">
<div id="password-strength-meter" class="password-strength-meter" style="direction: ltr;">
<div class="meter-block"></div>
<div class="meter-block"></div>
<div class="meter-block"></div>
<div class="meter-block"></div>
</div>
<div class="password-strength-message">
<div class="message-item">
ضعیف
</div>
<div class="message-item">
متوسط
</div>
<div class="message-item">
خوب
</div>
<div class="message-item">
عالی
</div>
</div>
</div>
</div>
</div>
<div class="col-12">
<div class="form-group mt-3">
<div class="position-relative">
<input type="password" asp-for="RePassword" class="form-control" id="repeat_password" placeholder="تکرار گذرواژه" style="direction: ltr;" />
<button type="button" class="position-absolute top-0 start-0 m-1 bg-transparent" onclick="rePassFunction()">
<svg class="reEyeShow" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.58 11.9999C15.58 13.9799 13.98 15.5799 12 15.5799C10.02 15.5799 8.42004 13.9799 8.42004 11.9999C8.42004 10.0199 10.02 8.41992 12 8.41992C13.98 8.41992 15.58 10.0199 15.58 11.9999Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
<path d="M12 20.27C15.53 20.27 18.82 18.19 21.11 14.59C22.01 13.18 22.01 10.81 21.11 9.39997C18.82 5.79997 15.53 3.71997 12 3.71997C8.46997 3.71997 5.17997 5.79997 2.88997 9.39997C1.98997 10.81 1.98997 13.18 2.88997 14.59C5.17997 18.19 8.46997 20.27 12 20.27Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<svg class="reEyeClose" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.53 9.46992L9.47004 14.5299C8.82004 13.8799 8.42004 12.9899 8.42004 11.9999C8.42004 10.0199 10.02 8.41992 12 8.41992C12.99 8.41992 13.88 8.81992 14.53 9.46992Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
<path d="M17.82 5.76998C16.07 4.44998 14.07 3.72998 12 3.72998C8.46997 3.72998 5.17997 5.80998 2.88997 9.40998C1.98997 10.82 1.98997 13.19 2.88997 14.6C3.67997 15.84 4.59997 16.91 5.59997 17.77" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
<path d="M8.42004 19.5299C9.56004 20.0099 10.77 20.2699 12 20.2699C15.53 20.2699 18.82 18.1899 21.11 14.5899C22.01 13.1799 22.01 10.8099 21.11 9.39993C20.78 8.87993 20.42 8.38993 20.05 7.92993" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
<path d="M15.5099 12.7C15.2499 14.11 14.0999 15.26 12.6899 15.52" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
<path d="M9.47 14.53L2 22" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
<path d="M22 2L14.53 9.47" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</button>
<div id="passwordErrorMessage" class="text-danger" style="text-align: start;font-size: 12px;position: absolute;bottom: -20px;"></div>
</div>
</div>
</div>
<div class="ShowMessage d-none">
<p class="m-0" id="ShowAccountMessage"></p>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<div class="container m-0">
<div class="row">
<div class="col-6 text-end">
<button type="button" class="btn-cancel2 justify-content-center w-100" data-bs-dismiss="modal">انصراف</button>
</div>
<div class="col-6 text-start">
<button type="button" class="btn-register w-100" onclick="checkAccountExist()">ثبت</button>
</div>
</div>
</div>
</div>
</div>
</form>
<script src="~/assetsclient/libs/cleave/cleave.min.js"></script>
<script>
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
var checkAccountAjax = `@Url.Page("./Index", "CheckAccount")`;
var saveCreateCameraAccountUrl = `@Url.Page("./Index", "CreateCameraAccount")`;
console.log(checkAccountAjax);
console.log(saveCreateCameraAccountUrl);
</script>
<script src="~/assetsclient/pages/rollcall/CameraAccounts/js/modalcameraaccount.js?ver=@clientVersion"></script>

View File

@@ -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>

View File

@@ -0,0 +1,321 @@
@page
@using _0_Framework.Domain.CustomizeCheckoutShared.Enums
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model ServiceHost.Areas.Client.Pages.Company.RollCall._WorkshopSetting.IndexModel
@{
ViewData["Title"] = " - " + "حضور و غیاب";
string clientVersion = _0_Framework.Application.Version.StyleVersion;
int index = 1;
int i = 0;
<link href="~/assetsclient/css/card.css?ver=@clientVersion" rel="stylesheet"/>
var isRegularWorkshop = Model.WorkshopSettingsDetails.WorkshopShiftStatus == WorkshopShiftStatus.Regular ? true : false;
<style>
.flex-container {
display: flex;
align-items: center;
padding: 10px;
position: relative;
}
.flex-container::after {
content: ""; /* Use an empty string for proper styling */
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: 1px;
background-color: #D9D9D9;
margin: 0;
padding: 0;
width: 100%;
}
.flex-end {
margin-right: auto;
}
.card-management {
font-size: 14px;
font-weight: 600;
color: #444444
}
.button-edit {
width: 100%;
height: 33px;
border: 1px solid #009EE2;
background-color: #C2F1F1;
font-size: 12px;
font-weight: 400;
color: #009EE2;
border-radius: 5px;
transition: opacity 0.3s ease;
}
.button-edit:hover {
opacity: 0.7;
}
.custom-gap {
gap: 18px;
}
.turn {
text-align: center;
height: 45px;
line-height: 45px;
color: #224B94;
background-color: #EFF7FF;
font-size: 12px;
font-weight: 500;
border-radius: 5px;
}
.custom-position {
position: absolute; /* Enable absolute positioning */
top: -22px; /* Set custom top position */
right: 18px; /* Set custom right position */
}
@@media (min-width: 760px) {
.flex-container {
display: flex;
justify-content: space-between;
align-items: center;
padding: 6px;
position: relative;
}
.card-management {
font-size: 14px;
font-weight: 600;
color: #444444
}
.button-edit {
width: 70px;
height: 27px;
border: 1px solid #009EE2;
background-color: #C2F1F1;
font-size: 12px;
font-weight: 400;
color: #009EE2;
border-radius: 5px
}
.turn {
text-align: center;
width: 118px;
height: 33px;
line-height: 33px;
color: #224B94;
background-color: #EFF7FF;
font-size: 12px;
font-weight: 500;
border-radius: 5px;
}
.custom-gap {
gap: 50px;
gap: 50px;
}
}
.mostamar-description {
width: 100%;
text-align: center;
height: 33px;
line-height: 33px;
color: #224B94;
background-color: #EFF7FF;
font-size: 12px;
font-weight: 500;
border-radius: 5px
}
@@media (min-width: 760px) {
.mostamar-description {
width: 272px;
}
}
</style>
}
<!-- MAIN CONTENT -->
<div class="content-container">
<div class="container-fluid">
<div class="row p-2">
<div class="col p-0 m-0 d-flex align-items-center justify-content-between">
<div class="col d-flex align-items-center justify-content-start">
<img src="~/AssetsClient/images/icons/face-scan.png" alt="" class="img-fluid me-2" style="width: 45px;"/>
<div>
<h4 class="title d-flex align-items-center">تنظیم ساعات کاری مجموعه</h4>
<div>@Model.WorkshopFullName</div>
</div>
</div>
<div>
<a asp-page="/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row p-2">
<div class="profile-header position-relative">
<img src="~/AssetsClient/images/profile-header.png" alt="" class="img-fluid">
</div>
</div>
</div>
<div class="container-fluid">
<div class="row px-2 py-0">
<div class="card px-0 custom-pt pb-1 d-flex flex-column w-100">
<div class="flex-container gap-4 mb-3 mb-md-2 ">
<div>
<svg width="34" height="34" viewBox="0 0 34 34" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="17" cy="17" r="12.75" fill="#9CD8D8"/>
<path d="M17.0007 7.38203C17.0007 7.23977 17.0007 7.16863 17.0462 7.12444C17.0918 7.08025 17.1614 7.08235 17.3006 7.08657C18.9374 7.13609 20.5382 7.59029 21.959 8.41061C23.4665 9.28098 24.7184 10.5328 25.5887 12.0404C26.4591 13.5479 26.9173 15.258 26.9173 16.9987C26.9173 18.7394 26.4591 20.4495 25.5887 21.957C24.7184 23.4646 23.4665 24.7164 21.959 25.5868C20.4515 26.4572 18.7414 26.9154 17.0006 26.9154C15.2599 26.9154 13.5498 26.4572 12.0423 25.5868C10.6215 24.7665 9.42776 23.6073 8.56648 22.2145C8.49321 22.0961 8.45657 22.0368 8.47207 21.9753C8.48757 21.9137 8.54917 21.8782 8.67237 21.807L16.8506 17.0853C16.9239 17.043 16.9605 17.0219 16.9806 16.9871C17.0007 16.9523 17.0007 16.91 17.0007 16.8255V7.38203Z" fill="#23A8A8"/>
</svg>
</div>
<span class="card-management">
تنظیم ساعات کاری مجموعه
@if (Model.WorkshopSettingsDetails.Id != 0)
{
<span> - @(isRegularWorkshop ? "منقطع" : "مستمر")</span>
}
</span>
<button class="flex-end button-edit d-none d-md-block @(Model.WorkshopSettingsDetails.Id == 0 ? "disable" : "")" onclick="modalOpenWorkshopSetting()">ویرایش</button>
</div>
@* <input type="hidden" name="customizeWorkshopSettingsId" id="customizeWorkshopSettingsId" value="@Model.Id"/> *@
<div class="d-flex px-2 justify-md-content-center justify-content-sm-start align-items-center custom-gap mb-3 mb-md-2">
@if (Model.WorkshopSettingsDetails.Id != 0)
{
@if (isRegularWorkshop)
{
@foreach (var item in Model.WorkshopSettingsDetails.ShiftsList.OrderBy(x => x.Placement))
{
<div class="d-flex flex-grow-1 flex-md-grow-0 gap-3 align-items-center ps-3">
<span class="d-none d-md-block" style="font-size: 10px; font-weight: 500; color: #5C5C5C;">
@if (item.Placement == ShiftPlacement.First)
{
@("نوبت اول")
}
else if (item.Placement == ShiftPlacement.Second)
{
@("نوبت دوم")
}
else
{
@("نوبت سوم")
}
</span>
<div class="d-flex flex-grow-1 flex-md-grow-0 turn justify-content-around position-relative">
<span class="position-absolute custom-position d-block d-md-none" style="font-size: 10px; font-weight: 500; color: #5C5C5C;">
@if (item.Placement == ShiftPlacement.First)
{
@("نوبت اول")
}
else if (item.Placement == ShiftPlacement.Second)
{
@("نوبت دوم")
}
else
{
@("نوبت سوم")
}
</span>
<span>@item.StartTime</span>
<span>الی</span>
<span>@item.EndTime</span>
</div>
</div>
}
}
else
{
<div class="mostamar-description ps-3 ">
مجموعه بدون وقفه و بصورت مستمر فعال می‌باشد
</div>
}
}
else
{
<div class="d-flex flex-grow-1 flex-md-grow-0 gap-3 align-items-center ps-3">
<span class="d-none d-md-block" style="font-size: 10px; font-weight: 500; color: #5C5C5C;">
نوبت اول
</span>
<div class="d-flex flex-grow-1 flex-md-grow-0 turn justify-content-around position-relative">
<span class="position-absolute custom-position d-block d-md-none" style="font-size: 10px; font-weight: 500; color: #5C5C5C;">
نوبت اول
</span>
<span>-</span>
<span>الی</span>
<span>-</span>
</div>
</div>
}
</div>
<div class="px-2 d-flex w-full">
<button class=" button-edit d-block d-md-none @(Model.WorkshopSettingsDetails.Id == 0 ? "disable" : "")" onclick="modalOpenWorkshopSetting()">ویرایش</button>
</div>
</div>
</div>
</div>
</div>
<!-- END MAIN CONTENT -->
<div id="MainModal" class="modal fade groupSettingModall" aria-labelledby="myModalLabel" aria-hidden="true" tabindex="-1" data-bs-backdrop="static" style="display: none;">
<div class="modal-dialog modal-md modal-dialog-centered groupSettingModall-width">
<div class="modal-content" id="ModalContent">
</div>
</div>
</div>
@section Script {
<script src="~/assetsclient/js/site.js?ver=@clientVersion"></script>
<script>
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
var saveEditSettingWorkTimeAjax = `@Url.Page("./Index", "EditSettingWorkTime")`;
var getGroupListAndEmployeeListAjax = `@Url.Page("./Index", "GroupListAndEmployeeList")`;
var hasWorkshopSetting = @(Model.WorkshopSettingsDetails.Id == 0 ? "false" : "true");
// var IsRegularWorkshop = @@(Model.WorkshopShiftStatus == WorkshopShiftStatus.Regular? "true" : "false");
$(document).ready(function() {
if (!hasWorkshopSetting) {
modalOpenWorkshopSetting();
}
});
function modalOpenWorkshopSetting() {
window.location.href = `#showmodal=/Client/Company/RollCall/WorkshopSetting/Index?handler=WorkshopSettingModal`;
}
</script>
}

View File

@@ -0,0 +1,128 @@
using _0_Framework.Application;
using _0_Framework.Infrastructure;
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Configuration.UserSecrets;
using System.Security.Claims;
using CompanyManagment.App.Contracts.Error;
using CompanyManagment.App.Contracts.Workshop;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using AccountManagement.Application.Contracts.CameraAccount;
using CompanyManagment.App.Contracts.RollCall;
using System.Transactions;
namespace ServiceHost.Areas.Client.Pages.Company.RollCall._WorkshopSetting
{
[Authorize]
[NeedsPermission(SubAccountPermissionHelper.RollCallOperationsPermissionCode)]
public class IndexModel : PageModel
{
private readonly IWorkshopApplication _workshopApplication;
private readonly ICustomizeWorkshopSettingsApplication _customizeWorkshopSettingsApplication;
private readonly IPasswordHasher _passwordHasher;
private readonly IAuthHelper _authHelper;
private readonly IHttpContextAccessor _contextAccessor;
private readonly long _workshopId;
public EditCustomizeWorkshopSettings WorkshopSettingsDetails;
public string WorkshopFullName;
public IndexModel(IAuthHelper authHelper, IPasswordHasher passwordHasher, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IHttpContextAccessor contextAccessor, IWorkshopApplication workshopApplication)
{
_authHelper = authHelper;
_passwordHasher = passwordHasher;
_customizeWorkshopSettingsApplication = customizeWorkshopSettingsApplication;
_contextAccessor = contextAccessor;
_workshopApplication = workshopApplication;
var workshopHash = _contextAccessor.HttpContext?.User.FindFirstValue("WorkshopSlug");
_workshopId = _passwordHasher.SlugDecrypt(workshopHash);
if (_workshopId < 1)
throw new InvalidDataException("اختلال در کارگاه");
}
public IActionResult OnGet()
{
WorkshopFullName = _workshopApplication.GetWorkshopInfo(_workshopId).WorkshopFullName;
WorkshopSettingsDetails = _customizeWorkshopSettingsApplication.GetWorkshopSettingsDetails(_workshopId);
return Page();
}
public IActionResult OnGetWorkshopSettingModal()
{
var command = _customizeWorkshopSettingsApplication.GetSimpleWorkshopSettings(_workshopId);
if (command.Id == 0)
{
var newCommand = new CreateCustomizeWorkshopSettings();
return Partial("_Partials/ModalCreateSettingWorkshop", newCommand);
}
return Partial("_Partials/ModalSettingWorkTime", command);
}
public IActionResult OnPostSaveNewWorkshopSetting(CreateCustomizeWorkshopSettings command)
{
string finalMessage = "";
using (var transaction = new TransactionScope())
{
var result = _customizeWorkshopSettingsApplication.CreateWorkshopSettings(command);
finalMessage = result.Message;
if (!result.IsSuccedded)
{
return new JsonResult(new
{
Success = false,
message = finalMessage,
});
}
transaction.Complete();
}
return new JsonResult(new
{
Success = true,
message = finalMessage,
});
}
public IActionResult OnGetGroupListAndEmployeeList(long customizeWorkshopSettingsId)
{
var resultData = _customizeWorkshopSettingsApplication.GetShiftChangesGroupAndEmployees(customizeWorkshopSettingsId);
var success = resultData.Any();
return new JsonResult(new
{
success = success,
data = resultData,
});
}
public IActionResult OnPostEditSettingWorkTime(List<CustomizeWorkshopShiftViewModel> shiftViewModels,
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus, FridayWork fridayWork, HolidayWork holidayWork)
{
var workshopHash = User.FindFirstValue("WorkshopSlug");
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
if (workshopId < 1)
return new JsonResult(new
{
success = false,
message = "هیچ کارگاهی یافت نشد!",
});
var result = _customizeWorkshopSettingsApplication
.EditWorkshopSettingShifts(shiftViewModels, customizeWorkshopSettingsId, workshopShiftStatus, fridayWork, holidayWork);
return new JsonResult(new
{
success = result.IsSuccedded,
message = result.Message,
});
}
}
}

View File

@@ -0,0 +1,157 @@
@using _0_Framework.Domain.CustomizeCheckoutShared.Enums
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model CompanyManagment.App.Contracts.CustomizeWorkshopSettings.CreateCustomizeWorkshopSettings
@{
string clientVersion = _0_Framework.Application.Version.StyleVersion;
<link rel="stylesheet" href="~/AssetsClient/css/rollcall-package.css">
<link href="~/assetsclient/pages/rollcall/workshopsetting/css/modalcreatesettingworkshop.css?ver=@clientVersion" rel="stylesheet" />
}
<form role="form" method="post" name="create-form" id="create-form" autocomplete="off">
<div class="modal-content">
<div class="modal-header d-block text-center mb-2">
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
<h6>تنظیم ساعات کاری</h6>
</div>
<div class="modal-body">
<div class="container p-0 m-0" id="step-form2">
<div class="p-0 m-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 mb-2">
<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="WorkshopShiftStatus" id="organized" class="radio-workTimeOption" checked="checked">
<label for="organized" 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>
</div>
</div>
</div>
<div class="row" id="step_workTimeOption" style="height: 0">
<div class="col-12" id="appendChildTimeWorkHtml">
<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="ShiftsList[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="ShiftsList[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 dateTime" name="ShiftsList[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 class="d-flex align-items-center justify-content-center w-100 my-2">
<button type="button" class="btnAddTimeWork">
<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="mx-1 btnAppendChildTimeWork">افزودن نوبت دوم</div>
</button>
</div>
<div class="ShowMessage d-none">
<p class="m-0" id="ShowSettingMessage"></p>
</div>
</div>
<div id="step_workTimeOptionIrregular" style="display: none">
<div class="show-disorganized mt-5">
<p class="m-0">مجموعه بدون وقفه و بصورت مستمر فعال می‌باشد</p>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<div class="container my-2">
<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 justify-content-center w-100" data-bs-dismiss="modal">انصراف</button>
</div>
<div class="col-6 text-start">
<button type="button" class="btn-register w-100" onclick="saveNewWorkshopSetting()">ثبت</button>
</div>
</div>
</div>
</div>
</div>
</form>
<script src="~/assetsclient/libs/cleave/cleave.min.js"></script>
<script>
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
var saveNewWorkshopSettingUrl = `@Url.Page("./Index", "SaveNewWorkshopSetting")`;
console.log(saveNewWorkshopSettingUrl);
</script>
<script src="~/assetsclient/pages/rollcall/workshopsetting/js/modalcreatesettingworkshop.js?ver=@clientVersion"></script>

View File

@@ -0,0 +1,235 @@
@using _0_Framework.Domain.CustomizeCheckoutShared.Enums
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model CompanyManagment.App.Contracts.CustomizeWorkshopSettings.EditCustomizeWorkshopSettings
@{
string clientVersion = _0_Framework.Application.Version.StyleVersion;
int i = 0;
<link rel="stylesheet" href="~/AssetsClient/css/rollcall-package.css">
<link href="~/assetsclient/pages/rollcall/workshopsetting/css/ModalSettingWorkTime.css?ver=@clientVersion" rel="stylesheet" />
}
<form role="form" method="post" name="create-form" id="create-form" autocomplete="off">
<div class="modal-content">
<div class="modal-header d-block text-center mb-2">
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
<h6>تنظیم ساعات کاری</h6>
</div>
<div class="modal-body">
<div class="container p-0 m-0">
<div class="row p-0 m-0">
<div class="d-flex flex-column align-items-center justify-content-center h-100 p-0">
<div class="d-flex align-items-center justify-content-center mb-2">
<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="workshopShiftStatus" id="organized" class="radio-workTimeOption">
<label for="organized" 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>
</div>
</div>
</div>
<div class="row" id="step_workTimeOption" style="height: 0">
<input type="hidden" name="customizeWorkshopSettingsId" id="customizeWorkshopSettingsId" value="@Model.Id"/>
<div class="col-12" id="appendChildTimeWorkHtml">
@if (Model.ShiftsList.Any())
{
@foreach (var item in Model.ShiftsList.OrderBy(x => x.Placement))
{
<div class="groupBox">
<div class="row align-items-center justify-content-between">
<div class="col-2 d-flex align-items-center">
<input type="hidden" name="shiftViewModels[@i].Placement" value="@item.Placement"/>
<div class="timeWorkTitle">
@if (item.Placement == ShiftPlacement.First)
{
@("نوبت اول")
}
else if (item.Placement == ShiftPlacement.Second)
{
@("نوبت دوم")
}
else
{
@("نوبت سوم")
}
</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="shiftViewModels[@i].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="shiftViewModels[@i].EndTime" value="@item.EndTime" placeholder="00:00" style="direction: ltr;">
</div>
@if (i == 0)
{
<div class="col-2 d-flex align-items-center justify-content-end">
</div>
}
else
{
<div class="col-2 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>
i++;
}
}
else
{
<div class="groupBox">
<div class="row align-items-center justify-content-between">
<div class="col-2 d-flex align-items-center">
<input type="hidden" name="shiftViewModels[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="shiftViewModels[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="shiftViewModels[0].EndTime" value="" placeholder="00:00" style="direction: ltr;">
</div>
<div class="col-2 d-flex align-items-center justify-content-end">
</div>
</div>
</div>
}
</div>
<div class="d-flex align-items-center justify-content-center w-100 my-2">
<button type="button" class="btnAddTimeWork" style="visibility: hidden">
<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="mx-1 btnAppendChildTimeWork">افزودن نوبت دوم</div>
</button>
</div>
<div class="ShowMessage d-none">
<p class="m-0" id="ShowSettingMessage"></p>
</div>
</div>
<div id="step_workTimeOptionIrregular" style="display: none">
<div class="show-disorganized mt-5">
<p class="m-0">مجموعه بدون وقفه و بصورت مستمر فعال می‌باشد</p>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<div class="container my-2">
<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" data-bs-dismiss="modal" aria-label="Close">انصراف</button>
</div>
<div class="col-6 text-start">
@* <button type="button" onclick="actionForShowModalReplaceChange()" class="btn-register w-100">ثبت</button> *@
<button type="button" onclick="saveEditSettingWorkTime()" class="btn-register w-100">ثبت</button>
</div>
</div>
</div>
</div>
</div>
<!-- مودال -->
@* <div id="ConfirmEmployeeModal" style="display: none" data-bs-backdrop="static" aria-hidden="true" tabindex="-1">
<div class="modal-dialog modal-dialog-centered ConfirmEmployeeSection">
<div class="" id="ModalConfirmEmployeeChange">
<partial name="_ModalWorkTimePartials/ConfirmReplaceGroupAndEmployee" />
</div>
</div>
</div> *@
<!-- مودال -->
</form>
<script src="~/assetsclient/libs/cleave/cleave.min.js"></script>
<script>
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
var saveEditSettingWorkTimeAjax = `@Url.Page("./Index", "EditSettingWorkTime")`;
var getGroupListAndEmployeeListAjax = `@Url.Page("./Index", "GroupListAndEmployeeList")`;
var IsRegularWorkshop = @(Model.WorkshopShiftStatus == WorkshopShiftStatus.Regular? "true" : "false");
</script>
<script src="~/assetsclient/pages/rollcall/WorkshopSetting/js/ModalSettingWorkTime.js?ver=@clientVersion"></script>

View File

@@ -128,11 +128,11 @@
$(id).toggleClass('disable', shouldDisable);
});
if (shouldDisable) {
$('#SetWorkshopWorkingHoursPageUrl a').attr('href', linkCameraAccountAndWorkshopSettingUrl);
} else {
$('#SetWorkshopWorkingHoursPageUrl').removeClass('disable');
}
// if (shouldDisable) {
// $('#SetWorkshopWorkingHoursPageUrl a').attr('href', linkCameraAccountAndWorkshopSettingUrl);
// } else {
// $('#SetWorkshopWorkingHoursPageUrl').removeClass('disable');
// }
} else {
$('#RollCallSubMenu').addClass('disable');
}

View File

@@ -187,8 +187,8 @@
<li id="ListCurrentDayRollCallsPageUrl" Permission="@SubAccountPermissionHelper.ListCurrentDayRollCallsPermissionCode"><a class="selectLi" asp-page="/Company/RollCall/CurrentDay"><span>حضور و غیاب جاری</span></a></li>
<li id="ListRollCallHistoryPageUrl" Permission="@SubAccountPermissionHelper.ListRollCallHistoryPermissionCode"><a class="selectLi" asp-page="/Company/RollCall/CaseHistory"><span>سوابق حضور و غیاب</span></a></li>
<li id="GroupingOperationsPageUrl" Permission="@SubAccountPermissionHelper.GroupingOperationsPermissionCode"><a class="selectLi" asp-page="/Company/RollCall/Grouping"><span>گروه‌بندی</span></a></li>
<li id="SetWorkshopWorkingHoursPageUrl" Permission="@SubAccountPermissionHelper.SetWorkshopWorkingHoursPermissionCode"><a class="" href="#showmodal=@Url.Page("/Company/RollCall/Index", "EditSettingWorkTime")"><span>تنظیم ساعت فعالیت مجموعه</span></a></li>
<li id="CameraAccountSettingsPageUrl" Permission="@SubAccountPermissionHelper.CameraAccountSettingsPermissionCode"><a class="selectLi" asp-page="/Company/RollCall/CameraAccounts"><span>تنظیمات حساب کاربری دوربین</span></a></li>
<li id="SetWorkshopWorkingHoursPageUrl" Permission="@SubAccountPermissionHelper.SetWorkshopWorkingHoursPermissionCode"><a class="selectLi" asp-page="/Company/RollCall/WorkshopSetting/Index"><span>تنظیم ساعت فعالیت مجموعه</span></a></li>
<li id="CameraAccountSettingsPageUrl" Permission="@SubAccountPermissionHelper.CameraAccountSettingsPermissionCode"><a class="selectLi" asp-page="/Company/RollCall/CameraAccounts/Index"><span>تنظیمات حساب کاربری دوربین</span></a></li>
</ul>
</li>

View File

@@ -292,7 +292,6 @@
<None Include="Areas\Client\Pages\Company\Reward\Index.cshtml" />
<None Include="Areas\Client\Pages\Company\Reward\ModalCreateNewReward.cshtml" />
<None Include="Areas\Client\Pages\Company\Reward\ModalEditReward.cshtml" />
<None Include="Areas\Client\Pages\Company\RollCall\CameraAccounts.cshtml" />
<None Include="Areas\Client\Pages\Company\RollCall\CaseHistory.cshtml" />
<None Include="Areas\Client\Pages\Company\RollCall\CurrentDay.cshtml" />
<None Include="Areas\Client\Pages\Company\RollCall\EmployeeUploadPicture.cshtml" />

View File

@@ -0,0 +1,265 @@
.errored {
animation: shake 300ms;
color: #eb3434 !important;
background-color: #fef2f2 !important;
border: 1px solid #eb3434 !important;
}
.modal-dialog, .modal-content {
height: 460px;
width: 510px;
}
.timeWorkTitle {
color: #5C5C5C;
font-weight: 600;
font-size: 12px;
margin: auto 0 auto 6px;
white-space: nowrap;
}
.groupBox {
background-color: #F5F5F5;
border-radius: 10px;
border: 1px solid #E7E7E7;
padding: 6px;
margin: 6px 3px;
}
.groupBox .form-control {
background-color: #ffffff;
}
.groupBox .form-control::placeholder {
color: #bfbfbf;
opacity: 1; /* Firefox */
}
.groupBox .form-control::-ms-input-placeholder { /* Edge 12-18 */
color: #bfbfbf;
}
.btnAddTimeWork {
display: flex;
align-items: center;
justify-content: center;
background-color: #84CC16;
border-radius: 5px;
color: #ffffff;
font-size: 12px;
font-weight: 500;
padding: 4px 8px;
}
.btnRemoveTimeWork {
display: flex;
align-items: center;
justify-content: center;
background-color: #F87171;
border-radius: 7px;
padding: 3px;
width: 30px;
height: 30px;
}
.ShowMessage {
position: absolute;
background: #dfdfdf;
width: 100%;
top: 0;
right: 0;
height: 100%;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
}
.btn-workTimeOption-container {
display: flex;
}
.radio-workTimeOption {
display: none;
}
.radio-label-workTimeOption {
font-size: 13px;
font-weight: 500;
color: #0F8080;
background-color: #DDF4F4;
text-align: center;
padding: 8px 16px;
border-radius: 4px;
margin: auto 6px;
transition: all 0.3s ease-in-out;
cursor: pointer;
}
.radio-label-workTimeOption:hover {
color: #FFFFFF;
background-color: #1c7474;
border-color: #23A8A8;
}
.radio-workTimeOption:checked + .radio-label-workTimeOption {
color: #FFFFFF;
background: linear-gradient(93.83deg, #2EBEBE 1.59%, #1E9D9D 47.86%, #0B7878 101.16%);
}
.show-disorganized {
height: 81px;
background: #F2FEFF;
border: 1px solid #B0EBF0;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
.show-disorganized p {
font-weight: 500;
font-size: 14px;
color: #1B929C;
}
.radio-label-workTimeOption {
font-size: 13px;
font-weight: 500;
color: #0F8080;
background-color: #DDF4F4;
text-align: center;
padding: 8px 16px;
border-radius: 9px;
margin: auto 5px;
transition: all 0.3s ease-in-out;
cursor: pointer;
}
.radio-label-workTimeOption:hover {
color: #FFFFFF;
background-color: #1c7474;
border-color: #23A8A8;
}
.radio-workTimeOption:checked + .radio-label-workTimeOption {
color: #FFFFFF;
background: linear-gradient(93.83deg, #2EBEBE 1.59%, #1E9D9D 47.86%, #0B7878 101.16%);
}
.show-disorganized {
height: 81px;
background: #F2FEFF;
border: 1px solid #B0EBF0;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
.show-disorganized p {
font-weight: 500;
font-size: 14px;
color: #1B929C;
}
#computeTime span,
.lableCheckBreakTime,
.labelExtraOption {
font-size: 12px;
font-weight: 500;
margin: 0 10px;
color: #101010;
text-align: right;
}
.breack-time {
border: 1px solid #ddd;
padding: 8px 0;
border-radius: 20px;
}
.extraOptionBorder {
border: 1px solid #ddd;
padding: 8px 0;
border-radius: 20px;
}
/************************ Radio Button Input () ************************/
.form-check-input[type="radio"],
.form-check-input[type="checkbox"] {
width: 15px;
height: 15px;
border-radius: 6px;
padding: 8px;
border: 1px solid #CFD3D4;
background-color: white;
background-position: center;
background-size: contain;
background-repeat: no-repeat;
margin-right: 8px;
appearance: none;
}
.form-check-input[type="radio"]:checked,
.form-check-input[type="checkbox"]:checked {
background-color: #148989;
border: 1px solid #ffffff !important;
background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="white" stroke-width="3"%3E%3Cpath stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" /%3E%3C/svg%3E');
background-size: 75%;
}
.form-check-input[type=checkbox]:indeterminate {
background-color: #148989;
border-color: #ffffff;
--bs-form-check-bg-image: url(data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e);
}
.form-check-input[type="radio"]:focus,
.form-check-input[type="checkbox"]:focus {
outline: none;
box-shadow: none;
}
.form-check-input[type="radio"] + label,
.form-check-input[type="checkbox"] + label {
color: #83898C;
}
.form-check-input[type="radio"]:checked + label,
.form-check-input[type="checkbox"]:checked + label {
color: #2B2F32;
}
/************************ Radio Button Input (Like Checkbox appearance) ************************/
@media (max-width: 992px) {
.modal-dialog, .modal-content {
/*height: 622px;*/
height: 600px;
width: auto;
}
.radio-label-workTimeOption {
font-size: 10px;
padding: 8px 8px;
font-weight: 800;
}
#computeTime span,
.lableCheckBreakTime,
.labelExtraOption {
font-size: 11px;
}
}
@media (min-width: 576px) {
.container, .container-sm {
max-width: none;
}
}

View File

@@ -0,0 +1,265 @@
.errored {
animation: shake 300ms;
color: #eb3434 !important;
background-color: #fef2f2 !important;
border: 1px solid #eb3434 !important;
}
.modal-dialog, .modal-content {
height: 460px;
width: 510px;
}
.timeWorkTitle {
color: #5C5C5C;
font-weight: 600;
font-size: 12px;
margin: auto 0 auto 6px;
white-space: nowrap;
}
.groupBox {
background-color: #F5F5F5;
border-radius: 10px;
border: 1px solid #E7E7E7;
padding: 6px;
margin: 6px 3px;
}
.groupBox .form-control {
background-color: #ffffff;
}
.groupBox .form-control::placeholder {
color: #bfbfbf;
opacity: 1; /* Firefox */
}
.groupBox .form-control::-ms-input-placeholder { /* Edge 12-18 */
color: #bfbfbf;
}
.btnAddTimeWork {
display: flex;
align-items: center;
justify-content: center;
background-color: #84CC16;
border-radius: 5px;
color: #ffffff;
font-size: 12px;
font-weight: 500;
padding: 4px 8px;
}
.btnRemoveTimeWork {
display: flex;
align-items: center;
justify-content: center;
background-color: #F87171;
border-radius: 7px;
padding: 3px;
width: 30px;
height: 30px;
}
.ShowMessage {
position: absolute;
background: #dfdfdf;
width: 100%;
top: 0;
right: 0;
height: 100%;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
}
.btn-workTimeOption-container {
display: flex;
}
.radio-workTimeOption {
display: none;
}
.radio-label-workTimeOption {
font-size: 13px;
font-weight: 500;
color: #0F8080;
background-color: #DDF4F4;
text-align: center;
padding: 8px 16px;
border-radius: 4px;
margin: auto 6px;
transition: all 0.3s ease-in-out;
cursor: pointer;
}
.radio-label-workTimeOption:hover {
color: #FFFFFF;
background-color: #1c7474;
border-color: #23A8A8;
}
.radio-workTimeOption:checked + .radio-label-workTimeOption {
color: #FFFFFF;
background: linear-gradient(93.83deg, #2EBEBE 1.59%, #1E9D9D 47.86%, #0B7878 101.16%);
}
.show-disorganized {
height: 81px;
background: #F2FEFF;
border: 1px solid #B0EBF0;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
.show-disorganized p {
font-weight: 500;
font-size: 14px;
color: #1B929C;
}
.radio-label-workTimeOption {
font-size: 13px;
font-weight: 500;
color: #0F8080;
background-color: #DDF4F4;
text-align: center;
padding: 8px 16px;
border-radius: 9px;
margin: auto 5px;
transition: all 0.3s ease-in-out;
cursor: pointer;
}
.radio-label-workTimeOption:hover {
color: #FFFFFF;
background-color: #1c7474;
border-color: #23A8A8;
}
.radio-workTimeOption:checked + .radio-label-workTimeOption {
color: #FFFFFF;
background: linear-gradient(93.83deg, #2EBEBE 1.59%, #1E9D9D 47.86%, #0B7878 101.16%);
}
.show-disorganized {
height: 81px;
background: #F2FEFF;
border: 1px solid #B0EBF0;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
.show-disorganized p {
font-weight: 500;
font-size: 14px;
color: #1B929C;
}
#computeTime span,
.lableCheckBreakTime,
.labelExtraOption {
font-size: 12px;
font-weight: 500;
margin: 0 10px;
color: #101010;
text-align: right;
}
.breack-time {
border: 1px solid #ddd;
padding: 8px 0;
border-radius: 20px;
}
.extraOptionBorder {
border: 1px solid #ddd;
padding: 8px 0;
border-radius: 20px;
}
/************************ Radio Button Input () ************************/
.form-check-input[type="radio"],
.form-check-input[type="checkbox"] {
width: 15px;
height: 15px;
border-radius: 6px;
padding: 8px;
border: 1px solid #CFD3D4;
background-color: white;
background-position: center;
background-size: contain;
background-repeat: no-repeat;
margin-right: 8px;
appearance: none;
}
.form-check-input[type="radio"]:checked,
.form-check-input[type="checkbox"]:checked {
background-color: #148989;
border: 1px solid #ffffff !important;
background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="white" stroke-width="3"%3E%3Cpath stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" /%3E%3C/svg%3E');
background-size: 75%;
}
.form-check-input[type=checkbox]:indeterminate {
background-color: #148989;
border-color: #ffffff;
--bs-form-check-bg-image: url(data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e);
}
.form-check-input[type="radio"]:focus,
.form-check-input[type="checkbox"]:focus {
outline: none;
box-shadow: none;
}
.form-check-input[type="radio"] + label,
.form-check-input[type="checkbox"] + label {
color: #83898C;
}
.form-check-input[type="radio"]:checked + label,
.form-check-input[type="checkbox"]:checked + label {
color: #2B2F32;
}
/************************ Radio Button Input (Like Checkbox appearance) ************************/
@media (max-width: 992px) {
.modal-dialog, .modal-content {
/*height: 622px;*/
height: 600px;
width: auto;
}
.radio-label-workTimeOption {
font-size: 10px;
padding: 8px 8px;
font-weight: 800;
}
#computeTime span,
.lableCheckBreakTime,
.labelExtraOption {
font-size: 11px;
}
}
@media (min-width: 576px) {
.container, .container-sm {
max-width: none;
}
}

View File

@@ -0,0 +1,261 @@
$(document).ready(function () {
$(".dateTime").each(function () {
let element = $(this);
element.on('input', function () {
let value = convertPersianNumbersToEnglish(element.val());
element.val(value);
});
new Cleave(this, {
time: true,
timePattern: ['h', 'm']
});
});
$("#organized").on("click", function () {
$('#step_workTimeOption').show();
$('#step_workTimeOptionIrregular').hide();
if ($('#step-form2').is(':visible')) {
$('.dateTime').each(function () {
if ($(this).val() === '') {
$('.btn-register').addClass('disable');
}
});
}
});
$("#disorganized").on("click", function () {
$('#step_workTimeOption').hide();
$('#step_workTimeOptionIrregular').show();
$('.btn-register').removeClass('disable');
});
$(".btnAddTimeWork").on("click", function () {
var currentCount = $('.groupBox').length;
var $inputs = $('.dateTime');
var allFilled = true;
$inputs.each(function () {
if ($(this).val() === '') {
allFilled = false;
showAlert('ابتدا ساعت شروع و پایان را وارد نمائید.', $(this));
}
});
//validateAllTimes();
if (!allFilled) {
return false;
}
if (currentCount < 3) {
var namePlacement = "";
var namePlacementPersian = "";
switch (currentCount + 1) {
case 2:
namePlacement = "Second";
namePlacementPersian = "دوم";
break;
case 3:
namePlacement = "Third";
namePlacementPersian = "سوم";
break;
default:
}
var timeWorkHtml = `
<div class="groupBox timeWork">
<div class="row align-items-center justify-content-between">
<div class="col-3 d-flex align-items-center">
<input type="hidden" name="ShiftsList[${currentCount}].Placement" value="${namePlacement}" />
<div class="timeWorkTitle">نوبت ${namePlacementPersian}</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="ShiftsList[${currentCount}].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="ShiftsList[${currentCount}].EndTime" placeholder="00:00" style="direction: ltr;">
</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>`;
$('#appendChildTimeWorkHtml').append(timeWorkHtml);
const newStartTimeInput = $(`input[name="ShiftsList[${currentCount}].StartTime"]`);
const newEndTimeInput = $(`input[name="ShiftsList[${currentCount}].EndTime"]`);
newStartTimeInput.on('input', function () {
const value = convertPersianNumbersToEnglish($(this).val());
$(this).val(value);
});
newEndTimeInput.on('input', function () {
const value = convertPersianNumbersToEnglish($(this).val());
$(this).val(value);
});
new Cleave(newStartTimeInput[0], {
time: true,
timePattern: ['h', 'm']
});
new Cleave(newEndTimeInput[0], {
time: true,
timePattern: ['h', 'm']
});
//new Cleave(`input[name="CreateWorkshopSettings.ShiftsList[${currentCount}].StartTime"]`, {
// time: true,
// timePattern: ['h', 'm']
//});
//new Cleave(`input[name="CreateWorkshopSettings.ShiftsList[${currentCount}].EndTime"]`, {
// time: true,
// timePattern: ['h', 'm']
//});
updateAddButtonText(currentCount + 1);
if (currentCount + 1 === 3) {
$(".btnAddTimeWork").hide();
}
// Update Remove button enable/disable state
updateRemoveButtons();
}
});
$(document).on("click", ".btnRemoveTimeWork", function () {
$(this).closest(".groupBox").remove();
var currentCount = $('.groupBox').length;
updateAddButtonText(currentCount);
updateRemoveButtons();
if (currentCount < 3) {
$(".btnAddTimeWork").show();
}
});
});
function updateRemoveButtons() {
$(".btnRemoveTimeWork").addClass("disable");
$(".btnRemoveTimeWork").last().removeClass("disable");
}
updateAddButtonText(1);
function updateAddButtonText(currentCount) {
if (currentCount === 1) {
$('.btnAppendChildTimeWork').text('افزودن نوبت دوم');
} else if (currentCount === 2) {
$('.btnAppendChildTimeWork').text('افزودن نوبت سوم');
}
let allFilled = true;
$('.dateTime').each(function () {
const value = $(this).val().trim();
if (value === "" || !timeValidCheck(value)) {
allFilled = false;
return false; // Break the loop
}
});
if (allFilled) {
$('.btn-register').removeClass('disable');
} else {
$('.btn-register').addClass('disable');
}
}
//******************** برای نوشتن تاریخ ********************
//$(document).on('input', ".dateTime", function () {
// var value = $(this).val();
// $(this).val(convertPersianNumbersToEnglish(value)).mask("00:00");
//});
$(document).on('keyup', ".dateTime", function () {
let $input = $(this);
let value = $input.val();
let lengthValue = value.length;
let currentCount = $('.groupBox').length;
if (lengthValue >= 5) {
if (!timeValidCheck(value)) {
showAlert('ساعت را به درستی وارد نمائید', $input);
updateAddButtonText(currentCount);
} else {
clearAlert($input);
//validateAllTimes();
updateAddButtonText(currentCount);
}
} else {
updateAddButtonText(currentCount);
}
});
function showAlert(message, inputElement) {
inputElement.addClass("errored");
$('.alert-msg').show().find('p').text(message);
setTimeout(function () {
clearAlert(inputElement);
}, 3500);
}
function clearAlert(inputElement) {
inputElement.removeClass("errored");
$('.alert-msg').hide().find('p').text('');
}
function timeValidCheck(value) {
const timePattern = /^([01]\d|2[0-3]):([0-5]\d)$/;
return timePattern.test(value);
}
//******************** برای نوشتن تاریخ ********************
function saveNewWorkshopSetting() {
$.ajax({
async: false,
dataType: 'json',
type: 'POST',
url: saveNewWorkshopSettingUrl,
headers: { "RequestVerificationToken": antiForgeryToken },
data: $('#create-form').serialize(),
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('');
}, 3500);
window.location.reload();
} 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);
}
});
}

View File

@@ -0,0 +1,346 @@
var isTabPressed = false;
$(document).ready(function () {
updateRemoveButtons();
$('.loading').hide();
$(".dateTime").on("blur", function () {
var valueCheck = $(this).val().trim();
if (valueCheck === "" || !timeValidCheck(valueCheck)) {
$(this).addClass("errored");
}
});
//$(".dateTime").on("keydown", function (e) {
// if (e.key === "Tab" && !e.shiftKey) {
// e.preventDefault();
// isTabPressed = true;
// if (e.shiftKey) {
// focusPreviousTimeInput(this);
// } else {
// focusNextTimeInput(this);
// }
// }
//});
if (IsRegularWorkshop) {
$("#organized").prop('checked', true);
$("#disorganized").prop('checked', false);
$('#step_workTimeOption').show();
$('#step_workTimeOptionIrregular').hide();
// این مرحله هنگام چک کردن تعداد نوبت هستش
var currentCount = $('.groupBox').length;
updateAddButtonText(currentCount);
} else {
$("#organized").prop('checked', false);
$("#disorganized").prop('checked', true);
$('#step_workTimeOption').hide();
$('#step_workTimeOptionIrregular').show();
}
$("#organized").on("click", function () {
$('#step_workTimeOption').show();
$('#step_workTimeOptionIrregular').hide();
if ($('#step_workTimeOption').is(':visible')) {
$('.dateTime').each(function () {
if ($(this).val() === '') {
var currentCount = $('.groupBox').length;
updateAddButtonText(currentCount);
}
});
}
});
$("#disorganized").on("click", function () {
$('#step_workTimeOption').hide();
$('#step_workTimeOptionIrregular').show();
$('.btn-register').removeClass('disable');
});
// ----------------------------------------
$(".dateTime").each(function () {
let element = $(this);
element.on('input', function () {
let value = convertPersianNumbersToEnglish(element.val());
element.val(value);
});
new Cleave(this, {
time: true,
timePattern: ['h', 'm']
});
});
$(".btnAddTimeWork").on("click", function () {
var currentCount = $('.groupBox').length;
var $inputs = $('.dateTime');
var allFilled = true;
$inputs.each(function () {
if ($(this).val() === '') {
allFilled = false;
showAlert('ابتدا ساعت شروع و پایان را وارد نمائید.', $(this));
}
});
//validateAllTimes();
if (!allFilled) {
return false;
}
if (currentCount < 3) {
var namePlacement = "";
var namePlacementPersian = "";
switch (currentCount + 1) {
case 2:
namePlacement = "Second";
namePlacementPersian = "دوم";
break;
case 3:
namePlacement = "Third";
namePlacementPersian = "سوم";
break;
default:
}
var timeWorkHtml = `
<div class="groupBox timeWork">
<div class="row align-items-center justify-content-between">
<div class="col-2 d-flex align-items-center">
<input type="hidden" name="shiftViewModels[${currentCount}].Placement" value="${namePlacement}" />
<div class="timeWorkTitle">نوبت ${namePlacementPersian}</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="shiftViewModels[${currentCount}].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="shiftViewModels[${currentCount}].EndTime" placeholder="00:00" style="direction: ltr;">
</div>
<div class="col-2 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>`;
$('#appendChildTimeWorkHtml').append(timeWorkHtml);
const newStartTimeInput = $(`input[name="shiftViewModels[${currentCount}].StartTime"]`);
const newEndTimeInput = $(`input[name="shiftViewModels[${currentCount}].EndTime"]`);
newStartTimeInput.on('input', function () {
const value = convertPersianNumbersToEnglish($(this).val());
$(this).val(value);
});
newEndTimeInput.on('input', function () {
const value = convertPersianNumbersToEnglish($(this).val());
$(this).val(value);
});
new Cleave(newStartTimeInput[0], {
time: true,
timePattern: ['h', 'm']
});
new Cleave(newEndTimeInput[0], {
time: true,
timePattern: ['h', 'm']
});
//new Cleave(`input[name="shiftViewModels[${currentCount}].StartTime"]`, {
// time: true,
// timePattern: ['h', 'm']
//});
//new Cleave(`input[name="shiftViewModels[${currentCount}].EndTime"]`, {
// time: true,
// timePattern: ['h', 'm']
//});
updateAddButtonText(currentCount + 1);
if (currentCount + 1 === 3) {
$(".btnAddTimeWork").hide();
}
// Update Remove button enable/disable state
updateRemoveButtons();
}
});
$(document).on("click", ".btnRemoveTimeWork", function () {
$(this).closest(".groupBox").remove();
var currentCount = $('.groupBox').length;
updateAddButtonText(currentCount);
if (currentCount < 3) {
$(".btnAddTimeWork").show();
}
// Update Remove button enable/disable state
updateRemoveButtons();
});
});
function updateRemoveButtons() {
$(".btnRemoveTimeWork").addClass("disable");
$(".btnRemoveTimeWork").last().removeClass("disable");
}
//updateAddButtonText(1);
function updateAddButtonText(currentCount) {
if (currentCount === 1) {
$('.btnAppendChildTimeWork').text('افزودن نوبت دوم');
$('.btnAddTimeWork').css('visibility', 'visible');
} else if (currentCount === 2) {
$('.btnAppendChildTimeWork').text('افزودن نوبت سوم');
$('.btnAddTimeWork').css('visibility', 'visible');
} else {
$('.btnAddTimeWork').css('visibility', 'hidden');
}
let allFilled = true;
$('.dateTime').each(function () {
const value = $(this).val().trim();
if (value === "" || !timeValidCheck(value)) {
allFilled = false;
return false; // Break the loop
}
});
if (allFilled) {
$('.btn-register').removeClass('disable');
} else {
$('.btn-register').addClass('disable');
}
}
//******************** برای نوشتن تاریخ ********************
$(document).on('keyup', ".dateTime", function () {
let $input = $(this);
let value = $input.val();
let lengthValue = value.length;
let currentCount = $('.groupBox').length;
if (isTabPressed) {
isTabPressed = false;
return;
}
if (lengthValue >= 5) {
if (!timeValidCheck(value)) {
showAlert('ساعت را به درستی وارد نمائید', $input);
updateAddButtonText(currentCount);
} else {
clearAlert($input);
updateAddButtonText(currentCount);
}
} else {
updateAddButtonText(currentCount);
}
});
function showAlert(message, inputElement) {
inputElement.addClass("errored");
$('.alert-msg').show().find('p').text(message);
setTimeout(function () {
clearAlert(inputElement);
}, 3500);
}
function clearAlert(inputElement) {
inputElement.removeClass("errored");
$('.alert-msg').hide().find('p').text('');
}
function timeValidCheck(value) {
const timePattern = /^([01]\d|2[0-3]):([0-5]\d)$/;
return timePattern.test(value);
}
function actionForShowModalReplaceChange() {
var htmlEmployeeItem = '';
$.ajax({
async: false,
dataType: 'json',
type: 'GET',
url: getGroupListAndEmployeeListAjax,
headers: { "RequestVerificationToken": antiForgeryToken },
data: { 'customizeWorkshopSettingsId': $('#customizeWorkshopSettingsId').val() },
success: function (response) {
if (response.success) {
$('#ConfirmEmployeeModal').show();
response.data.forEach(function (itemEmployee) {
htmlEmployeeItem += `<li>${itemEmployee.groupName}</li>`;
if (itemEmployee.employeeName.length > 0) {
htmlEmployeeItem += `<ul>`;
itemEmployee.employeeName.forEach(function (itemEmployeeName) {
htmlEmployeeItem += `<li>${itemEmployeeName}</li>`;
});
htmlEmployeeItem += `</ul>`;
}
});
$('#loadEmployeeItem').html(htmlEmployeeItem);
} else {
saveEditSettingWorkTime();
}
},
error: function (err) {
console.log(err);
}
});
}
function saveEditSettingWorkTime() {
$.ajax({
async: false,
dataType: 'json',
type: 'POST',
url: saveEditSettingWorkTimeAjax,
headers: { "RequestVerificationToken": antiForgeryToken },
data: $('#create-form').serialize(),
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('');
window.location.reload();
}, 1500);
$('#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);
}
});
}

View File

@@ -121,4 +121,15 @@
font-weight: 500;
font-size: 14px;
color: #1B929C;
}
}
.profilePasswordModal .modal-header h5 {
font-size: 20px;
}
.modal-title {
font-size: 16px;
color: #1F2937;
font-weight: 600;
}

View File

@@ -8,7 +8,8 @@ $(document).ready(function () {
if (response.hasRollCallService) {
if (!response.hasCameraAccount || !response.hasRollCallWorkshopSetting) {
//window.location.href = saveCameraAccountUrl;
AjaxUrlContentModal(saveCameraAccountUrl);
//AjaxUrlContentModal(saveCameraAccountUrl);
AjaxUrlContentModal(modalCreateCameraAccountUrl);
}
}
});

View File

@@ -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>`;