|
|
|
@ -71,7 +71,7 @@ namespace WF_WebAdmin.Service;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public async Task validQuote(Quote quote)
|
|
|
|
|
public Task validQuote(Quote quote)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
@ -170,15 +170,15 @@ namespace WF_WebAdmin.Service;
|
|
|
|
|
{
|
|
|
|
|
var data = await getAllQuote();
|
|
|
|
|
var q = data.FirstOrDefault(p => p.Id == id);
|
|
|
|
|
if (q != null)
|
|
|
|
|
if (q == null)
|
|
|
|
|
{
|
|
|
|
|
return q;
|
|
|
|
|
throw new KeyNotFoundException($"Quote with ID {id} not found.");
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
return q;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public async Task<List<Quote>> reserchQuote(string reserch, List<string> argument)
|
|
|
|
|
public Task<List<Quote>> reserchQuote(string reserch, List<string> argument)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
@ -196,7 +196,7 @@ namespace WF_WebAdmin.Service;
|
|
|
|
|
public async Task<List<Quote>> getAllQuoteInvalid()
|
|
|
|
|
{
|
|
|
|
|
var quotes = await getAllQuote();
|
|
|
|
|
quotes = quotes.Where(q => q.IsValid == false).ToList();
|
|
|
|
|
quotes = quotes.Where(q => !q.IsValid).ToList();
|
|
|
|
|
return quotes;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -218,13 +218,13 @@ namespace WF_WebAdmin.Service;
|
|
|
|
|
public async Task<List<Quote>> getSomeQuoteInvalid(int nb, int page)
|
|
|
|
|
{
|
|
|
|
|
var quotes = await getAllQuoteInvalid();
|
|
|
|
|
if ((page - 1) * nb + nb > quotes.Count())
|
|
|
|
|
if ((page - 1) * nb + nb > quotes.Count)
|
|
|
|
|
{
|
|
|
|
|
if (nb > quotes.Count())
|
|
|
|
|
if (nb > quotes.Count)
|
|
|
|
|
{
|
|
|
|
|
return quotes.GetRange(0, quotes.Count());
|
|
|
|
|
return quotes.GetRange(0, quotes.Count);
|
|
|
|
|
}
|
|
|
|
|
return quotes.GetRange(quotes.Count() - nb, nb);
|
|
|
|
|
return quotes.GetRange(quotes.Count - nb, nb);
|
|
|
|
|
}
|
|
|
|
|
return quotes.GetRange((page - 1) * nb, nb);
|
|
|
|
|
}
|
|
|
|
|