28 lines
841 B
C#
28 lines
841 B
C#
using CommunityToolkit.Mvvm.DependencyInjection;
|
|
using FastBill.Models;
|
|
using PSCHelpdesk.Shared.Service;
|
|
using PSCHelpdesk.Shared.Setting;
|
|
|
|
namespace FastBill.Services;
|
|
|
|
public class CustomerService
|
|
{
|
|
private readonly SettingsManager? _settingsManager;
|
|
private readonly Api.Customers _customerApi;
|
|
|
|
public CustomerService()
|
|
{
|
|
_settingsManager = (SettingsManager)Ioc.Default.GetService<ISettingsManager>();
|
|
_customerApi = new Api.Customers();
|
|
}
|
|
|
|
public async Task<List<Customer>> SearchCustomer(string term)
|
|
{
|
|
var settings = new Settings();
|
|
_settingsManager.LoadPluginSettings("FastbillSettings", settings);
|
|
|
|
List<Customer> customers = new List<Customer>();
|
|
customers = await _customerApi.SearchCustomer(settings, term);
|
|
return customers;
|
|
}
|
|
} |