Compare commits
1 Commits
Feature/Ex
...
Feature/ad
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e3e783c5c |
@@ -3,4 +3,6 @@
|
||||
public class AppSettingConfiguration
|
||||
{
|
||||
public string Domain { get; set; }
|
||||
public string ClientDomain =>"client"+Domain;
|
||||
public string AdminDomain =>"admin"+Domain;
|
||||
}
|
||||
@@ -14,8 +14,5 @@ namespace CompanyManagment.App.Contracts.Leave
|
||||
public string LeftWorlErrMessage { get; set; }
|
||||
public bool HasNotContract { get; set; }
|
||||
public string ContractErrMessage { get; set; }
|
||||
|
||||
public bool HasHolidayError { get; set; }
|
||||
public string HolidayErrorMessage { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,8 +96,6 @@ public class LeaveApplication : ILeaveApplication
|
||||
return op.Failed(checkErr.ContractErrMessage);
|
||||
if (checkErr.HasLeftWork)
|
||||
return op.Failed(checkErr.LeftWorlErrMessage);
|
||||
if (checkErr.HasHolidayError)
|
||||
return op.Failed(checkErr.HolidayErrorMessage);
|
||||
|
||||
if (start > end)
|
||||
return op.Failed("تارخ شروع از پایان بزرگتر است");
|
||||
@@ -306,8 +304,6 @@ public class LeaveApplication : ILeaveApplication
|
||||
return op.Failed(checkErr.CheckoutErrMessage);
|
||||
if (checkErr.HasLeftWork)
|
||||
return op.Failed(checkErr.LeftWorlErrMessage);
|
||||
if (checkErr.HasHolidayError)
|
||||
return op.Failed(checkErr.HolidayErrorMessage);
|
||||
if (start > end)
|
||||
return op.Failed("تارخ شروع از پایان بزرگتر است");
|
||||
|
||||
|
||||
@@ -454,17 +454,6 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
|
||||
#endregion
|
||||
|
||||
#region HolidayError
|
||||
|
||||
if (_context.HolidayItems.Any(x => startLeav.Date == x.Holidaydate.Date) ||
|
||||
startLeav.DayOfWeek == DayOfWeek.Friday)
|
||||
{
|
||||
res.HasHolidayError = true;
|
||||
res.HolidayErrorMessage = "شما نمیتوانید در روز های تعطیل مرخصی ثبت کنید";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using CompanyManagment.App.Contracts.AndroidApkVersion;
|
||||
using CompanyManagment.EFCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace ServiceHost.Pages.login;
|
||||
|
||||
@@ -35,6 +36,7 @@ public class IndexModel : PageModel
|
||||
private readonly IAndroidApkVersionApplication _androidApkVersionApplication;
|
||||
private readonly CompanyContext _context;
|
||||
private readonly IRollCallDomainService _rollCallDomainService;
|
||||
private readonly AppSettingConfiguration _appSettingConfiguration;
|
||||
|
||||
public string Mess { get; set; }
|
||||
[BindProperty] public string Username { get; set; }
|
||||
@@ -47,7 +49,7 @@ public class IndexModel : PageModel
|
||||
|
||||
public IndexModel(IAccountApplication accountApplication, IGoogleRecaptcha googleRecaptcha,
|
||||
IAuthHelper authHelper, IAndroidApkVersionApplication androidApkVersionApplication, CompanyContext context,
|
||||
IRollCallDomainService rollCallDomainService)
|
||||
IRollCallDomainService rollCallDomainService, IOptions<AppSettingConfiguration> optionsAppSetting)
|
||||
{
|
||||
_accountApplication = accountApplication;
|
||||
_googleRecaptcha = googleRecaptcha;
|
||||
@@ -55,6 +57,7 @@ public class IndexModel : PageModel
|
||||
_androidApkVersionApplication = androidApkVersionApplication;
|
||||
_context = context;
|
||||
_rollCallDomainService = rollCallDomainService;
|
||||
_appSettingConfiguration = optionsAppSetting.Value;
|
||||
}
|
||||
|
||||
public IActionResult OnGet()
|
||||
@@ -87,7 +90,7 @@ public class IndexModel : PageModel
|
||||
}
|
||||
else
|
||||
{
|
||||
return Redirect("/Admin");
|
||||
return Redirect($"https://{_appSettingConfiguration.AdminDomain}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,7 +170,7 @@ public class IndexModel : PageModel
|
||||
switch (result.SendId)
|
||||
{
|
||||
case 1:
|
||||
return Redirect("/Admin");
|
||||
return Redirect($"https://{_appSettingConfiguration.AdminDomain}");
|
||||
break;
|
||||
case 2:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user