КОЛЯ ДЕРЖИ ИЗМЕНЕНИЯ КАК ТЫ И ПРОСИЛ
This commit is contained in:
parent
60c507bb4b
commit
6f449c505b
@ -55,7 +55,7 @@ namespace HardwareShopStorekeeperApp.Controllers
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public void Privacy(string login, string email, string password)
|
||||
public IActionResult Privacy(string login, string email, string password)
|
||||
{
|
||||
if (APIClient.User == null)
|
||||
{
|
||||
@ -77,7 +77,7 @@ namespace HardwareShopStorekeeperApp.Controllers
|
||||
APIClient.User.Email = email;
|
||||
APIClient.User.Password = password;
|
||||
|
||||
RedirectToAction("MainStorekeeper", "Storekeeper");
|
||||
return RedirectToAction("MainStorekeeper", "Storekeeper");
|
||||
}
|
||||
|
||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Privacy Policy";
|
||||
Layout = "~/Views/Shared/_LayoutWorker.cshtml";
|
||||
Layout = "~/Views/Shared/_LayoutStorekeeper.cshtml";
|
||||
}
|
||||
<div class="text-center">
|
||||
<h2 class="display-4">Личные данные</h2>
|
||||
|
@ -17,14 +17,14 @@
|
||||
<h2 class="display-4">Регистрация</h2>
|
||||
</div>
|
||||
<form method="post" class="d-flex flex-column align-items-center">
|
||||
<div class="col-sm-3">
|
||||
<label class="form-label">Логин</label>
|
||||
<input type="text" class="form-control" aria-describedby="emailHelp" name="login">
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<label class="form-label">Почта</label>
|
||||
<input type="text" class="form-control" name="email">
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<label class="form-label">Логин</label>
|
||||
<input type="text" class="form-control" aria-describedby="emailHelp" name="login">
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<label class="form-label">Пароль</label>
|
||||
<input type="password" class="form-control" name="password">
|
||||
|
@ -35,6 +35,9 @@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Storekeeper" asp-action="Report">Отчёт</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Личные данные</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -10,7 +10,7 @@ namespace HardwareShopDatabaseImplement
|
||||
{
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
optionsBuilder.UseNpgsql("Host=localhost;Port=5433;Database=Computer_Hardware_Store;Username=user;Password=12345");
|
||||
optionsBuilder.UseNpgsql("Host=localhost;Port=5433;Database=Computer_Hardware_Store1;Username=user;Password=12345");
|
||||
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
|
||||
}
|
||||
|
||||
|
@ -21,9 +21,15 @@ namespace HardwareShopDatabaseImplement.Implements.Storekeeper
|
||||
var componentGoods = context.GoodsComponents.Where(x => x.ComponentId == element.Id).ToList();
|
||||
componentGoods.ForEach(x =>
|
||||
{
|
||||
var good = context.Goods.FirstOrDefault(rec => rec.Id == x.GoodId);
|
||||
var good = context.Goods.Include(x => x.Components).FirstOrDefault(rec => rec.Id == x.GoodId);
|
||||
if (good != null)
|
||||
context.Goods.Remove(good);
|
||||
if (good.GoodComponents.Count == 1)
|
||||
context.Goods.Remove(good);
|
||||
else
|
||||
{
|
||||
good.Price -= element.Cost * x.Count;
|
||||
good.Price = Math.Round(good.Price, 2);
|
||||
}
|
||||
});
|
||||
context.Components.Remove(element);
|
||||
context.SaveChanges();
|
||||
|
@ -54,10 +54,10 @@
|
||||
<td>
|
||||
<div>
|
||||
<button onclick="getPurchase(@item.Item1.Id)" type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#updateModal">
|
||||
Изменить
|
||||
<i class="fa fa-pencil" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button onclick="getPurchase(@item.Item1.Id)" type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#deleteModal">
|
||||
Удалить
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
@ -17,14 +17,14 @@
|
||||
<h2 class="display-4">Регистрация</h2>
|
||||
</div>
|
||||
<form method="post" class="d-flex flex-column align-items-center">
|
||||
<div class="col-sm-3">
|
||||
<label class="form-label">Логин</label>
|
||||
<input type="text" class="form-control" aria-describedby="emailHelp" name="login">
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<label class="form-label">Почта</label>
|
||||
<input type="text" class="form-control" name="email">
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<label class="form-label">Логин</label>
|
||||
<input type="text" class="form-control" aria-describedby="emailHelp" name="login">
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<label class="form-label">Пароль</label>
|
||||
<input type="password" class="form-control" name="password">
|
||||
|
Loading…
Reference in New Issue
Block a user