2025-08-24 02:31:12 -03:00
|
|
|
using Blazored.Modal;
|
|
|
|
|
using Blazored.Toast;
|
|
|
|
|
using Microsoft.AspNetCore.Components.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Components.Web;
|
|
|
|
|
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
2025-01-24 19:17:26 -03:00
|
|
|
using phronCare.UIBlazor;
|
2025-05-05 22:50:02 -03:00
|
|
|
using phronCare.UIBlazor.Services.Authorization;
|
2025-05-08 15:46:04 -03:00
|
|
|
using phronCare.UIBlazor.Services.Integrations;
|
2025-08-24 02:31:12 -03:00
|
|
|
using phronCare.UIBlazor.Services.Lookups;
|
2026-03-19 18:23:26 -03:00
|
|
|
using phronCare.UIBlazor.Services.Sales.DeliveryNotes;
|
2025-08-24 02:31:12 -03:00
|
|
|
using phronCare.UIBlazor.Services.Sales;
|
|
|
|
|
using phronCare.UIBlazor.Services.Sales.Quotes;
|
2025-06-27 13:52:22 -03:00
|
|
|
using phronCare.UIBlazor.Services.Stock;
|
2025-08-18 00:47:37 -03:00
|
|
|
using phronCare.UIBlazor.Services.Stock.Expeditions;
|
2025-08-24 02:31:12 -03:00
|
|
|
using phronCare.UIBlazor.Services.Tickets;
|
|
|
|
|
using phronCare.UIBlazor.Services.UI;
|
|
|
|
|
using System.Globalization;
|
2026-02-09 19:37:14 -03:00
|
|
|
|
2025-01-24 19:17:26 -03:00
|
|
|
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
|
|
|
|
builder.RootComponents.Add<App>("#app");
|
|
|
|
|
builder.RootComponents.Add<HeadOutlet>("head::after");
|
|
|
|
|
|
2025-08-24 02:31:12 -03:00
|
|
|
var culture = new CultureInfo("es-AR");
|
|
|
|
|
CultureInfo.DefaultThreadCurrentCulture = culture;
|
|
|
|
|
CultureInfo.DefaultThreadCurrentUICulture = culture;
|
2025-01-24 19:17:26 -03:00
|
|
|
#region Proveedor de Autorizacion
|
|
|
|
|
builder.Services.AddScoped<CustomAuthorizationProvider>();
|
|
|
|
|
builder.Services.AddScoped<AuthenticationStateProvider, CustomAuthorizationProvider>(p => p.GetRequiredService<CustomAuthorizationProvider>());
|
|
|
|
|
builder.Services.AddScoped<ILoginService, CustomAuthorizationProvider>(p => p.GetRequiredService<CustomAuthorizationProvider>());
|
|
|
|
|
builder.Services.AddAuthorizationCore();
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Load Configuration
|
|
|
|
|
var config = builder.Configuration.GetSection("BaseAd").Value;
|
|
|
|
|
if (config != null)
|
|
|
|
|
{
|
|
|
|
|
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(config) });
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
#region Injection Dependencis
|
2025-05-05 22:50:02 -03:00
|
|
|
InjectDependencies(builder);
|
2025-01-24 19:17:26 -03:00
|
|
|
#endregion
|
|
|
|
|
#region UI
|
|
|
|
|
builder.Services.AddBlazoredModal();
|
|
|
|
|
builder.Services.AddBlazoredToast();
|
|
|
|
|
builder.Services.AddSingleton<NavMenuService>();
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
await builder.Build().RunAsync();
|
2025-05-05 22:50:02 -03:00
|
|
|
|
|
|
|
|
static void InjectDependencies(WebAssemblyHostBuilder builder)
|
|
|
|
|
{
|
|
|
|
|
builder.Services.AddScoped<ISalesLookupService, SalesLookupService>();
|
2025-06-30 16:15:08 -03:00
|
|
|
builder.Services.AddScoped<IStockLookUpService, StockLookUpService>();
|
2025-05-08 08:55:54 -03:00
|
|
|
builder.Services.AddScoped<IExchangeRateService, ExchangeRateService>();
|
2025-08-18 00:47:37 -03:00
|
|
|
builder.Services.AddScoped<IStockScanService, StockScanService>();
|
2025-09-09 23:54:11 -03:00
|
|
|
builder.Services.AddScoped<IExpeditionService, ExpeditionService>();
|
2025-09-11 22:41:46 -03:00
|
|
|
builder.Services.AddScoped<IQuoteService,QuoteService>();
|
2026-03-19 18:23:26 -03:00
|
|
|
builder.Services.AddScoped<IDeliveryNoteService, DeliveryNoteService>();
|
2025-05-08 08:55:54 -03:00
|
|
|
|
2025-05-13 12:08:38 -03:00
|
|
|
builder.Services.AddScoped<ExchangeRateService>();
|
2025-05-05 22:50:02 -03:00
|
|
|
builder.Services.AddScoped<TicketsService>();
|
|
|
|
|
builder.Services.AddScoped<CustomerService>();
|
|
|
|
|
builder.Services.AddScoped<TaxConditionService>();
|
|
|
|
|
builder.Services.AddScoped<AccountTypeService>();
|
|
|
|
|
builder.Services.AddScoped<DocumentTypeService>();
|
|
|
|
|
builder.Services.AddScoped<InstitutionService>();
|
|
|
|
|
builder.Services.AddScoped<ProductService>();
|
|
|
|
|
builder.Services.AddScoped<BusinessUnitService>();
|
|
|
|
|
builder.Services.AddScoped<ProfessionalService>();
|
|
|
|
|
builder.Services.AddScoped<PeopleService>();
|
|
|
|
|
builder.Services.AddScoped<ProfessionalSpecialtyService>();
|
|
|
|
|
builder.Services.AddScoped<ProductCategoryService>();
|
2025-05-08 15:46:04 -03:00
|
|
|
builder.Services.AddScoped<PatientService>();
|
2025-06-27 13:52:22 -03:00
|
|
|
builder.Services.AddScoped<ProductDivisionService>();
|
2025-06-30 16:15:08 -03:00
|
|
|
builder.Services.AddScoped<LSProductService>();
|
2025-07-15 12:42:30 -03:00
|
|
|
builder.Services.AddScoped<LSUnitOfMeasureService>();
|
2025-08-18 00:47:37 -03:00
|
|
|
builder.Services.AddScoped<ExpeditionService>();
|
2025-05-05 22:50:02 -03:00
|
|
|
}
|