Kashin M.I. Lab work 5 hard #13

Closed
Sosees04ka wants to merge 18 commits from LabWork05_hard into LabWork04_hard
3 changed files with 8 additions and 3 deletions
Showing only changes of commit 192d064273 - Show all commits

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;
Review

private set

private set
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("Неверный пароль");