diff --git a/0_Framework/Application/Tools.cs b/0_Framework/Application/Tools.cs index d5a5a74b..e2c2c26a 100644 --- a/0_Framework/Application/Tools.cs +++ b/0_Framework/Application/Tools.cs @@ -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) diff --git a/CompanyManagment.EFCore/Repository/LeftWorkRepository.cs b/CompanyManagment.EFCore/Repository/LeftWorkRepository.cs index a23c34e4..6c7369ac 100644 --- a/CompanyManagment.EFCore/Repository/LeftWorkRepository.cs +++ b/CompanyManagment.EFCore/Repository/LeftWorkRepository.cs @@ -491,7 +491,8 @@ public class LeftWorkRepository : RepositoryBase, 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, 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" && diff --git a/ServiceHost/Areas/Client/Pages/Company/WorkFlow/RollCall.cshtml.cs b/ServiceHost/Areas/Client/Pages/Company/WorkFlow/RollCall.cshtml.cs index 44163b3f..cb2d9083 100644 --- a/ServiceHost/Areas/Client/Pages/Company/WorkFlow/RollCall.cshtml.cs +++ b/ServiceHost/Areas/Client/Pages/Company/WorkFlow/RollCall.cshtml.cs @@ -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 OnGet() diff --git a/ServiceHost/Program.cs b/ServiceHost/Program.cs index ed738608..6ebc1c24 100644 --- a/ServiceHost/Program.cs +++ b/ServiceHost/Program.cs @@ -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(); } diff --git a/ServiceHost/Properties/launchSettings.json b/ServiceHost/Properties/launchSettings.json index ccd45753..788962e4 100644 --- a/ServiceHost/Properties/launchSettings.json +++ b/ServiceHost/Properties/launchSettings.json @@ -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": {