Search client by login
This commit is contained in:
parent
7ff81c6bbd
commit
cfd78033b2
@ -19,7 +19,7 @@ namespace AutoWorkshopDatabaseImplement.Implements
|
||||
|
||||
public List<ClientViewModel> GetFilteredList(ClientSearchModel Model)
|
||||
{
|
||||
if (string.IsNullOrEmpty(Model.ClientFIO) && string.IsNullOrEmpty(Model.Email)) // TODO: check selecting by email
|
||||
if (string.IsNullOrEmpty(Model.Email) && string.IsNullOrEmpty(Model.ClientFIO))
|
||||
return new();
|
||||
|
||||
using var Context = new AutoWorkshopDatabase();
|
||||
@ -44,7 +44,7 @@ namespace AutoWorkshopDatabaseImplement.Implements
|
||||
|
||||
return Context.Clients
|
||||
.FirstOrDefault(x => (string.IsNullOrEmpty(Model.ClientFIO) || x.ClientFIO == Model.ClientFIO) &&
|
||||
(!Model.Id.HasValue || x.Id == Model.Id) && (string.IsNullOrEmpty(Model.Email) || x.Email == Model.Email) &&
|
||||
(string.IsNullOrEmpty(Model.Email) || x.Email == Model.Email) && (!Model.Id.HasValue || x.Id == Model.Id) &&
|
||||
(string.IsNullOrEmpty(Model.Password) || x.Password == Model.Password))?
|
||||
.GetViewModel;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user