leftWork Validation Chekout
This commit is contained in:
@@ -1033,13 +1033,15 @@ public static class Tools
|
||||
{
|
||||
DateTime dateTime = new DateTime();
|
||||
var parts = value.Split('-');
|
||||
if (parts.Length >= 4 && parts[1].Length == 4 && parts[2].Length == 2 && parts[3].Length == 2 && parts[4].Length == 2 && parts[5].Length == 2)
|
||||
if (parts.Length >= 4 && parts[1].Length == 4 && parts[2].Length == 2 && parts[3].Length == 2 && parts[4].Length == 2 && parts[5].Length >= 2)
|
||||
{
|
||||
var part5 = parts[5].Substring(0, 2);
|
||||
|
||||
try
|
||||
|
||||
try
|
||||
{
|
||||
PersianCalendar pc = new PersianCalendar();
|
||||
dateTime = pc.ToDateTime(int.Parse(parts[1]), int.Parse(parts[2]), int.Parse(parts[3]), int.Parse(parts[4]), int.Parse(parts[5]), 0, 0, 0);
|
||||
dateTime = pc.ToDateTime(int.Parse(parts[1]), int.Parse(parts[2]), int.Parse(parts[3]), int.Parse(parts[4]), int.Parse(part5), 0, 0, 0);
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
@@ -491,7 +491,8 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
hasContracts= _context.CheckoutSet.Any(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && (x.ContractStart.Date>= date) && x.IsActiveString == "true");
|
||||
if(hasContracts)
|
||||
return op.Failed("لطفا ابتدا تصفیه حساب های آتی را حذف نمایید");
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var LeftDay = date.Date;
|
||||
@@ -505,11 +506,11 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
string resultDay = LeftDayCheckout.Month + " " + LeftDayCheckout.Year;
|
||||
return op.Failed("در صورت تمایل به ثبت تاریخ، تصفیه حساب " + resultDay + " را حذف نمایید.");
|
||||
}
|
||||
//if (LastDayChekout != null)
|
||||
//{
|
||||
// string resultDay = LastDayChekout.Month + " " + LastDayChekout.Year;
|
||||
// return op.Failed("در صورت تمایل به ثبت تاریخ، تصفیه حساب " + resultDay + " را حذف نمایید.");
|
||||
//}
|
||||
if (LastDayChekout != null)
|
||||
{
|
||||
string resultDay = LastDayChekout.Month + " " + LastDayChekout.Year;
|
||||
return op.Failed("در صورت تمایل به ثبت تاریخ، تصفیه حساب " + resultDay + " را حذف نمایید.");
|
||||
}
|
||||
|
||||
var LastDayContract = _context.CheckoutSet.Any(x =>
|
||||
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.IsActiveString == "true" &&
|
||||
|
||||
@@ -6,6 +6,7 @@ using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.Build.Exceptions;
|
||||
using WorkFlow.Application.Contracts.RollCallConfirmedAbsence;
|
||||
using WorkFlow.Application.Contracts.RollCallConfirmedWithoutLunchBreak;
|
||||
using WorkFlow.Application.Contracts.Shared;
|
||||
@@ -48,7 +49,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.WorkFlow
|
||||
_workshopId = _passwordHasher.SlugDecrypt(workshopHash);
|
||||
|
||||
if (_workshopId < 1)
|
||||
throw new InvalidDataException("اختلال در کارگاه");
|
||||
throw new InternalLoggerException("اختلال در کارگاه");
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGet()
|
||||
|
||||
@@ -153,7 +153,6 @@ if (builder.Environment.IsDevelopment())
|
||||
}
|
||||
else
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
// The default HSTS value is 30 days. You may want to change this for pro
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
"dotnetRunMessages": "true",
|
||||
"nativeDebugging": true,
|
||||
"applicationUrl": "https://localhost:5004;http://localhost:5003;",
|
||||
//"applicationUrl": "https://localhost:5004;http://localhost:5003;http://192.168.0.117:82;https://192.168.0.117:83;",
|
||||
"jsWebView2Debugging": false,
|
||||
"hotReloadEnabled": true
|
||||
},
|
||||
@@ -34,6 +33,20 @@
|
||||
"ASPNETCORE_URLS": "https://localhost:5004;http://localhost:5003"
|
||||
},
|
||||
"distributionName": ""
|
||||
},
|
||||
"Publish": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Production",
|
||||
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"
|
||||
},
|
||||
"sqlDebugging": true,
|
||||
"dotnetRunMessages": "true",
|
||||
"nativeDebugging": true,
|
||||
"applicationUrl": "https://localhost:5004;http://localhost:5003;",
|
||||
"jsWebView2Debugging": false,
|
||||
"hotReloadEnabled": true
|
||||
}
|
||||
},
|
||||
"iisSettings": {
|
||||
|
||||
Reference in New Issue
Block a user