This commit is contained in:
SamSys
2025-08-09 14:21:30 +03:30
5 changed files with 12 additions and 5 deletions

View File

@@ -94,7 +94,14 @@ public class PersonnelCodeRepository : RepositoryBase<long, PersonnelCodeDomain>
#region Mahan
public long GetLastPersonnelCodeByWorkshop(long workshopId)
{
return _context.PersonnelCodeSet.Where(x => x.WorkshopId == workshopId).Max(x => x.PersonnelCode);
var codes = _context.PersonnelCodeSet.Where(x => x.WorkshopId == workshopId);
if (!codes.Any())
{
return 0; // مقدار پیش‌فرض یا هندل خاص تو این حالت
}
return codes.Max(x => x.PersonnelCode);
}
#endregion

View File

@@ -251,7 +251,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.SalaryAid
data = result
});
}
public IActionResult OnGetCheckoutExists(string calculationDate, string employeeIds)
public IActionResult OnPostCheckoutExists(string calculationDate, string employeeIds)
{
var extractNumbers = employeeIds.ExtractNumbers();
var calculationDateGr = calculationDate.ToGeorgianDateTime();

View File

@@ -333,7 +333,7 @@ function CheckExistAjax() {
$.ajax({
async: false,
dataType: 'json',
type: 'GET',
type: 'POST',
url: checkoutExistsAjaxUrl,
headers: { "RequestVerificationToken": antiForgeryToken },
traditional: true,

View File

@@ -263,7 +263,7 @@ function CheckExistAjax() {
$.ajax({
async: false,
dataType: 'json',
type: 'GET',
type: 'POST',
url: checkoutExistsAjaxUrl,
headers: { "RequestVerificationToken": antiForgeryToken },
traditional: true,

View File

@@ -753,7 +753,7 @@ function CheckExistAjax() {
$.ajax({
async: false,
dataType: 'json',
type: 'GET',
type: 'POST',
url: checkoutExistsAjaxUrl,
headers: { "RequestVerificationToken": antiForgeryToken },
traditional: true,