# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Build & Run

This is an **ASP.NET Web Forms** project targeting **.NET Framework 4.7.2**. Build and run via Visual Studio 2022:

- **Build:** `msbuild OlympiaIntranet.sln` or use VS Build menu
- **Run:** F5 in Visual Studio (IIS Express, port defined in `launchSettings`)
- **Publish:** Use publish profiles in `Properties/PublishProfiles/` — separate profiles for TEST and PROD environments

There are no automated tests in this solution.

## Architecture

### Project Type
ASP.NET Web Forms (not MVC/Blazor). Each page is an `.aspx` file with a paired `.aspx.cs` code-behind. The solution is a single project (`OlympiaIntranet.csproj`).

### Authentication
OWIN cookie-based auth configured in `App_Start/Startup.cs` via `Microsoft.AspNet.Identity`. Login page is `SignIn.aspx`. Forms auth timeout is 240 minutes. Cookie domain is configurable via `AppSettings["CookieDomain"]` in `Web.config`.

### Data Access
Two patterns coexist:
- **LINQ to SQL** via `DataClasses1DataContext` — primary ORM, maps to `FirstSolutionDB`. Context and entity definitions live in `DataClasses1.designer.cs`.
- **Raw ADO.NET** — `SqlConnection`/`SqlCommand`/`SqlDataAdapter`/`SqlBulkCopy` used directly in many pages.
- **MySQL** access via `MySqlConnector` (namespace `MySqlConnector`) for specific data sources.
- Entity Framework 6.4.4 is installed but minimally used.

Connection string is stored in `Properties.Settings.Default.SqlConnection`.

### Shared Utilities
`CommonClass` (in the root namespace) holds shared data access helpers, bulk copy operations, and common query execution methods. Check here before duplicating data access logic.

### Key Dependencies
- **DevExpress v23.2** — UI controls (grids, charts); configured in `Web.config` under `devExpress` section
- **ClosedXML** — Excel export
- **PDFsharp** — PDF generation
- **Newtonsoft.Json** — JSON serialization
- **LumenWorks CSV reader** — CSV parsing

### Page Organization
43 ASPX pages covering:
- Financial dashboards: `DashboardControlli`, `MonitorVaR`, `Mifir`, `Margini`
- Fund management: `Fondi`, `ElencoTitoli`, `EsposizioneTitoli`, `RankingFondi`
- Portfolio/Asset: `GPMAssetAllocation`, `GPMDispRendRisk`, `Reconciliator`
- Reports: `ReportAllFunds`, `ReportPortfoglioApi`

Static assets (CSS, JS, fonts, images) are in their respective top-level folders. Third-party frontend libraries are under `vendor/`.
