Прихорашиваю

This commit is contained in:
gg12 darfren 2024-04-27 22:38:44 +04:00
parent f83f74edc1
commit 7d89799f0e
3 changed files with 6 additions and 5 deletions

View File

@ -102,12 +102,12 @@ namespace IceCreamShopBusinessLogic.BusinessLogic
if (string.IsNullOrEmpty(model.Email))
{
throw new ArgumentNullException("Нет Email клиента",
nameof(model.ClientFIO));
nameof(model.Email));
}
if (string.IsNullOrEmpty(model.Password))
{
throw new ArgumentNullException("Нет пароля клиента",
nameof(model.ClientFIO));
nameof(model.Password));
}
_logger.LogInformation("Client. ClientFIO:{ClientFIO}." +
"Email:{ Email}. Password:{ Password}. Id: { Id} ", model.ClientFIO, model.Email, model.Password, model.Id);

View File

@ -113,6 +113,7 @@ namespace IceCreamShopClientApp.Controllers
[HttpGet]
public IActionResult Create()
{
var res = APIClient.GetRequest<List<IceCreamViewModel>>("api/main/geticecreamlist");
ViewBag.IceCreams =
APIClient.GetRequest<List<IceCreamViewModel>>("api/main/geticecreamlist");
return View();

View File

@ -30,9 +30,9 @@ namespace IceCreamShopDatabaseImplement.Implements
}
using var context = new IceCreamShopDataBase();
return context.Clients
.Where(x => (string.IsNullOrEmpty(model.ClientFIO) || x.ClientFIO.Contains(model.ClientFIO) &&
string.IsNullOrEmpty(model.Email) || x.ClientFIO.Contains(model.Email) &&
string.IsNullOrEmpty(model.Password) || x.ClientFIO.Contains(model.Password)))
.Where(x => (string.IsNullOrEmpty(model.ClientFIO) || x.ClientFIO.Contains(model.ClientFIO)) &&
(string.IsNullOrEmpty(model.Email) || x.ClientFIO.Contains(model.Email)) &&
(string.IsNullOrEmpty(model.Password) || x.ClientFIO.Contains(model.Password)))
.Select(x => x.GetViewModel)
.ToList();
}