То, что изменено на паре

This commit is contained in:
Кашин Максим 2023-05-02 21:36:33 +04:00
parent 329dcdfb84
commit 192d064273
3 changed files with 8 additions and 3 deletions

View File

@ -14,7 +14,7 @@ namespace PrecastConcretePlantDatabaseImplement
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-V0ON61E\SQLEXPRESS;Initial Catalog=PrecastConcretePlantDataBaseFullHard;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
optionsBuilder.UseSqlServer(@"Data Source=Maksim\SQLEXPRESS;Initial Catalog=PrecastConcretePlantDataBaseFullHard;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}

View File

@ -10,7 +10,12 @@ namespace PrecastConcretePlantShopApp
public static bool IsAccessAllowed { get; set; } = false;
public static string AccessPassword { get; private set; } = string.Empty;
public static string AccessPassword = string.Empty;
public static void GetAccess(string password)
{
IsAccessAllowed = AccessPassword.Equals(password);
}
public static void Connect(IConfiguration configuration)
{

View File

@ -54,7 +54,7 @@ namespace PrecastConcretePlantShopApp.Controllers
{
throw new Exception("Введите пароль");
}
APIClient.IsAccessAllowed = password.Equals(APIClient.AccessPassword);
APIClient.GetAccess(password);
if (APIClient.IsAccessAllowed is false)
{
throw new Exception("Неверный пароль");