Initial commit: ASP.NET Web Forms intranet project
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9
.claude/settings.local.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"allow": [
|
||||||
|
"mcp__plugin_context-mode_context-mode__ctx_batch_execute",
|
||||||
|
"mcp__plugin_context-mode_context-mode__ctx_execute_file",
|
||||||
|
"mcp__plugin_context-mode_context-mode__ctx_search"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
54
.gitignore
vendored
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
# SVN - keep SVN working copy metadata out of git
|
||||||
|
.svn/
|
||||||
|
|
||||||
|
# Visual Studio
|
||||||
|
.vs/
|
||||||
|
*.user
|
||||||
|
*.suo
|
||||||
|
*.userosscache
|
||||||
|
*.sln.docstates
|
||||||
|
|
||||||
|
# Build output
|
||||||
|
[Dd]ebug/
|
||||||
|
[Rr]elease/
|
||||||
|
x64/
|
||||||
|
x86/
|
||||||
|
[Aa][Rr][Mm]/
|
||||||
|
[Aa][Rr][Mm]64/
|
||||||
|
bld/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
[Ll]og/
|
||||||
|
[Ll]ogs/
|
||||||
|
|
||||||
|
# NuGet
|
||||||
|
packages/
|
||||||
|
*.nupkg
|
||||||
|
*.snupkg
|
||||||
|
project.lock.json
|
||||||
|
project.fragment.lock.json
|
||||||
|
artifacts/
|
||||||
|
!**/[Pp]ackages/build/
|
||||||
|
|
||||||
|
# Publish profiles output
|
||||||
|
PublishOutput/
|
||||||
|
publish/
|
||||||
|
|
||||||
|
# ASP.NET
|
||||||
|
App_Data/
|
||||||
|
*.pubxml.user
|
||||||
|
|
||||||
|
# Rider
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
Thumbs.db
|
||||||
|
Desktop.ini
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Temp files
|
||||||
|
*.tmp
|
||||||
|
*.temp
|
||||||
|
*.bak
|
||||||
|
*.cache
|
||||||
|
~$*
|
||||||
49
CLAUDE.md
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
# 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/`.
|
||||||
26
OlympiaIntranet.sln
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.10.34928.147
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OlympiaIntranet", "OlympiaIntranet\OlympiaIntranet.csproj", "{343269B8-30DD-430E-8A63-B55DC1209097}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{343269B8-30DD-430E-8A63-B55DC1209097}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{343269B8-30DD-430E-8A63-B55DC1209097}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{343269B8-30DD-430E-8A63-B55DC1209097}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{343269B8-30DD-430E-8A63-B55DC1209097}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {4F2D9DA5-5059-46B4-A491-530EBBD68707}
|
||||||
|
VisualSVNWorkingCopyRoot = .
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
437
OlympiaIntranet/AUM.aspx
Normal file
@@ -0,0 +1,437 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AUM.aspx.cs" Inherits="OlympiaIntranet.AUMPage" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Data.Linq" TagPrefix="dx" %>
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<%-- <div class="col d-flex align-items-center justify-content-center">
|
||||||
|
<img src="Images/logo_sito.jpg" class="img-fluid" alt="Responsive image" />
|
||||||
|
</div>
|
||||||
|
<hr />--%>
|
||||||
|
<div>
|
||||||
|
<dx:ASPxRibbon ID="ASPxRibbon1" runat="server" EnableTheming="True" Theme="Office2010Blue" ShowFileTab="False" ShowTabs="False" OnCommandExecuted="ASPxRibbon1_CommandExecuted" OnInit="ASPxRibbon1_Init">
|
||||||
|
<Tabs>
|
||||||
|
<dx:RibbonTab Name="Main" Text="Main">
|
||||||
|
<Groups>
|
||||||
|
<dx:RibbonGroup Text="Filtri" Name="Filtri">
|
||||||
|
<Items>
|
||||||
|
<dx:RibbonTemplateItem Size="Large" Name="ribbonTemplate">
|
||||||
|
<Template>
|
||||||
|
<table cellpadding="0" cellspacing="0">
|
||||||
|
<tr>
|
||||||
|
<td>Data Inizio
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxDateEdit ID="dataInizio" runat="server" DisplayFormatString="dd/MM/yyyy" EditFormat="Custom" EditFormatString="dd/MM/yyyy" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Data Fine
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxDateEdit ID="dataFine" runat="server" DisplayFormatString="dd/MM/yyyy" EditFormat="Custom" EditFormatString="dd/MM/yyyy" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</Template>
|
||||||
|
</dx:RibbonTemplateItem>
|
||||||
|
<dx:RibbonButtonItem Name="loadGrid" Size="Large" Text="Carica">
|
||||||
|
<LargeImage IconID="actions_refresh2_32x32">
|
||||||
|
</LargeImage>
|
||||||
|
</dx:RibbonButtonItem>
|
||||||
|
</Items>
|
||||||
|
</dx:RibbonGroup>
|
||||||
|
<dx:RibbonGroup Text="Tools" Name="Tools">
|
||||||
|
<Items>
|
||||||
|
<dx:RibbonButtonItem Name="exportExcel" Size="Large" Text="Excel">
|
||||||
|
<LargeImage IconID="export_exporttoxlsx_32x32">
|
||||||
|
</LargeImage>
|
||||||
|
</dx:RibbonButtonItem>
|
||||||
|
</Items>
|
||||||
|
</dx:RibbonGroup>
|
||||||
|
</Groups>
|
||||||
|
</dx:RibbonTab>
|
||||||
|
</Tabs>
|
||||||
|
</dx:ASPxRibbon>
|
||||||
|
<dx:ASPxPageControl ID="pageControl" runat="server" ActiveTabIndex="0" EnableTheming="True" Theme="Office2010Blue" ClientInstanceName="pcAUM" Width="100%">
|
||||||
|
<TabPages>
|
||||||
|
<dx:TabPage Name="tpFondi" Text="Fondi">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="Totale AUM Iniziale" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbTotAumInizialeFondi" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel29" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel2" runat="server" Text="Totale AUM Finale" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbTotAumFinaleFondi" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel1" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel3" runat="server" Text="Delta" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbDelta" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel4" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel4" runat="server" Text="Raccolta Netta" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbRaccoltaNetta" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel5" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
<dx:ASPxGridView ID="gvFondi" runat="server" OnDataBound="gvFondi_DataBound" Theme="Office2010Blue" Width="100%">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<SettingsPager PageSize="15" Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
<Settings ShowFilterRow="True" ShowHeaderFilterButton="True" ShowTitlePanel="True" />
|
||||||
|
<SettingsText Title="FONDI" />
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>
|
||||||
|
<dx:TabPage Name="tpDettaglioFondi" Text="Dettaglio Fondi">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<dx:ASPxGridView ID="gvDettaglioFondi" runat="server" Theme="Office2010Blue" OnDataBound="gvDettaglioFondi_DataBound" Width="100%">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<SettingsPager PageSize="15">
|
||||||
|
<PageSizeItemSettings Visible="True">
|
||||||
|
</PageSizeItemSettings>
|
||||||
|
</SettingsPager>
|
||||||
|
<Settings ShowFilterRow="True" ShowHeaderFilterButton="True" ShowTitlePanel="True" HorizontalScrollBarMode="Visible" />
|
||||||
|
<SettingsText Title="DETTAGLIO FONDI" />
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
<Styles>
|
||||||
|
<Header Wrap="True">
|
||||||
|
</Header>
|
||||||
|
</Styles>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>
|
||||||
|
<dx:TabPage Name="tpGPMConsuntivo" Text="GPM Consuntivo">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel5" runat="server" Text="Totale AUM Iniziale" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbTotAumInizialePtf_GPMConsuntivo" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel2" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel6" runat="server" Text="Totale AUM Finale" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbTotAumFinalePtf_GPMConsuntivo" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel13" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="label2" runat="server" Text="Delta" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbDelta_GPMConsuntivo" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel14" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="label1" runat="server" Text="Raccolta Netta" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbRaccoltaNetta_GPMConsuntivo" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel6" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel9" runat="server" Text="Totale AUM Finale (ITA)" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbTotAumFinaleITA_GPMConsuntivo" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel7" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel10" runat="server" Text="Totale AUM Finale (UK)" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbTotAumFinaleUK_GPMConsuntivo" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel11" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
<dx:ASPxGridView ID="gvGPMConsuntivo" runat="server" OnDataBound="gvGPMConsuntivo_DataBound" Theme="Office2010Blue" Width="100%">
|
||||||
|
<SettingsDetail ShowDetailRow="False" />
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<SettingsPager PageSize="10">
|
||||||
|
<PageSizeItemSettings Visible="True">
|
||||||
|
</PageSizeItemSettings>
|
||||||
|
</SettingsPager>
|
||||||
|
<Settings ShowFilterRow="True" ShowGroupPanel="True" ShowHeaderFilterButton="True" HorizontalScrollBarMode="Visible" />
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
<Styles>
|
||||||
|
<Header Wrap="True">
|
||||||
|
</Header>
|
||||||
|
</Styles>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>
|
||||||
|
<dx:TabPage Name="tpGPMForecast" Text="GPM Forecast">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel7" runat="server" Text="Totale AUM Iniziale" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbTotAumInizialePtf_GPMForecast" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel3" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel8" runat="server" Text="Totale AUM Finale" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbTotAumFinalePtf_GPMForecast" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel15" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel13" runat="server" Text="Delta" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbDelta_GPMForecast" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel16" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel14" runat="server" Text="Raccolta Netta" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbRaccoltaNetta_GPMForecast" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel8" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel11" runat="server" Text="Totale AUM Finale (ITA)" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbTotAumFinaleITA_GPMForecast" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel9" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel12" runat="server" Text="Totale AUM Finale (UK)" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbTotAumFinaleUK_GPMForecast" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr style="height: 10px;"></tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel15" runat="server" Text="Comm. Perf in maturazione" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbCommPerfInMaturazione" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel10" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
<dx:ASPxGridView ID="gvGPMForecast" runat="server" OnDataBound="gvGPMForecast_DataBound" Theme="Office2010Blue" Width="100%">
|
||||||
|
<SettingsDetail ShowDetailRow="False" />
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<SettingsPager PageSize="10">
|
||||||
|
<PageSizeItemSettings Visible="True">
|
||||||
|
</PageSizeItemSettings>
|
||||||
|
</SettingsPager>
|
||||||
|
<Settings ShowFilterRow="True" ShowGroupPanel="True" ShowHeaderFilterButton="True" HorizontalScrollBarMode="Visible" />
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
<Styles>
|
||||||
|
<Header Wrap="True">
|
||||||
|
</Header>
|
||||||
|
</Styles>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>
|
||||||
|
|
||||||
|
<%-- <dx:TabPage Name="tpAnagraficaFondi" Text="Anagrafica Fondi">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel21" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
<dx:ASPxGridView ID="gvAnagraficaFondi" runat="server" OnDataBound="gvAnagraficaFondi_DataBound" Theme="Office2010Blue" Width="100%">
|
||||||
|
<SettingsDetail ShowDetailRow="False" />
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<SettingsPager PageSize="10">
|
||||||
|
<PageSizeItemSettings Visible="True">
|
||||||
|
</PageSizeItemSettings>
|
||||||
|
</SettingsPager>
|
||||||
|
<Settings ShowFilterRow="True" ShowGroupPanel="True" ShowHeaderFilterButton="True" HorizontalScrollBarMode="Visible" />
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
<Styles>
|
||||||
|
<Header Wrap="True">
|
||||||
|
</Header>
|
||||||
|
</Styles>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>--%>
|
||||||
|
|
||||||
|
</TabPages>
|
||||||
|
</dx:ASPxPageControl>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<asp:SqlDataSource ID="SqlDSGestioniPatrimoniali" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection %>" ProviderName="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection.ProviderName %>" SelectCommand="aum_GestioniPatrimoniali" SelectCommandType="StoredProcedure" OnSelecting="SqlDSGestioniPatrimoniali_Selecting">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="data_inizio" SessionField="data_inizio" />
|
||||||
|
<asp:SessionParameter Name="data_fine" SessionField="data_fine" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSGPMConsuntivo" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection %>" ProviderName="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection.ProviderName %>" SelectCommand="aum_GPMConsuntivo" SelectCommandType="StoredProcedure" OnSelecting="SqlDSGPMConsuntivo_Selecting">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="data_inizio" SessionField="data_inizio" />
|
||||||
|
<asp:SessionParameter Name="data_fine" SessionField="data_fine" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSGPMForecast" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection %>" ProviderName="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection.ProviderName %>" SelectCommand="aum_GPMForecast" SelectCommandType="StoredProcedure" OnSelecting="SqlDSGPMForecast_Selecting">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="data_inizio" SessionField="data_inizio" />
|
||||||
|
<asp:SessionParameter Name="data_fine" SessionField="data_fine" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSFondi" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection %>" ProviderName="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection.ProviderName %>" SelectCommand="aum_Fondi2" SelectCommandType="StoredProcedure" OnSelecting="SqlDSFondi_Selecting">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="data_inizio" SessionField="data_inizio" />
|
||||||
|
<asp:SessionParameter Name="data_fine" SessionField="data_fine" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSDettaglioFondi" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="aum_DettaglioFondi2" SelectCommandType="StoredProcedure" OnSelecting="SqlDSDettaglioFondi_Selecting"></asp:SqlDataSource>
|
||||||
|
<dx:ASPxGridViewExporter ID="ExporterGPMConsuntivo" runat="server" GridViewID="gvGPMConsuntivo">
|
||||||
|
</dx:ASPxGridViewExporter>
|
||||||
|
<dx:ASPxGridViewExporter ID="ExporterGPMForecast" runat="server" GridViewID="gvGPMForecast">
|
||||||
|
</dx:ASPxGridViewExporter>
|
||||||
|
<dx:ASPxGridViewExporter ID="ExporterFondi" runat="server" GridViewID="gvFondi">
|
||||||
|
</dx:ASPxGridViewExporter>
|
||||||
|
<dx:ASPxGridViewExporter ID="ExporterDettaglioFondi" runat="server" GridViewID="gvDettaglioFondi">
|
||||||
|
</dx:ASPxGridViewExporter>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
603
OlympiaIntranet/AUM.aspx.cs
Normal file
@@ -0,0 +1,603 @@
|
|||||||
|
using DevExpress.Export;
|
||||||
|
using DevExpress.Spreadsheet;
|
||||||
|
using DevExpress.SpreadsheetSource.Implementation;
|
||||||
|
using DevExpress.Web;
|
||||||
|
using DevExpress.XtraEditors;
|
||||||
|
using DevExpress.XtraPrinting;
|
||||||
|
using DevExpress.XtraPrintingLinks;
|
||||||
|
using MySqlConnector;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class AUMPage : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (HttpContext.Current.User.Identity.IsAuthenticated == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxRibbon1_CommandExecuted(object source, DevExpress.Web.RibbonCommandExecutedEventArgs e)
|
||||||
|
{
|
||||||
|
// Selezionato pulsante Refresh
|
||||||
|
if (e.Item.Name == "loadGrid")
|
||||||
|
{
|
||||||
|
RibbonTemplateItem template = (RibbonTemplateItem)ASPxRibbon1.Tabs[0].Groups[0].Items.FindByName("ribbonTemplate");
|
||||||
|
ASPxDateEdit deDataInizio = template.FindControl("dataInizio") as ASPxDateEdit;
|
||||||
|
if (String.IsNullOrEmpty(deDataInizio.Text))
|
||||||
|
{
|
||||||
|
CommonClass.MessageBox(this, "Inserire data inizio!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ASPxDateEdit deDataFine = template.FindControl("dataFine") as ASPxDateEdit;
|
||||||
|
if (String.IsNullOrEmpty(deDataFine.Text))
|
||||||
|
{
|
||||||
|
CommonClass.MessageBox(this, "Inserire data fine!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// recupero il valore del ribbondateedit dataInizio
|
||||||
|
//DateTime dataInizio = Convert.ToDateTime(ribDataInizio.Value);
|
||||||
|
Session["data_inizio"] = deDataInizio.Date;
|
||||||
|
|
||||||
|
// recupero il valore del ribbondateedit dataFine
|
||||||
|
//DateTime dataFine = Convert.ToDateTime(ribDataFine.Value);
|
||||||
|
Session["data_fine"] = deDataFine.Date;
|
||||||
|
|
||||||
|
|
||||||
|
// Verifica che dataInizio sia minore di dataFine
|
||||||
|
if (deDataInizio.Date > deDataFine.Date)
|
||||||
|
{
|
||||||
|
CommonClass.MessageBox(this, "Data inizio deve essere minore di Data fine!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Se i controlli sono passati allora linka datasource a grdiview...
|
||||||
|
//gvGestioniPatrimoniali.DataSourceID = "SqlDSGestioniPatrimoniali";
|
||||||
|
//gvGestioniPatrimoniali.KeyFieldName = "PORTAFOGLIO";
|
||||||
|
//gvGestioniPatrimoniali.DataBind();
|
||||||
|
|
||||||
|
gvGPMConsuntivo.DataSourceID = "SqlDSGPMConsuntivo";
|
||||||
|
gvGPMConsuntivo.KeyFieldName = "PORTAFOGLIO";
|
||||||
|
gvGPMConsuntivo.DataBind();
|
||||||
|
|
||||||
|
gvGPMForecast.DataSourceID = "SqlDSGPMForecast";
|
||||||
|
gvGPMForecast.KeyFieldName = "PORTAFOGLIO";
|
||||||
|
gvGPMForecast.DataBind();
|
||||||
|
|
||||||
|
gvFondi.DataSourceID = "SqlDSFondi";
|
||||||
|
gvFondi.DataBind();
|
||||||
|
|
||||||
|
gvDettaglioFondi.DataSourceID = "SqlDSDettaglioFondi";
|
||||||
|
gvDettaglioFondi.DataBind();
|
||||||
|
|
||||||
|
}
|
||||||
|
// Selezionato pulsante Export in Excel
|
||||||
|
if (e.Item.Name == "exportExcel")
|
||||||
|
{
|
||||||
|
// Ref link: https://www.devexpress.com/Support/Center/Question/Details/T327338/aspxgridview-export-multiple-grids-to-the-same-excel-file
|
||||||
|
PrintingSystem ps = new PrintingSystem();
|
||||||
|
|
||||||
|
// Esporta griglia GPMForecast
|
||||||
|
PrintableComponentLink link0 = new PrintableComponentLink(ps);
|
||||||
|
ExporterGPMForecast.ExportSelectedRowsOnly = false;
|
||||||
|
string reportHeader0 = string.Format(@"Estrazione GPM Forecast dal {0} al {1} \par Tot. AUM Iniziale: {2:n2} \par Tot. AUM Finale: {3:n2} \par", Convert.ToDateTime(Session["data_inizio"]).ToString("dd/MM/yyyy"), Convert.ToDateTime(Session["data_fine"]).ToString("dd/MM/yyyy"), Convert.ToDouble(tbTotAumInizialePtf_GPMForecast.Text), Convert.ToDouble(tbTotAumFinalePtf_GPMForecast.Text));
|
||||||
|
ExporterGPMForecast.ReportHeader = @"{\rtf1\ansi\ansicpg1252\deff0\deflang1040{\fonttbl{\f0\fnil\fcharset0 Tahoma;}{\f1\fnil\fcharset0 Times New Roman;}}\viewkind4\uc1\pard\b\f0\fs28 " + reportHeader0 + @"\b0\f1\fs20\par}";
|
||||||
|
link0.Component = ExporterGPMForecast;
|
||||||
|
|
||||||
|
// Esporta griglia GPMConsuntivo
|
||||||
|
PrintableComponentLink link1 = new PrintableComponentLink(ps);
|
||||||
|
ExporterGPMConsuntivo.ExportSelectedRowsOnly = false;
|
||||||
|
string reportHeader1 = string.Format(@"Estrazione GPM Consuntivo dal {0} al {1} \par Tot. AUM Iniziale: {2:n2} \par Tot. AUM Finale: {3:n2} \par", Convert.ToDateTime(Session["data_inizio"]).ToString("dd/MM/yyyy"), Convert.ToDateTime(Session["data_fine"]).ToString("dd/MM/yyyy"), Convert.ToDouble(tbTotAumInizialePtf_GPMConsuntivo.Text), Convert.ToDouble(tbTotAumFinalePtf_GPMConsuntivo.Text));
|
||||||
|
ExporterGPMConsuntivo.ReportHeader = @"{\rtf1\ansi\ansicpg1252\deff0\deflang1040{\fonttbl{\f0\fnil\fcharset0 Tahoma;}{\f1\fnil\fcharset0 Times New Roman;}}\viewkind4\uc1\pard\b\f0\fs28 " + reportHeader1 + @"\b0\f1\fs20\par}";
|
||||||
|
link1.Component = ExporterGPMConsuntivo;
|
||||||
|
|
||||||
|
// Esporta griglia Fondi
|
||||||
|
PrintableComponentLink link2 = new PrintableComponentLink(ps);
|
||||||
|
ExporterFondi.ExportSelectedRowsOnly = false;
|
||||||
|
string reportHeader2 = string.Format(@"Estrazione Fondi dal {0} al {1} \par Tot. AUM Iniziale: {2:n2} \par Tot. AUM Finale: {3:n2} \par Delta: {4:n2} \par Raccolta Netta: {5:n2} \par",
|
||||||
|
Convert.ToDateTime(Session["data_inizio"]).ToString("dd/MM/yyyy"),
|
||||||
|
Convert.ToDateTime(Session["data_fine"]).ToString("dd/MM/yyyy"),
|
||||||
|
Convert.ToDouble(tbTotAumInizialeFondi.Text),
|
||||||
|
Convert.ToDouble(tbTotAumFinaleFondi.Text),
|
||||||
|
Convert.ToDouble(tbDelta.Text),
|
||||||
|
Convert.ToDouble(tbRaccoltaNetta.Text)
|
||||||
|
);
|
||||||
|
ExporterFondi.ReportHeader = @"{\rtf1\ansi\ansicpg1252\deff0\deflang1040{\fonttbl{\f0\fnil\fcharset0 Tahoma;}{\f1\fnil\fcharset0 Times New Roman;}}\viewkind4\uc1\pard\b\f0\fs28 " + reportHeader2 + @"\b0\f1\fs20\par}";
|
||||||
|
link2.Component = ExporterFondi;
|
||||||
|
|
||||||
|
// Esporta griglia Dettaglio Fondi
|
||||||
|
PrintableComponentLink link3 = new PrintableComponentLink(ps);
|
||||||
|
ExporterDettaglioFondi.ExportSelectedRowsOnly = false;
|
||||||
|
link3.Component = ExporterDettaglioFondi;
|
||||||
|
|
||||||
|
CompositeLink compositeLink = new CompositeLink(ps);
|
||||||
|
compositeLink.Links.AddRange(new object[] { link0, link1, link2, link3 });
|
||||||
|
compositeLink.CreatePageForEachLink();
|
||||||
|
|
||||||
|
string fileName = string.Format("{0}_{1}", DateTime.Now.ToString("yyyyMMdd_HHmm"), "AUM.xlsx");
|
||||||
|
using (MemoryStream stream = new MemoryStream())
|
||||||
|
{
|
||||||
|
XlsxExportOptionsEx options = new XlsxExportOptionsEx();
|
||||||
|
options.ExportMode = XlsxExportMode.SingleFilePageByPage;
|
||||||
|
options.ExportType = ExportType.WYSIWYG;
|
||||||
|
compositeLink.PrintingSystemBase.ExportToXlsx(stream, options);
|
||||||
|
Response.Clear();
|
||||||
|
Response.Buffer = false;
|
||||||
|
Response.AppendHeader("Content-Type", "application/xlsx");
|
||||||
|
Response.AppendHeader("Content-Transfer-Encoding", "binary");
|
||||||
|
Response.AppendHeader("Content-Disposition", $"attachment; filename={fileName}");
|
||||||
|
stream.Position = 0;
|
||||||
|
|
||||||
|
Workbook workbook = new Workbook();
|
||||||
|
workbook.LoadDocument(stream,DevExpress.Spreadsheet.DocumentFormat.OpenXml);
|
||||||
|
DevExpress.Spreadsheet.WorksheetCollection worksheets = workbook.Worksheets;
|
||||||
|
workbook.Worksheets[0].Name = "GPM Forecast";
|
||||||
|
workbook.Worksheets[1].Name = "GPM Consuntivo";
|
||||||
|
workbook.Worksheets[2].Name = "Fondi";
|
||||||
|
workbook.Worksheets[3].Name = "Dettaglio Fondi";
|
||||||
|
using (MemoryStream outputStream = new MemoryStream())
|
||||||
|
{
|
||||||
|
workbook.SaveDocument(outputStream, DevExpress.Spreadsheet.DocumentFormat.OpenXml);
|
||||||
|
Response.BinaryWrite(outputStream.ToArray());
|
||||||
|
Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ps.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void WriteToResponse(string fileName, bool saveAsFile, string fileFormat, MemoryStream stream)
|
||||||
|
{
|
||||||
|
if (Page == null || Page.Response == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
string disposition = saveAsFile ? "attachment" : "inline";
|
||||||
|
Page.Response.Clear();
|
||||||
|
Page.Response.Buffer = false;
|
||||||
|
Page.Response.AppendHeader("Content-Type", string.Format("application/{0}", fileFormat));
|
||||||
|
Page.Response.AppendHeader("Content-Transfer-Encoding", "binary");
|
||||||
|
Page.Response.AppendHeader("Content-Disposition", string.Format("{0}; filename={1}", disposition, fileName));
|
||||||
|
Page.Response.BinaryWrite(stream.ToArray());
|
||||||
|
Page.Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region DATABOUND
|
||||||
|
//protected void gvAnagraficaFondi_DataBound(object sender, EventArgs e)
|
||||||
|
//{
|
||||||
|
// ASPxGridView gridview = sender as ASPxGridView;
|
||||||
|
// foreach (GridViewColumn column in gridview.Columns)
|
||||||
|
// {
|
||||||
|
// if (column is GridViewDataColumn)
|
||||||
|
// column.Caption = ((GridViewDataColumn)column).FieldName;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
protected void gvDettaglioFondi_DataBound(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// ref : https://www.devexpress.com/Support/Center/Question/Details/Q585537/aspxgridview-autogeneratecolumns-true-field-name-start-with-lower-case-letter-insert-a
|
||||||
|
// Evita che a runtime le colonne con maiuscole nella query vengono scritte con lo spazio (ad esempio codiceIsin -> codice Isin)
|
||||||
|
// questo poi crea un problema andando a esportare l'excel dove serve che le colonne siano le stesse della query.
|
||||||
|
ASPxGridView gridview = sender as ASPxGridView;
|
||||||
|
foreach (GridViewColumn column in gridview.Columns)
|
||||||
|
{
|
||||||
|
if (column is GridViewDataColumn)
|
||||||
|
column.Caption = ((GridViewDataColumn)column).FieldName;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Effettua formattazione colonne a runtime..
|
||||||
|
if (gridview.Columns.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (GridViewDataColumn dataCol in gridview.DataColumns)
|
||||||
|
{
|
||||||
|
List<string> listHeader = new List<string>(); // Contiene tutte le colonne che non sono pivot dalla query
|
||||||
|
listHeader.Add("PORTAFOGLIO");
|
||||||
|
listHeader.Add("TITOLO");
|
||||||
|
listHeader.Add("NOME");
|
||||||
|
listHeader.Add("DIVISA");
|
||||||
|
listHeader.Add("DEPOSITARIA");
|
||||||
|
listHeader.Add("GESTORE");
|
||||||
|
listHeader.Add("CONSULENTE");
|
||||||
|
listHeader.Add("ADVISOR");
|
||||||
|
|
||||||
|
bool IsColPivot = !listHeader.Any(s => dataCol.Caption.Contains(s)); // Se la colonna è pivot...
|
||||||
|
if (IsColPivot == true) dataCol.PropertiesEdit.DisplayFormatString = "N2"; // .. allora viene formattata con decimali e migliaia
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvGestioniPatrimoniali_DataBound(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// ref : https://www.devexpress.com/Support/Center/Question/Details/Q585537/aspxgridview-autogeneratecolumns-true-field-name-start-with-lower-case-letter-insert-a
|
||||||
|
// Evita che a runtime le colonne con maiuscole nella query vengono scritte con lo spazio (ad esempio codiceIsin -> codice Isin)
|
||||||
|
// questo poi crea un problema andando a esportare l'excel dove serve che le colonne siano le stesse della query.
|
||||||
|
//ASPxGridView gridview = sender as ASPxGridView;
|
||||||
|
//foreach (GridViewColumn column in gridview.Columns)
|
||||||
|
//{
|
||||||
|
// if (column is GridViewDataColumn)
|
||||||
|
// column.Caption = ((GridViewDataColumn)column).FieldName;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//// Effettua formattazione colonne a runtime..
|
||||||
|
//if (gridview.Columns.Count > 0)
|
||||||
|
//{
|
||||||
|
// gridview.DataColumns["DATA APERTURA"].PropertiesEdit.DisplayFormatString = "dd/MM/yyyy";
|
||||||
|
// gridview.DataColumns["DATA CHIUSURA"].PropertiesEdit.DisplayFormatString = "dd/MM/yyyy";
|
||||||
|
// gridview.DataColumns["AUM INIZIALE"].PropertiesEdit.DisplayFormatString = "N2";
|
||||||
|
// gridview.DataColumns["AUM FINALE"].PropertiesEdit.DisplayFormatString = "N2";
|
||||||
|
// gridview.DataColumns["AUM MEDIO"].PropertiesEdit.DisplayFormatString = "N2";
|
||||||
|
// gridview.DataColumns["COMM DI GESTIONE"].PropertiesEdit.DisplayFormatString = "P2";
|
||||||
|
// gridview.DataColumns["COMM PERFORMANCE"].PropertiesEdit.DisplayFormatString = "P2";
|
||||||
|
|
||||||
|
// // Calcola Totali AUM INIZIALE e AUM FINALE ma non li mostra nel footer
|
||||||
|
// gridview.TotalSummary.Clear();
|
||||||
|
// gridview.Settings.ShowFooter = false;
|
||||||
|
// ASPxSummaryItem totPatrimonioPrec = new ASPxSummaryItem();
|
||||||
|
// totPatrimonioPrec.FieldName = "AUM INIZIALE";
|
||||||
|
// totPatrimonioPrec.SummaryType = DevExpress.Data.SummaryItemType.Sum;
|
||||||
|
// gridview.TotalSummary.Add(totPatrimonioPrec);
|
||||||
|
// tbTotAumInizialePtf_GPM.DisplayFormatString = "n2";
|
||||||
|
// tbTotAumInizialePtf_GPM.Text = gridview.GetTotalSummaryValue(totPatrimonioPrec).ToString();
|
||||||
|
|
||||||
|
// ASPxSummaryItem totPatrimonioOggi = new ASPxSummaryItem();
|
||||||
|
// totPatrimonioOggi.FieldName = "AUM FINALE";
|
||||||
|
// totPatrimonioOggi.SummaryType = DevExpress.Data.SummaryItemType.Sum;
|
||||||
|
// gridview.TotalSummary.Add(totPatrimonioOggi);
|
||||||
|
// tbTotAumFinalePtf_GPM.DisplayFormatString = "n2";
|
||||||
|
// tbTotAumFinalePtf_GPM.Text = gridview.GetTotalSummaryValue(totPatrimonioOggi).ToString();
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvFondi_DataBound(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// ref : https://www.devexpress.com/Support/Center/Question/Details/Q585537/aspxgridview-autogeneratecolumns-true-field-name-start-with-lower-case-letter-insert-a
|
||||||
|
// Evita che a runtime le colonne con maiuscole nella query vengono scritte con lo spazio (ad esempio codiceIsin -> codice Isin)
|
||||||
|
// questo poi crea un problema andando a esportare l'excel dove serve che le colonne siano le stesse della query.
|
||||||
|
ASPxGridView gridview = sender as ASPxGridView;
|
||||||
|
foreach (GridViewColumn column in gridview.Columns)
|
||||||
|
{
|
||||||
|
if (column is GridViewDataColumn)
|
||||||
|
column.Caption = ((GridViewDataColumn)column).FieldName;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Effettua formattazione colonne a runtime..
|
||||||
|
if (gridview.Columns.Count > 0)
|
||||||
|
{
|
||||||
|
gridview.DataColumns["AUM INIZIALE"].PropertiesEdit.DisplayFormatString = "N2";
|
||||||
|
gridview.DataColumns["AUM FINALE"].PropertiesEdit.DisplayFormatString = "N2";
|
||||||
|
gridview.DataColumns["SUBQUOTES"].PropertiesEdit.DisplayFormatString = "N2";
|
||||||
|
gridview.DataColumns["REDQUOTES"].PropertiesEdit.DisplayFormatString = "N2";
|
||||||
|
|
||||||
|
// Cancella totali e non li disabilita sulla griglia
|
||||||
|
gridview.TotalSummary.Clear();
|
||||||
|
gridview.Settings.ShowFooter = false;
|
||||||
|
|
||||||
|
// Calcolo Totale AUM Iniziale
|
||||||
|
ASPxSummaryItem totPatrimonioPrec = new ASPxSummaryItem();
|
||||||
|
totPatrimonioPrec.FieldName = "AUM INIZIALE";
|
||||||
|
totPatrimonioPrec.SummaryType = DevExpress.Data.SummaryItemType.Sum;
|
||||||
|
gridview.TotalSummary.Add(totPatrimonioPrec);
|
||||||
|
tbTotAumInizialeFondi.DisplayFormatString = "n2";
|
||||||
|
tbTotAumInizialeFondi.Text = gridview.GetTotalSummaryValue(totPatrimonioPrec).ToString();
|
||||||
|
|
||||||
|
// Calcolo Totale AUM Finale
|
||||||
|
ASPxSummaryItem totPatrimonioOggi = new ASPxSummaryItem();
|
||||||
|
totPatrimonioOggi.FieldName = "AUM FINALE";
|
||||||
|
totPatrimonioOggi.SummaryType = DevExpress.Data.SummaryItemType.Sum;
|
||||||
|
gridview.TotalSummary.Add(totPatrimonioOggi);
|
||||||
|
tbTotAumFinaleFondi.DisplayFormatString = "n2";
|
||||||
|
tbTotAumFinaleFondi.Text = gridview.GetTotalSummaryValue(totPatrimonioOggi).ToString();
|
||||||
|
|
||||||
|
// Calcolo Delta
|
||||||
|
tbDelta.DisplayFormatString = "n2";
|
||||||
|
//tbDelta.Text = (Convert.ToDouble(gridview.GetTotalSummaryValue(totPatrimonioPrec)) - Convert.ToDouble(gridview.GetTotalSummaryValue(totPatrimonioOggi))).ToString();
|
||||||
|
tbDelta.Text = (Convert.ToDouble(gridview.GetTotalSummaryValue(totPatrimonioOggi)) - Convert.ToDouble(gridview.GetTotalSummaryValue(totPatrimonioPrec))).ToString();
|
||||||
|
|
||||||
|
// Calcolo Totale Subquotes (per calcolare Raccolta Netta)
|
||||||
|
ASPxSummaryItem totSubquotes = new ASPxSummaryItem();
|
||||||
|
totSubquotes.FieldName = "SUBQUOTES";
|
||||||
|
totSubquotes.SummaryType = DevExpress.Data.SummaryItemType.Sum;
|
||||||
|
gridview.TotalSummary.Add(totSubquotes);
|
||||||
|
|
||||||
|
|
||||||
|
// Calcolo Totale Redquotes (per calcolare Raccolta Netta)
|
||||||
|
ASPxSummaryItem totRedquotes = new ASPxSummaryItem();
|
||||||
|
totRedquotes.FieldName = "REDQUOTES";
|
||||||
|
totRedquotes.SummaryType = DevExpress.Data.SummaryItemType.Sum;
|
||||||
|
gridview.TotalSummary.Add(totRedquotes);
|
||||||
|
|
||||||
|
// Calcolo Raccolta Netta
|
||||||
|
tbRaccoltaNetta.DisplayFormatString = "n2";
|
||||||
|
tbRaccoltaNetta.Text = (Convert.ToDouble(gridview.GetTotalSummaryValue(totSubquotes)) + Convert.ToDouble(gridview.GetTotalSummaryValue(totRedquotes))).ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvGPMForecast_DataBound(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// ref : https://www.devexpress.com/Support/Center/Question/Details/Q585537/aspxgridview-autogeneratecolumns-true-field-name-start-with-lower-case-letter-insert-a
|
||||||
|
// Evita che a runtime le colonne con maiuscole nella query vengono scritte con lo spazio (ad esempio codiceIsin -> codice Isin)
|
||||||
|
// questo poi crea un problema andando a esportare l'excel dove serve che le colonne siano le stesse della query.
|
||||||
|
ASPxGridView gridview = sender as ASPxGridView;
|
||||||
|
foreach (GridViewColumn column in gridview.Columns)
|
||||||
|
{
|
||||||
|
if (column is GridViewDataColumn)
|
||||||
|
column.Caption = ((GridViewDataColumn)column).FieldName;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Effettua formattazione colonne a runtime..
|
||||||
|
if (gridview.Columns.Count > 0)
|
||||||
|
{
|
||||||
|
gridview.DataColumns["DATA APERTURA"].PropertiesEdit.DisplayFormatString = "dd/MM/yyyy";
|
||||||
|
gridview.DataColumns["DATA CHIUSURA"].PropertiesEdit.DisplayFormatString = "dd/MM/yyyy";
|
||||||
|
gridview.DataColumns["DATA FINE CALCOLO PERFORMANCE"].PropertiesEdit.DisplayFormatString = "dd/MM/yyyy";
|
||||||
|
gridview.DataColumns["AUM INIZIALE"].PropertiesEdit.DisplayFormatString = "N2";
|
||||||
|
gridview.DataColumns["AUM FINALE"].PropertiesEdit.DisplayFormatString = "N2";
|
||||||
|
gridview.DataColumns["AUM MEDIO"].PropertiesEdit.DisplayFormatString = "N2";
|
||||||
|
gridview.DataColumns["COMM DI GESTIONE"].PropertiesEdit.DisplayFormatString = "P2";
|
||||||
|
gridview.DataColumns["COMM PERFORMANCE"].PropertiesEdit.DisplayFormatString = "P2";
|
||||||
|
gridview.DataColumns["RETRO GESTORE"].PropertiesEdit.DisplayFormatString = "P2";
|
||||||
|
gridview.DataColumns["RETRO ADVISOR"].PropertiesEdit.DisplayFormatString = "P2";
|
||||||
|
gridview.DataColumns["RETRO CONSULENTE"].PropertiesEdit.DisplayFormatString = "P2";
|
||||||
|
gridview.DataColumns["RETRO TOTALE"].PropertiesEdit.DisplayFormatString = "P2";
|
||||||
|
gridview.DataColumns["QUOTA IN ANNUA"].PropertiesEdit.DisplayFormatString = "N2";
|
||||||
|
gridview.DataColumns["QUOTA OUT ANNUA"].PropertiesEdit.DisplayFormatString = "N2";
|
||||||
|
|
||||||
|
// Calcola Totali AUM INIZIALE e AUM FINALE ma non li mostra nel footer
|
||||||
|
gridview.TotalSummary.Clear();
|
||||||
|
gridview.Settings.ShowFooter = false;
|
||||||
|
ASPxSummaryItem totPatrimonioPrec = new ASPxSummaryItem();
|
||||||
|
totPatrimonioPrec.FieldName = "AUM INIZIALE";
|
||||||
|
totPatrimonioPrec.SummaryType = DevExpress.Data.SummaryItemType.Sum;
|
||||||
|
gridview.TotalSummary.Add(totPatrimonioPrec);
|
||||||
|
tbTotAumInizialePtf_GPMForecast.DisplayFormatString = "n2";
|
||||||
|
tbTotAumInizialePtf_GPMForecast.Text = gridview.GetTotalSummaryValue(totPatrimonioPrec).ToString();
|
||||||
|
|
||||||
|
ASPxSummaryItem totPatrimonioOggi = new ASPxSummaryItem();
|
||||||
|
totPatrimonioOggi.FieldName = "AUM FINALE";
|
||||||
|
totPatrimonioOggi.SummaryType = DevExpress.Data.SummaryItemType.Sum;
|
||||||
|
gridview.TotalSummary.Add(totPatrimonioOggi);
|
||||||
|
tbTotAumFinalePtf_GPMForecast.DisplayFormatString = "n2";
|
||||||
|
tbTotAumFinalePtf_GPMForecast.Text = gridview.GetTotalSummaryValue(totPatrimonioOggi).ToString();
|
||||||
|
|
||||||
|
// Calcola Totale Aum Finale per OLYMPIA (ITA)
|
||||||
|
decimal totAumFinaleITA = CalcolaSommaSocieta(gridview, "OLYMPIAITA");
|
||||||
|
tbTotAumFinaleITA_GPMForecast.Text = $"{totAumFinaleITA:n2}";
|
||||||
|
|
||||||
|
// Calcola Totale Aum Finale per OLYMPIA (UK)
|
||||||
|
decimal totAumFinaleUK = CalcolaSommaSocieta(gridview, "OLYMPIA");
|
||||||
|
tbTotAumFinaleUK_GPMForecast.Text = $"{totAumFinaleUK:n2}";
|
||||||
|
|
||||||
|
// Calcolo Delta
|
||||||
|
tbDelta_GPMForecast.DisplayFormatString = "n2";
|
||||||
|
//tbDelta_GPMForecast.Text = (Convert.ToDouble(gridview.GetTotalSummaryValue(totPatrimonioPrec)) - Convert.ToDouble(gridview.GetTotalSummaryValue(totPatrimonioOggi))).ToString();
|
||||||
|
tbDelta_GPMForecast.Text = (Convert.ToDouble(gridview.GetTotalSummaryValue(totPatrimonioOggi)) - Convert.ToDouble(gridview.GetTotalSummaryValue(totPatrimonioPrec))).ToString();
|
||||||
|
|
||||||
|
// Calcolo Totale CASHIN (per calcolare Raccolta Netta)
|
||||||
|
ASPxSummaryItem TotCashIN = CreaSummaryItem("CASH IN");
|
||||||
|
gridview.TotalSummary.Add(TotCashIN);
|
||||||
|
double CashIN = Convert.ToDouble(gridview.GetTotalSummaryValue(TotCashIN));
|
||||||
|
|
||||||
|
// Calcolo Totale TRANSFERIN (per calcolare Raccolta Netta)
|
||||||
|
ASPxSummaryItem TotTransferIN = CreaSummaryItem("TRANSFER IN");
|
||||||
|
gridview.TotalSummary.Add(TotTransferIN);
|
||||||
|
double TransferIN = Convert.ToDouble(gridview.GetTotalSummaryValue(TotTransferIN));
|
||||||
|
|
||||||
|
// Calcolo Totale WITHDRAWAL (per calcolare Raccolta Netta)
|
||||||
|
ASPxSummaryItem TotWithdrawal = CreaSummaryItem("WITHDRAWAL");
|
||||||
|
gridview.TotalSummary.Add(TotWithdrawal);
|
||||||
|
double Withdrawal = Convert.ToDouble(gridview.GetTotalSummaryValue(TotWithdrawal));
|
||||||
|
|
||||||
|
// Calcolo Totale TRANSFEROUT (per calcolare Raccolta Netta)
|
||||||
|
ASPxSummaryItem TotTransferOUT = CreaSummaryItem("TRANSFER OUT");
|
||||||
|
gridview.TotalSummary.Add(TotTransferOUT);
|
||||||
|
double TransferOUT = Convert.ToDouble(gridview.GetTotalSummaryValue(TotTransferOUT));
|
||||||
|
|
||||||
|
// Calcolo Raccolta Netta
|
||||||
|
tbRaccoltaNetta_GPMForecast.DisplayFormatString = "n2";
|
||||||
|
tbRaccoltaNetta_GPMForecast.Text = $"{CashIN + TransferIN + Withdrawal + TransferOUT}";
|
||||||
|
|
||||||
|
// Carica Commissioni Performance in maturazione
|
||||||
|
//string query = CommonClass.ExecSql("GDN_CommissioniPerformanceEuro"); // Rileva testo query per poi eseguirla in db MySql
|
||||||
|
string CommPerformance = CommonClass.ExecSql("[os_GDN_ID568_A]");
|
||||||
|
//DataTable dt = CommonClass.execQuery_Datatable_MySql(query, Properties.Settings.Default.mySqlConnection);
|
||||||
|
|
||||||
|
tbCommPerfInMaturazione.DisplayFormatString = "n2";
|
||||||
|
//tbCommPerfInMaturazione.Text = $"{dt.Rows[0][0].ToString()}";
|
||||||
|
tbCommPerfInMaturazione.Text = $"{CommPerformance}";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvGPMConsuntivo_DataBound(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// ref : https://www.devexpress.com/Support/Center/Question/Details/Q585537/aspxgridview-autogeneratecolumns-true-field-name-start-with-lower-case-letter-insert-a
|
||||||
|
// Evita che a runtime le colonne con maiuscole nella query vengono scritte con lo spazio (ad esempio codiceIsin -> codice Isin)
|
||||||
|
// questo poi crea un problema andando a esportare l'excel dove serve che le colonne siano le stesse della query.
|
||||||
|
ASPxGridView gridview = sender as ASPxGridView;
|
||||||
|
foreach (GridViewColumn column in gridview.Columns)
|
||||||
|
{
|
||||||
|
if (column is GridViewDataColumn)
|
||||||
|
column.Caption = ((GridViewDataColumn)column).FieldName;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Effettua formattazione colonne a runtime..
|
||||||
|
if (gridview.Columns.Count > 0)
|
||||||
|
{
|
||||||
|
gridview.DataColumns["DATA APERTURA"].PropertiesEdit.DisplayFormatString = "dd/MM/yyyy";
|
||||||
|
gridview.DataColumns["DATA CHIUSURA"].PropertiesEdit.DisplayFormatString = "dd/MM/yyyy";
|
||||||
|
gridview.DataColumns["DATA FINE CALCOLO PERFORMANCE"].PropertiesEdit.DisplayFormatString = "dd/MM/yyyy";
|
||||||
|
gridview.DataColumns["AUM INIZIALE"].PropertiesEdit.DisplayFormatString = "N2";
|
||||||
|
gridview.DataColumns["AUM FINALE"].PropertiesEdit.DisplayFormatString = "N2";
|
||||||
|
gridview.DataColumns["AUM MEDIO TRIM PREC"].PropertiesEdit.DisplayFormatString = "N2";
|
||||||
|
gridview.DataColumns["COMM DI GESTIONE"].PropertiesEdit.DisplayFormatString = "P2";
|
||||||
|
gridview.DataColumns["COMM PERFORMANCE"].PropertiesEdit.DisplayFormatString = "P2";
|
||||||
|
gridview.DataColumns["RETRO GESTORE"].PropertiesEdit.DisplayFormatString = "P2";
|
||||||
|
gridview.DataColumns["RETRO ADVISOR"].PropertiesEdit.DisplayFormatString = "P2";
|
||||||
|
gridview.DataColumns["RETRO CONSULENTE"].PropertiesEdit.DisplayFormatString = "P2";
|
||||||
|
gridview.DataColumns["RETRO TOTALE"].PropertiesEdit.DisplayFormatString = "P2";
|
||||||
|
gridview.DataColumns["QUOTA IN TRIM PREC"].PropertiesEdit.DisplayFormatString = "N2";
|
||||||
|
gridview.DataColumns["QUOTA OUT TRIM PREC"].PropertiesEdit.DisplayFormatString = "N2";
|
||||||
|
|
||||||
|
// Calcola Totali AUM INIZIALE e AUM FINALE ma non li mostra nel footer
|
||||||
|
gridview.TotalSummary.Clear();
|
||||||
|
gridview.Settings.ShowFooter = false;
|
||||||
|
ASPxSummaryItem totPatrimonioPrec = new ASPxSummaryItem();
|
||||||
|
totPatrimonioPrec.FieldName = "AUM INIZIALE";
|
||||||
|
totPatrimonioPrec.SummaryType = DevExpress.Data.SummaryItemType.Sum;
|
||||||
|
gridview.TotalSummary.Add(totPatrimonioPrec);
|
||||||
|
tbTotAumInizialePtf_GPMConsuntivo.DisplayFormatString = "n2";
|
||||||
|
tbTotAumInizialePtf_GPMConsuntivo.Text = gridview.GetTotalSummaryValue(totPatrimonioPrec).ToString();
|
||||||
|
|
||||||
|
ASPxSummaryItem totPatrimonioOggi = new ASPxSummaryItem();
|
||||||
|
totPatrimonioOggi.FieldName = "AUM FINALE";
|
||||||
|
totPatrimonioOggi.SummaryType = DevExpress.Data.SummaryItemType.Sum;
|
||||||
|
gridview.TotalSummary.Add(totPatrimonioOggi);
|
||||||
|
tbTotAumFinalePtf_GPMConsuntivo.DisplayFormatString = "n2";
|
||||||
|
tbTotAumFinalePtf_GPMConsuntivo.Text = gridview.GetTotalSummaryValue(totPatrimonioOggi).ToString();
|
||||||
|
|
||||||
|
// Calcola Totale Aum Finale per OLYMPIA (ITA)
|
||||||
|
decimal totAumFinaleITA = CalcolaSommaSocieta(gridview, "OLYMPIAITA");
|
||||||
|
tbTotAumFinaleITA_GPMConsuntivo.Text = $"{totAumFinaleITA:n2}";
|
||||||
|
|
||||||
|
// Calcola Totale Aum Finale per OLYMPIA (UK)
|
||||||
|
decimal totAumFinaleUK = CalcolaSommaSocieta(gridview, "OLYMPIA");
|
||||||
|
tbTotAumFinaleUK_GPMConsuntivo.Text = $"{totAumFinaleUK:n2}";
|
||||||
|
|
||||||
|
// Calcolo Delta
|
||||||
|
tbDelta_GPMConsuntivo.DisplayFormatString = "n2";
|
||||||
|
//tbDelta_GPMConsuntivo.Text = (Convert.ToDouble(gridview.GetTotalSummaryValue(totPatrimonioPrec)) - Convert.ToDouble(gridview.GetTotalSummaryValue(totPatrimonioOggi))).ToString();
|
||||||
|
tbDelta_GPMConsuntivo.Text = (Convert.ToDouble(gridview.GetTotalSummaryValue(totPatrimonioOggi)) - Convert.ToDouble(gridview.GetTotalSummaryValue(totPatrimonioPrec))).ToString();
|
||||||
|
|
||||||
|
|
||||||
|
// Calcolo Totale CASHIN (per calcolare Raccolta Netta)
|
||||||
|
ASPxSummaryItem TotCashIN = CreaSummaryItem("CASH IN");
|
||||||
|
gridview.TotalSummary.Add(TotCashIN);
|
||||||
|
double CashIN = Convert.ToDouble(gridview.GetTotalSummaryValue(TotCashIN));
|
||||||
|
|
||||||
|
// Calcolo Totale TRANSFERIN (per calcolare Raccolta Netta)
|
||||||
|
ASPxSummaryItem TotTransferIN = CreaSummaryItem("TRANSFER IN");
|
||||||
|
gridview.TotalSummary.Add(TotTransferIN);
|
||||||
|
double TransferIN = Convert.ToDouble(gridview.GetTotalSummaryValue(TotTransferIN));
|
||||||
|
|
||||||
|
// Calcolo Totale WITHDRAWAL (per calcolare Raccolta Netta)
|
||||||
|
ASPxSummaryItem TotWithdrawal = CreaSummaryItem("WITHDRAWAL");
|
||||||
|
gridview.TotalSummary.Add(TotWithdrawal);
|
||||||
|
double Withdrawal = Convert.ToDouble(gridview.GetTotalSummaryValue(TotWithdrawal));
|
||||||
|
|
||||||
|
// Calcolo Totale TRANSFEROUT (per calcolare Raccolta Netta)
|
||||||
|
ASPxSummaryItem TotTransferOUT = CreaSummaryItem("TRANSFER OUT");
|
||||||
|
gridview.TotalSummary.Add(TotTransferOUT);
|
||||||
|
double TransferOUT = Convert.ToDouble(gridview.GetTotalSummaryValue(TotTransferOUT));
|
||||||
|
|
||||||
|
// Calcolo Raccolta Netta
|
||||||
|
tbRaccoltaNetta_GPMConsuntivo.DisplayFormatString = "n2";
|
||||||
|
tbRaccoltaNetta_GPMConsuntivo.Text = $"{CashIN + TransferIN + Withdrawal + TransferOUT}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private ASPxSummaryItem CreaSummaryItem(string FieldName)
|
||||||
|
{
|
||||||
|
ASPxSummaryItem summaryItem = new ASPxSummaryItem();
|
||||||
|
summaryItem.FieldName = FieldName;
|
||||||
|
summaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;
|
||||||
|
return summaryItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
private decimal CalcolaSommaSocieta(ASPxGridView gridView, string Societa)
|
||||||
|
{
|
||||||
|
decimal sommaAum = 0;
|
||||||
|
|
||||||
|
for (int i = 0; i < gridView.VisibleRowCount; i++)
|
||||||
|
{
|
||||||
|
object societaObj = gridView.GetRowValues(i, "SOCIETA");
|
||||||
|
object aumFinaleObj = gridView.GetRowValues(i, "AUM FINALE");
|
||||||
|
|
||||||
|
if (societaObj != null && aumFinaleObj != null)
|
||||||
|
{
|
||||||
|
string societaGridView = societaObj.ToString();
|
||||||
|
|
||||||
|
if (societaGridView == Societa)
|
||||||
|
{
|
||||||
|
if (decimal.TryParse(aumFinaleObj.ToString(), out decimal aumFinale))
|
||||||
|
{
|
||||||
|
sommaAum += aumFinale;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sommaAum;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region SELECTING
|
||||||
|
protected void SqlDSGestioniPatrimoniali_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
|
||||||
|
{
|
||||||
|
e.Command.CommandTimeout = 0; // disabilita timeout , aspetta finchè non finisce elaborazione
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void SqlDSFondi_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
|
||||||
|
{
|
||||||
|
e.Command.CommandTimeout = 0; // disabilita timeout , aspetta finchè non finisce elaborazione
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void SqlDSDettaglioFondi_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
|
||||||
|
{
|
||||||
|
e.Command.CommandTimeout = 0; // disabilita timeout , aspetta finchè non finisce elaborazione
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void SqlDSGPMConsuntivo_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
|
||||||
|
{
|
||||||
|
e.Command.CommandTimeout = 0; // disabilita timeout , aspetta finchè non finisce elaborazione
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void SqlDSGPMForecast_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
|
||||||
|
{
|
||||||
|
e.Command.CommandTimeout = 0; // disabilita timeout , aspetta finchè non finisce elaborazione
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
protected void ASPxRibbon1_Init(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!IsPostBack)
|
||||||
|
{
|
||||||
|
// Trovo il Group "Filtri"
|
||||||
|
RibbonGroup gruppoFiltri = ASPxRibbon1.Tabs[0].Groups.FindByName("Filtri");
|
||||||
|
|
||||||
|
if (gruppoFiltri != null)
|
||||||
|
{
|
||||||
|
// Trovo il TemplateItem
|
||||||
|
RibbonTemplateItem template = gruppoFiltri.Items.FindByName("ribbonTemplate") as RibbonTemplateItem;
|
||||||
|
|
||||||
|
if (template != null)
|
||||||
|
{
|
||||||
|
ASPxDateEdit dataInizio = template.FindControl("dataInizio") as ASPxDateEdit;
|
||||||
|
ASPxDateEdit dataFine = template.FindControl("dataFine") as ASPxDateEdit;
|
||||||
|
|
||||||
|
if (dataInizio != null)
|
||||||
|
dataInizio.Date = new DateTime(DateTime.Now.Year, 1, 1);
|
||||||
|
|
||||||
|
if (dataFine != null)
|
||||||
|
dataFine.Date = CommonClass.AddBusinessDays(DateTime.Today,-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
611
OlympiaIntranet/AUM.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,611 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public partial class AUMPage
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxRibbon1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxRibbon ASPxRibbon1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// pageControl control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPageControl pageControl;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbTotAumInizialeFondi control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbTotAumInizialeFondi;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel29 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel29;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel2 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbTotAumFinaleFondi control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbTotAumFinaleFondi;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel3 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel3;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbDelta control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbDelta;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel4 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel4;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel4 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel4;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbRaccoltaNetta control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbRaccoltaNetta;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel5 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel5;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvFondi control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvFondi;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvDettaglioFondi control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvDettaglioFondi;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel5 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel5;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbTotAumInizialePtf_GPMConsuntivo control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbTotAumInizialePtf_GPMConsuntivo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel2 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel6 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel6;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbTotAumFinalePtf_GPMConsuntivo control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbTotAumFinalePtf_GPMConsuntivo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel13 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel13;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// label2 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel label2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbDelta_GPMConsuntivo control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbDelta_GPMConsuntivo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel14 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel14;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// label1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel label1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbRaccoltaNetta_GPMConsuntivo control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbRaccoltaNetta_GPMConsuntivo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel6 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel6;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel9 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel9;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbTotAumFinaleITA_GPMConsuntivo control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbTotAumFinaleITA_GPMConsuntivo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel7 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel7;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel10 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel10;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbTotAumFinaleUK_GPMConsuntivo control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbTotAumFinaleUK_GPMConsuntivo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel11 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel11;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvGPMConsuntivo control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvGPMConsuntivo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel7 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel7;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbTotAumInizialePtf_GPMForecast control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbTotAumInizialePtf_GPMForecast;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel3 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel3;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel8 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel8;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbTotAumFinalePtf_GPMForecast control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbTotAumFinalePtf_GPMForecast;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel15 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel15;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel13 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel13;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbDelta_GPMForecast control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbDelta_GPMForecast;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel16 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel16;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel14 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel14;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbRaccoltaNetta_GPMForecast control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbRaccoltaNetta_GPMForecast;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel8 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel8;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel11 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel11;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbTotAumFinaleITA_GPMForecast control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbTotAumFinaleITA_GPMForecast;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel9 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel9;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel12 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel12;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbTotAumFinaleUK_GPMForecast control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbTotAumFinaleUK_GPMForecast;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel15 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel15;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbCommPerfInMaturazione control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbCommPerfInMaturazione;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel10 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel10;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvGPMForecast control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvGPMForecast;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSGestioniPatrimoniali control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSGestioniPatrimoniali;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSGPMConsuntivo control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSGPMConsuntivo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSGPMForecast control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSGPMForecast;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSFondi control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSFondi;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSDettaglioFondi control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSDettaglioFondi;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ExporterGPMConsuntivo control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridViewExporter ExporterGPMConsuntivo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ExporterGPMForecast control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridViewExporter ExporterGPMForecast;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ExporterFondi control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridViewExporter ExporterFondi;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ExporterDettaglioFondi control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridViewExporter ExporterDettaglioFondi;
|
||||||
|
}
|
||||||
|
}
|
||||||
159
OlympiaIntranet/AndamentoRaccolta.aspx
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AndamentoRaccolta.aspx.cs" Inherits="OlympiaIntranet.AndamentoRaccolta" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Data.Linq" TagPrefix="dx" %>
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<div>
|
||||||
|
<dx:ASPxRibbon ID="ASPxRibbon1" runat="server" EnableTheming="True" Theme="Office2010Blue" ShowFileTab="False" ShowTabs="False" OnCommandExecuted="ASPxRibbon1_CommandExecuted">
|
||||||
|
<Tabs>
|
||||||
|
<dx:RibbonTab Name="Main" Text="Main">
|
||||||
|
<Groups>
|
||||||
|
<dx:RibbonGroup Text="Filtri" Name="Filtri">
|
||||||
|
<Items>
|
||||||
|
<dx:RibbonTemplateItem Size="Large" Name="ribbonTemplate">
|
||||||
|
<Template>
|
||||||
|
<table cellpadding="0" cellspacing="0">
|
||||||
|
<tr>
|
||||||
|
<td>Data Inizio
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxDateEdit ID="dataInizio" runat="server" DisplayFormatString="dd/MM/yyyy" EditFormat="Custom" EditFormatString="dd/MM/yyyy" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Data Fine
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxDateEdit ID="dataFine" runat="server" DisplayFormatString="dd/MM/yyyy" EditFormat="Custom" EditFormatString="dd/MM/yyyy" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</Template>
|
||||||
|
</dx:RibbonTemplateItem>
|
||||||
|
<dx:RibbonButtonItem Name="loadGrid" Size="Large" Text="Carica">
|
||||||
|
<LargeImage IconID="actions_refresh2_32x32">
|
||||||
|
</LargeImage>
|
||||||
|
</dx:RibbonButtonItem>
|
||||||
|
</Items>
|
||||||
|
</dx:RibbonGroup>
|
||||||
|
<dx:RibbonGroup Text="Tools" Name="Tools">
|
||||||
|
<Items>
|
||||||
|
<dx:RibbonButtonItem Name="exportExcel" Size="Large" Text="Excel">
|
||||||
|
<LargeImage IconID="export_exporttoxlsx_32x32">
|
||||||
|
</LargeImage>
|
||||||
|
</dx:RibbonButtonItem>
|
||||||
|
</Items>
|
||||||
|
</dx:RibbonGroup>
|
||||||
|
</Groups>
|
||||||
|
</dx:RibbonTab>
|
||||||
|
</Tabs>
|
||||||
|
</dx:ASPxRibbon>
|
||||||
|
<table>
|
||||||
|
<tr style="height: 10px;"></tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel15" runat="server" Text="Totale Raccolta" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbTotaleRaccolta" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel29" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel2" runat="server" Text="Totale Conti Aperti" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbTotContiAperti" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel1" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="Totale Conti Chiusi" Theme="Office2010Blue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="tbTotContiChiusi" runat="server" Width="170px" Theme="Office2010Blue" Font-Bold="True" ReadOnly="True"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr style="height: 10px;"></tr>
|
||||||
|
</table>
|
||||||
|
<dx:ASPxPageControl ID="ASPxPageControl1" runat="server" Theme="Office2010Blue" ActiveTabIndex="0" EnableTheming="True">
|
||||||
|
<TabPages>
|
||||||
|
<dx:TabPage Text="Gestori" Name="tabGestori">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<dx:ASPxGridView ID="gvRaccoltaGestori" runat="server" OnDataBound="gvRaccoltaGestori_DataBound" Theme="Office2010Blue" Width="100%" OnCustomSummaryCalculate="gvRaccoltaGestori_CustomSummaryCalculate" AutoGenerateColumns="False" KeyFieldName="ID" OnHtmlFooterCellPrepared="gvRaccoltaGestori_HtmlFooterCellPrepared" OnSummaryDisplayText="gvRaccoltaGestori_SummaryDisplayText">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<SettingsPager PageSize="15" Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
<Settings ShowFilterRow="True" ShowHeaderFilterButton="True" ShowTitlePanel="True" ShowFooter="true" />
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>
|
||||||
|
<dx:TabPage Name="tabConsulenti" Text="Consulenti">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<dx:ASPxGridView ID="gvSituazioneConti" runat="server" OnDataBound="gvSituazioneConti_DataBound" Theme="Office2010Blue" Width="100%" AutoGenerateColumns="False" KeyFieldName="ID">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<SettingsPager PageSize="15" Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
<Settings ShowFilterRow="True" ShowHeaderFilterButton="True" ShowTitlePanel="True" ShowFooter="true" />
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel10" runat="server" Width="20px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server"></dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
<dx:ASPxGridView ID="gvRaccoltaConsulenti" runat="server" OnDataBound="gvRaccoltaConsulenti_DataBound" Theme="Office2010Blue" Width="100%" OnCustomSummaryCalculate="gvRaccoltaConsulenti_CustomSummaryCalculate" AutoGenerateColumns="False" KeyFieldName="ID" OnHtmlFooterCellPrepared="gvRaccoltaConsulenti_HtmlFooterCellPrepared" OnSummaryDisplayText="gvRaccoltaConsulenti_SummaryDisplayText">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<SettingsPager PageSize="15" Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
<Settings ShowFilterRow="True" ShowHeaderFilterButton="True" ShowTitlePanel="True" ShowFooter="true" />
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>
|
||||||
|
</TabPages>
|
||||||
|
</dx:ASPxPageControl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<%-- <asp:SqlDataSource ID="SqlDSRaccoltaConsulenti" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72;TrustServerCertificate=True;" SelectCommand="GDN_RaccoltaConsulenti" SelectCommandType="StoredProcedure" >
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="DataInizio" SessionField="data_inizio" />
|
||||||
|
<asp:SessionParameter Name="DataFine" SessionField="data_fine" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>--%>
|
||||||
|
<dx:ASPxGridViewExporter ID="ExporterRaccoltaConsulenti" runat="server" GridViewID="gvRaccoltaConsulenti">
|
||||||
|
</dx:ASPxGridViewExporter>
|
||||||
|
<dx:ASPxGridViewExporter ID="ExporterRaccoltaGestori" runat="server" GridViewID="gvRaccoltaGestori">
|
||||||
|
</dx:ASPxGridViewExporter>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
344
OlympiaIntranet/AndamentoRaccolta.aspx.cs
Normal file
@@ -0,0 +1,344 @@
|
|||||||
|
using DevExpress.Export;
|
||||||
|
using DevExpress.Web;
|
||||||
|
using DevExpress.XtraPrinting;
|
||||||
|
using DevExpress.XtraPrintingLinks;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
using MySqlConnector;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Data;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Threading;
|
||||||
|
using DevExpress.Spreadsheet;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class AndamentoRaccolta : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
protected void Page_Init(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Imposta la cultura per la pagina specifica
|
||||||
|
CultureInfo ci = new CultureInfo("en-US");
|
||||||
|
ci.NumberFormat.NumberGroupSeparator = ".";
|
||||||
|
ci.NumberFormat.NumberDecimalSeparator = ",";
|
||||||
|
Thread.CurrentThread.CurrentCulture = ci;
|
||||||
|
Thread.CurrentThread.CurrentUICulture = ci;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (HttpContext.Current.User.Identity.IsAuthenticated == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!IsPostBack)
|
||||||
|
{
|
||||||
|
BindGridView(gvRaccoltaGestori, "GDN_RaccoltaGestori");
|
||||||
|
BindGridView(gvRaccoltaConsulenti, "GDN_RaccoltaConsulenti");
|
||||||
|
BindGridView(gvSituazioneConti, "GDN_RaccoltaConsulenti_NumConti");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
protected void ASPxRibbon1_CommandExecuted(object source, DevExpress.Web.RibbonCommandExecutedEventArgs e)
|
||||||
|
{
|
||||||
|
// Selezionato pulsante Refresh
|
||||||
|
if (e.Item.Name == "loadGrid")
|
||||||
|
{
|
||||||
|
RibbonTemplateItem template = (RibbonTemplateItem)ASPxRibbon1.Tabs[0].Groups[0].Items.FindByName("ribbonTemplate");
|
||||||
|
ASPxDateEdit deDataInizio = template.FindControl("dataInizio") as ASPxDateEdit;
|
||||||
|
if (String.IsNullOrEmpty(deDataInizio.Text))
|
||||||
|
{
|
||||||
|
CommonClass.MessageBox(this, "Inserire data inizio!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ASPxDateEdit deDataFine = template.FindControl("dataFine") as ASPxDateEdit;
|
||||||
|
if (String.IsNullOrEmpty(deDataFine.Text))
|
||||||
|
{
|
||||||
|
CommonClass.MessageBox(this, "Inserire data fine!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// recupero il valore del ribbondateedit dataInizio
|
||||||
|
Session["data_inizio"] = deDataInizio.Date;
|
||||||
|
|
||||||
|
// recupero il valore del ribbondateedit dataFine
|
||||||
|
Session["data_fine"] = deDataFine.Date;
|
||||||
|
|
||||||
|
|
||||||
|
// Verifica che dataInizio sia minore di dataFine
|
||||||
|
if (deDataInizio.Date > deDataFine.Date)
|
||||||
|
{
|
||||||
|
CommonClass.MessageBox(this, "Data inizio deve essere minore di Data fine!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Se i controlli sono passati allora linka datasource a grdiview...
|
||||||
|
//gvRaccoltaConsulenti.DataSourceID = "SqlDSRaccoltaConsulenti";
|
||||||
|
//gvRaccoltaConsulenti.KeyFieldName = "ID";
|
||||||
|
//gvRaccoltaConsulenti.DataBind();
|
||||||
|
// Nota del 05-02-2025: ho dovuto implementare la chiamata lato codice altrimenti usando il Datasource non funzionava perchè l'sp GDN_RaccoltaConsulenti utilizza una query dinamica e non veniva riconosciuta la tabella temporanea #GDNConsulenti!
|
||||||
|
//BindGridView();
|
||||||
|
BindGridView(gvRaccoltaGestori, "GDN_RaccoltaGestori");
|
||||||
|
BindGridView(gvRaccoltaConsulenti, "GDN_RaccoltaConsulenti");
|
||||||
|
BindGridView(gvSituazioneConti, "GDN_RaccoltaConsulenti_NumConti");
|
||||||
|
|
||||||
|
}
|
||||||
|
// Selezionato pulsante Export in Excel
|
||||||
|
if (e.Item.Name == "exportExcel")
|
||||||
|
{
|
||||||
|
|
||||||
|
// Preparazione esportatori
|
||||||
|
BindGridView(gvRaccoltaConsulenti, "GDN_RaccoltaConsulenti");
|
||||||
|
BindGridView(gvRaccoltaGestori, "GDN_RaccoltaGestori");
|
||||||
|
|
||||||
|
// Ref link: https://www.devexpress.com/Support/Center/Question/Details/T327338/aspxgridview-export-multiple-grids-to-the-same-excel-file
|
||||||
|
PrintingSystem ps = new PrintingSystem();
|
||||||
|
|
||||||
|
// Esporta griglia Raccolta Gestori
|
||||||
|
PrintableComponentLink link0 = new PrintableComponentLink(ps);
|
||||||
|
ExporterRaccoltaGestori.ExportSelectedRowsOnly = false;
|
||||||
|
string reportHeader0 = string.Format(@"Estrazione Raccolta Gestori dal {0} al {1}", Convert.ToDateTime(Session["data_inizio"]).ToString("dd/MM/yyyy"), Convert.ToDateTime(Session["data_fine"]).ToString("dd/MM/yyyy"));
|
||||||
|
ExporterRaccoltaGestori.ReportHeader = @"{\rtf1\ansi\ansicpg1252\deff0\deflang1040{\fonttbl{\f0\fnil\fcharset0 Tahoma;}{\f1\fnil\fcharset0 Times New Roman;}}\viewkind4\uc1\pard\b\f0\fs28 " + reportHeader0 + @"\b0\f1\fs20\par}";
|
||||||
|
link0.Component = ExporterRaccoltaGestori;
|
||||||
|
|
||||||
|
// Esporta griglia Raccolta Consulenti
|
||||||
|
PrintableComponentLink link1 = new PrintableComponentLink(ps);
|
||||||
|
ExporterRaccoltaConsulenti.ExportSelectedRowsOnly = false;
|
||||||
|
string reportHeader1 = string.Format(@"Estrazione Raccolta Consulenti dal {0} al {1}", Convert.ToDateTime(Session["data_inizio"]).ToString("dd/MM/yyyy"), Convert.ToDateTime(Session["data_fine"]).ToString("dd/MM/yyyy"));
|
||||||
|
ExporterRaccoltaConsulenti.ReportHeader = @"{\rtf1\ansi\ansicpg1252\deff0\deflang1040{\fonttbl{\f0\fnil\fcharset0 Tahoma;}{\f1\fnil\fcharset0 Times New Roman;}}\viewkind4\uc1\pard\b\f0\fs28 " + reportHeader1 + @"\b0\f1\fs20\par}";
|
||||||
|
link1.Component = ExporterRaccoltaConsulenti;
|
||||||
|
|
||||||
|
|
||||||
|
// Compone excel unico
|
||||||
|
CompositeLink compositeLink = new CompositeLink(ps);
|
||||||
|
compositeLink.Links.AddRange(new object[] { link0, link1 });
|
||||||
|
compositeLink.CreatePageForEachLink();
|
||||||
|
|
||||||
|
string fileName = string.Format("{0}_{1}", DateTime.Now.ToString("yyyyMMdd_HHmm"), "Andamento Raccolta.xlsx");
|
||||||
|
using (MemoryStream stream = new MemoryStream())
|
||||||
|
{
|
||||||
|
XlsxExportOptionsEx options = new XlsxExportOptionsEx();
|
||||||
|
options.ExportMode = XlsxExportMode.SingleFilePageByPage;
|
||||||
|
options.ExportType = ExportType.WYSIWYG;
|
||||||
|
compositeLink.PrintingSystemBase.ExportToXlsx(stream, options);
|
||||||
|
Response.Clear();
|
||||||
|
Response.Buffer = false;
|
||||||
|
Response.AppendHeader("Content-Type", "application/xlsx");
|
||||||
|
Response.AppendHeader("Content-Transfer-Encoding", "binary");
|
||||||
|
Response.AppendHeader("Content-Disposition", $"attachment; filename={fileName}");
|
||||||
|
stream.Position = 0;
|
||||||
|
|
||||||
|
Workbook workbook = new Workbook();
|
||||||
|
workbook.LoadDocument(stream, DevExpress.Spreadsheet.DocumentFormat.OpenXml);
|
||||||
|
DevExpress.Spreadsheet.WorksheetCollection worksheets = workbook.Worksheets;
|
||||||
|
workbook.Worksheets[0].Name = "Raccolta Gestori";
|
||||||
|
workbook.Worksheets[1].Name = "Raccolta Consulenti";
|
||||||
|
using (MemoryStream outputStream = new MemoryStream())
|
||||||
|
{
|
||||||
|
workbook.SaveDocument(outputStream, DevExpress.Spreadsheet.DocumentFormat.OpenXml);
|
||||||
|
Response.BinaryWrite(outputStream.ToArray());
|
||||||
|
Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ps.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private DataTable GetDynamicData(string query, DateTime DataInizio, DateTime DataFine)
|
||||||
|
{
|
||||||
|
//string query = "GDN_RaccoltaConsulenti";
|
||||||
|
|
||||||
|
using (SqlConnection conn = new SqlConnection(OlympiaIntranet.Properties.Settings.Default.SqlConnection))
|
||||||
|
{
|
||||||
|
using (SqlCommand cmd = new SqlCommand(query, conn))
|
||||||
|
{
|
||||||
|
cmd.CommandType = CommandType.StoredProcedure;
|
||||||
|
|
||||||
|
// Aggiungi i parametri
|
||||||
|
cmd.Parameters.Add(new SqlParameter("@DataInizio", SqlDbType.Date) { Value = DataInizio });
|
||||||
|
cmd.Parameters.Add(new SqlParameter("@DataFine", SqlDbType.Date) { Value = DataFine });
|
||||||
|
|
||||||
|
using (SqlDataAdapter da = new SqlDataAdapter(cmd))
|
||||||
|
{
|
||||||
|
DataTable dt = new DataTable();
|
||||||
|
da.Fill(dt);
|
||||||
|
return dt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BindGridView(ASPxGridView gridview, string query)
|
||||||
|
{
|
||||||
|
if ((Session["data_inizio"] is null) || (Session["data_fine"] is null)) return;
|
||||||
|
DataTable dt = GetDynamicData(query,(DateTime)Session["data_inizio"], (DateTime)Session["data_fine"]);
|
||||||
|
gridview.DataSource = dt;
|
||||||
|
|
||||||
|
gridview.Columns.Clear();
|
||||||
|
|
||||||
|
foreach (DataColumn column in dt.Columns)
|
||||||
|
{
|
||||||
|
if (column.ColumnName != "ID")
|
||||||
|
{
|
||||||
|
GridViewDataTextColumn gridColumn = new GridViewDataTextColumn();
|
||||||
|
gridColumn.FieldName = column.ColumnName;
|
||||||
|
gridColumn.Caption = column.ColumnName;
|
||||||
|
gridview.Columns.Add(gridColumn);
|
||||||
|
gridview.Settings.ShowFooter = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gridview.DataBind();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void gvRaccoltaConsulenti_DataBound(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// ref : https://www.devexpress.com/Support/Center/Question/Details/Q585537/aspxgridview-autogeneratecolumns-true-field-name-start-with-lower-case-letter-insert-a
|
||||||
|
// Evita che a runtime le colonne con maiuscole nella query vengono scritte con lo spazio (ad esempio codiceIsin -> codice Isin)
|
||||||
|
// questo poi crea un problema andando a esportare l'excel dove serve che le colonne siano le stesse della query.
|
||||||
|
DataBound(sender);
|
||||||
|
|
||||||
|
// Totale Conti Aperti
|
||||||
|
DataTable dtContiAperti = GetDynamicData("GDN_RaccoltaConsulenti_ContiAperti", (DateTime)Session["data_inizio"], (DateTime)Session["data_fine"]);
|
||||||
|
tbTotContiAperti.Text = dtContiAperti.Rows[0][0].ToString();
|
||||||
|
|
||||||
|
// Totale Conti Chiusi
|
||||||
|
DataTable dtContiChiusi = GetDynamicData("GDN_RaccoltaConsulenti_ContiChiusi", (DateTime)Session["data_inizio"], (DateTime)Session["data_fine"]);
|
||||||
|
tbTotContiChiusi.Text = dtContiChiusi.Rows[0][0].ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvRaccoltaConsulenti_CustomSummaryCalculate(object sender, DevExpress.Data.CustomSummaryEventArgs e)
|
||||||
|
{
|
||||||
|
CustomSummaryCalculate(sender, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvRaccoltaConsulenti_HtmlFooterCellPrepared(object sender, ASPxGridViewTableFooterCellEventArgs e)
|
||||||
|
{
|
||||||
|
HtmlFooterCellPrepared(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void HtmlFooterCellPrepared(ASPxGridViewTableFooterCellEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Column is GridViewDataColumn dataColumn && dataColumn.FieldName != "ID" && dataColumn.FieldName != "Mese")
|
||||||
|
{
|
||||||
|
e.Cell.Text = e.Cell.Text.Replace("Sum=", ""); // Rimuove 'Sum=' dal testo del footer
|
||||||
|
e.Cell.Style["font-weight"] = "bold"; // Imposta il testo in grassetto
|
||||||
|
}
|
||||||
|
;
|
||||||
|
if (e.Column is GridViewDataColumn dataColumn1 && dataColumn1.FieldName == "Mese")
|
||||||
|
{
|
||||||
|
e.Cell.Text = e.Cell.Text = "Totale"; // Rimuove 'Sum=' dal testo del footer
|
||||||
|
e.Cell.Style["font-weight"] = "bold"; // Imposta il testo in grassetto
|
||||||
|
}
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvRaccoltaConsulenti_SummaryDisplayText(object sender, ASPxGridViewSummaryDisplayTextEventArgs e)
|
||||||
|
{
|
||||||
|
SummaryDisplayText(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SummaryDisplayText(ASPxGridViewSummaryDisplayTextEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Item.FieldName != "Mese" && e.Item.FieldName != "ID" && e.Item.SummaryType == DevExpress.Data.SummaryItemType.Sum)
|
||||||
|
{
|
||||||
|
e.Text = string.Format("{0:N0}", e.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvRaccoltaGestori_DataBound(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// ref : https://www.devexpress.com/Support/Center/Question/Details/Q585537/aspxgridview-autogeneratecolumns-true-field-name-start-with-lower-case-letter-insert-a
|
||||||
|
// Evita che a runtime le colonne con maiuscole nella query vengono scritte con lo spazio (ad esempio codiceIsin -> codice Isin)
|
||||||
|
// questo poi crea un problema andando a esportare l'excel dove serve che le colonne siano le stesse della query.
|
||||||
|
DataBound(sender);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataBound(object sender)
|
||||||
|
{
|
||||||
|
double TotRaccolta = 0;
|
||||||
|
ASPxGridView gridview = sender as ASPxGridView;
|
||||||
|
|
||||||
|
if (gridview.Columns.Count > 0)
|
||||||
|
{
|
||||||
|
gridview.TotalSummary.Clear();
|
||||||
|
foreach (GridViewColumn column in gridview.Columns)
|
||||||
|
{
|
||||||
|
if (column is GridViewDataColumn)
|
||||||
|
{
|
||||||
|
if (column.Name != "ID" && column.Name != "Mese")
|
||||||
|
{
|
||||||
|
ASPxSummaryItem summaryItem = new ASPxSummaryItem();
|
||||||
|
summaryItem.FieldName = ((GridViewDataColumn)column).FieldName;
|
||||||
|
summaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;
|
||||||
|
summaryItem.DisplayFormat = "{0}"; // Rimuove 'Sum='
|
||||||
|
gridview.TotalSummary.Add(summaryItem);
|
||||||
|
|
||||||
|
((GridViewDataColumn)column).PropertiesEdit.DisplayFormatString = "N0";
|
||||||
|
|
||||||
|
// Calcola totale per tutte le colonne presenti (il valore fra Gestori e Consulenti è lo stesso!)
|
||||||
|
TotRaccolta += Convert.ToDouble(gridview.GetTotalSummaryValue(summaryItem));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
tbTotaleRaccolta.Text = $"{TotRaccolta:N0}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvRaccoltaGestori_CustomSummaryCalculate(object sender, DevExpress.Data.CustomSummaryEventArgs e)
|
||||||
|
{
|
||||||
|
CustomSummaryCalculate(sender, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void CustomSummaryCalculate(object sender, DevExpress.Data.CustomSummaryEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.SummaryProcess == DevExpress.Data.CustomSummaryProcess.Finalize)
|
||||||
|
{
|
||||||
|
ASPxGridView grid = sender as ASPxGridView;
|
||||||
|
ASPxSummaryItem summaryItem = e.Item as ASPxSummaryItem;
|
||||||
|
|
||||||
|
if (summaryItem != null && summaryItem.FieldName != "Mese") // Presuming 'Mese' is a fixed column
|
||||||
|
{
|
||||||
|
decimal total = 0;
|
||||||
|
|
||||||
|
for (int i = 0; i < grid.VisibleRowCount; i++)
|
||||||
|
{
|
||||||
|
object value = grid.GetRowValues(i, summaryItem.FieldName);
|
||||||
|
total += (value != DBNull.Value) ? Convert.ToDecimal(value) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.TotalValue = total;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvRaccoltaGestori_HtmlFooterCellPrepared(object sender, ASPxGridViewTableFooterCellEventArgs e)
|
||||||
|
{
|
||||||
|
HtmlFooterCellPrepared(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void gvRaccoltaGestori_SummaryDisplayText(object sender, ASPxGridViewSummaryDisplayTextEventArgs e)
|
||||||
|
{
|
||||||
|
SummaryDisplayText(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvSituazioneConti_DataBound(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
170
OlympiaIntranet/AndamentoRaccolta.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public partial class AndamentoRaccolta
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxRibbon1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxRibbon ASPxRibbon1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel15 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel15;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbTotaleRaccolta control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbTotaleRaccolta;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel29 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel29;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel2 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbTotContiAperti control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbTotContiAperti;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// tbTotContiChiusi control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox tbTotContiChiusi;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPageControl1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPageControl ASPxPageControl1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvRaccoltaGestori control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvRaccoltaGestori;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvSituazioneConti control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvSituazioneConti;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel10 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel10;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvRaccoltaConsulenti control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvRaccoltaConsulenti;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ExporterRaccoltaConsulenti control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridViewExporter ExporterRaccoltaConsulenti;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ExporterRaccoltaGestori control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridViewExporter ExporterRaccoltaGestori;
|
||||||
|
}
|
||||||
|
}
|
||||||
39
OlympiaIntranet/App_Start/Startup.cs
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
using Microsoft.AspNet.Identity;
|
||||||
|
using Microsoft.AspNet.Identity.Owin;
|
||||||
|
using Microsoft.Owin;
|
||||||
|
using Microsoft.Owin.Host.SystemWeb;
|
||||||
|
using Microsoft.Owin.Security.Cookies;
|
||||||
|
using Owin;
|
||||||
|
using System;
|
||||||
|
using System.Configuration;
|
||||||
|
|
||||||
|
[assembly: OwinStartup(typeof(OlympiaIntranet.App_Start.Startup))]
|
||||||
|
|
||||||
|
namespace OlympiaIntranet.App_Start
|
||||||
|
{
|
||||||
|
public class Startup
|
||||||
|
{
|
||||||
|
public void Configuration(IAppBuilder app)
|
||||||
|
{
|
||||||
|
// Per gestire il timeout degli utenti guardare qui : https://www.jamessturtevant.com/posts/ASPNET-Identity-Cookie-Authentication-Timeouts/
|
||||||
|
// Per implementare il single sign on : https://stackoverflow.com/questions/42229847/single-sign-on-using-asp-net-identity-between-2-asp-net-mvc-projects
|
||||||
|
|
||||||
|
// Possibile soluzione da studiare per il mancanto login qui : https://stackoverflow.com/questions/20737578/asp-net-sessionid-owin-cookies-do-not-send-to-browser
|
||||||
|
|
||||||
|
string cookieDomain = ConfigurationManager.AppSettings["cookieDomain"].ToString();
|
||||||
|
app.UseCookieAuthentication(new CookieAuthenticationOptions
|
||||||
|
{
|
||||||
|
LoginPath = new PathString("/SignIn.aspx"),
|
||||||
|
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
|
||||||
|
CookieName = "OlympiaCookieAuth",
|
||||||
|
CookieDomain = cookieDomain,
|
||||||
|
CookieManager = new SystemWebCookieManager()
|
||||||
|
//SlidingExpiration = false,
|
||||||
|
//CookieHttpOnly = false, // aggiunto per risolvere problemi di login
|
||||||
|
//CookieSameSite = SameSiteMode.None, // aggiunto per risolvere problemi di login
|
||||||
|
//CookieSecure = CookieSecureOption.Always, // aggiunto per risolvere problemi di login
|
||||||
|
//ExpireTimeSpan = TimeSpan.FromMinutes(240) // scadenza credenziali login 4 ore
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
47
OlympiaIntranet/AssociazioneLinee.aspx
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AssociazioneLinee.aspx.cs" Inherits="OlympiaIntranet.AssociazioneLinee" %>
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<div>
|
||||||
|
<dx:ASPxGridView ID="gvAssociazioneFondi" runat="server" EnableTheming="True" Theme="Office2010Blue" AutoGenerateColumns="False" DataSourceID="SqlDSAssociazioneLinee" KeyFieldName="cod_rap" OnHtmlDataCellPrepared="gvAssociazioneFondi_HtmlDataCellPrepared">
|
||||||
|
<SettingsPager AlwaysShowPager="True" PageSize="40">
|
||||||
|
<PageSizeItemSettings ShowAllItem="True" Visible="True">
|
||||||
|
</PageSizeItemSettings>
|
||||||
|
</SettingsPager>
|
||||||
|
<Settings ShowFilterRow="True" ShowHeaderFilterButton="True" ShowFilterBar="Visible" />
|
||||||
|
<SettingsBehavior FilterRowMode="OnClick"/>
|
||||||
|
<SettingsFilterControl ViewMode="VisualAndText">
|
||||||
|
</SettingsFilterControl>
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewCommandColumn ShowEditButton="True" VisibleIndex="0">
|
||||||
|
</dx:GridViewCommandColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="IDGDNAssociazioneLinee" Caption="Portafoglio" VisibleIndex="3" Visible="false">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_rap" Caption="Portafoglio" VisibleIndex="3">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_lin" Caption="Linea" VisibleIndex="4">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="des_rap" Caption="Cliente" VisibleIndex="5" >
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_sta" Caption="Stato" VisibleIndex="7" >
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_ges" Caption="Gestore" VisibleIndex="8" >
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
<asp:SqlDataSource ID="SqlDSAssociazioneLinee" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection %>" ProviderName="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection.ProviderName %>" SelectCommand="GDN_AssociazioneLinee_Load" SelectCommandType="StoredProcedure" UpdateCommand="GDN_AssociazioneLinee_Upd" UpdateCommandType="StoredProcedure">
|
||||||
|
<UpdateParameters>
|
||||||
|
<asp:Parameter Name="cod_rap" />
|
||||||
|
<asp:Parameter Name="cod_lin" />
|
||||||
|
</UpdateParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
28
OlympiaIntranet/AssociazioneLinee.aspx.cs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class AssociazioneLinee : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (HttpContext.Current.User.Identity.IsAuthenticated == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvAssociazioneFondi_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridViewTableDataCellEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.DataColumn.FieldName.Contains("cod_lin") && String.IsNullOrEmpty(e.CellValue.ToString()) == true)
|
||||||
|
{
|
||||||
|
e.Cell.BackColor = System.Drawing.Color.OrangeRed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
42
OlympiaIntranet/AssociazioneLinee.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet {
|
||||||
|
|
||||||
|
|
||||||
|
public partial class AssociazioneLinee {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvAssociazioneFondi control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvAssociazioneFondi;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSAssociazioneLinee control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSAssociazioneLinee;
|
||||||
|
}
|
||||||
|
}
|
||||||
97
OlympiaIntranet/CapienzaOrdiniSella.aspx
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CapienzaOrdiniSella.aspx.cs" Inherits="OlympiaIntranet.CapienzaOrdiniSella" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<div>
|
||||||
|
<dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server" EnableTheming="True" Theme="Office2010Blue" Width="500px">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxRadioButtonList ID="rblFiltraNegativi" runat="server" RepeatDirection="Horizontal" OnValueChanged="rblFiltraNegativi_ValueChanged">
|
||||||
|
<Items>
|
||||||
|
<dx:ListEditItem Text="Mostra tutti" Value="0" />
|
||||||
|
<dx:ListEditItem Text="Mostra solo saldo residuo negativo" Value="1" />
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxRadioButtonList>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutGroup Caption="Filtri Selezione" ColCount="6" ColSpan="1" ColumnCount="6">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="Gestore" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="gridLookupGestore" runat="server" Theme="Aqua" DataSourceID="SqlDSGestori" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Gestore" TextFormatString="{0}" OnValueChanged="gridLookupGestore_ValueChanged">
|
||||||
|
<%--<ClientSideEvents EndCallback="OnFirstEndCallback" />--%>
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
|
||||||
|
<SettingsPopup>
|
||||||
|
<FilterControl AutoUpdatePosition="False"></FilterControl>
|
||||||
|
</SettingsPopup>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="buttonCaricaDati" runat="server" OnClick="buttonCaricaDati_Click" Theme="Aqua" ToolTip="Carica dati dal db">
|
||||||
|
<Image IconID="actions_refresh_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="buttonEsportaExcel" runat="server" OnClick="buttonEsportaExcel_Click" Theme="Aqua" ToolTip="Esporta dati in excel" AutoPostBack="False">
|
||||||
|
<Image IconID="export_exporttoxlsx_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxFormLayout>
|
||||||
|
<dx:ASPxGridView ID="gvCapienzaOrdiniSella" runat="server" DataSourceID="SqlDSCapienzaOrdiniSella" Theme="Office2010Blue" Width="500px" AutoGenerateColumns="True" KeyFieldName="Portafoglio">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<SettingsPager PageSize="15" Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
<Settings ShowFilterRow="True" ShowHeaderFilterButton="True" ShowTitlePanel="True" ShowFooter="true" />
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</div>
|
||||||
|
<asp:SqlDataSource ID="SqlDSGestori" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GetGestore" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSCapienzaOrdiniSella" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_CapienzaOrdiniSella" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="cod_ges" SessionField="cod_ges" />
|
||||||
|
<asp:SessionParameter Name="filtra_negativi" SessionField="filtra_negativi" />
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<dx:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="gvCapienzaOrdiniSella"></dx:ASPxGridViewExporter>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
68
OlympiaIntranet/CapienzaOrdiniSella.aspx.cs
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
using DevExpress.Export;
|
||||||
|
using DevExpress.Web;
|
||||||
|
using DevExpress.XtraPrinting;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class CapienzaOrdiniSella : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (IsPostBack) {
|
||||||
|
gvCapienzaOrdiniSella.DataBind();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void buttonCaricaDati_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (Session["cod_ges"] != null && Session["filtra_negativi"] != null)
|
||||||
|
{
|
||||||
|
//SqlDSCapienzaOrdiniSella.SelectCommand = "GDN_CapienzaOrdiniSella";
|
||||||
|
//SqlDSCapienzaOrdiniSella.SelectCommandType = SqlDataSourceCommandType.StoredProcedure;
|
||||||
|
//Parameter p = SqlDSCapienzaOrdiniSella.SelectParameters["cod_ges"];
|
||||||
|
//SqlDSCapienzaOrdiniSella.SelectParameters.Remove(p);
|
||||||
|
//SqlDSCapienzaOrdiniSella.SelectParameters.Add("cod_ges", (string)objGestore);
|
||||||
|
//Parameter q = SqlDSCapienzaOrdiniSella.SelectParameters["filtra_negativi"];
|
||||||
|
//SqlDSCapienzaOrdiniSella.SelectParameters.Remove(q);
|
||||||
|
//SqlDSCapienzaOrdiniSella.SelectParameters.Add("filtra_negativi", rblFiltraNegativi.SelectedIndex.ToString());
|
||||||
|
gvCapienzaOrdiniSella.DataBind();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void buttonEsportaExcel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ASPxGridViewExporter1.ExportSelectedRowsOnly = false;
|
||||||
|
ASPxGridViewExporter1.FileName = DateTime.Now.ToString("yyyyMMdd_HHmm") + " - Capienza Ordini Fondi Sella";
|
||||||
|
XlsxExportOptionsEx op = new XlsxExportOptionsEx() { ExportType = ExportType.DataAware }; // in DataAware mode l'evento ASPxGridViewExporter_RenderBrick non viene eseguito!!
|
||||||
|
ASPxGridViewExporter1.WriteXlsxToResponse(op);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gridLookupGestore_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ASPxGridView grid = gridLookupGestore.GridView;
|
||||||
|
object objGestore = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Gestore" });
|
||||||
|
|
||||||
|
if (objGestore != null)
|
||||||
|
{
|
||||||
|
Session["cod_ges"] = (string)objGestore;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvOrdiniSella_DataBound(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void rblFiltraNegativi_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Session["filtra_negativi"] = rblFiltraNegativi.SelectedIndex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
107
OlympiaIntranet/CapienzaOrdiniSella.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public partial class CapienzaOrdiniSella
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxFormLayout1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxFormLayout ASPxFormLayout1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// rblFiltraNegativi control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxRadioButtonList rblFiltraNegativi;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gridLookupGestore control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup gridLookupGestore;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// buttonCaricaDati control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton buttonCaricaDati;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// buttonEsportaExcel control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton buttonEsportaExcel;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvCapienzaOrdiniSella control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvCapienzaOrdiniSella;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSGestori control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSGestori;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSCapienzaOrdiniSella control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSCapienzaOrdiniSella;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxGridViewExporter1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridViewExporter ASPxGridViewExporter1;
|
||||||
|
}
|
||||||
|
}
|
||||||
774
OlympiaIntranet/CommonClass.cs
Normal file
@@ -0,0 +1,774 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
using DevExpress.Data;
|
||||||
|
using DevExpress.Web;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.IO;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Net;
|
||||||
|
using System.Threading;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using PdfSharp.Pdf;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Net.Mail;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Text;
|
||||||
|
using PdfSharp.Drawing;
|
||||||
|
using MySqlConnector;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public class CommonClass
|
||||||
|
{
|
||||||
|
public static DataTable GetGestori()
|
||||||
|
{
|
||||||
|
string query = "GDN_GetGestore";
|
||||||
|
|
||||||
|
using (SqlConnection conn = new SqlConnection(OlympiaIntranet.Properties.Settings.Default.SqlConnection))
|
||||||
|
{
|
||||||
|
using (SqlCommand cmd = new SqlCommand(query, conn))
|
||||||
|
{
|
||||||
|
cmd.CommandType = CommandType.StoredProcedure;
|
||||||
|
|
||||||
|
using (SqlDataAdapter da = new SqlDataAdapter(cmd))
|
||||||
|
{
|
||||||
|
DataTable dt = new DataTable();
|
||||||
|
da.Fill(dt);
|
||||||
|
return dt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SqlBulkCopyTable(Page page, DataTable dt, string sqlTable)
|
||||||
|
{
|
||||||
|
//var table = "Events";
|
||||||
|
using (var conn = new SqlConnection(Properties.Settings.Default.SqlConnection))
|
||||||
|
{
|
||||||
|
var bulkCopy = new SqlBulkCopy(conn) { DestinationTableName = sqlTable };
|
||||||
|
bulkCopy.BulkCopyTimeout = 6000;
|
||||||
|
conn.Open();
|
||||||
|
var schema = conn.GetSchema("Columns", new[] { null, null, sqlTable, null });
|
||||||
|
foreach (DataColumn schemaColumn in dt.Columns)
|
||||||
|
{
|
||||||
|
foreach (DataRow row in schema.Rows)
|
||||||
|
{
|
||||||
|
if (string.Equals(schemaColumn.ColumnName, (string)row["COLUMN_NAME"], StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
bulkCopy.ColumnMappings.Add(schemaColumn.ColumnName, (string)row["COLUMN_NAME"]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
bulkCopy.WriteToServer(dt);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
CommonClass.MessageBox(page, ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DataTable execQuery_Datatable_MySql(string query, string connectionString)
|
||||||
|
{
|
||||||
|
MySqlDataReader result;
|
||||||
|
DataTable dt = new DataTable();
|
||||||
|
using (var con = new MySqlConnection(connectionString))
|
||||||
|
{
|
||||||
|
var cmd = new MySqlCommand
|
||||||
|
{
|
||||||
|
CommandText = query,
|
||||||
|
CommandType = CommandType.Text,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
cmd.CommandTimeout = 0;
|
||||||
|
con.Open(); // Open the MySqlConnection.
|
||||||
|
result = cmd.ExecuteReader();
|
||||||
|
dt.Load(result);
|
||||||
|
}
|
||||||
|
return (dt);
|
||||||
|
}
|
||||||
|
//public static DataTable execQuery_Datatable_Sql(string storedProc,
|
||||||
|
// string connectionString,
|
||||||
|
// string Gestore = "",
|
||||||
|
// string Consulente = "",
|
||||||
|
// string Linea = "",
|
||||||
|
// int FiltroRanking = -1 ,
|
||||||
|
// int TipoRanking = -1,
|
||||||
|
// DateTime? DataIns = null,
|
||||||
|
// string TipoAttivita = "",
|
||||||
|
// string Societa = "",
|
||||||
|
// DateTime? MeseRiferimento = null)
|
||||||
|
//{
|
||||||
|
// SqlDataReader result;
|
||||||
|
// DataTable dt = new DataTable();
|
||||||
|
// using (var con = new SqlConnection(connectionString))
|
||||||
|
// {
|
||||||
|
// var cmd = new SqlCommand
|
||||||
|
// {
|
||||||
|
// CommandText = storedProc,
|
||||||
|
// CommandType = CommandType.StoredProcedure,
|
||||||
|
// Connection = con
|
||||||
|
// };
|
||||||
|
// cmd.CommandTimeout = 600;
|
||||||
|
// if (String.IsNullOrEmpty(Gestore) == false) cmd.Parameters.Add("@cod_ges", SqlDbType.VarChar).Value = Gestore;
|
||||||
|
// if (String.IsNullOrEmpty(Consulente) == false) cmd.Parameters.Add("@cod_pro", SqlDbType.VarChar).Value = Consulente;
|
||||||
|
// if (String.IsNullOrEmpty(Linea) == false) cmd.Parameters.Add("@cod_lin", SqlDbType.VarChar).Value = Linea;
|
||||||
|
// if (DataIns != null) cmd.Parameters.Add("@data_ins", SqlDbType.Date).Value = DataIns;
|
||||||
|
// if (FiltroRanking != -1) cmd.Parameters.Add("@FiltroRanking", SqlDbType.Int).Value = FiltroRanking;
|
||||||
|
// if (TipoRanking != -1) cmd.Parameters.Add("@TipoRanking", SqlDbType.Int).Value = TipoRanking;
|
||||||
|
// if (String.IsNullOrEmpty(TipoAttivita) == false) cmd.Parameters.Add("@TipoAttivita", SqlDbType.VarChar).Value = TipoAttivita;
|
||||||
|
// if (String.IsNullOrEmpty(Societa) == false) cmd.Parameters.Add("@Societa", SqlDbType.VarChar).Value = Societa;
|
||||||
|
// if (MeseRiferimento != null) cmd.Parameters.Add("@MeseRiferimento", SqlDbType.Date).Value = MeseRiferimento;
|
||||||
|
// con.Open(); // Open the SqlConnection.
|
||||||
|
// result = cmd.ExecuteReader();
|
||||||
|
// dt.Load(result);
|
||||||
|
// }
|
||||||
|
// return (dt);
|
||||||
|
//}
|
||||||
|
public static DataTable execQuery_Datatable_Sql(string storedProc,
|
||||||
|
string connectionString,
|
||||||
|
string Gestore = "",
|
||||||
|
string Consulente = "",
|
||||||
|
string Linea = "",
|
||||||
|
int FiltroRanking = -1,
|
||||||
|
int TipoRanking = -1,
|
||||||
|
DateTime? DataIns = null,
|
||||||
|
string TipoAttivita = "",
|
||||||
|
string Societa = "",
|
||||||
|
DateTime? MeseRiferimento = null,
|
||||||
|
string Advisor = "",
|
||||||
|
string Titolo = "")
|
||||||
|
{
|
||||||
|
SqlDataReader result;
|
||||||
|
DataTable dt = new DataTable();
|
||||||
|
using (var con = new SqlConnection(connectionString))
|
||||||
|
{
|
||||||
|
var cmd = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = storedProc,
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
cmd.CommandTimeout = 600;
|
||||||
|
if (String.IsNullOrEmpty(Gestore) == false) cmd.Parameters.Add("@cod_ges", SqlDbType.VarChar).Value = Gestore;
|
||||||
|
if (String.IsNullOrEmpty(Consulente) == false) cmd.Parameters.Add("@cod_pro", SqlDbType.VarChar).Value = Consulente;
|
||||||
|
if (String.IsNullOrEmpty(Linea) == false) cmd.Parameters.Add("@cod_lin", SqlDbType.VarChar).Value = Linea;
|
||||||
|
if (DataIns != null) cmd.Parameters.Add("@data_ins", SqlDbType.Date).Value = DataIns;
|
||||||
|
if (FiltroRanking != -1) cmd.Parameters.Add("@FiltroRanking", SqlDbType.Int).Value = FiltroRanking;
|
||||||
|
if (TipoRanking != -1) cmd.Parameters.Add("@TipoRanking", SqlDbType.Int).Value = TipoRanking;
|
||||||
|
if (String.IsNullOrEmpty(TipoAttivita) == false) cmd.Parameters.Add("@TipoAttivita", SqlDbType.VarChar).Value = TipoAttivita;
|
||||||
|
if (String.IsNullOrEmpty(Societa) == false) cmd.Parameters.Add("@Societa", SqlDbType.VarChar).Value = Societa;
|
||||||
|
if (MeseRiferimento != null) cmd.Parameters.Add("@MeseRiferimento", SqlDbType.Date).Value = MeseRiferimento;
|
||||||
|
if (String.IsNullOrEmpty(Advisor) == false) cmd.Parameters.Add("@cod_adv", SqlDbType.VarChar).Value = Advisor;
|
||||||
|
if (String.IsNullOrEmpty(Titolo) == false) cmd.Parameters.Add("@Titolo", SqlDbType.VarChar).Value = Titolo;
|
||||||
|
con.Open(); // Open the SqlConnection.
|
||||||
|
result = cmd.ExecuteReader();
|
||||||
|
dt.Load(result);
|
||||||
|
}
|
||||||
|
return (dt);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string ExecSql(string proc, string Param1 = "", string Param2 = "", string Param3 = "", string Param4 = "", string Param5 = "")
|
||||||
|
{
|
||||||
|
string result;
|
||||||
|
using (var con = new SqlConnection(Properties.Settings.Default.SqlConnection))
|
||||||
|
{
|
||||||
|
var cmd = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = proc,
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
if (proc == "monitorVaR_LoadData1") // Se viene chiamata da MonitorVaR allora passa i parametri anche se vuoti , altrimenti schianta!!
|
||||||
|
{
|
||||||
|
//cmd.Parameters.Add("@gruppo", SqlDbType.VarChar).Value = Param1;
|
||||||
|
//cmd.Parameters.Add("@linea", SqlDbType.VarChar).Value = Param2;
|
||||||
|
//cmd.Parameters.Add("@gestore", SqlDbType.VarChar).Value = Param3;
|
||||||
|
//cmd.Parameters.Add("@advisor", SqlDbType.VarChar).Value = Param4;
|
||||||
|
//cmd.Parameters.Add("@consulente", SqlDbType.VarChar).Value = Param5;
|
||||||
|
cmd.Parameters.Add("@gestore", SqlDbType.VarChar).Value = Param1;
|
||||||
|
cmd.Parameters.Add("@linea", SqlDbType.VarChar).Value = Param2;
|
||||||
|
}
|
||||||
|
if (proc.Contains("GDN_EsposizioneTitoli_Rating") == true) // se viene chiamata da GDN_EsposizioneTitoli_RatingX allora passa il cod_tit altrimenti schianta!!
|
||||||
|
{
|
||||||
|
cmd.Parameters.Add("@cod_tit", SqlDbType.VarChar).Value = Param1;
|
||||||
|
cmd.Parameters.Add("@TipoRanking", SqlDbType.Int).Value = Convert.ToInt16(Param2);
|
||||||
|
}
|
||||||
|
con.Open(); // Open the SqlConnection.
|
||||||
|
result = cmd.ExecuteScalar().ToString();
|
||||||
|
}
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetColumnVisibility (ASPxGridView grid, bool visibility, string columnName)
|
||||||
|
{
|
||||||
|
if (visibility == true) grid.DataColumns[columnName].EditFormSettings.Visible = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
if (visibility == false) grid.DataColumns[columnName].EditFormSettings.Visible = DevExpress.Utils.DefaultBoolean.False;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool IsIsinValid(string isin)
|
||||||
|
{
|
||||||
|
isin = isin.Trim().ToUpper();
|
||||||
|
Regex r = new Regex("^[A-Z]{2}[A-Z0-9]{9}\\d$");
|
||||||
|
if (!r.IsMatch(isin))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
foreach (char c in isin.Substring(0, 12))
|
||||||
|
{
|
||||||
|
sb.Append(Digit(c, 36));
|
||||||
|
}
|
||||||
|
|
||||||
|
return LuhnTest(sb.ToString());
|
||||||
|
}
|
||||||
|
static int DigitValue(char c, int b)
|
||||||
|
{
|
||||||
|
if (c >= '0' && c <= '9')
|
||||||
|
{
|
||||||
|
return c - '0';
|
||||||
|
}
|
||||||
|
return c - 'A' + 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int Digit(char c, int b)
|
||||||
|
{
|
||||||
|
int result = DigitValue(c, b);
|
||||||
|
if (result >= b)
|
||||||
|
{
|
||||||
|
Console.Error.WriteLine("Invalid Number");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
static string ReverseString(string input)
|
||||||
|
{
|
||||||
|
char[] intermediate = input.ToCharArray();
|
||||||
|
Array.Reverse(intermediate);
|
||||||
|
return new string(intermediate);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool LuhnTest(string number)
|
||||||
|
{
|
||||||
|
int s1 = 0;
|
||||||
|
int s2 = 0;
|
||||||
|
string reverse = ReverseString(number);
|
||||||
|
for (int i = 0; i < reverse.Length; i++)
|
||||||
|
{
|
||||||
|
int digit = Digit(reverse[i], 10);
|
||||||
|
//This is for odd digits, they are 1-indexed in the algorithm.
|
||||||
|
if (i % 2 == 0)
|
||||||
|
{
|
||||||
|
s1 += digit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ // Add 2 * digit for 0-4, add 2 * digit - 9 for 5-9.
|
||||||
|
s2 += 2 * digit;
|
||||||
|
if (digit >= 5)
|
||||||
|
{
|
||||||
|
s2 -= 9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (s1 + s2) % 10 == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string SincronizzaInCedLab(string linkApi)
|
||||||
|
{
|
||||||
|
string callPage = string.Empty;
|
||||||
|
string response = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (WebClient web = new WebClient())
|
||||||
|
{
|
||||||
|
callPage = web.DownloadString(linkApi);
|
||||||
|
}
|
||||||
|
if (callPage.IndexOf("STATUSCODE : OK") != -1)
|
||||||
|
{
|
||||||
|
int posStart = callPage.IndexOf("STATUSCODE : START") + 18;
|
||||||
|
int posEnd = callPage.IndexOf("STATUSCODE : OK");
|
||||||
|
response = callPage.Substring(posStart, posEnd - posStart).Replace(System.Environment.NewLine, @"\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (callPage.IndexOf("Eccezione rilevata") != -1)
|
||||||
|
{
|
||||||
|
int posStart = callPage.IndexOf("Eccezione rilevata :") + 20;
|
||||||
|
int posEnd = callPage.IndexOf("@");
|
||||||
|
response = callPage.Substring(posStart, posEnd - posStart);
|
||||||
|
string error = response.Replace(System.Environment.NewLine, @"\n"); // rimpiazzo \r\n con \\n che viene 'digerito' da javascript nell'alert
|
||||||
|
return (error);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (response);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return (ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SendEmail(string msgBody, string msgSubject = "", string msgFrom = "")
|
||||||
|
{
|
||||||
|
var mailFrom = "info@gl-software.it";
|
||||||
|
var mailTo = "glicciardello@gmail.com";
|
||||||
|
//var mailTo1 = "federico.costalonga@gmail.com";
|
||||||
|
var host = "mail.gl-software.it";
|
||||||
|
var user = "gl-software.it";
|
||||||
|
var pass = "kohriwoo";
|
||||||
|
//var ComputerName = System.Environment.MachineName;
|
||||||
|
//int port = 0;
|
||||||
|
|
||||||
|
//if (ComputerName == "DELL-NOTEBOOK") port = 587; // dal notebook usa porta 587
|
||||||
|
//else port = 25; // dal server usa porta 25
|
||||||
|
|
||||||
|
// Invio email tramite .Net
|
||||||
|
using (MailMessage message = new MailMessage())// msgFrom, DestMail, tbOggetto.Text, htmlBody))
|
||||||
|
{
|
||||||
|
message.From = new MailAddress(mailFrom, msgFrom);
|
||||||
|
message.To.Add(new MailAddress(mailTo));
|
||||||
|
//if (!isDebug) message.To.Add(new MailAddress(mailTo1)); // invia mail a Fede solo se non è in debug mode!
|
||||||
|
message.IsBodyHtml = true;
|
||||||
|
message.Body = msgBody;
|
||||||
|
message.Subject = msgSubject;
|
||||||
|
|
||||||
|
using (SmtpClient client = new SmtpClient(host))
|
||||||
|
{
|
||||||
|
client.Port = 25;
|
||||||
|
client.EnableSsl = false;
|
||||||
|
client.UseDefaultCredentials = false;
|
||||||
|
client.Credentials = new NetworkCredential(user, pass);
|
||||||
|
client.Send(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void MessageBox(System.Web.UI.Page page, string strMsg)
|
||||||
|
{
|
||||||
|
//+ character added after strMsg "')"
|
||||||
|
ScriptManager.RegisterClientScriptBlock(page,page.GetType(), "alertMessage", "alert('" + strMsg.Replace("'", string.Empty) + "')", true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void CopyPages(PdfDocument from, PdfDocument to)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < from.PageCount; i++)
|
||||||
|
{
|
||||||
|
to.AddPage(from.Pages[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DateTime AddBusinessDays(DateTime date, int days)
|
||||||
|
{
|
||||||
|
int d = 4 - Math.Sign(days) * (4 - ((int)date.DayOfWeek + 1)); //SET @d = 4 - SIGN(@n) * (4 - DATEPART(DW, @Date)); Aggiunto uno a DayOfWeek perchè in C# Sunday = 0 mentre in sql DATEPART(dw,..) Sunday = 1
|
||||||
|
DateTime returnDate = date.AddDays(days + ((Math.Abs(days) + d - 2) / 5) * 2 * Math.Sign(days) - d / 7); // DATEADD(D, @n + ((ABS(@n) + @d - 2) / 5) * 2 * SIGN(@n) - @d / 7, @Date);
|
||||||
|
return (returnDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string CallWebApi(string linkApi)
|
||||||
|
{
|
||||||
|
// Create a request for the URL.
|
||||||
|
WebRequest request = WebRequest.Create(linkApi);
|
||||||
|
request.Timeout = 60 * 1000; // 60 secondi timeout
|
||||||
|
// If required by the server, set the credentials.
|
||||||
|
request.Credentials = CredentialCache.DefaultCredentials;
|
||||||
|
// Get the response.
|
||||||
|
WebResponse response = request.GetResponse();
|
||||||
|
// Display the status.
|
||||||
|
Console.WriteLine(((HttpWebResponse)response).StatusDescription);
|
||||||
|
// Get the stream containing content returned by the server.
|
||||||
|
Stream dataStream = response.GetResponseStream();
|
||||||
|
// Open the stream using a StreamReader for easy access.
|
||||||
|
StreamReader reader = new StreamReader(dataStream);
|
||||||
|
// Read the content.
|
||||||
|
string responseFromServer = reader.ReadToEnd();
|
||||||
|
// Display the content.
|
||||||
|
Console.WriteLine(responseFromServer);
|
||||||
|
// Clean up the streams and the response.
|
||||||
|
reader.Close();
|
||||||
|
response.Close();
|
||||||
|
return (responseFromServer);
|
||||||
|
}
|
||||||
|
public static bool IsValidJson(string strInput)
|
||||||
|
{
|
||||||
|
strInput = strInput.Trim();
|
||||||
|
if ((strInput.StartsWith("{") && strInput.EndsWith("}")) || //For object
|
||||||
|
(strInput.StartsWith("[") && strInput.EndsWith("]"))) //For array
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var obj = JToken.Parse(strInput);
|
||||||
|
//ScriveLog("BBG Service OK!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (JsonReaderException )
|
||||||
|
{
|
||||||
|
//Exception in parsing json
|
||||||
|
//ScriveLog(string.Format(" Error (JsonReaderException) from BBGservice : {0} {1}", jex.Message, jex.InnerException));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
catch (Exception ) //some other exception
|
||||||
|
{
|
||||||
|
//Console.WriteLine(ex.ToString());
|
||||||
|
//ScriveLog(string.Format(" Error (Exception) from BBGservice : {0} {1}", ex.Message, ex.InnerException));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SaveHits(int idSite, int hits, string user = "")
|
||||||
|
{
|
||||||
|
using (var con = new SqlConnection(Properties.Settings.Default.SqlConnection))
|
||||||
|
{
|
||||||
|
var cmd = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = "SaveHits1",
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
if (idSite == 0) cmd.Parameters.Add("@site", SqlDbType.VarChar).Value = "ROMA";
|
||||||
|
if (idSite == 1) cmd.Parameters.Add("@site", SqlDbType.VarChar).Value = "LONDRA";
|
||||||
|
cmd.Parameters.Add("@hits", SqlDbType.Int).Value = hits;
|
||||||
|
cmd.Parameters.Add("@user", SqlDbType.VarChar).Value = user;
|
||||||
|
con.Open(); // Open the SqlConnection.
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verifica server bbg sia online prendendo dalla lista server in tabella BBGServer
|
||||||
|
// Restituisce l'ip:porta del server attivo altrimenti N/A
|
||||||
|
public static string[] IsBBGServiceOnline()
|
||||||
|
{
|
||||||
|
string[] result = new string[2];
|
||||||
|
result[0] = QueryBBGService("ROMA");
|
||||||
|
result[1] = QueryBBGService("LONDRA");
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int CheckHitsManuali(string Site)
|
||||||
|
{
|
||||||
|
int result = 0;
|
||||||
|
using (var con = new SqlConnection(Properties.Settings.Default.SqlConnection))
|
||||||
|
{
|
||||||
|
var cmd = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = "hits_TotalHitsManuali",
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
cmd.Parameters.Add("@site", SqlDbType.VarChar).Value = Site;
|
||||||
|
//cmd.Parameters.Add("@utente", SqlDbType.VarChar).Value = utente;
|
||||||
|
con.Open(); // Open the SqlConnection.
|
||||||
|
result = (int)cmd.ExecuteScalar();
|
||||||
|
}
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string QueryBBGService(string site)
|
||||||
|
{
|
||||||
|
DataTable serverlistTable = null;
|
||||||
|
// Rileva elenco server BBG disponibili
|
||||||
|
using (var con = new SqlConnection(Properties.Settings.Default.SqlConnection))
|
||||||
|
{
|
||||||
|
var cmd = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = "bbg_ServerList1",
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
cmd.Parameters.Add("@site", SqlDbType.VarChar).Value = site;
|
||||||
|
con.Open(); // Open the SqlConnection.
|
||||||
|
SqlDataReader result = cmd.ExecuteReader();
|
||||||
|
serverlistTable = new DataTable();
|
||||||
|
serverlistTable.Load(result);
|
||||||
|
}
|
||||||
|
// Test per verificare che BBG Service sia attivo e raggiungibile...
|
||||||
|
bool callEsito = false;
|
||||||
|
string testjson = "";
|
||||||
|
string jsonString = "";
|
||||||
|
string ActualServerIP = "";
|
||||||
|
foreach (DataRow serverRow in serverlistTable.Rows)
|
||||||
|
{
|
||||||
|
if (callEsito == true) break; // esce se il server ha risposto al precedente IP
|
||||||
|
|
||||||
|
if (!String.IsNullOrEmpty(serverRow["Port"].ToString())) ActualServerIP = serverRow["IP"].ToString() + ":" + serverRow["Port"].ToString();
|
||||||
|
else ActualServerIP = serverRow["IP"].ToString();
|
||||||
|
|
||||||
|
int callNum = 1;
|
||||||
|
while (callNum < 5 && callEsito == false) // Effettua 5 tentativi per ogni server in lista
|
||||||
|
{
|
||||||
|
testjson = string.Format("http://{0}/api/bbgservicehst?security=XS1431873659@ETLX%20Corp&field=PX_LAST&startDate=20170331&endDate=20170331&type=json", ActualServerIP);
|
||||||
|
using (WebClient web = new WebClient())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
jsonString = web.DownloadString(testjson);
|
||||||
|
Console.WriteLine(string.Format("Test N°{0} connessione a BBG Service...", callNum));
|
||||||
|
//ScriveLog(string.Format("Test N°{0} connessione a BBG Service...", callNum));
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
//ScriveLog(string.Format("Errore connessione Test N°{0} a BBG Service - ErrMsg {1} - InnerMsg {2} - jsonResult {3}", callNum, e.Message, e.InnerException, jsonString));
|
||||||
|
jsonString = "";
|
||||||
|
callNum++;
|
||||||
|
Thread.Sleep(1000); // aspetta 1 secondo e poi riscarica i dati...
|
||||||
|
}
|
||||||
|
if (!String.IsNullOrEmpty(jsonString)) callEsito = true; // esce se riesce a connettersi a BBG Service...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (callEsito == false) return ("N/A");
|
||||||
|
else return (ActualServerIP);
|
||||||
|
}
|
||||||
|
//public static string IsBBGServiceOnline(string logFileName)
|
||||||
|
//{
|
||||||
|
// DataTable serverlistTable = null;
|
||||||
|
// // Rileva elenco server BBG disponibili
|
||||||
|
// using (var con = new SqlConnection(Properties.Settings.Default.DBSettings))
|
||||||
|
// {
|
||||||
|
// var cmd = new SqlCommand
|
||||||
|
// {
|
||||||
|
// CommandText = "bbg_ServerList",
|
||||||
|
// CommandType = CommandType.StoredProcedure,
|
||||||
|
// Connection = con
|
||||||
|
// };
|
||||||
|
// con.Open(); // Open the SqlConnection.
|
||||||
|
// SqlDataReader result = cmd.ExecuteReader();
|
||||||
|
// serverlistTable = new DataTable();
|
||||||
|
// serverlistTable.Load(result);
|
||||||
|
// }
|
||||||
|
// // Test per verificare che BBG Service sia attivo e raggiungibile...
|
||||||
|
|
||||||
|
// bool callEsito = false;
|
||||||
|
// string testjson = "";
|
||||||
|
// string jsonString = "";
|
||||||
|
// string ActualServerIP = "";
|
||||||
|
// foreach (DataRow serverRow in serverlistTable.Rows)
|
||||||
|
// {
|
||||||
|
// if (callEsito == true) break; // esce se il server ha risposto al precedente IP
|
||||||
|
|
||||||
|
// if (!String.IsNullOrEmpty(serverRow["Port"].ToString())) ActualServerIP = serverRow["IP"].ToString() + ":" + serverRow["Port"].ToString();
|
||||||
|
// else ActualServerIP = serverRow["IP"].ToString();
|
||||||
|
|
||||||
|
// int callNum = 1;
|
||||||
|
// while (callNum < 20 && callEsito == false) // Effettua 20 tentativi per ogni server in lista
|
||||||
|
// {
|
||||||
|
// testjson = string.Format("http://{0}/api/bbgservicehst?security=XS1431873659@ETLX%20Corp&field=OPEN,PX_BID,PX_ASK,PX_OPEN,PX_LAST&startDate=20170331&endDate=20170331&type=json", ActualServerIP);
|
||||||
|
// using (WebClient web = new WebClient())
|
||||||
|
// {
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// jsonString = web.DownloadString(testjson);
|
||||||
|
// //Console.WriteLine(string.Format("Test N°{0} connessione a BBG Service...", callNum));
|
||||||
|
// //ScriveLog(string.Format("Test N°{0} connessione a BBG Service...", callNum));
|
||||||
|
// }
|
||||||
|
// catch (Exception e)
|
||||||
|
// {
|
||||||
|
// //ScriveLog(string.Format("Errore connessione Test N°{0} a BBG Service - ErrMsg {1} - InnerMsg {2} - jsonResult {3}", callNum, e.Message, e.InnerException, jsonString));
|
||||||
|
// jsonString = "";
|
||||||
|
// callNum++;
|
||||||
|
// Thread.Sleep(1000); // aspetta 1 secondo e poi riscarica i dati...
|
||||||
|
// }
|
||||||
|
// if (!String.IsNullOrEmpty(jsonString)) callEsito = true; // esce se riesce a connettersi a BBG Service...
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if (callEsito == false) return ("N/A");
|
||||||
|
// else return (ActualServerIP);
|
||||||
|
|
||||||
|
//}
|
||||||
|
|
||||||
|
public static double[] shiftArray(double[] list, int m)
|
||||||
|
{
|
||||||
|
|
||||||
|
var from = 0;
|
||||||
|
var val = list[from];
|
||||||
|
var nextGroup = 1;
|
||||||
|
for (int i = 0; i < list.Length; i++)
|
||||||
|
{
|
||||||
|
var to = ((from - m) + list.Length) % list.Length;
|
||||||
|
if (to == from)
|
||||||
|
break;
|
||||||
|
|
||||||
|
var temp = list[to];
|
||||||
|
list[to] = val;
|
||||||
|
from = to;
|
||||||
|
val = temp;
|
||||||
|
|
||||||
|
if (from < nextGroup)
|
||||||
|
{
|
||||||
|
from = nextGroup++;
|
||||||
|
val = list[from];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (list);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string CreaBuildNumber()
|
||||||
|
{
|
||||||
|
DateTime compiledOn = File.GetLastWriteTime(Assembly.GetExecutingAssembly().Location);
|
||||||
|
string result = "Build version "+compiledOn.ToString("ddMMyyyy.HHmm")+" - DE 18.1.6";
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void CreaColonna(ASPxGridView webGrid, string tipoCol, string nomeCampo, ref int ordineColonna, bool applicaFormattazione=true)
|
||||||
|
{
|
||||||
|
webGrid.Columns.Remove(webGrid.Columns[nomeCampo]); // Rimuove colonna prima di crearla
|
||||||
|
if (tipoCol== "Text")
|
||||||
|
{
|
||||||
|
var col = new GridViewDataTextColumn() { FieldName = nomeCampo };
|
||||||
|
if (ordineColonna == 0) webGrid.TotalSummary.Add(SummaryItemType.Count, nomeCampo).DisplayFormat = "n0";
|
||||||
|
if (applicaFormattazione) col.PropertiesTextEdit.DisplayFormatString = "n2";
|
||||||
|
col.VisibleIndex = ordineColonna;
|
||||||
|
webGrid.Columns.Add(col);
|
||||||
|
}
|
||||||
|
if (tipoCol == "Date")
|
||||||
|
{
|
||||||
|
var col = new GridViewDataDateColumn() { FieldName = nomeCampo };
|
||||||
|
col.PropertiesDateEdit.DisplayFormatString = "dd/MM/yyyy";
|
||||||
|
col.VisibleIndex = ordineColonna;
|
||||||
|
webGrid.Columns.Add(col);
|
||||||
|
}
|
||||||
|
ordineColonna++;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SettaFormatiNumerici()
|
||||||
|
{
|
||||||
|
CultureInfo newCulture = (CultureInfo)CultureInfo.CurrentCulture.Clone();
|
||||||
|
newCulture.NumberFormat.NumberGroupSeparator = ".";
|
||||||
|
newCulture.NumberFormat.NumberDecimalSeparator = ",";
|
||||||
|
|
||||||
|
System.Threading.Thread.CurrentThread.CurrentCulture = newCulture;
|
||||||
|
System.Threading.Thread.CurrentThread.CurrentUICulture = newCulture;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SettaWebGrid(ASPxGridView webgrid, bool showAll=true)
|
||||||
|
{
|
||||||
|
if (!showAll)
|
||||||
|
{
|
||||||
|
webgrid.SettingsPager.Mode = GridViewPagerMode.ShowPager;
|
||||||
|
webgrid.SettingsPager.PageSize = 20;
|
||||||
|
webgrid.SettingsPager.PageSizeItemSettings.ShowAllItem = true;
|
||||||
|
webgrid.Settings.ShowGroupPanel = true;
|
||||||
|
webgrid.Settings.ShowFilterRow = true;
|
||||||
|
webgrid.Settings.ShowFooter = true;
|
||||||
|
webgrid.Settings.ShowFilterBar = GridViewStatusBarMode.Visible;
|
||||||
|
webgrid.Settings.ShowHeaderFilterButton = true;
|
||||||
|
//webgrid.Settings.VerticalScrollBarMode = ScrollBarMode.Visible;
|
||||||
|
//webgrid.SettingsAdaptivity.AdaptivityMode = GridViewAdaptivityMode.HideDataCells;
|
||||||
|
//webgrid.SettingsAdaptivity.AllowOnlyOneAdaptiveDetailExpanded = true;
|
||||||
|
webgrid.Theme = "MetropolisBlue";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
webgrid.SettingsPager.Mode = GridViewPagerMode.ShowAllRecords;
|
||||||
|
webgrid.Settings.ShowGroupPanel = false;
|
||||||
|
webgrid.Settings.ShowFilterRow = false;
|
||||||
|
webgrid.Settings.ShowFooter = false;
|
||||||
|
//webgrid.Theme = "Moderno";
|
||||||
|
webgrid.Theme = "MetropolisBlue";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetColumnFilterContains(ASPxGridView grid)
|
||||||
|
{
|
||||||
|
// Abilita in tutte le colonne di default la ricerca con 'Contains'
|
||||||
|
for (int i = 0; i < Math.Min(grid.VisibleRowCount, grid.Columns.Count); i++)
|
||||||
|
{
|
||||||
|
GridViewDataColumn col = (grid.Columns[i]) as GridViewDataColumn;
|
||||||
|
if (col != null) col.Settings.AutoFilterCondition = AutoFilterCondition.Contains;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void CustomDataBind(string tipo,ASPxGridView webgrid, string sp, Label label, string testolabel, bool usaParametri=true)
|
||||||
|
{
|
||||||
|
//var sqlDS = new SqlDataSource
|
||||||
|
//{
|
||||||
|
// ConnectionString = Properties.Settings.Default.DBSettings,
|
||||||
|
// SelectCommandType = SqlDataSourceCommandType.StoredProcedure,
|
||||||
|
// SelectCommand = sp
|
||||||
|
//};
|
||||||
|
//if (usaParametri)
|
||||||
|
//{
|
||||||
|
// var sqlParam = new Parameter("Filter", DbType.String, tipo);
|
||||||
|
// sqlDS.SelectParameters.Add(sqlParam);
|
||||||
|
|
||||||
|
// switch (tipo)
|
||||||
|
// {
|
||||||
|
// case "P":
|
||||||
|
// label.Text = testolabel + " (Utenti Public)";
|
||||||
|
// break;
|
||||||
|
// case "F":
|
||||||
|
// label.Text = testolabel + " (Utenti Full)";
|
||||||
|
// break;
|
||||||
|
// case "C":
|
||||||
|
// label.Text = testolabel + " (Utenti Customer)";
|
||||||
|
// break;
|
||||||
|
// case "R":
|
||||||
|
// label.Text = testolabel + " (Utenti Registered)";
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
//webgrid.DataSource = sqlDS;
|
||||||
|
//webgrid.DataBind();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SalvaLogSync(string paramCall, string paramUtente)
|
||||||
|
{
|
||||||
|
using (var con = new SqlConnection(Properties.Settings.Default.SqlConnection))
|
||||||
|
{
|
||||||
|
var cmd = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = "dbo.logsync_Ins",
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
cmd.Parameters.Add("Call", SqlDbType.VarChar).Value = paramCall;
|
||||||
|
cmd.Parameters.Add("Utente", SqlDbType.VarChar).Value = paramUtente;
|
||||||
|
con.Open(); // Open the SqlConnection.
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string SQLProc(string proc, string date = "", int idSite = -1)
|
||||||
|
{
|
||||||
|
string result;
|
||||||
|
using (var con = new SqlConnection(Properties.Settings.Default.SqlConnection))
|
||||||
|
{
|
||||||
|
var cmd = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = proc,
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
if (String.IsNullOrEmpty(date) == false) cmd.Parameters.Add("@Date", SqlDbType.Date).Value = Convert.ToDateTime(date);
|
||||||
|
if (idSite == 0) cmd.Parameters.Add("@site", SqlDbType.VarChar).Value = "ROMA";
|
||||||
|
if (idSite == 1) cmd.Parameters.Add("@site", SqlDbType.VarChar).Value = "LONDRA";
|
||||||
|
con.Open(); // Open the SqlConnection.
|
||||||
|
result = cmd.ExecuteScalar().ToString();
|
||||||
|
}
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void DrawImage(XGraphics gfx, string jpegFileNamePath, int x, int y, int width, int height)
|
||||||
|
{
|
||||||
|
XImage image = XImage.FromFile(jpegFileNamePath);
|
||||||
|
gfx.DrawImage(image, x, y, width, height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 2.0 MiB |
97
OlympiaIntranet/DashboardControlli.aspx
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DashboardControlli.aspx.cs" Inherits="OlympiaIntranet.DashboardControlli" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title>Dashboard Controlli</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel1" runat="server" EnableTheming="True" Theme="Aqua">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent>
|
||||||
|
<table style="width: 100%; padding: 10px;">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<h2 style="font-family: Tahoma,Arial,sans-serif; color: #1F4E79; margin: 0 0 10px 0;">Dashboard Controlli
|
||||||
|
</h2>
|
||||||
|
</td>
|
||||||
|
<td style="text-align: right; vertical-align: middle;">
|
||||||
|
<dx:ASPxButton ID="btnExportExcel" runat="server"
|
||||||
|
Theme="Aqua"
|
||||||
|
EnableTheming="True"
|
||||||
|
Text="Esporta Excel"
|
||||||
|
AutoPostBack="True"
|
||||||
|
OnClick="btnExportExcel_Click">
|
||||||
|
<Image IconID="export_exporttoxlsx_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<dx:ASPxGridView ID="gvDashboardAlert" runat="server"
|
||||||
|
Theme="Aqua"
|
||||||
|
EnableTheming="True"
|
||||||
|
AutoGenerateColumns="False"
|
||||||
|
KeyFieldName="ID"
|
||||||
|
Width="100%"
|
||||||
|
OnDataBinding="gvDashboardAlert_DataBinding">
|
||||||
|
|
||||||
|
<SettingsBehavior AllowEllipsisInText="True" />
|
||||||
|
|
||||||
|
<SettingsPager Mode="ShowAllRecords" />
|
||||||
|
|
||||||
|
<Settings ShowGroupPanel="False" ShowFilterRow="True" />
|
||||||
|
|
||||||
|
<SettingsExport ExcelExportMode="WYSIWYG" />
|
||||||
|
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="ID" Caption="ID"
|
||||||
|
Width="50px" ReadOnly="True">
|
||||||
|
<Settings AllowSort="True" AllowHeaderFilter="True" />
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Descrizione" Caption="Descrizione"
|
||||||
|
Width="300px" ReadOnly="True">
|
||||||
|
<Settings AllowSort="True" AllowHeaderFilter="True" />
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Frequenza" Caption="Frequenza"
|
||||||
|
Width="100px" ReadOnly="True">
|
||||||
|
<Settings AllowSort="True" AllowHeaderFilter="True" />
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Giorno" Caption="Giorno"
|
||||||
|
Width="80px" ReadOnly="True">
|
||||||
|
<Settings AllowSort="True" AllowHeaderFilter="True" />
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Orario" Caption="Orario"
|
||||||
|
Width="80px" ReadOnly="True">
|
||||||
|
<Settings AllowSort="True" AllowHeaderFilter="True" />
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Destinatari" Caption="Destinatari"
|
||||||
|
Width="250px" ReadOnly="True">
|
||||||
|
<Settings AllowSort="True" AllowHeaderFilter="True" />
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
|
||||||
|
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
|
||||||
|
<%-- Exporter collegato alla griglia --%>
|
||||||
|
<dx:ASPxGridViewExporter ID="gridExporter" runat="server"
|
||||||
|
GridViewID="gvDashboardAlert"
|
||||||
|
FileName="DashboardAlert" />
|
||||||
|
|
||||||
|
</dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxPanel>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
79
OlympiaIntranet/DashboardControlli.aspx.cs
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
using DevExpress.Web;
|
||||||
|
using System;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class DashboardControlli : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
private string ConnectionString
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return System.Configuration.ConfigurationManager
|
||||||
|
.ConnectionStrings["OlympiaIntranet.Properties.Settings.SqlConnection"]
|
||||||
|
.ConnectionString;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!HttpContext.Current.User.Identity.IsAuthenticated)
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IsPostBack)
|
||||||
|
{
|
||||||
|
BindGrid();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------
|
||||||
|
// Necessario per i callback DevExpress (filtro, ordinamento, ecc.)
|
||||||
|
// ---------------------------------------------------------------
|
||||||
|
protected void gvDashboardAlert_DataBinding(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
gvDashboardAlert.DataSource = GetData();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------
|
||||||
|
// Carica i dati e li assegna alla griglia
|
||||||
|
// ---------------------------------------------------------------
|
||||||
|
private void BindGrid()
|
||||||
|
{
|
||||||
|
gvDashboardAlert.DataSource = GetData();
|
||||||
|
gvDashboardAlert.DataBind();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------
|
||||||
|
// Recupera i dati dalla SP GDN_DashboardAlert
|
||||||
|
// ---------------------------------------------------------------
|
||||||
|
private DataTable GetData()
|
||||||
|
{
|
||||||
|
DataTable dt = new DataTable();
|
||||||
|
|
||||||
|
using (SqlConnection conn = new SqlConnection(ConnectionString))
|
||||||
|
using (SqlCommand cmd = new SqlCommand("GDN_DashboardAlert", conn))
|
||||||
|
{
|
||||||
|
cmd.CommandType = CommandType.StoredProcedure;
|
||||||
|
SqlDataAdapter da = new SqlDataAdapter(cmd);
|
||||||
|
da.Fill(dt);
|
||||||
|
}
|
||||||
|
|
||||||
|
return dt;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------
|
||||||
|
// Export Excel - usa ASPxGridViewExporter dichiarato nel markup
|
||||||
|
// ---------------------------------------------------------------
|
||||||
|
protected void btnExportExcel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
gvDashboardAlert.DataSource = GetData();
|
||||||
|
gridExporter.WriteXlsxToResponse("DashboardAlert_" + DateTime.Now.ToString("yyyyMMdd") + ".xlsx");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
62
OlympiaIntranet/DashboardControlli.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public partial class DashboardControlli
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnExportExcel control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton btnExportExcel;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvDashboardAlert control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvDashboardAlert;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gridExporter control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridViewExporter gridExporter;
|
||||||
|
}
|
||||||
|
}
|
||||||
28
OlympiaIntranet/DataClasses1.dbml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?><Database Name="FirstSolutionDB" Class="DataClasses1DataContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">
|
||||||
|
<Connection Mode="AppSettings" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa" SettingsObjectName="OlympiaIntranet.Properties.Settings" SettingsPropertyName="SqlConnection" Provider="System.Data.SqlClient" />
|
||||||
|
<Table Name="dbo.LoadFondiETF" Member="LoadFondiETFs">
|
||||||
|
<Type Name="LoadFondiETF">
|
||||||
|
<Column Name="IsinCode" Type="System.String" DbType="VarChar(50)" CanBeNull="true" />
|
||||||
|
<Column Name="Name" Type="System.String" DbType="VarChar(500)" CanBeNull="true" />
|
||||||
|
<Column Name="ListingCurrency" Type="System.String" DbType="VarChar(10)" CanBeNull="true" />
|
||||||
|
<Column Name="TepiloraCategory" Type="System.String" DbType="VarChar(500)" CanBeNull="true" />
|
||||||
|
<Column Name="TepiloraType" Type="System.String" DbType="VarChar(50)" CanBeNull="true" />
|
||||||
|
<Column Name="TepiloraCurrencyExposure" Type="System.String" DbType="VarChar(50)" CanBeNull="true" />
|
||||||
|
<Column Name="TepiloraCurrencyHedging" Type="System.String" DbType="VarChar(50)" CanBeNull="true" />
|
||||||
|
<Column Name="InceptionDate" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
|
||||||
|
<Column Name="OngoingFees" Type="System.Double" DbType="Float" CanBeNull="true" />
|
||||||
|
<Column Name="TER" Type="System.Double" DbType="Float" CanBeNull="true" />
|
||||||
|
<Column Name="TotalAssetValue" Type="System.Double" DbType="Float" CanBeNull="true" />
|
||||||
|
<Column Name="DistributionPolicy" Type="System.String" DbType="VarChar(50)" CanBeNull="true" />
|
||||||
|
<Column Name="LowerFees" Type="System.Int32" DbType="Int" CanBeNull="true" />
|
||||||
|
<Column Name="TMonthlyReturns" Type="System.Double" DbType="Float" CanBeNull="true" />
|
||||||
|
<Column Name="TMonthlyVolatility" Type="System.Double" DbType="Float" CanBeNull="true" />
|
||||||
|
<Column Name="TRDD" Type="System.Double" DbType="Float" CanBeNull="true" />
|
||||||
|
<Column Name="FinalRating" Type="System.Double" DbType="Float" CanBeNull="true" />
|
||||||
|
<Column Name="DataIns" Type="System.DateTime" DbType="Date" CanBeNull="true" />
|
||||||
|
<Column Name="TepiloraCode" Type="System.String" DbType="VarChar(50)" CanBeNull="true" />
|
||||||
|
<Column Name="MorningStarCategory" Type="System.String" DbType="VarChar(100)" CanBeNull="true" />
|
||||||
|
<Column Name="MorningstarCode" Type="System.String" DbType="VarChar(100)" CanBeNull="true" />
|
||||||
|
</Type>
|
||||||
|
</Table>
|
||||||
|
</Database>
|
||||||
12
OlympiaIntranet/DataClasses1.dbml.layout
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 11, 8.5" name="DataClasses1">
|
||||||
|
<DataContextMoniker Name="/DataClasses1DataContext" />
|
||||||
|
<nestedChildShapes>
|
||||||
|
<classShape Id="a1df1593-765d-4750-9f81-dacd22883190" isExpanded="false" absoluteBounds="6.75, 2, 2, 0.45">
|
||||||
|
<DataClassMoniker Name="/DataClasses1DataContext/LoadFondiETF" />
|
||||||
|
<nestedChildShapes>
|
||||||
|
<elementListCompartment Id="7d4aa445-ee62-41be-bab5-9efa938ff8d5" absoluteBounds="6.765, 2.46, 1.9700000000000002, 4.2877197265625" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
|
||||||
|
</nestedChildShapes>
|
||||||
|
</classShape>
|
||||||
|
</nestedChildShapes>
|
||||||
|
</ordesignerObjectsDiagram>
|
||||||
461
OlympiaIntranet/DataClasses1.designer.cs
generated
Normal file
@@ -0,0 +1,461 @@
|
|||||||
|
#pragma warning disable 1591
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
using System.Data.Linq;
|
||||||
|
using System.Data.Linq.Mapping;
|
||||||
|
using System.Data;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Expressions;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.DatabaseAttribute(Name="FirstSolutionDB")]
|
||||||
|
public partial class DataClasses1DataContext : System.Data.Linq.DataContext
|
||||||
|
{
|
||||||
|
|
||||||
|
private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
|
||||||
|
|
||||||
|
#region Extensibility Method Definitions
|
||||||
|
partial void OnCreated();
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public DataClasses1DataContext() :
|
||||||
|
base(global::OlympiaIntranet.Properties.Settings.Default.SqlConnection, mappingSource)
|
||||||
|
{
|
||||||
|
OnCreated();
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataClasses1DataContext(string connection) :
|
||||||
|
base(connection, mappingSource)
|
||||||
|
{
|
||||||
|
OnCreated();
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataClasses1DataContext(System.Data.IDbConnection connection) :
|
||||||
|
base(connection, mappingSource)
|
||||||
|
{
|
||||||
|
OnCreated();
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataClasses1DataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
|
||||||
|
base(connection, mappingSource)
|
||||||
|
{
|
||||||
|
OnCreated();
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataClasses1DataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
|
||||||
|
base(connection, mappingSource)
|
||||||
|
{
|
||||||
|
OnCreated();
|
||||||
|
}
|
||||||
|
|
||||||
|
public System.Data.Linq.Table<LoadFondiETF> LoadFondiETFs
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.GetTable<LoadFondiETF>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.LoadFondiETF")]
|
||||||
|
public partial class LoadFondiETF
|
||||||
|
{
|
||||||
|
|
||||||
|
private string _IsinCode;
|
||||||
|
|
||||||
|
private string _Name;
|
||||||
|
|
||||||
|
private string _ListingCurrency;
|
||||||
|
|
||||||
|
private string _TepiloraCategory;
|
||||||
|
|
||||||
|
private string _TepiloraType;
|
||||||
|
|
||||||
|
private string _TepiloraCurrencyExposure;
|
||||||
|
|
||||||
|
private string _TepiloraCurrencyHedging;
|
||||||
|
|
||||||
|
private System.Nullable<System.DateTime> _InceptionDate;
|
||||||
|
|
||||||
|
private System.Nullable<double> _OngoingFees;
|
||||||
|
|
||||||
|
private System.Nullable<double> _TER;
|
||||||
|
|
||||||
|
private System.Nullable<double> _TotalAssetValue;
|
||||||
|
|
||||||
|
private string _DistributionPolicy;
|
||||||
|
|
||||||
|
private System.Nullable<int> _LowerFees;
|
||||||
|
|
||||||
|
private System.Nullable<double> _TMonthlyReturns;
|
||||||
|
|
||||||
|
private System.Nullable<double> _TMonthlyVolatility;
|
||||||
|
|
||||||
|
private System.Nullable<double> _TRDD;
|
||||||
|
|
||||||
|
private System.Nullable<double> _FinalRating;
|
||||||
|
|
||||||
|
private System.Nullable<System.DateTime> _DataIns;
|
||||||
|
|
||||||
|
private string _TepiloraCode;
|
||||||
|
|
||||||
|
private string _MorningStarCategory;
|
||||||
|
|
||||||
|
private string _MorningstarCode;
|
||||||
|
|
||||||
|
public LoadFondiETF()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsinCode", DbType="VarChar(50)")]
|
||||||
|
public string IsinCode
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._IsinCode;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._IsinCode != value))
|
||||||
|
{
|
||||||
|
this._IsinCode = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="VarChar(500)")]
|
||||||
|
public string Name
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._Name;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._Name != value))
|
||||||
|
{
|
||||||
|
this._Name = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ListingCurrency", DbType="VarChar(10)")]
|
||||||
|
public string ListingCurrency
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._ListingCurrency;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._ListingCurrency != value))
|
||||||
|
{
|
||||||
|
this._ListingCurrency = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TepiloraCategory", DbType="VarChar(500)")]
|
||||||
|
public string TepiloraCategory
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._TepiloraCategory;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._TepiloraCategory != value))
|
||||||
|
{
|
||||||
|
this._TepiloraCategory = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TepiloraType", DbType="VarChar(50)")]
|
||||||
|
public string TepiloraType
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._TepiloraType;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._TepiloraType != value))
|
||||||
|
{
|
||||||
|
this._TepiloraType = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TepiloraCurrencyExposure", DbType="VarChar(50)")]
|
||||||
|
public string TepiloraCurrencyExposure
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._TepiloraCurrencyExposure;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._TepiloraCurrencyExposure != value))
|
||||||
|
{
|
||||||
|
this._TepiloraCurrencyExposure = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TepiloraCurrencyHedging", DbType="VarChar(50)")]
|
||||||
|
public string TepiloraCurrencyHedging
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._TepiloraCurrencyHedging;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._TepiloraCurrencyHedging != value))
|
||||||
|
{
|
||||||
|
this._TepiloraCurrencyHedging = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InceptionDate", DbType="DateTime")]
|
||||||
|
public System.Nullable<System.DateTime> InceptionDate
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._InceptionDate;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._InceptionDate != value))
|
||||||
|
{
|
||||||
|
this._InceptionDate = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OngoingFees", DbType="Float")]
|
||||||
|
public System.Nullable<double> OngoingFees
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._OngoingFees;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._OngoingFees != value))
|
||||||
|
{
|
||||||
|
this._OngoingFees = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TER", DbType="Float")]
|
||||||
|
public System.Nullable<double> TER
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._TER;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._TER != value))
|
||||||
|
{
|
||||||
|
this._TER = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalAssetValue", DbType="Float")]
|
||||||
|
public System.Nullable<double> TotalAssetValue
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._TotalAssetValue;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._TotalAssetValue != value))
|
||||||
|
{
|
||||||
|
this._TotalAssetValue = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DistributionPolicy", DbType="VarChar(50)")]
|
||||||
|
public string DistributionPolicy
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._DistributionPolicy;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._DistributionPolicy != value))
|
||||||
|
{
|
||||||
|
this._DistributionPolicy = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LowerFees", DbType="Int")]
|
||||||
|
public System.Nullable<int> LowerFees
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._LowerFees;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._LowerFees != value))
|
||||||
|
{
|
||||||
|
this._LowerFees = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TMonthlyReturns", DbType="Float")]
|
||||||
|
public System.Nullable<double> TMonthlyReturns
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._TMonthlyReturns;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._TMonthlyReturns != value))
|
||||||
|
{
|
||||||
|
this._TMonthlyReturns = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TMonthlyVolatility", DbType="Float")]
|
||||||
|
public System.Nullable<double> TMonthlyVolatility
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._TMonthlyVolatility;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._TMonthlyVolatility != value))
|
||||||
|
{
|
||||||
|
this._TMonthlyVolatility = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TRDD", DbType="Float")]
|
||||||
|
public System.Nullable<double> TRDD
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._TRDD;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._TRDD != value))
|
||||||
|
{
|
||||||
|
this._TRDD = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FinalRating", DbType="Float")]
|
||||||
|
public System.Nullable<double> FinalRating
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._FinalRating;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._FinalRating != value))
|
||||||
|
{
|
||||||
|
this._FinalRating = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DataIns", DbType="Date")]
|
||||||
|
public System.Nullable<System.DateTime> DataIns
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._DataIns;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._DataIns != value))
|
||||||
|
{
|
||||||
|
this._DataIns = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TepiloraCode", DbType="VarChar(50)")]
|
||||||
|
public string TepiloraCode
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._TepiloraCode;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._TepiloraCode != value))
|
||||||
|
{
|
||||||
|
this._TepiloraCode = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MorningStarCategory", DbType="VarChar(100)")]
|
||||||
|
public string MorningStarCategory
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._MorningStarCategory;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._MorningStarCategory != value))
|
||||||
|
{
|
||||||
|
this._MorningStarCategory = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MorningstarCode", DbType="VarChar(100)")]
|
||||||
|
public string MorningstarCode
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this._MorningstarCode;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ((this._MorningstarCode != value))
|
||||||
|
{
|
||||||
|
this._MorningstarCode = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#pragma warning restore 1591
|
||||||
212
OlympiaIntranet/Default.aspx
Normal file
@@ -0,0 +1,212 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="OlympiaIntranet.Default" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="icon" type="image/png" href="Images/icons/favicon.ico" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="fonts/Linearicons-Free-v1.0.0/icon-font.min.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="vendor/animate/animate.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="vendor/css-hamburgers/hamburgers.min.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="vendor/animsition/css/animsition.min.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="vendor/daterangepicker/daterangepicker.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/util.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/main.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<style type="text/css">
|
||||||
|
.auto-style1 {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.auto-style2 {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="limiter">
|
||||||
|
<div class="col d-flex align-items-center justify-content-center">
|
||||||
|
<img src="Images/logo_sito.jpg" class="img-fluid" alt="Responsive image" />
|
||||||
|
</div>
|
||||||
|
<form runat="server">
|
||||||
|
<div class="auto-style2">
|
||||||
|
<asp:LoginView ID="LoginView2" runat="server">
|
||||||
|
<AnonymousTemplate>
|
||||||
|
<asp:Label ID="Label2" runat="server" Font-Names="Calibri" Text="utente non loggato "></asp:Label>
|
||||||
|
<asp:Image ID="Image2" runat="server" ImageUrl="~/Images/lock_open.png" />
|
||||||
|
</AnonymousTemplate>
|
||||||
|
<LoggedInTemplate>
|
||||||
|
<asp:Label ID="Label2" runat="server" Text="loggato come "></asp:Label>
|
||||||
|
<asp:LoginName ID="LoginName1" runat="server" Font-Bold="True" />
|
||||||
|
<asp:Image ID="Image2" runat="server" ImageUrl="~/Images/lock.png" />
|
||||||
|
<br />
|
||||||
|
<asp:LinkButton ID="lbLogout" runat="server" OnClick="lbLogout_Click">Logout</asp:LinkButton>
|
||||||
|
</LoggedInTemplate>
|
||||||
|
</asp:LoginView>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<hr />
|
||||||
|
<div class="container-login100">
|
||||||
|
<div class="wrap-login100 p-t-0 p-b-600">
|
||||||
|
<div class="row">
|
||||||
|
<%-- <div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/" class="login-form-topmenu" role="button" runat="server">Back Office</a>
|
||||||
|
</div>--%>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/" class="login-form-topmenu" role="button" runat="server">Middle Office</a>
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/" class="login-form-topmenu" role="button" runat="server">Risk</a>
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/" class="login-form-topmenu" role="button" runat="server">Pianificazione</a>
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/" class="login-form-topmenu" role="button" runat="server">Comparatore</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<%-- <div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="https://www.olympia-wealth.net/backoffice/" target="_blank" class="login100-form-btn" role="button" runat="server">Anagrafiche</a>
|
||||||
|
</div>--%>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/MSReset.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">CFD Morgan Stanley</a>
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/ElencoProxy.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Elenco Proxy</a>
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/AUM.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">AUM</a>
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/Fondi.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Ranking Fondi</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<%-- <div class="col container-login100-form-btn m-t-20">
|
||||||
|
</div>--%>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/ElencoTitoli.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Elenco Titoli</a>
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/EsposizioneCertificati.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Esposizione Certificati</a>
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/SelettoreFondiETF.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Selettore Fondi ed ETF</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<%-- <div class="col container-login100-form-btn m-t-20">
|
||||||
|
</div>--%>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/Margini.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Margini e Derivati</a>
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/EsposizioneTitoli.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Esposizione Titoli</a>
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<%-- <div class="col container-login100-form-btn m-t-20">
|
||||||
|
</div>--%>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/OrdiniFondiUBS.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Ordini Fondi UBS</a>
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/VaR.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">VaR Titoli/Portafogli</a>
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<%-- <div class="col container-login100-form-btn m-t-20">
|
||||||
|
</div>--%>
|
||||||
|
<%-- <div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/Fondi.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Ranking Fondi</a>
|
||||||
|
</div>--%>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/ReportAllFunds.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Report AllFunds</a>
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/MonitorVaR.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Monitor VaR</a>
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<%-- <div class="col container-login100-form-btn m-t-20">
|
||||||
|
</div>--%>
|
||||||
|
<%-- <div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/ReportAllFunds.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Report AllFunds</a>
|
||||||
|
</div>--%>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
<a href="~/Reconciliator.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Reconciliator</a>
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%-- <div class="row">
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
</div>
|
||||||
|
<div class="col container-login100-form-btn m-t-20">
|
||||||
|
</div>
|
||||||
|
</div>--%>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="dropDownSelect1"></div>
|
||||||
|
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="vendor/animsition/js/animsition.min.js"></script>
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="vendor/bootstrap/js/popper.js"></script>
|
||||||
|
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="vendor/select2/select2.min.js"></script>
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="vendor/daterangepicker/moment.min.js"></script>
|
||||||
|
<script src="vendor/daterangepicker/daterangepicker.js"></script>
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="vendor/countdowntime/countdowntime.js"></script>
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="js/main.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
28
OlympiaIntranet/Default.aspx.cs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class Default : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (User.Identity.IsAuthenticated == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void lbLogout_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var AuthenticationManager = HttpContext.Current.GetOwinContext().Authentication;
|
||||||
|
AuthenticationManager.SignOut();
|
||||||
|
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
24
OlympiaIntranet/Default.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet {
|
||||||
|
|
||||||
|
|
||||||
|
public partial class Default {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// LoginView2 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.LoginView LoginView2;
|
||||||
|
}
|
||||||
|
}
|
||||||
446
OlympiaIntranet/Default2.aspx
Normal file
@@ -0,0 +1,446 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default2.aspx.cs" Inherits="OlympiaIntranet.Default2" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="icon" type="image/png" href="Images/icons/favicon.ico" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="fonts/Linearicons-Free-v1.0.0/icon-font.min.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="vendor/animate/animate.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="vendor/css-hamburgers/hamburgers.min.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="vendor/animsition/css/animsition.min.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="vendor/daterangepicker/daterangepicker.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/util.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/main.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<style type="text/css">
|
||||||
|
.auto-style1 {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.auto-style2 {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
/* centrare nella pagina AspxFormLayout : https://supportcenter.devexpress.com/ticket/details/t190995/how-to-align-all-controls-at-the-center-of-a-page */
|
||||||
|
.centered {
|
||||||
|
margin: 0 auto;
|
||||||
|
float: none !important;
|
||||||
|
display: table;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Allineare al centro caption group header: https://supportcenter.devexpress.com/ticket/details/t582642/formlayout-how-to-center-align-a-groupbox-caption-horizontally */
|
||||||
|
.groupheaderLevel1 {
|
||||||
|
position: relative;
|
||||||
|
left: 50% !important;
|
||||||
|
-webkit-transform: translateX(-50%);
|
||||||
|
transform: translateX(-50%);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="limiter">
|
||||||
|
<div class="col d-flex align-items-center justify-content-center">
|
||||||
|
<img src="Images/logo_sito.jpg" class="img-fluid" alt="Responsive image" />
|
||||||
|
</div>
|
||||||
|
<form runat="server">
|
||||||
|
<div class="auto-style2">
|
||||||
|
<asp:LoginView ID="LoginView2" runat="server">
|
||||||
|
<AnonymousTemplate>
|
||||||
|
<asp:Label ID="Label2" runat="server" Font-Names="Calibri" Text="utente non loggato "></asp:Label>
|
||||||
|
<asp:Image ID="Image2" runat="server" ImageUrl="~/Images/lock_open.png" />
|
||||||
|
</AnonymousTemplate>
|
||||||
|
<LoggedInTemplate>
|
||||||
|
<asp:Label ID="Label2" runat="server" Text="loggato come "></asp:Label>
|
||||||
|
<asp:LoginName ID="LoginName1" runat="server" Font-Bold="True" />
|
||||||
|
<asp:Image ID="Image2" runat="server" ImageUrl="~/Images/lock.png" />
|
||||||
|
<br />
|
||||||
|
<asp:LinkButton ID="lbLogout" runat="server" OnClick="lbLogout_Click">Logout</asp:LinkButton>
|
||||||
|
</LoggedInTemplate>
|
||||||
|
</asp:LoginView>
|
||||||
|
</div>
|
||||||
|
<hr />
|
||||||
|
<dx:ASPxFormLayout ID="menuFormLayout" runat="server" EnableTheming="True" Theme="Aqua" ColCount="7" ColumnCount="7" CssClass="centered">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutGroup Caption="" ColCount="1" ColSpan="1" GroupBoxDecoration="None" HorizontalAlign="Center">
|
||||||
|
<GroupBoxStyle>
|
||||||
|
<Caption Font-Size="Larger" CssClass="groupheaderLevel1">
|
||||||
|
</Caption>
|
||||||
|
</GroupBoxStyle>
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/" class="login-form-topmenu" role="button" runat="server">MIDDLE OFFICE</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/MSReset.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">CFD Morgan Stanley</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/ElencoTitoli.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Elenco Titoli</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/Margini.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Margini e Derivati</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<%-- <dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/OrdiniFondiUBS.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Ordini Fondi UBS</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>--%>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/CapienzaOrdiniSella.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Capienza Ordini Fondi Sella</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/ReportAllFunds.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Report AllFunds</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/Reconciliator.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Reconciliator</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
<dx:LayoutGroup Caption="" ColCount="1" ColSpan="1" GroupBoxDecoration="None" HorizontalAlign="Center">
|
||||||
|
<GroupBoxStyle>
|
||||||
|
<Caption Font-Size="Larger" CssClass="groupheaderLevel1">
|
||||||
|
</Caption>
|
||||||
|
</GroupBoxStyle>
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/" class="login-form-topmenu" role="button" runat="server">RISK</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/ElencoProxy.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Elenco Proxy</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/RicercaSottostanti.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Ricerca Sottostanti</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/EsposizioneCertificati.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Esposizione Certificati</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/EsposizioneTitoli.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Esposizione Titoli</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/LimitiUcits.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">LIMITI UCITS 5/40-10</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/VaR.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">VaR Titoli/Portafogli</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/MonitorVaR.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Monitor VaR</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
<dx:LayoutGroup Caption="" ColCount="1" ColSpan="1" GroupBoxDecoration="None" HorizontalAlign="Center">
|
||||||
|
<GroupBoxStyle>
|
||||||
|
<Caption Font-Size="Larger" CssClass="groupheaderLevel1">
|
||||||
|
</Caption>
|
||||||
|
</GroupBoxStyle>
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/" class="login-form-topmenu" role="button" runat="server">COMPLIANCE</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/DashboardControlli.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Dashboard Controlli</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
<dx:LayoutGroup Caption="" ColCount="1" ColSpan="1" GroupBoxDecoration="None" HorizontalAlign="Center">
|
||||||
|
<GroupBoxStyle>
|
||||||
|
<Caption Font-Size="Larger" CssClass="groupheaderLevel1">
|
||||||
|
</Caption>
|
||||||
|
</GroupBoxStyle>
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/" class="login-form-topmenu" role="button" runat="server">PIANIFICAZIONE</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/AUM.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">AUM</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/AndamentoRaccolta.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Andamento Raccolta</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/VerificheAML.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Verifiche AML</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
<dx:LayoutGroup Caption="" ColCount="1" ColSpan="1" GroupBoxDecoration="None" HorizontalAlign="Center">
|
||||||
|
<GroupBoxStyle>
|
||||||
|
<Caption Font-Size="Larger" CssClass="groupheaderLevel1">
|
||||||
|
</Caption>
|
||||||
|
</GroupBoxStyle>
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/" class="login-form-topmenu" role="button" runat="server">PORTFOLIO MANAGEMENT</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/LimitiViolati.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Limiti Violati</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/ScostamentoPerformance.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Scostamenti Performance</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/Performance1Day.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Performance 1 Day</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/PerformanceYTDLinee.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Performance YTD Linee</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/GPMAssetAllocation.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">GPM Asset Allocation</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/GPMDispRendRisk.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">GPM Disp Risk/Rend</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<%-- <dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/Fondi.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Ranking Fondi</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>--%>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/RankingBreveTermineFondiETF.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Ranking breve termine Fondi ed ETF</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/SelettoreFondiETF.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Selettore Fondi ed ETF</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<div class="col container-login100-form-btn m-t-10">
|
||||||
|
<a href="~/SelettoreCertificati.aspx" target="_blank" class="login100-form-btn" role="button" runat="server">Selettore Certificati</a>
|
||||||
|
</div>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxFormLayout>
|
||||||
|
</form>
|
||||||
|
<hr />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="dropDownSelect1"></div>
|
||||||
|
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="vendor/animsition/js/animsition.min.js"></script>
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="vendor/bootstrap/js/popper.js"></script>
|
||||||
|
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="vendor/select2/select2.min.js"></script>
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="vendor/daterangepicker/moment.min.js"></script>
|
||||||
|
<script src="vendor/daterangepicker/daterangepicker.js"></script>
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="vendor/countdowntime/countdowntime.js"></script>
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="js/main.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
||||||
29
OlympiaIntranet/Default2.aspx.cs
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class Default2 : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//if (User.Identity.IsAuthenticated == false || User.Identity.Name == "external")
|
||||||
|
if (User.Identity.IsAuthenticated == false) // [30-08-2024]: Rimossa utenza external su richiesta di Fede
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void lbLogout_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var AuthenticationManager = HttpContext.Current.GetOwinContext().Authentication;
|
||||||
|
AuthenticationManager.SignOut();
|
||||||
|
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
33
OlympiaIntranet/Default2.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet {
|
||||||
|
|
||||||
|
|
||||||
|
public partial class Default2 {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// LoginView2 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.LoginView LoginView2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// menuFormLayout control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxFormLayout menuFormLayout;
|
||||||
|
}
|
||||||
|
}
|
||||||
102
OlympiaIntranet/ElencoProxy.aspx
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ElencoProxy.aspx.cs" Inherits="OlympiaIntranet.ElencoProxy" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.Bootstrap.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.Bootstrap" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<%@ Register assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web" tagprefix="dx" %>
|
||||||
|
<%--<%@ Register Src="~/MemberPages/menu.ascx" TagPrefix="mc" TagName="menuControl" %>--%>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<%-- <div>
|
||||||
|
<mc:menuControl ID="menu" runat="server" GridID="CERTIFICATESPAGE" Visible="True" />
|
||||||
|
</div>--%>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<dx:ASPxGridView ID="gvElencoProxy" runat="server" AutoGenerateColumns="False" EnableTheming="True" KeyFieldName="IDProxylist" Theme="MetropolisBlue" OnRowDeleting="gvElencoProxy_RowDeleting" OnRowInserting="gvElencoProxy_RowInserting" OnRowUpdating="gvElencoProxy_RowUpdating">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
|
||||||
|
<SettingsPager PageSize="100">
|
||||||
|
<PageSizeItemSettings Visible="True" ShowAllItem="True">
|
||||||
|
</PageSizeItemSettings>
|
||||||
|
</SettingsPager>
|
||||||
|
<Settings ShowFilterRow="True" ShowHeaderFilterButton="True" ShowFilterBar="Visible" />
|
||||||
|
<SettingsBehavior ConfirmDelete="True" />
|
||||||
|
<SettingsFilterControl ViewMode="VisualAndText">
|
||||||
|
</SettingsFilterControl>
|
||||||
|
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewCommandColumn ShowDeleteButton="True" ShowEditButton="True" ShowNewButtonInHeader="True" VisibleIndex="0">
|
||||||
|
</dx:GridViewCommandColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="IDProxylist" ReadOnly="True" VisibleIndex="1">
|
||||||
|
<EditFormSettings Visible="False" />
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_tit_originale" VisibleIndex="2">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="isin_originale" VisibleIndex="3">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="descrizione_originale" VisibleIndex="4">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_tit_proxy" VisibleIndex="5">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="isin_proxy" VisibleIndex="6">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="descrizione_proxy" VisibleIndex="7">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataDateColumn FieldName="scadenza" VisibleIndex="8">
|
||||||
|
<PropertiesDateEdit DisplayFormatString="dd/MM/yyyy" EditFormat="Custom" EditFormatString="dd/MM/yyyy">
|
||||||
|
</PropertiesDateEdit>
|
||||||
|
</dx:GridViewDataDateColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</div>
|
||||||
|
<asp:SqlDataSource ID="SqlDSProxyList" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.MySqlConnection %>" InsertCommand="INSERT INTO olympia_proxylist
|
||||||
|
([cod_tit_originale],[isin_originale] ,[descrizione_originale] ,[cod_tit_proxy] ,[isin_proxy],[descrizione_proxy],data_ins,scadenza)
|
||||||
|
VALUES
|
||||||
|
(@cod_tit_originale ,@isin_originale,@descrizione_originale,@cod_tit_proxy,@isin_proxy,@descrizione_proxy,curdate(),@scadenza)" ProviderName="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.MySqlConnection.ProviderName %>" SelectCommand="select * from olympia_proxylist" UpdateCommand=" UPDATE olympia_proxylist
|
||||||
|
SET cod_tit_originale = @cod_tit_originale,
|
||||||
|
isin_originale = @isin_originale,
|
||||||
|
descrizione_originale = @descrizione_originale,
|
||||||
|
cod_tit_proxy = @cod_tit_proxy,
|
||||||
|
isin_proxy = @isin_proxy,
|
||||||
|
descrizione_proxy = @descrizione_proxy,
|
||||||
|
data_mod=CURDATE(),
|
||||||
|
scadenza=@scadenza
|
||||||
|
WHERE IDProxylist = @IDProxylist" DeleteCommand="DELETE olympia_proxylist
|
||||||
|
WHERE IDProxylist = @IDProxylist">
|
||||||
|
<DeleteParameters>
|
||||||
|
<asp:Parameter Name="IDProxylist" Type="Int32" />
|
||||||
|
</DeleteParameters>
|
||||||
|
<InsertParameters>
|
||||||
|
<asp:Parameter Name="cod_tit_originale" Type="String" />
|
||||||
|
<asp:Parameter Name="isin_originale" Type="String" />
|
||||||
|
<asp:Parameter Name="descrizione_originale" Type="String" />
|
||||||
|
<asp:Parameter Name="cod_tit_proxy" Type="String" />
|
||||||
|
<asp:Parameter Name="isin_proxy" Type="String" />
|
||||||
|
<asp:Parameter Name="descrizione_proxy" Type="String" />
|
||||||
|
<asp:Parameter DbType="Date" Name="scadenza" />
|
||||||
|
</InsertParameters>
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
<UpdateParameters>
|
||||||
|
<asp:Parameter Name="IDProxylist" Type="Int32" />
|
||||||
|
<asp:Parameter Name="cod_tit_originale" Type="String" />
|
||||||
|
<asp:Parameter Name="isin_originale" Type="String" />
|
||||||
|
<asp:Parameter Name="descrizione_originale" Type="String" />
|
||||||
|
<asp:Parameter Name="cod_tit_proxy" Type="String" />
|
||||||
|
<asp:Parameter Name="isin_proxy" Type="String" />
|
||||||
|
<asp:Parameter Name="descrizione_proxy" Type="String" />
|
||||||
|
<asp:Parameter DbType="Date" Name="scadenza" />
|
||||||
|
</UpdateParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
177
OlympiaIntranet/ElencoProxy.aspx.cs
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
using MySqlConnector;
|
||||||
|
using System.Data;
|
||||||
|
using DevExpress.Web;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Nota : Per colpa di un bug in mySQL Connector .Net v6.10.6 non si può usare SqlDataSource e bisogna gestire le operazioni CRUD a mano! (la soluzione sarebbe di aggiornare MySql Connector all'ultima versione !)
|
||||||
|
//
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class ElencoProxy : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (HttpContext.Current.User.Identity.IsAuthenticated == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
|
||||||
|
CommonClass.SetColumnFilterContains(gvElencoProxy);
|
||||||
|
|
||||||
|
RefreshGrid();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void RefreshGrid()
|
||||||
|
{
|
||||||
|
MySqlConnection conn = new MySqlConnection(Properties.Settings.Default.mySqlConnection);
|
||||||
|
MySqlCommand cmd = conn.CreateCommand();
|
||||||
|
|
||||||
|
cmd.CommandText = "select * from olympia_proxylist";
|
||||||
|
conn.Open();
|
||||||
|
|
||||||
|
MySqlDataReader dataReader = cmd.ExecuteReader();
|
||||||
|
var dataTable = new DataTable();
|
||||||
|
dataTable.Load(dataReader);
|
||||||
|
conn.Close();
|
||||||
|
|
||||||
|
gvElencoProxy.DataSource = dataTable;
|
||||||
|
gvElencoProxy.KeyFieldName = "IDProxylist";
|
||||||
|
gvElencoProxy.DataBind();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvElencoProxy_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
|
||||||
|
{
|
||||||
|
// ref link : https://www.devexpress.com/Support/Center/Question/Details/KA18686/aspxgridview-how-to-implement-crud-operations-with-a-custom-data-source
|
||||||
|
|
||||||
|
ASPxGridView gridView = (ASPxGridView)sender;
|
||||||
|
IDictionaryEnumerator enumerator = e.NewValues.GetEnumerator();
|
||||||
|
string sqlKey = String.Empty;
|
||||||
|
string sqlValue = String.Empty;
|
||||||
|
string sql = String.Empty;
|
||||||
|
string cod_tit_originale = String.Empty;
|
||||||
|
enumerator.Reset();
|
||||||
|
int cont = 1;
|
||||||
|
while (enumerator.MoveNext())
|
||||||
|
{
|
||||||
|
|
||||||
|
if (enumerator.Key.ToString() == "cod_tit_originale") { if (enumerator.Value != null) cod_tit_originale = enumerator.Value.ToString(); }
|
||||||
|
|
||||||
|
if (cont == 7) // sono 7 i campi che salviamo : cod_tit_originale,isin_originale,descrizione_originale,cod_tit_proxy,isin_proxy,descrizione_proxy,scadenza
|
||||||
|
{
|
||||||
|
sqlKey += enumerator.Key.ToString();
|
||||||
|
if (enumerator.Value != null) sqlValue += "'" + Convert.ToDateTime(enumerator.Value).ToString("yyyy-MM-dd")+"'"; // Ultimo campo è scadenza che è una data
|
||||||
|
else sqlValue += "'2000-01-01'";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sqlKey += enumerator.Key.ToString() + ",";
|
||||||
|
if (enumerator.Value != null) sqlValue += "'" + enumerator.Value.ToString() + "',";
|
||||||
|
else sqlValue += "NULL,";
|
||||||
|
}
|
||||||
|
cont++;
|
||||||
|
}
|
||||||
|
sql = "INSERT INTO olympia_proxylist (" + sqlKey + ",data_ins) values (" + sqlValue + ",CURDATE())";
|
||||||
|
|
||||||
|
// Verifico che isin_originale non sia già presente fra le proxy, e nel caso segnalo errore e non permetto l'inserimento! (31/01/2024)
|
||||||
|
List<string> listIsinOriginale = new List<string>();
|
||||||
|
for (int i = 0; i < gvElencoProxy.VisibleRowCount; i++)
|
||||||
|
{
|
||||||
|
listIsinOriginale.Add(gvElencoProxy.GetRowValues(i, "cod_tit_originale").ToString());
|
||||||
|
}
|
||||||
|
if (listIsinOriginale.Contains(cod_tit_originale) == true)
|
||||||
|
{
|
||||||
|
e.Cancel = false;
|
||||||
|
throw new MyException($"Titolo {cod_tit_originale} già presente nelle proxy, cancellarlo oppure modificarlo!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Salva nuovo Proxy in tabella olympia_proxylist
|
||||||
|
MySqlConnection conn = new MySqlConnection(Properties.Settings.Default.mySqlConnection);
|
||||||
|
MySqlCommand cmd = conn.CreateCommand();
|
||||||
|
cmd.CommandText = sql;
|
||||||
|
conn.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
conn.Close();
|
||||||
|
|
||||||
|
gridView.CancelEdit();
|
||||||
|
e.Cancel = true;
|
||||||
|
|
||||||
|
RefreshGrid();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvElencoProxy_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
|
||||||
|
{
|
||||||
|
// ref link : https://www.devexpress.com/Support/Center/Question/Details/KA18686/aspxgridview-how-to-implement-crud-operations-with-a-custom-data-source
|
||||||
|
|
||||||
|
ASPxGridView gridView = (ASPxGridView)sender;
|
||||||
|
int ID = (int)e.Keys[0];
|
||||||
|
|
||||||
|
IDictionaryEnumerator enumerator = e.NewValues.GetEnumerator();
|
||||||
|
string sqlKeyValue = String.Empty;
|
||||||
|
string sql = String.Empty;
|
||||||
|
enumerator.Reset();
|
||||||
|
int cont = 1;
|
||||||
|
while (enumerator.MoveNext())
|
||||||
|
{
|
||||||
|
if (cont == 7) // sono 7 i campi che salviamo : cod_tit_originale,isin_originale,descrizione_originale,cod_tit_proxy,isin_proxy,descrizione_proxy,scadenza
|
||||||
|
{
|
||||||
|
if (enumerator.Value != null) sqlKeyValue += enumerator.Key.ToString()+"='" + Convert.ToDateTime(enumerator.Value).ToString("yyyy-MM-dd") + "',"; // Ultimo campo è scadenza che è una data
|
||||||
|
else sqlKeyValue += enumerator.Key.ToString() + "='2000-01-01',";
|
||||||
|
sqlKeyValue += "data_mod=CURDATE()";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (enumerator.Value != null) sqlKeyValue += enumerator.Key.ToString() + "='" + enumerator.Value.ToString() + "',";
|
||||||
|
else sqlKeyValue += enumerator.Key.ToString() + "=NULL,";
|
||||||
|
}
|
||||||
|
cont++;
|
||||||
|
}
|
||||||
|
sql = "UPDATE olympia_proxylist SET " + sqlKeyValue +" WHERE IDProxylist=" + ID;
|
||||||
|
|
||||||
|
// Salva nuovo Proxy in tabella olympia_proxylist
|
||||||
|
MySqlConnection conn = new MySqlConnection(Properties.Settings.Default.mySqlConnection);
|
||||||
|
MySqlCommand cmd = conn.CreateCommand();
|
||||||
|
cmd.CommandText = sql;
|
||||||
|
conn.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
conn.Close();
|
||||||
|
|
||||||
|
gridView.CancelEdit();
|
||||||
|
e.Cancel = true;
|
||||||
|
|
||||||
|
RefreshGrid();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvElencoProxy_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
|
||||||
|
{
|
||||||
|
// ref link : https://www.devexpress.com/Support/Center/Question/Details/KA18686/aspxgridview-how-to-implement-crud-operations-with-a-custom-data-source
|
||||||
|
|
||||||
|
ASPxGridView gridView = (ASPxGridView)sender;
|
||||||
|
int ID = (int)e.Keys[0];
|
||||||
|
|
||||||
|
string sql = String.Empty;
|
||||||
|
|
||||||
|
sql = "DELETE FROM olympia_proxylist WHERE IDProxylist=" + ID;
|
||||||
|
|
||||||
|
// Salva nuovo Proxy in tabella olympia_proxylist
|
||||||
|
MySqlConnection conn = new MySqlConnection(Properties.Settings.Default.mySqlConnection);
|
||||||
|
MySqlCommand cmd = conn.CreateCommand();
|
||||||
|
cmd.CommandText = sql;
|
||||||
|
conn.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
conn.Close();
|
||||||
|
|
||||||
|
gridView.CancelEdit();
|
||||||
|
e.Cancel = true;
|
||||||
|
|
||||||
|
RefreshGrid();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
44
OlympiaIntranet/ElencoProxy.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public partial class ElencoProxy
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvElencoProxy control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvElencoProxy;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSProxyList control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSProxyList;
|
||||||
|
}
|
||||||
|
}
|
||||||
115
OlympiaIntranet/ElencoTitoli.aspx
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ElencoTitoli.aspx.cs" Inherits="OlympiaIntranet.ElencoTitoli" %>
|
||||||
|
|
||||||
|
<%@ Register assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web" tagprefix="dx" %>
|
||||||
|
<%--<%@ Register Src="~/MemberPages/menu.ascx" TagPrefix="mc" TagName="menuControl" %>--%>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<%-- <mc:menuControl ID="menu" runat="server" GridID="CERTIFICATESPAGE" Visible="True" />--%>
|
||||||
|
<dx:ASPxButton ID="ASPxExportXls" runat="server" OnClick="ASPxExportXls_Click" Theme="Office2010Blue" ToolTip="Click to export data to excel..." Height="22px" Width="36px" Text="Esporta in Excel">
|
||||||
|
<Image IconID="export_exporttoxlsx_16x16">
|
||||||
|
</Image>
|
||||||
|
<Paddings Padding="0px" />
|
||||||
|
</dx:ASPxButton>
|
||||||
|
<dx:ASPxGridView ID="ASPxTitoliGDN" runat="server" EnableTheming="True" Theme="Office2010Blue" AutoGenerateColumns="False" KeyFieldName="CodiceTitolo">
|
||||||
|
<SettingsPager AlwaysShowPager="True" PageSize="20">
|
||||||
|
<PageSizeItemSettings ShowAllItem="True" Visible="True">
|
||||||
|
</PageSizeItemSettings>
|
||||||
|
</SettingsPager>
|
||||||
|
<Settings ShowFilterRow="True" ShowHeaderFilterButton="True" ShowFilterBar="Visible" />
|
||||||
|
<SettingsFilterControl ViewMode="VisualAndText">
|
||||||
|
</SettingsFilterControl>
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="CodiceTitolo" ReadOnly="True" VisibleIndex="0">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="ISIN" VisibleIndex="1">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="DescrizioneTitolo" VisibleIndex="2">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="DescrizioneTitoloBreve" VisibleIndex="3">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Divisa" VisibleIndex="4">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="SecurityType" VisibleIndex="5">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="TickerBBG" VisibleIndex="6">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="ETF" VisibleIndex="8">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Mercato" VisibleIndex="9">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Divisore" VisibleIndex="10">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="n0">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="TipoTitolo" VisibleIndex="11">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="DescrTipoTitolo" Caption="Descrizione Tipo Titolo" VisibleIndex="12">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="LinkPrezzi" VisibleIndex="14">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="LinkError" VisibleIndex="14">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="NewEntry" VisibleIndex="15">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="InPortafoglio" VisibleIndex="16">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Utilizzato" VisibleIndex="17">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Conflitto" VisibleIndex="18">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="UltimoPrezzo" VisibleIndex="19">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="n6">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataDateColumn FieldName="DataUltimoPrezzo" VisibleIndex="20">
|
||||||
|
<PropertiesDateEdit DisplayFormatString="dd/MM/yyyy">
|
||||||
|
</PropertiesDateEdit>
|
||||||
|
</dx:GridViewDataDateColumn>
|
||||||
|
<dx:GridViewDataComboBoxColumn FieldName="Tipo" VisibleIndex="7">
|
||||||
|
<PropertiesComboBox>
|
||||||
|
<Items>
|
||||||
|
<dx:ListEditItem Text="Certificato" Value="Certificato" />
|
||||||
|
<dx:ListEditItem Text="Fondo Azionario" Value="Fondo Azionario" />
|
||||||
|
<dx:ListEditItem Text="Fondo Bilanciato" Value="Fondo Bilanciato" />
|
||||||
|
<dx:ListEditItem Text="Fondo Monetario" Value="Fondo Monetario" />
|
||||||
|
<dx:ListEditItem Text="Fondo Obbligazionario" Value="Fondo Obbligazionario" />
|
||||||
|
</Items>
|
||||||
|
</PropertiesComboBox>
|
||||||
|
</dx:GridViewDataComboBoxColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Bloccato" VisibleIndex="12">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="nobuy" VisibleIndex="13">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Note" VisibleIndex="21">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Coordinate" VisibleIndex="22">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<asp:SqlDataSource ID="SqlDSTitoliGDN" runat="server" ConnectionString="server=192.168.125.10;user id=pegasus9x;password=Locarno_4139$;persistsecurityinfo=True;database=olympia" SelectCommand="select cod_tit as CodiceTitolo , cod_isin as ISIN , des_tit as DescrizioneTitolo, des_tit_bre as DescrizioneTitoloBreve, cod_div as Divisa, security_type as SecurityType, cod_bloomberg as TickerBBG,
|
||||||
|
CASE WHEN fondo_azi='S' THEN 'Fondo Azionario'
|
||||||
|
WHEN fondo_bil='S' THEN 'Fondo Bilanciato'
|
||||||
|
WHEN fondo_obb='S' THEN 'Fondo Obbligazionario'
|
||||||
|
WHEN fondo_mon='S' THEN 'Fondo Monetario'
|
||||||
|
WHEN certificate='S' THEN 'Certificato'
|
||||||
|
END as Tipo,
|
||||||
|
ETF, cod_mer as Mercato, divisore as Divisore, t.cod_tiptit as TipoTitolo, tt.des_tiptit AS DescrTipoTitolo, bloccato as Bloccato, noacquisti as nobuy, link_prezzi as LinkPrezzi, link_error as LinkError, new_entry as NewEntry, in_portafoglio as InPortafoglio,
|
||||||
|
utilizzato as Utilizzato, conflitto as Conflitto, prezzo_ult as UltimoPrezzo, data_ult as DataUltimoPrezzo, note as Note, coordinate from tit t left join tabtiptit tt ON tt.cod_tiptit=t.cod_tiptit where estinto is null" ProviderName="MySqlConnector"></asp:SqlDataSource>
|
||||||
|
|
||||||
|
<dx:ASPxGridViewExporter ID="ASPxGridViewExporter" runat="server" GridViewID="ASPxTitoliGDN">
|
||||||
|
</dx:ASPxGridViewExporter>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
63
OlympiaIntranet/ElencoTitoli.aspx.cs
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
using DevExpress.Export;
|
||||||
|
using DevExpress.XtraPrinting;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
using MySqlConnector;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
|
// Codice Titolo | ISIN | Descrizione Titolo | Ticker Bloomberg | Tipo titolo | Descrizione Tipo Titolo | Asset Class | Descrizione Asset Class | Flag Certificate | Mercato | Prezzo | Data Ultimo Prezzo
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class ElencoTitoli : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
string mySqlconnString = "Server=192.168.125.10;Port=3306;Database=olympia;Uid=pegasus9x;Pwd=Locarno_4139$;";
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (HttpContext.Current.User.Identity.IsAuthenticated == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setta in tutte le colonne di default ricerca per 'Contains' invece che per 'Begins with' (mettere in Page_Load altrimenti non funziona!)
|
||||||
|
CommonClass.SetColumnFilterContains(ASPxTitoliGDN);
|
||||||
|
|
||||||
|
//if (!IsPostBack)
|
||||||
|
//{
|
||||||
|
MySqlConnection conn = new MySqlConnection(mySqlconnString);
|
||||||
|
MySqlCommand cmd = conn.CreateCommand();
|
||||||
|
|
||||||
|
cmd.CommandText = "select cod_tit as CodiceTitolo , cod_isin as ISIN , des_tit as DescrizioneTitolo, des_tit_bre as DescrizioneTitoloBreve, cod_div as Divisa, security_type as SecurityType, cod_bloomberg as TickerBBG,"+
|
||||||
|
"CASE WHEN fondo_azi = 'S' THEN 'Fondo Azionario' "+
|
||||||
|
"WHEN fondo_bil = 'S' THEN 'Fondo Bilanciato' "+
|
||||||
|
"WHEN fondo_obb = 'S' THEN 'Fondo Obbligazionario' " +
|
||||||
|
"WHEN fondo_mon = 'S' THEN 'Fondo Monetario' "+
|
||||||
|
"WHEN certificate = 'S' THEN 'Certificato' "+
|
||||||
|
"END as Tipo,"+
|
||||||
|
"ETF, cod_mer as Mercato, divisore as Divisore, t.cod_tiptit as TipoTitolo, tt.des_tiptit AS DescrTipoTitolo, bloccato as Bloccato, noacquisti as nobuy, link_prezzi as LinkPrezzi, link_error as LinkError, new_entry as NewEntry, in_portafoglio as InPortafoglio," +
|
||||||
|
"utilizzato as Utilizzato, conflitto as Conflitto, prezzo_ult as UltimoPrezzo, data_ult as DataUltimoPrezzo, note as Note, coordinate as Coordinate "+
|
||||||
|
"from tit t left join tabtiptit tt ON tt.cod_tiptit=t.cod_tiptit where estinto is null";
|
||||||
|
conn.Open();
|
||||||
|
|
||||||
|
MySqlDataReader dataReader = cmd.ExecuteReader();
|
||||||
|
var dataTable = new DataTable();
|
||||||
|
dataTable.Load(dataReader);
|
||||||
|
conn.Close();
|
||||||
|
|
||||||
|
ASPxTitoliGDN.DataSource = dataTable;
|
||||||
|
ASPxTitoliGDN.DataBind();
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxExportXls_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ASPxGridViewExporter.ExportSelectedRowsOnly = false;
|
||||||
|
ASPxGridViewExporter.FileName = DateTime.Now.ToString("yyyyMMdd_HHmm") + " - Tabella Titoli Guardian";
|
||||||
|
XlsxExportOptionsEx op = new XlsxExportOptionsEx() { ExportType = ExportType.DataAware }; // in DataAware mode l'evento ASPxGridViewExporter_RenderBrick non viene eseguito!!
|
||||||
|
ASPxGridViewExporter.WriteXlsxToResponse(op);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
60
OlympiaIntranet/ElencoTitoli.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet {
|
||||||
|
|
||||||
|
|
||||||
|
public partial class ElencoTitoli {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxExportXls control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton ASPxExportXls;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxTitoliGDN control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView ASPxTitoliGDN;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSTitoliGDN control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSTitoliGDN;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxGridViewExporter control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridViewExporter ASPxGridViewExporter;
|
||||||
|
}
|
||||||
|
}
|
||||||
158
OlympiaIntranet/EsposizioneCertificati.aspx
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EsposizioneCertificati.aspx.cs" Inherits="OlympiaIntranet.EsposizioneCertificati" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.XtraCharts.v23.2.Web, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.XtraCharts.Web" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.XtraCharts.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.XtraCharts" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
<style>
|
||||||
|
/*.center {
|
||||||
|
margin: auto;
|
||||||
|
width: 50%;
|
||||||
|
padding: 6px 5px;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
html {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
display: flex;
|
||||||
|
/*justify-content: center;
|
||||||
|
align-items: center;*/
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<div>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="Portafoglio" Theme="DevEx">
|
||||||
|
</dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel29" runat="server" Width="10px"></dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="txtPortafoglio" runat="server" Theme="DevEx" Width="170px" CssClass="height">
|
||||||
|
</dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel1" runat="server" Width="10px"></dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxButton ID="btnCaricaDati" runat="server" Theme="DevEx" OnClick="btnCaricaDati_Click" CssClass="height">
|
||||||
|
<Image IconID="arrows_next_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel2" runat="server" Width="10px"></dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxButton ID="btnEsportaExcel" runat="server" Theme="DevEx" CssClass="height" OnClick="btnEsportaExcel_Click">
|
||||||
|
<Image IconID="export_exporttoxlsx_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel3" runat="server" Width="10px"></dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxButton ID="btnEsportaPdf" runat="server" Theme="DevEx" CssClass="height" OnClick="btnEsportaPdf_Click">
|
||||||
|
<Image IconID="export_exporttopdf_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxGridView ID="gvEsposizioneCertificati" runat="server" Theme="DevEx" DataSourceID="SqlDSEsposizioneCertificati" ClientInstanceName="clientEsposizioneCertificati" OnCustomErrorText="gvEsposizioneCertificati_CustomErrorText" Width="400px" Style="margin-right: 2px" AutoGenerateColumns="False">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<SettingsPager PageSize="30" Mode="ShowAllRecords" Visible="False">
|
||||||
|
<PageSizeItemSettings ShowAllItem="True">
|
||||||
|
</PageSizeItemSettings>
|
||||||
|
</SettingsPager>
|
||||||
|
<Settings ShowFilterRow="True" VerticalScrollableHeight="523" VerticalScrollBarMode="Visible" /> <%--messo a 523 per arrivare a 600px (523px grafico + 77px height header)--%>
|
||||||
|
<SettingsDataSecurity AllowDelete="False" AllowEdit="False" AllowInsert="False" />
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewCommandColumn ShowClearFilterButton="True" Visible="False" VisibleIndex="0">
|
||||||
|
</dx:GridViewCommandColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="ISIN" ReadOnly="True" VisibleIndex="1">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Descrizione" ReadOnly="True" VisibleIndex="2">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewBandColumn Caption="Olympia" Name="Olympia" VisibleIndex="5">
|
||||||
|
<HeaderStyle HorizontalAlign="Center" />
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn Caption="CTV" FieldName="CTV_OLY" ReadOnly="True" VisibleIndex="0">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="N2">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Esposizione" FieldName="Esp_OLY" ReadOnly="True" VisibleIndex="1">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="P2">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:GridViewBandColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:WebChartControl ID="chart" runat="server" CrosshairEnabled="True" Height="600px" Width="800px" DataSourceID="SqlDSEsposizioneCertificatiTOP10">
|
||||||
|
<BorderOptions Visibility="False" />
|
||||||
|
<Legend Name="Default Legend" AlignmentHorizontal="Left" AlignmentVertical="BottomOutside" Direction="LeftToRight" Visibility="False"></Legend>
|
||||||
|
<SeriesSerializable>
|
||||||
|
<dx:Series ArgumentDataMember="Descrizione" LabelsVisibility="True" LegendName="Default Legend" LegendTextPattern="{A}" Name="Series 1" ValueDataMembersSerializable="Esp_OLY">
|
||||||
|
<ViewSerializable>
|
||||||
|
<dx:PieSeriesView>
|
||||||
|
</dx:PieSeriesView>
|
||||||
|
</ViewSerializable>
|
||||||
|
<LabelSerializable>
|
||||||
|
<dx:PieSeriesLabel Position="Outside" ColumnIndent="20" TextColor="Black" BackColor="Transparent" Font="Tahoma, 8pt, style=Bold" TextPattern="{A} {V:0.00%}">
|
||||||
|
<Border Visibility="False"></Border>
|
||||||
|
</dx:PieSeriesLabel>
|
||||||
|
</LabelSerializable>
|
||||||
|
</dx:Series>
|
||||||
|
</SeriesSerializable>
|
||||||
|
<SeriesTemplate ArgumentDataMember="Descrizione" ValueDataMembersSerializable="Esp_OLY">
|
||||||
|
</SeriesTemplate>
|
||||||
|
</dx:WebChartControl>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<asp:SqlDataSource ID="SqlDSEsposizioneCertificati" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_EsposizioneCertificati" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="cod_rap" SessionField="cod_rap" />
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSEsposizioneCertificatiTOP10" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_EsposizioneCertificatiTOP10" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="cod_rap" SessionField="cod_rap" />
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<dx:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="gvEsposizioneCertificati">
|
||||||
|
</dx:ASPxGridViewExporter>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
116
OlympiaIntranet/EsposizioneCertificati.aspx.cs
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
using DevExpress.Export;
|
||||||
|
using DevExpress.Web;
|
||||||
|
using DevExpress.XtraCharts.Native;
|
||||||
|
using DevExpress.XtraPrinting;
|
||||||
|
using PdfSharp.Pdf;
|
||||||
|
using PdfSharp.Pdf.IO;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class EsposizioneCertificati : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (HttpContext.Current.User.Identity.IsAuthenticated == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void btnCaricaDati_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Session["cod_rap"] = txtPortafoglio.Text;
|
||||||
|
|
||||||
|
gvEsposizioneCertificati.DataBind();
|
||||||
|
|
||||||
|
if (gvEsposizioneCertificati.VisibleRowCount == 0)
|
||||||
|
{
|
||||||
|
CommonClass.MessageBox(this, "Consultare la posizione in Guardian e ripetere la richiesta!");
|
||||||
|
// throw new MyException("Consultare la posizione in Guardian e ripetere la richiesta!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected void btnEsportaExcel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ASPxGridViewExporter1.ExportSelectedRowsOnly = false;
|
||||||
|
ASPxGridViewExporter1.FileName = DateTime.Now.ToString("yyyyMMdd_HHmm") + " - Esposizione Certificati";
|
||||||
|
XlsxExportOptionsEx op = new XlsxExportOptionsEx() { ExportType = ExportType.WYSIWYG };
|
||||||
|
ASPxGridViewExporter1.WriteXlsxToResponse(op);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvEsposizioneCertificati_CustomErrorText(object sender, ASPxGridViewCustomErrorTextEventArgs e)
|
||||||
|
{
|
||||||
|
// https://supportcenter.devexpress.com/ticket/details/e59/how-to-show-an-error-message-when-a-record-cannot-be-deleted
|
||||||
|
if (e.Exception is MyException) e.ErrorText = e.Exception.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void btnEsportaPdf_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Crea pdf di gvEsposizioneCertificati
|
||||||
|
string gridFileName = DateTime.Now.ToString("yyyyMMdd_HHmm") + " - grid.pdf";
|
||||||
|
using (System.IO.FileStream output = new System.IO.FileStream(Server.MapPath(@"~/App_Data/UploadTemp/" +gridFileName), FileMode.Create))
|
||||||
|
{
|
||||||
|
gvEsposizioneCertificati.ExportToPdf(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Crea pdf del grafico
|
||||||
|
string chartFileName = DateTime.Now.ToString("yyyyMMdd_HHmm") + " - chart.pdf";
|
||||||
|
chart.DataBind();
|
||||||
|
|
||||||
|
// Esporta grafico in pdf in landscape
|
||||||
|
var ps = new PrintingSystem();
|
||||||
|
ps.PageSettings.Landscape = true;
|
||||||
|
var link1 = new PrintableComponentLink();
|
||||||
|
chart.DataBind();
|
||||||
|
link1.Component = ((IChartContainer)chart).Chart;
|
||||||
|
link1.Landscape = true;
|
||||||
|
//link1.PaperKind = System.Drawing.Printing.PaperKind.A4Extra;
|
||||||
|
//((Chart)link1.Component).OptionsPrint.SizeMode = DevExpress.XtraCharts.Printing.PrintSizeMode.Zoom;
|
||||||
|
link1.PrintingSystem = ps;
|
||||||
|
link1.CreateDocument();
|
||||||
|
ps.Document.AutoFitToPagesWidth = 1; // Fit to page
|
||||||
|
ps.Document.ScaleFactor = 0.95F;
|
||||||
|
using (FileStream stream = new FileStream(Server.MapPath(@"~/App_Data/UploadTemp/" + chartFileName), FileMode.Create))
|
||||||
|
{
|
||||||
|
link1.PrintingSystem.ExportToPdf(stream);
|
||||||
|
}
|
||||||
|
ps.Dispose();
|
||||||
|
|
||||||
|
// Unisce i pdf della griglia e del grafico
|
||||||
|
string finalPdfFinalName = DateTime.Now.ToString("yyyyMMdd_HHmm") + " - EsposizioneCertificati.pdf";
|
||||||
|
PdfDocument one = new PdfDocument();
|
||||||
|
one = PdfReader.Open(Server.MapPath(@"~/App_Data/UploadTemp/" + gridFileName), PdfDocumentOpenMode.Import); // pdf griglia
|
||||||
|
PdfDocument two = new PdfDocument();
|
||||||
|
two = PdfReader.Open(Server.MapPath(@"~/App_Data/UploadTemp/" + chartFileName), PdfDocumentOpenMode.Import); // pdf grafico
|
||||||
|
PdfDocument three = new PdfDocument();
|
||||||
|
using (PdfDocument outPdf = new PdfDocument())
|
||||||
|
{
|
||||||
|
CommonClass.CopyPages(one, outPdf);
|
||||||
|
CommonClass.CopyPages(two, outPdf);
|
||||||
|
outPdf.Save(Server.MapPath(@"~/App_Data/UploadTemp/" + finalPdfFinalName));
|
||||||
|
}
|
||||||
|
File.Delete(Server.MapPath(@"~/App_Data/UploadTemp/" + gridFileName));
|
||||||
|
File.Delete(Server.MapPath(@"~/App_Data/UploadTemp/" + chartFileName));
|
||||||
|
|
||||||
|
// Restituisce pdf finale da scaricare
|
||||||
|
byte[] bytePDF = System.IO.File.ReadAllBytes(Server.MapPath(@"~/App_Data/UploadTemp/" + finalPdfFinalName));
|
||||||
|
|
||||||
|
// Restituisce pdf
|
||||||
|
Response.Clear();
|
||||||
|
Response.ContentType = "application/pdf";
|
||||||
|
Response.AddHeader("Content-Disposition", $"attachment; filename={finalPdfFinalName}");
|
||||||
|
Response.BinaryWrite(bytePDF);
|
||||||
|
Response.Flush();
|
||||||
|
Response.End();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
150
OlympiaIntranet/EsposizioneCertificati.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet {
|
||||||
|
|
||||||
|
|
||||||
|
public partial class EsposizioneCertificati {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel29 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel29;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtPortafoglio control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox txtPortafoglio;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnCaricaDati control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton btnCaricaDati;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel2 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnEsportaExcel control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton btnEsportaExcel;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel3 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel3;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnEsportaPdf control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton btnEsportaPdf;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvEsposizioneCertificati control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvEsposizioneCertificati;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// chart control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.XtraCharts.Web.WebChartControl chart;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSEsposizioneCertificati control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSEsposizioneCertificati;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSEsposizioneCertificatiTOP10 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSEsposizioneCertificatiTOP10;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxGridViewExporter1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridViewExporter ASPxGridViewExporter1;
|
||||||
|
}
|
||||||
|
}
|
||||||
245
OlympiaIntranet/EsposizioneTitoli.aspx
Normal file
@@ -0,0 +1,245 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EsposizioneTitoli.aspx.cs" Inherits="OlympiaIntranet.EsposizioneTitoli" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<!-- Bootstrap CSS -->
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous" />
|
||||||
|
|
||||||
|
<title></title>
|
||||||
|
<script>
|
||||||
|
function OnFirstEndCallback(s, e) {
|
||||||
|
|
||||||
|
// azzera eventuale selezione in gridLookupLinea
|
||||||
|
clientgridLookupLinea.SetValue(null);
|
||||||
|
|
||||||
|
// azzera eventuale selezione in gridLookupConsulente
|
||||||
|
clientgridLookupConsulente.SetValue(null);
|
||||||
|
}
|
||||||
|
//function onShowPopup1(tepiloraText, morningstarText, popupHeaderText) {
|
||||||
|
// lblTepilora.SetText(tepiloraText);
|
||||||
|
// lblMorningstar.SetText(morningstarText);
|
||||||
|
// //popup.SetHeaderText(popupHeaderText); non metto titolo al popup
|
||||||
|
// popup.Show();
|
||||||
|
//}
|
||||||
|
//function onHidePopup() {
|
||||||
|
// popup.Hide();
|
||||||
|
//}
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
.row {
|
||||||
|
display: flex;
|
||||||
|
margin-left: -5px;
|
||||||
|
margin-right: -5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.column {
|
||||||
|
flex: 50%;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
<dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server" ColCount="2" EnableTheming="True" Theme="Aqua" ColumnCount="2">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutGroup Caption="Filtri Selezione" ColSpan="1" ColCount="6" ColumnCount="6">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxRadioButtonList ID="rgFiltriRanking" runat="server" RepeatDirection="Horizontal" SelectedIndex="0" ValueType="System.Int32">
|
||||||
|
<Items>
|
||||||
|
<dx:ListEditItem Selected="True" Text="Titoli con ranking" Value="0" />
|
||||||
|
<dx:ListEditItem Text="Titoli senza ranking" Value="1" />
|
||||||
|
<dx:ListEditItem Text="Tutti i titoli" Value="2" />
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxRadioButtonList>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Gestore" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="gridLookupGestore" runat="server" DataSourceID="SqlDSGestori" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Gestore" OnValueChanged="gridLookupGestore_ValueChanged" TextFormatString="{0}" Theme="Aqua">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
<ClientSideEvents EndCallback="OnFirstEndCallback" />
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Consulente" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="gridLookupConsulente" runat="server" ClientInstanceName="clientgridLookupConsulente" DataSourceID="SqlDSConsulenti" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Consulente" TextFormatString="{0}" Theme="Aqua">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Linea di Gestione" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="gridLookupLinea" runat="server" ClientInstanceName="clientgridLookupLinea" DataSourceID="SqlDSLinee" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Linea" TextFormatString="{0}" Theme="Aqua">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="buttonEsposizioneTitoli" runat="server" OnClick="buttonEsposizioneTitoli_Click" Theme="Aqua">
|
||||||
|
<Image IconID="grid_grid_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="buttonEsportaExcel" runat="server" OnClick="buttonEsportaExcel_Click" Theme="Aqua">
|
||||||
|
<Image IconID="export_exporttoxls_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxFormLayout>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPageControl ID="ASPxPageControl2" runat="server" ActiveTabIndex="0" EnableTheming="True" Theme="Aqua">
|
||||||
|
<TabPages>
|
||||||
|
<dx:TabPage Name="Esposizione Titoli" Text="Esposizione Titoli">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<dx:ASPxGridView ID="gvEsposizioneTitoli" runat="server" Theme="Aqua" OnHtmlDataCellPrepared="gvEsposizioneTitoli_HtmlDataCellPrepared" OnHtmlRowPrepared="gvEsposizioneTitoli_HtmlRowPrepared">
|
||||||
|
<SettingsPager PageSize="20" Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
<SettingsDataSecurity AllowDelete="False" AllowEdit="False" AllowInsert="False" />
|
||||||
|
<SettingsSearchPanel Visible="True" />
|
||||||
|
<Templates>
|
||||||
|
<GroupRowContent>
|
||||||
|
<%# Eval("Titolo").ToString() %>
|
||||||
|
<dx:ASPxButton ID="btnRankingTitoli" runat="server" OnClick="btnRankingTitoli_Click" Theme="Aqua" AutoPostBack="false">
|
||||||
|
<Image Url="Images/list.png">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</GroupRowContent>
|
||||||
|
</Templates>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
<dx:ASPxPopupControl ID="ASPxPopupControl1" runat="server" ClientInstanceName="popup" ShowHeader="true" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" HeaderText="">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:PopupControlContentControl runat="server">
|
||||||
|
<dx:ASPxPageControl ID="ASPxPageControl1" runat="server" ActiveTabIndex="0" EnableTheming="True" Theme="Aqua">
|
||||||
|
<TabPages>
|
||||||
|
<%-- <dx:TabPage Name="Ranking Tepilora" Text="Ranking Tepilora">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<dx:ASPxLabel ID="ASPxlblTepilora" runat="server" Text="" ClientInstanceName="lblTepilora">
|
||||||
|
</dx:ASPxLabel>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>--%>
|
||||||
|
<dx:TabPage Name="Ranking MorningStar" Text="Ranking MorningStar">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<dx:ASPxLabel ID="ASPxlblMorningstar" runat="server" Text="" ClientInstanceName="lblMorningstar">
|
||||||
|
</dx:ASPxLabel>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>
|
||||||
|
</TabPages>
|
||||||
|
</dx:ASPxPageControl>
|
||||||
|
</dx:PopupControlContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:ASPxPopupControl>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>
|
||||||
|
<dx:TabPage Name="Controvalori Titoli" Text="Controvalori Titoli">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<dx:ASPxGridView ID="gvControvaloreTitoli" runat="server" Theme="Aqua">
|
||||||
|
<SettingsPager PageSize="20" Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
<SettingsDataSecurity AllowDelete="False" AllowEdit="False" AllowInsert="False" />
|
||||||
|
<SettingsSearchPanel Visible="True" />
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>
|
||||||
|
</TabPages>
|
||||||
|
</dx:ASPxPageControl>
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<%-- <table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxGridView ID="gvControvaloreTitoli" runat="server" Theme="Aqua">
|
||||||
|
<SettingsPager PageSize="20" Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
<SettingsDataSecurity AllowDelete="False" AllowEdit="False" AllowInsert="False" />
|
||||||
|
<SettingsSearchPanel Visible="True" />
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>--%>
|
||||||
|
<dx:ASPxGridViewExporter runat="server" ID="gridviewExporter" GridViewID="gvEsposizioneTitoli"></dx:ASPxGridViewExporter>
|
||||||
|
<asp:SqlDataSource ID="SqlDSGestori" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Gestori" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSLinee" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Linee1" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="cod_ges" SessionField="cod_ges" />
|
||||||
|
<asp:SessionParameter Name="user" SessionField="user" />
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSConsulenti" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Consulenti" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="cod_ges" SessionField="cod_ges" />
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<!-- Option 1: Bootstrap Bundle with Popper -->
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
||||||
229
OlympiaIntranet/EsposizioneTitoli.aspx.cs
Normal file
@@ -0,0 +1,229 @@
|
|||||||
|
using DevExpress.Data;
|
||||||
|
using DevExpress.Export;
|
||||||
|
using DevExpress.Web;
|
||||||
|
using DevExpress.XtraPrinting;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class EsposizioneTitoli : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (HttpContext.Current.User.Identity.IsAuthenticated == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string loggedUser = HttpContext.Current.User.Identity.Name;
|
||||||
|
|
||||||
|
switch (loggedUser)
|
||||||
|
{
|
||||||
|
// Gestori
|
||||||
|
case "adonini":
|
||||||
|
gridLookupGestore.Value = "DONINI";
|
||||||
|
gridLookupGestore.Enabled = false;
|
||||||
|
break;
|
||||||
|
case "sbettinelli":
|
||||||
|
gridLookupGestore.Value = "BETTINELLI";
|
||||||
|
gridLookupGestore.Enabled = false;
|
||||||
|
break;
|
||||||
|
case "agamba":
|
||||||
|
gridLookupGestore.Value = "GAMBA";
|
||||||
|
gridLookupGestore.Enabled = false;
|
||||||
|
break;
|
||||||
|
case "rcammarino":
|
||||||
|
gridLookupGestore.Value = "CAMMARINO";
|
||||||
|
gridLookupGestore.Enabled = false;
|
||||||
|
break;
|
||||||
|
case "rtorre":
|
||||||
|
gridLookupGestore.Value = "TORRE";
|
||||||
|
gridLookupGestore.Enabled = false;
|
||||||
|
break;
|
||||||
|
case "lbrambilla":
|
||||||
|
gridLookupGestore.Value = "BRAMBILLA";
|
||||||
|
gridLookupGestore.Enabled = false;
|
||||||
|
break;
|
||||||
|
// consulenti
|
||||||
|
case "mbeltramelli":
|
||||||
|
gridLookupGestore.Value = "PISONI";
|
||||||
|
gridLookupGestore.Enabled = false;
|
||||||
|
gridLookupConsulente.Value = "BELTRAMELLI";
|
||||||
|
gridLookupConsulente.Enabled = false;
|
||||||
|
break;
|
||||||
|
case "fmucci":
|
||||||
|
gridLookupGestore.Value = "PISONI";
|
||||||
|
gridLookupGestore.Enabled = false;
|
||||||
|
gridLookupConsulente.Value = "MUCCI";
|
||||||
|
gridLookupConsulente.Enabled = false;
|
||||||
|
break;
|
||||||
|
// utenti
|
||||||
|
case "slopez": // nota: da sp GDN_GPM_Linee1 carica solo le linee "HIGH.RET.VAR","LOW.VOL.VAR" per slopez (02/03/2022)
|
||||||
|
gridLookupGestore.Value = "CAMMARINO";
|
||||||
|
gridLookupGestore.Enabled = false;
|
||||||
|
gridLookupConsulente.Value = "CASTRICHELLA";
|
||||||
|
gridLookupConsulente.Enabled = false;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
gridLookupGestore.Enabled = true; // gli altri gestori abilitati a vedere tutto sono fcostalonga, ecanziani, fpisoni, glicciardello
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Session["cod_ges"] = gridLookupGestore.Value; // serve per popolare gridlookupLinea!!
|
||||||
|
Session["user"] = loggedUser; // serve per popolare gridlookupLinea!!
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsPostBack) // Rielabora il grafico altrimenti il print non la stampa.
|
||||||
|
{
|
||||||
|
CaricaEsposizioneTitoli();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gridLookupGestore_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// ref: https://supportcenter.devexpress.com/ticket/details/q340370/aspxgridlookup-how-to-refresh-the-control-after-some-data-is-changed
|
||||||
|
// note: Per refreshare gridlookupLinea sulla base del valore di gridLookupGestore, salvo il valore gestore in una variabile di sessione Session["cod_ges"]
|
||||||
|
// e poi il refresh/rebind di SqlDSLinee verrà effettuato nell'evento lato client EndCallBack
|
||||||
|
|
||||||
|
ASPxGridView grid = gridLookupGestore.GridView;
|
||||||
|
object objGestore = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Gestore" });
|
||||||
|
|
||||||
|
if (objGestore != null)
|
||||||
|
{
|
||||||
|
Session["cod_ges"] = (string)objGestore;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void buttonEsposizioneTitoli_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
CaricaEsposizioneTitoli();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CaricaEsposizioneTitoli()
|
||||||
|
{
|
||||||
|
ASPxGridView grid = gridLookupGestore.GridView;
|
||||||
|
object objGestore = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Gestore" });
|
||||||
|
grid = gridLookupLinea.GridView;
|
||||||
|
object objLinea = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Linea" });
|
||||||
|
grid = gridLookupConsulente.GridView;
|
||||||
|
object objConsulente = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Consulente" });
|
||||||
|
|
||||||
|
if (!(objGestore != null && objLinea != null && objConsulente != null)) return;
|
||||||
|
|
||||||
|
DataTable dtEsposizioneTitoli = CommonClass.execQuery_Datatable_Sql("GDN_EsposizioneTitoli8", Properties.Settings.Default.SqlConnection, (string)objGestore, (string)objConsulente, (string)objLinea, rgFiltriRanking.SelectedIndex);
|
||||||
|
gvEsposizioneTitoli.DataSource = dtEsposizioneTitoli;
|
||||||
|
gvEsposizioneTitoli.DataBind();
|
||||||
|
if (gvEsposizioneTitoli.Columns["Titolo"] != null)
|
||||||
|
{
|
||||||
|
gvEsposizioneTitoli.GroupBy(gvEsposizioneTitoli.Columns["Titolo"]);
|
||||||
|
//ASPxSummaryItem summaryItem = new ASPxSummaryItem
|
||||||
|
//{
|
||||||
|
// FieldName = "Controvalore",
|
||||||
|
// SummaryType = SummaryItemType.Sum,
|
||||||
|
// DisplayFormat = "{0}",
|
||||||
|
// ShowInColumn = "Titolo"
|
||||||
|
//};
|
||||||
|
//gvEsposizioneTitoli.GroupSummary.Add(summaryItem);
|
||||||
|
//gvEsposizioneTitoli.SortBy(gvEsposizioneTitoli.Columns["CtvTitolo"], DevExpress.Data.ColumnSortOrder.Descending);
|
||||||
|
}
|
||||||
|
if (objLinea.ToString() != "-- TUTTI --" && objConsulente.ToString() != "-- TUTTI --") gvEsposizioneTitoli.SettingsBehavior.AutoExpandAllGroups = true; // autoespande tutti gruppi solo se non sono selezionati tutti nelle linee e nei consulenti
|
||||||
|
else gvEsposizioneTitoli.SettingsBehavior.AutoExpandAllGroups = false;
|
||||||
|
|
||||||
|
// Visualizza Controvalori titoli
|
||||||
|
DataTable dtControvaloriTitoli = CommonClass.execQuery_Datatable_Sql("GDN_EsposizioneTitoli_Controvalori", Properties.Settings.Default.SqlConnection, (string)objGestore, (string)objConsulente, (string)objLinea, rgFiltriRanking.SelectedIndex);
|
||||||
|
gvControvaloreTitoli.DataSource = dtControvaloriTitoli;
|
||||||
|
gvControvaloreTitoli.DataBind();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected void gvEsposizioneTitoli_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
|
||||||
|
{
|
||||||
|
//if (e.DataColumn.FieldName == "CodiceTitolo")
|
||||||
|
//{
|
||||||
|
// string htmlValue = CommonClass.ExecSql("GDN_EsposizioneTitoli_Rating1", e.GetValue("CodiceTitolo").ToString());
|
||||||
|
// if (String.IsNullOrEmpty(htmlValue) == false)
|
||||||
|
// {
|
||||||
|
// e.Cell.Attributes.Add("onmouseover", string.Format("onShowPopup(event.x, event.y, '{0}')", htmlValue));
|
||||||
|
// //e.Cell.Attributes.Add("onmouseover", string.Format("onShowPopupAtElement('{0}')", htmlValue));
|
||||||
|
// }
|
||||||
|
|
||||||
|
// else e.Cell.Attributes.Add("onmouseout", string.Format("onHidePopup();"));
|
||||||
|
//}
|
||||||
|
//else e.Cell.Attributes.Add("onmouseout", string.Format("onHidePopup();"));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvEsposizioneTitoli_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e)
|
||||||
|
{
|
||||||
|
// da rimettere!!
|
||||||
|
|
||||||
|
//if (e.RowType == GridViewRowType.Group)
|
||||||
|
//{
|
||||||
|
// //string htmlValue = CommonClass.ExecSql("GDN_EsposizioneTitoli_Rating3", e.GetValue("CodiceTitolo").ToString(),rgTipoRanking.SelectedIndex.ToString());
|
||||||
|
// //string morningstarRankingHtml = CommonClass.ExecSql("GDN_EsposizioneTitoli_Rating3", e.GetValue("CodiceTitolo").ToString(), "1");
|
||||||
|
// //if (String.IsNullOrEmpty(htmlValue) == false)
|
||||||
|
// //{
|
||||||
|
// // string popupHeaderText = String.Empty;
|
||||||
|
// // if (rgTipoRanking.SelectedIndex == 0) popupHeaderText = "Ranking Tepilora";
|
||||||
|
// // if (rgTipoRanking.SelectedIndex == 1) popupHeaderText = "Ranking MorningStar";
|
||||||
|
// // e.Row.Attributes.Add("onclick", string.Format("onShowPopup('{0}','{1}')", htmlValue, popupHeaderText));
|
||||||
|
// //}
|
||||||
|
// //else e.Row.Attributes.Add("onmouseout", string.Format("onHidePopup();"));
|
||||||
|
|
||||||
|
// string tepiloraRankingHtml = CommonClass.ExecSql("GDN_EsposizioneTitoli_Rating4", e.GetValue("CodiceTitolo").ToString(), "0");
|
||||||
|
// string morningstarRankingHtml = CommonClass.ExecSql("GDN_EsposizioneTitoli_Rating4", e.GetValue("CodiceTitolo").ToString(), "1");
|
||||||
|
// if (String.IsNullOrEmpty(tepiloraRankingHtml) == false && String.IsNullOrEmpty(morningstarRankingHtml) == false)
|
||||||
|
// {
|
||||||
|
// //string popupHeaderText = $"Ranking {e.GetValue("CodiceTitolo").ToString()}";
|
||||||
|
// e.Row.Attributes.Add("onclick", string.Format("onShowPopup1('{0}','{1}')", tepiloraRankingHtml, morningstarRankingHtml, ""));
|
||||||
|
// }
|
||||||
|
// else e.Row.Attributes.Add("onmouseout", string.Format("onHidePopup();"));
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void buttonEsportaExcel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
gridviewExporter.ExportSelectedRowsOnly = false;
|
||||||
|
gridviewExporter.FileName = DateTime.Now.ToString("yyyyMMdd_HHmm") + " - EsposizioneTitoli";
|
||||||
|
XlsxExportOptionsEx op = new XlsxExportOptionsEx() { ExportType = ExportType.DataAware }; // in DataAware mode l'evento ASPxGridViewExporter_RenderBrick non viene eseguito!!
|
||||||
|
gridviewExporter.WriteXlsxToResponse(op);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void btnRankingTitoli_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ASPxButton btn = sender as ASPxButton;
|
||||||
|
GridViewGroupRowTemplateContainer container = btn.NamingContainer as GridViewGroupRowTemplateContainer;
|
||||||
|
string titolo = container.GroupText.Substring(1, 5);
|
||||||
|
//string tepiloraRankingHtml = CommonClass.ExecSql("GDN_EsposizioneTitoli_Rating4", titolo, "0");
|
||||||
|
//string morningstarRankingHtml = CommonClass.ExecSql("GDN_EsposizioneTitoli_Rating4", titolo, "1");
|
||||||
|
//if (String.IsNullOrEmpty(tepiloraRankingHtml) == false && String.IsNullOrEmpty(morningstarRankingHtml) == false)
|
||||||
|
//{
|
||||||
|
// ASPxlblTepilora.EncodeHtml = false;
|
||||||
|
// ASPxlblTepilora.Text = tepiloraRankingHtml;
|
||||||
|
// ASPxlblMorningstar.EncodeHtml = false;
|
||||||
|
// ASPxlblMorningstar.Text = morningstarRankingHtml;
|
||||||
|
// ASPxPopupControl1.ShowOnPageLoad = true;
|
||||||
|
//}
|
||||||
|
|
||||||
|
// Tepilora rimosso dal 26/06/2023 su richiesta di Fede
|
||||||
|
string morningstarRankingHtml = CommonClass.ExecSql("GDN_EsposizioneTitoli_Rating4", titolo, "1");
|
||||||
|
if (String.IsNullOrEmpty(morningstarRankingHtml) == false)
|
||||||
|
{
|
||||||
|
ASPxlblMorningstar.EncodeHtml = false;
|
||||||
|
ASPxlblMorningstar.Text = morningstarRankingHtml;
|
||||||
|
ASPxPopupControl1.ShowOnPageLoad = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
177
OlympiaIntranet/EsposizioneTitoli.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet {
|
||||||
|
|
||||||
|
|
||||||
|
public partial class EsposizioneTitoli {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxFormLayout1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxFormLayout ASPxFormLayout1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// rgFiltriRanking control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxRadioButtonList rgFiltriRanking;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gridLookupGestore control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup gridLookupGestore;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gridLookupConsulente control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup gridLookupConsulente;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gridLookupLinea control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup gridLookupLinea;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// buttonEsposizioneTitoli control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton buttonEsposizioneTitoli;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// buttonEsportaExcel control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton buttonEsportaExcel;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPageControl2 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPageControl ASPxPageControl2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvEsposizioneTitoli control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvEsposizioneTitoli;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPopupControl1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPopupControl ASPxPopupControl1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPageControl1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPageControl ASPxPageControl1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxlblMorningstar control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxlblMorningstar;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvControvaloreTitoli control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvControvaloreTitoli;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gridviewExporter control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridViewExporter gridviewExporter;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSGestori control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSGestori;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSLinee control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSLinee;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSConsulenti control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSConsulenti;
|
||||||
|
}
|
||||||
|
}
|
||||||
150
OlympiaIntranet/EsposizioneTitoli_old.aspx
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EsposizioneTitoli_old.aspx.cs" Inherits="OlympiaIntranet.EsposizioneTitoli_old" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<!-- Bootstrap CSS -->
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous" />
|
||||||
|
|
||||||
|
<title></title>
|
||||||
|
<script>
|
||||||
|
function OnFirstEndCallback(s, e) {
|
||||||
|
|
||||||
|
// azzera eventuale selezione in gridLookupLinea
|
||||||
|
clientgridLookupLinea.SetValue(null);
|
||||||
|
|
||||||
|
// azzera eventuale selezione in gridLookupConsulente
|
||||||
|
clientgridLookupConsulente.SetValue(null);
|
||||||
|
}
|
||||||
|
function onShowPopup(x, y, text) {
|
||||||
|
lbl.SetText(text);
|
||||||
|
popup.ShowAtPos(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onHidePopup() {
|
||||||
|
popup.Hide();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
<dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server" ColCount="2" EnableTheming="True" Theme="Aqua" ColumnCount="2">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutGroup Caption="Filtri Selezione" ColCount="5" ColSpan="1" ColumnCount="5">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="Gestore" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="gridLookupGestore" runat="server" Theme="Aqua" DataSourceID="SqlDSGestori" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Gestore" TextFormatString="{0}" OnValueChanged="gridLookupGestore_ValueChanged">
|
||||||
|
<ClientSideEvents EndCallback="OnFirstEndCallback" />
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Consulente" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="gridLookupConsulente" ClientInstanceName="clientgridLookupConsulente" runat="server" Theme="Aqua" DataSourceID="SqlDSConsulenti" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Consulente" TextFormatString="{0}">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Linea di Gestione" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="gridLookupLinea" ClientInstanceName="clientgridLookupLinea" runat="server" Theme="Aqua" DataSourceID="SqlDSLinee" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Linea" TextFormatString="{0}">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Esposizione Titoli" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="buttonEsposizioneTitoli" runat="server" Theme="Aqua" OnClick="buttonEsposizioneTitoli_Click">
|
||||||
|
<Image IconID="grid_grid_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxFormLayout>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
<dx:ASPxGridView ID="gvEsposizioneTitoli" runat="server" Theme="Aqua" OnHtmlDataCellPrepared="gvEsposizioneTitoli_HtmlDataCellPrepared" OnHtmlRowPrepared="gvEsposizioneTitoli_HtmlRowPrepared">
|
||||||
|
<SettingsPager PageSize="20" Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
<SettingsDataSecurity AllowDelete="False" AllowEdit="False" AllowInsert="False" />
|
||||||
|
<SettingsSearchPanel Visible="True" />
|
||||||
|
<Templates>
|
||||||
|
<GroupRowContent>
|
||||||
|
<a id="clickElement" target="_blank" href="SelettoreFondiETF.aspx?categoriaMS=<%# Eval("CategoriaMS").ToString()%>&divisa=<%# Eval("DivisaTitolo").ToString()%>&isinTitolo=<%# Eval("ISIN Titolo").ToString()%>"><%# Eval("Titolo").ToString()%></a>
|
||||||
|
</GroupRowContent>
|
||||||
|
</Templates>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
<dx:ASPxPopupControl ID="ASPxPopupControl1" runat="server" ClientInstanceName="popup" ShowHeader="false">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:PopupControlContentControl runat="server">
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="ASPxLabel" ClientInstanceName="lbl">
|
||||||
|
</dx:ASPxLabel>
|
||||||
|
</dx:PopupControlContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:ASPxPopupControl>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<asp:SqlDataSource ID="SqlDSGestori" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Gestori" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSLinee" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Linee" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="cod_ges" SessionField="cod_ges" />
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSConsulenti" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Consulenti" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="cod_ges" SessionField="cod_ges" />
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<!-- Option 1: Bootstrap Bundle with Popper -->
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
126
OlympiaIntranet/EsposizioneTitoli_old.aspx.cs
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
using DevExpress.Data;
|
||||||
|
using DevExpress.Web;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class EsposizioneTitoli_old : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (HttpContext.Current.User.Identity.IsAuthenticated == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string loggedUser = HttpContext.Current.User.Identity.Name;
|
||||||
|
|
||||||
|
switch (loggedUser)
|
||||||
|
{
|
||||||
|
// Gestori
|
||||||
|
case "sbettinelli":
|
||||||
|
gridLookupGestore.Value = "BETTINELLI";
|
||||||
|
gridLookupGestore.Enabled = false;
|
||||||
|
break;
|
||||||
|
case "agamba":
|
||||||
|
gridLookupGestore.Value = "GAMBA";
|
||||||
|
gridLookupGestore.Enabled = false;
|
||||||
|
break;
|
||||||
|
case "rcammarino":
|
||||||
|
gridLookupGestore.Value = "CAMMARINO";
|
||||||
|
gridLookupGestore.Enabled = false;
|
||||||
|
break;
|
||||||
|
case "rtorre":
|
||||||
|
gridLookupGestore.Value = "TORRE";
|
||||||
|
gridLookupGestore.Enabled = false;
|
||||||
|
break;
|
||||||
|
// consulenti
|
||||||
|
case "mbeltramelli":
|
||||||
|
gridLookupGestore.Value = "PISONI";
|
||||||
|
gridLookupGestore.Enabled = false;
|
||||||
|
gridLookupConsulente.Value = "BELTRAMELLI";
|
||||||
|
gridLookupConsulente.Enabled = false;
|
||||||
|
break;
|
||||||
|
case "fmucci":
|
||||||
|
gridLookupGestore.Value = "PISONI";
|
||||||
|
gridLookupGestore.Enabled = false;
|
||||||
|
gridLookupConsulente.Value = "MUCCI";
|
||||||
|
gridLookupConsulente.Enabled = false;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
gridLookupGestore.Enabled = true; // gli altri gestori abilitati a vedere tutto sono fcostalonga, ecanziani, fpisoni, glicciardello
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Session["cod_ges"] = gridLookupGestore.Value; // serve per popolare gridlookupLinea!!
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsPostBack) // Rielabora il grafico altrimenti il print non la stampa.
|
||||||
|
{
|
||||||
|
CaricaEsposizioneTitoli();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gridLookupGestore_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// ref: https://supportcenter.devexpress.com/ticket/details/q340370/aspxgridlookup-how-to-refresh-the-control-after-some-data-is-changed
|
||||||
|
// note: Per refreshare gridlookupLinea sulla base del valore di gridLookupGestore, salvo il valore gestore in una variabile di sessione Session["cod_ges"]
|
||||||
|
// e poi il refresh/rebind di SqlDSLinee verrà effettuato nell'evento lato client EndCallBack
|
||||||
|
|
||||||
|
ASPxGridView grid = gridLookupGestore.GridView;
|
||||||
|
object objGestore = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Gestore" });
|
||||||
|
|
||||||
|
if (objGestore != null)
|
||||||
|
{
|
||||||
|
Session["cod_ges"] = (string)objGestore;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void buttonEsposizioneTitoli_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
CaricaEsposizioneTitoli();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CaricaEsposizioneTitoli()
|
||||||
|
{
|
||||||
|
ASPxGridView grid = gridLookupGestore.GridView;
|
||||||
|
object objGestore = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Gestore" });
|
||||||
|
grid = gridLookupLinea.GridView;
|
||||||
|
object objLinea = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Linea" });
|
||||||
|
grid = gridLookupConsulente.GridView;
|
||||||
|
object objConsulente = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Consulente" });
|
||||||
|
if (!(objGestore != null && objLinea != null && objConsulente != null)) return;
|
||||||
|
|
||||||
|
DataTable dtEsposizioneTitoli = CommonClass.execQuery_Datatable_Sql("GDN_EsposizioneTitoli1", Properties.Settings.Default.SqlConnection, (string)objGestore, (string)objConsulente, (string)objLinea);
|
||||||
|
gvEsposizioneTitoli.DataSource = dtEsposizioneTitoli;
|
||||||
|
gvEsposizioneTitoli.DataBind();
|
||||||
|
if (gvEsposizioneTitoli.Columns["Titolo"] != null) gvEsposizioneTitoli.GroupBy(gvEsposizioneTitoli.Columns["Titolo"]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected void gvEsposizioneTitoli_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
|
||||||
|
{
|
||||||
|
//string htmlValue = CommonClass.ExecSql("GDN_EsposizioneTitoli_Rating1", e.GetValue("CodiceTitolo").ToString());
|
||||||
|
//e.Cell.Attributes.Add("onmouseover", string.Format("onShowPopup(event.x, event.y, '{0}')", htmlValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvEsposizioneTitoli_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.RowType == GridViewRowType.Group)
|
||||||
|
{
|
||||||
|
e.Row.Attributes.Add("onmouseout", string.Format("onHidePopup();"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
123
OlympiaIntranet/EsposizioneTitoli_old.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet {
|
||||||
|
|
||||||
|
|
||||||
|
public partial class EsposizioneTitoli_old {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxFormLayout1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxFormLayout ASPxFormLayout1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gridLookupGestore control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup gridLookupGestore;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gridLookupConsulente control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup gridLookupConsulente;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gridLookupLinea control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup gridLookupLinea;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// buttonEsposizioneTitoli control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton buttonEsposizioneTitoli;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvEsposizioneTitoli control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvEsposizioneTitoli;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPopupControl1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPopupControl ASPxPopupControl1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSGestori control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSGestori;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSLinee control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSLinee;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSConsulenti control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSConsulenti;
|
||||||
|
}
|
||||||
|
}
|
||||||
282
OlympiaIntranet/Fondi.aspx
Normal file
@@ -0,0 +1,282 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Fondi.aspx.cs" Inherits="OlympiaIntranet.test" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
<style type="text/css">
|
||||||
|
.height,
|
||||||
|
height * {
|
||||||
|
height: 34px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function OnContextMenuItemClick(sender, args) {
|
||||||
|
if (args.item.name == "scaricaFondoBBG") {
|
||||||
|
args.processOnServer = true;
|
||||||
|
args.usePostBack = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<div>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxRadioButtonList ID="rblFiltro" runat="server" RepeatDirection="Horizontal" AutoPostBack="True" OnSelectedIndexChanged="rblFiltro_SelectedIndexChanged" Theme="Aqua" SelectedIndex="1">
|
||||||
|
<Items>
|
||||||
|
<dx:ListEditItem Text="Filtra per Asset Class" Value="0" />
|
||||||
|
<dx:ListEditItem Text="Filtra per Tipo Titolo" Value="1" Selected="True" />
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxRadioButtonList>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel29" runat="server" Width="10px"></dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxGridLookup ID="gridlookupCategorie" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDSCategorie" EnableTheming="True" KeyFieldName="Codice" TextFormatString="{0} - {1} - {2}" Theme="Aqua" Width="363px" OnValueChanged="gridlookupCategorie_ValueChanged" CssClass="height" IncrementalFilteringDelay="500" IncrementalFilteringMode="Contains" DropDownStyle="DropDownList">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True"></SettingsBehavior>
|
||||||
|
<SettingsPager PageSize="30">
|
||||||
|
</SettingsPager>
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
</GridViewProperties>
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Codice" VisibleIndex="0">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Descrizione" VisibleIndex="1">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="numRecord" VisibleIndex="2" Caption="# Record">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel2" runat="server" Width="10px"></dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxDateEdit ID="ASPxDateEdit1" runat="server" CssClass="height" Theme="Aqua" DisplayFormatString="dd/MM/yyyy" EditFormat="Custom" EditFormatString="dd/MM/yyyy" Visible="false"></dx:ASPxDateEdit>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel3" runat="server" Width="10px"></dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxButton ID="ASPxLoadData" runat="server" CssClass="height" Theme="Aqua" OnClick="ASPxButton1_Click">
|
||||||
|
<Image IconID="arrows_next_32x32">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel1" runat="server" Width="10px" Height="20px"></dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<dx:ASPxGridView ID="gridviewFondi" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDSFondi" EnableTheming="True" Theme="Aqua" OnContextMenuItemClick="gridviewFondi_ContextMenuItemClick" OnFillContextMenuItems="gridviewFondi_FillContextMenuItems" KeyFieldName="ISIN" >
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<SettingsContextMenu Enabled="True" EnableRowMenu="True">
|
||||||
|
</SettingsContextMenu>
|
||||||
|
<SettingsPager AlwaysShowPager="True" PageSize="20">
|
||||||
|
<PageSizeItemSettings Visible="True">
|
||||||
|
</PageSizeItemSettings>
|
||||||
|
</SettingsPager>
|
||||||
|
<ClientSideEvents ContextMenuItemClick="function(s,e) { OnContextMenuItemClick(s, e); }" />
|
||||||
|
<Settings ShowFilterRow="True" />
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" EnableRowHotTrack="True" AllowSelectByRowClick="True" />
|
||||||
|
<SettingsDataSecurity AllowDelete="False" AllowEdit="False" AllowInsert="False" />
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Security Description" VisibleIndex="0">
|
||||||
|
<PropertiesTextEdit>
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="ISIN" VisibleIndex="1">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Bloomberg Ticker" VisibleIndex="2">
|
||||||
|
<PropertiesTextEdit>
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataDateColumn FieldName="Inception date" VisibleIndex="4">
|
||||||
|
<PropertiesDateEdit DisplayFormatString="dd/MM/yyyy">
|
||||||
|
</PropertiesDateEdit>
|
||||||
|
</dx:GridViewDataDateColumn>
|
||||||
|
<dx:GridViewDataDateColumn FieldName="Bloomberg Last Update" VisibleIndex="5">
|
||||||
|
<PropertiesDateEdit DisplayFormatString="dd/MM/yyyy">
|
||||||
|
</PropertiesDateEdit>
|
||||||
|
</dx:GridViewDataDateColumn>
|
||||||
|
<dx:GridViewBandColumn Caption="Return 1 Yr" Name="Return 1 Yr" VisibleIndex="8">
|
||||||
|
<HeaderStyle HorizontalAlign="Center" />
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Value" FieldName="Return 1 Yr" VisibleIndex="0">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0.0000;(0.0000); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Norm Distr" FieldName="Return 1 Yr (norm distr)" VisibleIndex="1">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0.00%;(0.00%); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Score" FieldName="Return 1 Yr (score)" VisibleIndex="2">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0;(0); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:GridViewBandColumn>
|
||||||
|
<dx:GridViewBandColumn Caption="Standard Deviation 3 Yr" Name="Standard Deviation 3 Yr" VisibleIndex="9">
|
||||||
|
<HeaderStyle HorizontalAlign="Center" />
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Value" FieldName="Standard Deviation 3 Yr" VisibleIndex="0">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0.0000;(0.0000); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Norm Distr" FieldName="Standard Deviation 3 Yr (norm distr)" VisibleIndex="1">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0.00%;(0.00%); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Score" FieldName="Standard Deviation 3 Yr (score)" VisibleIndex="2">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0;(0); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:GridViewBandColumn>
|
||||||
|
<dx:GridViewBandColumn Caption="Management Fees" Name="Management Fees" VisibleIndex="10">
|
||||||
|
<HeaderStyle HorizontalAlign="Center" />
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Value" FieldName="Management Fees" VisibleIndex="0">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0.0000;(0.0000); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Norm Distr" FieldName="Management Fees (norm distr)" VisibleIndex="1">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0.00%;(0.00%); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Score" FieldName="Management Fees (score)" VisibleIndex="2">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0;(0); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:GridViewBandColumn>
|
||||||
|
<dx:GridViewBandColumn Caption="Total Expense Ratio" Name="Total Expense Ratio" VisibleIndex="11">
|
||||||
|
<HeaderStyle HorizontalAlign="Center" />
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Value" FieldName="Total Expense Ratio" VisibleIndex="0">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0.0000;(0.0000); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Norm Distr" FieldName="Total Expense Ratio (norm distr)" VisibleIndex="1">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0.00%;(0.00%); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Score" FieldName="Total Expense Ratio (score)" VisibleIndex="2">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0;(0); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:GridViewBandColumn>
|
||||||
|
<dx:GridViewBandColumn Caption="Fund Total Assets (mln)" Name="Fund Total Assets (mln)" VisibleIndex="12">
|
||||||
|
<HeaderStyle HorizontalAlign="Center" />
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Value" FieldName="Fund Total Assets (mln)" VisibleIndex="0">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0.0000;(0.0000); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Norm Distr" FieldName="Fund Total Assets (mln) (norm distr)" VisibleIndex="1">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0.00%;(0.00%); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Score" FieldName="Fund Total Assets (mln) (score)" VisibleIndex="2">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0;(0); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:GridViewBandColumn>
|
||||||
|
<dx:GridViewBandColumn Caption="Sharpe Ratio 1 Yr" Name="Sharpe Ratio 1 Yr" VisibleIndex="15">
|
||||||
|
<HeaderStyle HorizontalAlign="Center" />
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Value" FieldName="Sharpe Ratio 1 Yr" VisibleIndex="0">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0.0000;(0.0000); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Norm Distr" FieldName="Sharpe Ratio 1 Yr (norm distr)" VisibleIndex="1">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0.00%;(0.00%); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Score" FieldName="Sharpe Ratio 1 Yr (score)" VisibleIndex="2">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0;(0); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:GridViewBandColumn>
|
||||||
|
<dx:GridViewBandColumn Caption="Downside Risk" Name="Downside Risk" VisibleIndex="21">
|
||||||
|
<HeaderStyle HorizontalAlign="Center" />
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Value" FieldName="Downside Risk" VisibleIndex="0">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0.0000;(0.0000); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Norm Distr" FieldName="Downside Risk (norm distr)" VisibleIndex="1">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0.00%;(0.00%); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Score" FieldName="Downside Risk (score)" VisibleIndex="2">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0;(0); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:GridViewBandColumn>
|
||||||
|
<dx:GridViewBandColumn Caption="Overall Score" Name="Overall Score" VisibleIndex="6">
|
||||||
|
<HeaderStyle HorizontalAlign="Center" />
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Value" FieldName="Overall Score" VisibleIndex="0">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Norm Distr" FieldName="Overall Score (norm distr)" ReadOnly="True" VisibleIndex="1">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0.00%;(0.00%); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:GridViewBandColumn>
|
||||||
|
<dx:GridViewBandColumn Caption="Var 95" Name="Var 95" VisibleIndex="7">
|
||||||
|
<HeaderStyle HorizontalAlign="Center" />
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Value" FieldName="Var 95" VisibleIndex="0">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0.0000;(0.0000); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Norm Distr" FieldName="Var 95 (norm distr)" VisibleIndex="1">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0.00%;(0.00%); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Score" FieldName="Var 95 (score)" VisibleIndex="2">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="0;(0); ">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:GridViewBandColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Divisa" VisibleIndex="3">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<asp:SqlDataSource ID="SqlDSCategorie" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_CategorieFondi2" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter DbType="Int16" DefaultValue="-1" Name="Switch" SessionField="Switch" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSFondi" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_ElencoFondi6" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="Switch" SessionField="Switch" />
|
||||||
|
<asp:SessionParameter Name="Codice" SessionField="Codice" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
141
OlympiaIntranet/Fondi.aspx.cs
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
using ClosedXML.Excel;
|
||||||
|
using DevExpress.Export;
|
||||||
|
using DevExpress.Web;
|
||||||
|
using DevExpress.XtraPrinting;
|
||||||
|
using MySqlConnector;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class test : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
string queryLoadGrid = "GDN_ElencoFondi6";
|
||||||
|
|
||||||
|
protected void Page_Init(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ASPxDateEdit1.Date = DateTime.Now.Date;
|
||||||
|
}
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (HttpContext.Current.User.Identity.IsAuthenticated == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
|
||||||
|
CommonClass.SetColumnFilterContains(gridviewFondi);
|
||||||
|
|
||||||
|
// Assegna la variabile di sessione Switch ad ogni postback
|
||||||
|
if (IsPostBack==true)
|
||||||
|
{
|
||||||
|
Session["Switch"] = rblFiltro.SelectedIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Se Overall Score norm distr > 50% allora colora verdino
|
||||||
|
GridViewFormatConditionHighlight Rule1 = new GridViewFormatConditionHighlight();
|
||||||
|
Rule1.FieldName = "Overall Score (norm distr)";
|
||||||
|
Rule1.Expression = "[Overall Score (norm distr)] >= 0.5";
|
||||||
|
Rule1.Format = GridConditionHighlightFormat.LightGreenFill;
|
||||||
|
gridviewFondi.FormatConditions.Add(Rule1);
|
||||||
|
|
||||||
|
// Se Overall Score norm distr < 50% allora colora rossastro
|
||||||
|
GridViewFormatConditionHighlight Rule2 = new GridViewFormatConditionHighlight();
|
||||||
|
Rule2.FieldName = "Overall Score (norm distr)";
|
||||||
|
Rule2.Expression = "[Overall Score (norm distr)] < 0.5";
|
||||||
|
Rule2.Format = GridConditionHighlightFormat.LightRedFill;
|
||||||
|
gridviewFondi.FormatConditions.Add(Rule2);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void rblFiltro_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Session["Switch"] = rblFiltro.SelectedIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gridlookupCategorie_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
object objCodice = gridlookupCategorie.GridView.GetRowValues(gridlookupCategorie.GridView.FocusedRowIndex, "Codice");
|
||||||
|
if (String.IsNullOrEmpty(objCodice.ToString()) == false) Session["Codice"] = gridlookupCategorie.GridView.GetRowValues(gridlookupCategorie.GridView.FocusedRowIndex, "Codice");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxButton1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gridviewFondi_ContextMenuItemClick(object sender, ASPxGridViewContextMenuItemClickEventArgs e)
|
||||||
|
{
|
||||||
|
// RefreshData(); // ** da togliere x test!!
|
||||||
|
|
||||||
|
// Nota: Se si aggiunge un menu contestuale , ricordarsi di modificare pure lato client la procedura OnContextMenuItemClick
|
||||||
|
var gridView = (ASPxGridView)sender;
|
||||||
|
|
||||||
|
if (e.Item.Name == "scaricaFondoBBG")
|
||||||
|
{
|
||||||
|
string tickerBBG = (string)gridviewFondi.GetRowValues(gridView.FocusedRowIndex, "Bloomberg Ticker");
|
||||||
|
string result = string.Empty;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
result = CommonClass.CallWebApi(String.Format("https://api.smart-roots.net:4001/api/bbgFondi?tickerBBG={0}", tickerBBG));
|
||||||
|
|
||||||
|
if (result.IndexOf("[OK]") != -1)
|
||||||
|
{
|
||||||
|
string msg = string.Format("Dati fondo {0} scaricati da Bloomberg!",tickerBBG);
|
||||||
|
CommonClass.MessageBox(this, msg);
|
||||||
|
//RefreshData();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
string error = string.Format("[{0}] - " + "[ERRORE] Eccezione rilevata in scarico dati fondi da bbg <br /> <br /> Message: {1} <br /> InnerException: {2}", DateTime.Now, ex.Message, ex.InnerException);
|
||||||
|
CommonClass.MessageBox(this, error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gridviewFondi_FillContextMenuItems(object sender, ASPxGridViewContextMenuEventArgs e)
|
||||||
|
{
|
||||||
|
var gridView = (ASPxGridView)sender;
|
||||||
|
if (e.MenuType == GridViewContextMenuType.Rows)
|
||||||
|
{
|
||||||
|
// Crea Context Menu per scaricare dati fondi da bbg
|
||||||
|
var item = e.CreateItem("Scarica dati da BBG", "scaricaFondoBBG");
|
||||||
|
item.BeginGroup = true;
|
||||||
|
item.Image.IconID = "miscellaneous_publish_16x16";
|
||||||
|
e.Items.Add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//protected void gridviewFondi_CustomErrorText(object sender, ASPxGridViewCustomErrorTextEventArgs e)
|
||||||
|
//{
|
||||||
|
// // https://supportcenter.devexpress.com/ticket/details/e59/how-to-show-an-error-message-when-a-record-cannot-be-deleted
|
||||||
|
// if (e.Exception is MyException) e.ErrorText = e.Exception.Message;
|
||||||
|
//}
|
||||||
|
|
||||||
|
private void RefreshData()
|
||||||
|
{
|
||||||
|
SqlDSFondi.SelectCommand = queryLoadGrid;
|
||||||
|
SqlDSFondi.SelectCommandType = SqlDataSourceCommandType.StoredProcedure;
|
||||||
|
Parameter p1 = SqlDSFondi.SelectParameters["Switch"];
|
||||||
|
SqlDSFondi.SelectParameters.Remove(p1);
|
||||||
|
SqlDSFondi.SelectParameters.Add("Switch", Session["Switch"].ToString());
|
||||||
|
Parameter p2 = SqlDSFondi.SelectParameters["Codice"];
|
||||||
|
SqlDSFondi.SelectParameters.Remove(p2);
|
||||||
|
SqlDSFondi.SelectParameters.Add("Codice", Session["Codice"].ToString());
|
||||||
|
gridviewFondi.DataBind();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
123
OlympiaIntranet/Fondi.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet {
|
||||||
|
|
||||||
|
|
||||||
|
public partial class test {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// rblFiltro control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxRadioButtonList rblFiltro;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel29 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel29;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gridlookupCategorie control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup gridlookupCategorie;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel2 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxDateEdit1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxDateEdit ASPxDateEdit1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel3 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel3;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLoadData control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton ASPxLoadData;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gridviewFondi control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gridviewFondi;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSCategorie control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSCategorie;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSFondi control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSFondi;
|
||||||
|
}
|
||||||
|
}
|
||||||
189
OlympiaIntranet/GPMAssetAllocation.aspx
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GPMAssetAllocation.aspx.cs" Inherits="OlympiaIntranet.GPMAssetAllocation" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.XtraCharts.v23.2.Web, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.XtraCharts.Web" TagPrefix="dx" %>
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.XtraCharts.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.XtraCharts" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
<style>
|
||||||
|
html {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
function ExportChartToPdf(e) {
|
||||||
|
e.processOnServer = false;
|
||||||
|
var chartPrintOptions = clientChart.GetPrintOptions();
|
||||||
|
chartPrintOptions.SetSizeMode('Stretch');
|
||||||
|
chartPrintOptions.SetLandscape(true);
|
||||||
|
const date = new Date();
|
||||||
|
var fileName = 'GPM_AssetAllocation_' + date.toLocaleDateString();
|
||||||
|
clientChart.SaveToDisk('pdf', fileName);
|
||||||
|
}
|
||||||
|
function OnFirstEndCallback(s, e) {
|
||||||
|
//clientgridLookupLinea.GetGridView().Refresh();
|
||||||
|
//clientgridLookupConsulente.GetGridView().Refresh();
|
||||||
|
|
||||||
|
// azzera eventuale selezione in gridLookupLinea
|
||||||
|
clientgridLookupLinea.SetValue(null);
|
||||||
|
|
||||||
|
// azzera eventuale selezione in gridLookupConsulente
|
||||||
|
//clientgridLookupConsulente.SetValue(null);
|
||||||
|
|
||||||
|
// azzera eventuale selezione in gridLookupAdvisor
|
||||||
|
//clientgridLookupAdvisor.SetValue(null);
|
||||||
|
|
||||||
|
}
|
||||||
|
//function OnFirstEndCallbackAdvisor(s, e) {
|
||||||
|
// // azzera eventuale selezione in gridLookupLinea
|
||||||
|
// clientgridLookupLinea.SetValue(null);
|
||||||
|
//}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
<dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server" ColCount="2" EnableTheming="True" Theme="Aqua" ColumnCount="2">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutGroup Caption="Filtri Selezione" ColCount="5" ColSpan="1" ColumnCount="5">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="Gestore" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="gridLookupGestore" runat="server" Theme="Aqua" DataSourceID="SqlDSGestori" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Gestore" TextFormatString="{0}" OnValueChanged="gridLookupGestore_ValueChanged">
|
||||||
|
<ClientSideEvents EndCallback="OnFirstEndCallback" />
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<%-- <dx:LayoutItem Caption="Consulente" ColSpan="1" Visible="false">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="gridLookupConsulente" ClientInstanceName="clientgridLookupConsulente" runat="server" Theme="Aqua" DataSourceID="SqlDSConsulenti" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Consulente" TextFormatString="{0}">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>--%>
|
||||||
|
<%-- <dx:LayoutItem Caption="Advisor" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="gridLookupAdvisor" ClientInstanceName="clientgridLookupAdvisor" runat="server" Theme="Aqua" DataSourceID="SqlDSAdvisor" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Advisor" TextFormatString="{0}" OnValueChanged="gridLookupAdvisor_ValueChanged">
|
||||||
|
<ClientSideEvents EndCallback="OnFirstEndCallbackAdvisor" />
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>--%>
|
||||||
|
<dx:LayoutItem Caption="Linea di Gestione" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="gridLookupLinea" ClientInstanceName="clientgridLookupLinea" runat="server" Theme="Aqua" DataSourceID="SqlDSLinee" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Linea" TextFormatString="{0}">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Genera Grafico" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="buttonGeneraGrafici" runat="server" Theme="Aqua" OnClick="buttonGeneraGrafici_Click">
|
||||||
|
<Image IconID="chart_chart_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Esporta in Pdf" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<%-- <dx:ASPxButton ID="buttonEsportaPdf" runat="server" Theme="Aqua" AutoPostBack="True" OnClick="buttonEsportaPdf_Click">
|
||||||
|
<Image IconID="export_exporttopdf_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>--%>
|
||||||
|
<dx:ASPxButton ID="buttonEsportaPdf" runat="server" AutoPostBack="False" OnClick="buttonEsportaPdf_Click" Theme="Aqua">
|
||||||
|
<ClientSideEvents Click="function(s, e) { ExportChartToPdf(e); }" />
|
||||||
|
<Image IconID="export_exporttopdf_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxFormLayout>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
<dx:WebChartControl ID="fullStackedBarChart" ClientInstanceName="clientChart" runat="server" CrosshairEnabled="True" Height="720px" Width="1280px" RenderFormat="Svg" EnableViewState="False" AppearanceNameSerializable="Gray">
|
||||||
|
</dx:WebChartControl>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<asp:SqlDataSource ID="SqlDSGestori" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Gestori1" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="user" SessionField="user" />
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<%-- <asp:SqlDataSource ID="SqlDSConsulenti" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Consulenti" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="cod_ges" SessionField="cod_ges" />
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>--%>
|
||||||
|
<%-- <asp:SqlDataSource ID="SqlDSAdvisor" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Advisor" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="cod_ges" SessionField="cod_ges" />
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>--%>
|
||||||
|
<asp:SqlDataSource ID="SqlDSLinee" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Linee3" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="cod_ges" SessionField="cod_ges" />
|
||||||
|
<%-- <asp:SessionParameter Name="cod_adv" SessionField="cod_adv" />--%>
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
320
OlympiaIntranet/GPMAssetAllocation.aspx.cs
Normal file
@@ -0,0 +1,320 @@
|
|||||||
|
using DevExpress.Web;
|
||||||
|
using DevExpress.XtraCharts;
|
||||||
|
using DevExpress.XtraCharts.Native;
|
||||||
|
using DevExpress.XtraCharts.Web;
|
||||||
|
using DevExpress.Pdf;
|
||||||
|
using DevExpress.XtraPrinting;
|
||||||
|
using DevExpress.XtraGrid;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
|
||||||
|
public partial class GPMAssetAllocation : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
string[] adminUser = new string[] { "fcostalonga", "ecanziani", "fpisoni", "glicciardello" };
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (HttpContext.Current.User.Identity.IsAuthenticated == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string loggedUser = HttpContext.Current.User.Identity.Name;
|
||||||
|
|
||||||
|
if (adminUser.Contains(loggedUser) == true) { gridLookupGestore.Enabled = true; }
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gridLookupGestore.Value = loggedUser.Substring(1).ToUpper();
|
||||||
|
gridLookupGestore.Enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Session["cod_ges"] = gridLookupGestore.Value; // serve per popolare gridlookupLinea!!
|
||||||
|
//Session["cod_adv"] = gridLookupAdvisor.Value; // serve per popolare gridlookupLinea!!
|
||||||
|
Session["user"] = loggedUser; // serve per popolare gridlookupGestore!!
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsPostBack) // Rielabora il grafico altrimenti il print non la stampa.
|
||||||
|
{
|
||||||
|
PlottaFullStackedBar();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void buttonGeneraGrafici_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
PlottaFullStackedBar();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PlottaFullStackedBar()
|
||||||
|
{
|
||||||
|
// Carica dati in dtStackedBarsData
|
||||||
|
ASPxGridView grid = gridLookupGestore.GridView;
|
||||||
|
object objGestore = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Gestore" });
|
||||||
|
grid = gridLookupLinea.GridView;
|
||||||
|
object objLinea = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Linea" });
|
||||||
|
|
||||||
|
//grid = gridLookupAdvisor.GridView;
|
||||||
|
//object objAdvisor = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Advisor" });
|
||||||
|
//if (!(objGestore != null && objLinea != null && objAdvisor != null)) return;
|
||||||
|
|
||||||
|
if (!(objGestore != null && objLinea != null)) return;
|
||||||
|
DataTable dtStackedBarsData = CommonClass.execQuery_Datatable_Sql("GDN_GPMAssetAllocation_StackedBars2",
|
||||||
|
Properties.Settings.Default.SqlConnection,
|
||||||
|
(string)objGestore,
|
||||||
|
"",
|
||||||
|
(string)objLinea,
|
||||||
|
-1,
|
||||||
|
-1,
|
||||||
|
null,
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
null,
|
||||||
|
""
|
||||||
|
);
|
||||||
|
Session["dtStackedBarsData"] = dtStackedBarsData;
|
||||||
|
var listAssetClass = (from r in dtStackedBarsData.AsEnumerable()
|
||||||
|
group r by r["Asset Class"]);
|
||||||
|
|
||||||
|
/*
|
||||||
|
WebChartControl fullStackedBarChart = new WebChartControl
|
||||||
|
{
|
||||||
|
DataSource = dtStackedBarsData,
|
||||||
|
RenderFormat = RenderFormat.Svg,
|
||||||
|
Height = 768,
|
||||||
|
Width = 1024,
|
||||||
|
EnableViewState = false, // necessario altrimenti non riaggiorna il grafico!
|
||||||
|
AppearanceName = "Gray"
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
|
fullStackedBarChart.DataSource = dtStackedBarsData;
|
||||||
|
|
||||||
|
// Cancella tutte le serie prima di plottare
|
||||||
|
fullStackedBarChart.Series.Clear();
|
||||||
|
|
||||||
|
// Cancella tutti i titoli della serie prima di plottare
|
||||||
|
fullStackedBarChart.Titles.Clear();
|
||||||
|
|
||||||
|
// Rimuove legenda aggiuntiva dei portafogli
|
||||||
|
fullStackedBarChart.Legends.Clear();
|
||||||
|
|
||||||
|
// Setta titolo del grafico
|
||||||
|
SettaTitoloGrafico(fullStackedBarChart);
|
||||||
|
|
||||||
|
|
||||||
|
foreach (var groupedAssetClass in listAssetClass)
|
||||||
|
{
|
||||||
|
string AssetClass = (string)groupedAssetClass.Key;
|
||||||
|
Series series = new Series(AssetClass, ViewType.FullStackedBar);
|
||||||
|
foreach (var seriesPoint in groupedAssetClass)
|
||||||
|
{
|
||||||
|
series.Points.Add(new SeriesPoint(seriesPoint["Codice Portafoglio"], seriesPoint["Esposizione"]));
|
||||||
|
}
|
||||||
|
series.ArgumentScaleType = ScaleType.Qualitative;
|
||||||
|
series.CrosshairContentShowMode = CrosshairContentShowMode.Default;
|
||||||
|
series.CrosshairLabelPattern = "{S}: {V:F2}%"; // ref link : https://docs.devexpress.com/CoreLibraries/DevExpress.XtraCharts.SeriesBase.CrosshairLabelPattern
|
||||||
|
|
||||||
|
FullStackedBarSeriesView seriesView = (FullStackedBarSeriesView)series.View;
|
||||||
|
switch (AssetClass)
|
||||||
|
{
|
||||||
|
case "Fondi Bilanciati e Flessibili":
|
||||||
|
seriesView.Color = Color.LightCyan;
|
||||||
|
break;
|
||||||
|
case "Liquidità":
|
||||||
|
seriesView.Color = Color.LightGreen;
|
||||||
|
break;
|
||||||
|
case "Obbligazioni e Fondi Obbligazionari":
|
||||||
|
seriesView.Color = Color.LightSalmon;
|
||||||
|
break;
|
||||||
|
case "Prodotti Strutturati":
|
||||||
|
seriesView.Color = Color.MediumPurple;
|
||||||
|
break;
|
||||||
|
case "Azioni e Fondi Azionari":
|
||||||
|
seriesView.Color = Color.OrangeRed;
|
||||||
|
break;
|
||||||
|
case "Real Estate":
|
||||||
|
seriesView.Color = Color.Orange;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
seriesView.BarWidth = 0.4;
|
||||||
|
fullStackedBarChart.Series.Add(series);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Posiziona la legenda sopra e fuori dal grafico
|
||||||
|
// ref link: https://docs.devexpress.com/CoreLibraries/DevExpress.XtraCharts.LegendBase.AlignmentHorizontal
|
||||||
|
Legend legend = fullStackedBarChart.Legend;
|
||||||
|
legend.AlignmentHorizontal = LegendAlignmentHorizontal.Center;
|
||||||
|
legend.AlignmentVertical = LegendAlignmentVertical.TopOutside;
|
||||||
|
legend.MaxHorizontalPercentage = 100;
|
||||||
|
legend.Direction = LegendDirection.LeftToRight;
|
||||||
|
|
||||||
|
// Hide the legend (if necessary).
|
||||||
|
fullStackedBarChart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
fullStackedBarChart.CrosshairOptions.GroupHeaderPattern = "Portafoglio: {A}";
|
||||||
|
|
||||||
|
// Add the chart to the form.
|
||||||
|
//this.Controls.Add(fullStackedBarChart);
|
||||||
|
|
||||||
|
// Ruota etichetta sulle ascisse di 180
|
||||||
|
XYDiagram diagram = (XYDiagram)fullStackedBarChart.Diagram;
|
||||||
|
if (diagram != null)
|
||||||
|
{
|
||||||
|
// Ruota etichetta sulle ascisse di 180
|
||||||
|
diagram.AxisX.Label.Angle = -90;
|
||||||
|
diagram.AxisX.QualitativeScaleOptions.AutoGrid = false; // ref link: https://supportcenter.devexpress.com/ticket/details/t567170/how-to-force-displaying-all-axis-labels-when-the-qualitative-scale-type-is-used
|
||||||
|
diagram.AxisX.QualitativeScaleOptions.GridSpacing = 1;
|
||||||
|
|
||||||
|
// Rimuove margini su asse Y
|
||||||
|
diagram.AxisY.WholeRange.AutoSideMargins = false;
|
||||||
|
diagram.AxisY.WholeRange.EndSideMargin = 0;
|
||||||
|
diagram.AxisY.WholeRange.StartSideMargin = 0;
|
||||||
|
|
||||||
|
// Setta Ordinate (Asse Y) in percentuale
|
||||||
|
diagram.AxisY.Label.TextPattern = "{VP:P0}";
|
||||||
|
|
||||||
|
// Aggiunge legenda relativa ai ptf in basso
|
||||||
|
Legend ptfLegend = new Legend();
|
||||||
|
fullStackedBarChart.Legends.Add(ptfLegend);
|
||||||
|
|
||||||
|
ptfLegend.DockTarget = diagram.Panes.GetPaneByName("Default");
|
||||||
|
ptfLegend.AlignmentHorizontal = LegendAlignmentHorizontal.Center;
|
||||||
|
ptfLegend.AlignmentVertical = LegendAlignmentVertical.BottomOutside;
|
||||||
|
ptfLegend.ItemVisibilityMode = LegendItemVisibilityMode.AutoGeneratedAndCustom;
|
||||||
|
ptfLegend.MarkerMode = LegendMarkerMode.None;
|
||||||
|
ptfLegend.MaxHorizontalPercentage = 100;
|
||||||
|
ptfLegend.Direction = LegendDirection.LeftToRight;
|
||||||
|
|
||||||
|
AggiungeItemLegend(ptfLegend, "(A) = ATTIVO");
|
||||||
|
AggiungeItemLegend(ptfLegend, "(AR) = ATTIVO-RIC");
|
||||||
|
AggiungeItemLegend(ptfLegend, "(V) = VIRTUALE");
|
||||||
|
//AggiungeItemLegend(ptfLegend, "(P) = PENDING");
|
||||||
|
//AggiungeItemLegend(ptfLegend, "(C) = IN CHIUSURA");
|
||||||
|
}
|
||||||
|
|
||||||
|
fullStackedBarChart.DataBind();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AggiungeItemLegend(Legend ptfLegend, string legendText)
|
||||||
|
{
|
||||||
|
CustomLegendItem item = new CustomLegendItem
|
||||||
|
{
|
||||||
|
Text = legendText
|
||||||
|
};
|
||||||
|
ptfLegend.CustomItems.Add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
private string TitoloFiltri()
|
||||||
|
{
|
||||||
|
string filtro = String.Empty;
|
||||||
|
if (String.IsNullOrEmpty(gridLookupGestore.Text) == true) { filtro += "Gestore: tutti "; } else { filtro += $"Gestore: {gridLookupGestore.Text} "; }
|
||||||
|
//if (String.IsNullOrEmpty(gridLookupAdvisor.Text) == true) { filtro += "Advisor: tutti "; } else { filtro += $"Advisor: {gridLookupAdvisor.Text} "; }
|
||||||
|
if (String.IsNullOrEmpty(gridLookupLinea.Text) == true) { filtro += "Linea: tutti "; } else { filtro += $"Linea: {gridLookupLinea.Text} "; }
|
||||||
|
return (filtro);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SettaTitoloGrafico(WebChartControl chartControl)
|
||||||
|
{
|
||||||
|
// Create chart titles.
|
||||||
|
ChartTitle chartTitle1 = new ChartTitle();
|
||||||
|
ChartTitle chartTitle2 = new ChartTitle();
|
||||||
|
// Define the text for the titles.
|
||||||
|
chartTitle1.Text = "<b>GPM ASSET ALLOCATION</b>";
|
||||||
|
|
||||||
|
chartTitle2.Text = TitoloFiltri();
|
||||||
|
|
||||||
|
chartTitle2.WordWrap = true;
|
||||||
|
chartTitle2.MaxLineCount = 2;
|
||||||
|
|
||||||
|
// Define the alignment of the titles.
|
||||||
|
chartTitle1.Alignment = StringAlignment.Center;
|
||||||
|
chartTitle2.Alignment = StringAlignment.Center;
|
||||||
|
|
||||||
|
// Place the titles where it's required.
|
||||||
|
chartTitle1.Dock = ChartTitleDockStyle.Top;
|
||||||
|
chartTitle2.Dock = ChartTitleDockStyle.Top;
|
||||||
|
|
||||||
|
// Customize a title's appearance.
|
||||||
|
chartTitle1.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
chartTitle1.Font = new Font("Tahoma", 14, FontStyle.Bold);
|
||||||
|
chartTitle1.TextColor = Color.Blue;
|
||||||
|
chartTitle1.Indent = 10;
|
||||||
|
|
||||||
|
// Customize a title's appearance.
|
||||||
|
chartTitle2.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
chartTitle2.Font = new Font("Arial", 10, FontStyle.Bold);
|
||||||
|
chartTitle2.TextColor = Color.Black;
|
||||||
|
chartTitle2.Indent = 10;
|
||||||
|
|
||||||
|
// Add the titles to the chart.
|
||||||
|
chartControl.Titles.AddRange(new ChartTitle[] { chartTitle1, chartTitle2 });
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void buttonEsportaPdf_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Esporta grafico in pdf
|
||||||
|
//var ps = new PrintingSystem();
|
||||||
|
//ps.PageSettings.Landscape = true;
|
||||||
|
//var link1 = new PrintableComponentLink();
|
||||||
|
//fullStackedBarChart.DataBind();
|
||||||
|
//link1.Component = ((IChartContainer)fullStackedBarChart).Chart;
|
||||||
|
//link1.Landscape = true;
|
||||||
|
//link1.PrintingSystem = ps;
|
||||||
|
//link1.CreateDocument();
|
||||||
|
//ps.Document.AutoFitToPagesWidth = 1; // Fit to page
|
||||||
|
|
||||||
|
//using (var stream = new MemoryStream())
|
||||||
|
//{
|
||||||
|
// link1.PrintingSystem.ExportToPdf(stream);
|
||||||
|
// Response.Clear();
|
||||||
|
// Response.Buffer = false;
|
||||||
|
// Response.AppendHeader("Content-Type", "application/pdf");
|
||||||
|
// Response.AppendHeader("Content-Transfer-Encoding", "binary");
|
||||||
|
// Response.AppendHeader("Content-Disposition", $"attachment; filename=GPMAssetAllocation_{DateTime.Now.Date.ToString("yyyyMMdd")}.pdf");
|
||||||
|
// Response.BinaryWrite(stream.GetBuffer());
|
||||||
|
// Response.End();
|
||||||
|
//}
|
||||||
|
//ps.Dispose();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gridLookupGestore_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// ref: https://supportcenter.devexpress.com/ticket/details/q340370/aspxgridlookup-how-to-refresh-the-control-after-some-data-is-changed
|
||||||
|
// note: Per refreshare gridlookupLinea sulla base del valore di gridLookupGestore, salvo il valore gestore in una variabile di sessione Session["cod_ges"]
|
||||||
|
// e poi il refresh/rebind di SqlDSLinee verrà effettuato nell'evento lato client EndCallBack
|
||||||
|
|
||||||
|
ASPxGridView grid = gridLookupGestore.GridView;
|
||||||
|
object objGestore = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Gestore" });
|
||||||
|
|
||||||
|
if (objGestore != null)
|
||||||
|
{
|
||||||
|
Session["cod_ges"] = (string)objGestore;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//protected void gridLookupAdvisor_ValueChanged(object sender, EventArgs e)
|
||||||
|
//{
|
||||||
|
// ASPxGridView grid = gridLookupAdvisor.GridView;
|
||||||
|
// object objAdvisor = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Advisor" });
|
||||||
|
|
||||||
|
// if (objAdvisor != null)
|
||||||
|
// {
|
||||||
|
// Session["cod_adv"] = (string)objAdvisor;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
}
|
||||||
98
OlympiaIntranet/GPMAssetAllocation.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public partial class GPMAssetAllocation
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxFormLayout1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxFormLayout ASPxFormLayout1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gridLookupGestore control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup gridLookupGestore;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gridLookupLinea control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup gridLookupLinea;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// buttonGeneraGrafici control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton buttonGeneraGrafici;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// buttonEsportaPdf control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton buttonEsportaPdf;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// fullStackedBarChart control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.XtraCharts.Web.WebChartControl fullStackedBarChart;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSGestori control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSGestori;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSLinee control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSLinee;
|
||||||
|
}
|
||||||
|
}
|
||||||
160
OlympiaIntranet/GPMAssetAllocationAPI.aspx
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GPMAssetAllocationAPI.aspx.cs" Inherits="OlympiaIntranet.GPMAssetAllocationAPI" %>
|
||||||
|
<%@ Register Assembly="DevExpress.XtraCharts.v23.2.Web, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.XtraCharts.Web" TagPrefix="dx" %>
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
<%@ Register Assembly="DevExpress.XtraCharts.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.XtraCharts" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
<style>
|
||||||
|
html {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
function ExportChartToPdf(e) {
|
||||||
|
/*
|
||||||
|
e.processOnServer = false;
|
||||||
|
var chartPrintOptions = clientChart.GetPrintOptions();
|
||||||
|
chartPrintOptions.SetSizeMode('Stretch');
|
||||||
|
chartPrintOptions.SetLandscape(true);
|
||||||
|
const date = new Date();
|
||||||
|
var fileName = 'GPM_AssetAllocation_' + date.toLocaleDateString();
|
||||||
|
clientChart.SaveToDisk('pdf', fileName);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
function OnFirstEndCallback(s, e) {
|
||||||
|
//clientgridLookupLinea.GetGridView().Refresh();
|
||||||
|
//clientgridLookupConsulente.GetGridView().Refresh();
|
||||||
|
|
||||||
|
// azzera eventuale selezione in gridLookupLinea
|
||||||
|
clientgridLookupLinea.SetValue(null);
|
||||||
|
|
||||||
|
// azzera eventuale selezione in gridLookupConsulente
|
||||||
|
clientgridLookupConsulente.SetValue(null);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
<dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server" ColCount="2" EnableTheming="True" Theme="Aqua" ColumnCount="2">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutGroup Caption="Filtri Selezione" ColCount="5" ColSpan="1" ColumnCount="5">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="Gestore" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<%-- <dx:ASPxGridLookup ID="gridLookupGestore" runat="server" Theme="Aqua" DataSourceID="SqlDSGestori" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Gestore" TextFormatString="{0}" OnValueChanged="gridLookupGestore_ValueChanged">
|
||||||
|
<ClientSideEvents EndCallback="OnFirstEndCallback" />
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>--%>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Consulente" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<%-- <dx:ASPxGridLookup ID="gridLookupConsulente" ClientInstanceName="clientgridLookupConsulente" runat="server" Theme="Aqua" DataSourceID="SqlDSConsulenti" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Consulente" TextFormatString="{0}">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>--%>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Linea di Gestione" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<%-- <dx:ASPxGridLookup ID="gridLookupLinea" ClientInstanceName="clientgridLookupLinea" runat="server" Theme="Aqua" DataSourceID="SqlDSLinee" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Linea" TextFormatString="{0}">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>--%>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Genera Grafico" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="buttonGeneraGrafici" runat="server" Theme="Aqua" OnClick="buttonGeneraGrafici_Click">
|
||||||
|
<Image IconID="chart_chart_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Esporta in Pdf" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<%-- <dx:ASPxButton ID="buttonEsportaPdf" runat="server" Theme="Aqua" AutoPostBack="True" OnClick="buttonEsportaPdf_Click">
|
||||||
|
<Image IconID="export_exporttopdf_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>--%>
|
||||||
|
<dx:ASPxButton ID="buttonEsportaPdf" runat="server" AutoPostBack="False" OnClick="buttonEsportaPdf_Click" Theme="Aqua">
|
||||||
|
<ClientSideEvents Click="function(s, e) { ExportChartToPdf(e); }" />
|
||||||
|
<Image IconID="export_exporttopdf_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxFormLayout>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
<dx:WebChartControl ID="fullStackedBarChart" ClientInstanceName="clientChart" runat="server" CrosshairEnabled="True" Height="720px" Width="1280px" RenderFormat="Svg" EnableViewState="False" AppearanceNameSerializable="Gray">
|
||||||
|
</dx:WebChartControl>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<%-- <asp:SqlDataSource ID="SqlDSGestori" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Gestori" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSLinee" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Linee1" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="cod_ges" SessionField="cod_ges" />
|
||||||
|
<asp:SessionParameter Name="user" SessionField="user" />
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSConsulenti" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Consulenti" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="cod_ges" SessionField="cod_ges" />
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>--%>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
493
OlympiaIntranet/GPMAssetAllocationAPI.aspx.cs
Normal file
@@ -0,0 +1,493 @@
|
|||||||
|
using DevExpress.Web;
|
||||||
|
using DevExpress.XtraCharts;
|
||||||
|
using DevExpress.XtraCharts.Native;
|
||||||
|
using DevExpress.XtraCharts.Web;
|
||||||
|
using DevExpress.Pdf;
|
||||||
|
using DevExpress.XtraPrinting;
|
||||||
|
using DevExpress.XtraGrid;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
|
||||||
|
public partial class GPMAssetAllocationAPI : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
string cod_ges = String.Empty;
|
||||||
|
//string cod_adv = String.Empty;
|
||||||
|
string cod_lin = String.Empty;
|
||||||
|
|
||||||
|
protected void Page_Load(object sender, EventArgs e) // Parametri input : cod_ges,cod_adv,cod_lin
|
||||||
|
{
|
||||||
|
// (@cod_ges AS VARCHAR(50), @cod_adv AS VARCHAR(50), @cod_lin AS VARCHAR(50))
|
||||||
|
cod_ges = Request.QueryString["cod_ges"];
|
||||||
|
//cod_adv = Request.QueryString["cod_adv"];
|
||||||
|
cod_lin = Request.QueryString["cod_lin"];
|
||||||
|
|
||||||
|
//Session["cod_ges"] = cod_ges; // serve per popolare gridlookupLinea!!
|
||||||
|
|
||||||
|
PlottaFullStackedBar();
|
||||||
|
|
||||||
|
buttonEsportaPdf_Click(this, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void buttonGeneraGrafici_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
PlottaFullStackedBar();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PlottaFullStackedBar()
|
||||||
|
{
|
||||||
|
//if (!(String.IsNullOrEmpty(cod_ges) == false && String.IsNullOrEmpty(cod_adv) == false && String.IsNullOrEmpty(cod_lin) == false)) return;
|
||||||
|
if (!(String.IsNullOrEmpty(cod_ges) == false && String.IsNullOrEmpty(cod_lin) == false)) return;
|
||||||
|
// Carica dati in dtStackedBarsData
|
||||||
|
|
||||||
|
DataTable dtStackedBarsData = CommonClass.execQuery_Datatable_Sql("GDN_GPMAssetAllocation_StackedBars2",
|
||||||
|
Properties.Settings.Default.SqlConnection,
|
||||||
|
cod_ges,
|
||||||
|
"",
|
||||||
|
cod_lin,
|
||||||
|
-1,
|
||||||
|
-1,
|
||||||
|
null,
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
null,
|
||||||
|
"");
|
||||||
|
Session["dtStackedBarsData"] = dtStackedBarsData;
|
||||||
|
var listAssetClass = (from r in dtStackedBarsData.AsEnumerable()
|
||||||
|
group r by r["Asset Class"]);
|
||||||
|
|
||||||
|
|
||||||
|
fullStackedBarChart.DataSource = dtStackedBarsData;
|
||||||
|
|
||||||
|
// Cancella tutte le serie prima di plottare
|
||||||
|
fullStackedBarChart.Series.Clear();
|
||||||
|
|
||||||
|
// Cancella tutti i titoli della serie prima di plottare
|
||||||
|
fullStackedBarChart.Titles.Clear();
|
||||||
|
|
||||||
|
// Rimuove legenda aggiuntiva dei portafogli
|
||||||
|
fullStackedBarChart.Legends.Clear();
|
||||||
|
|
||||||
|
// Setta titolo del grafico
|
||||||
|
SettaTitoloGrafico(fullStackedBarChart);
|
||||||
|
|
||||||
|
|
||||||
|
foreach (var groupedAssetClass in listAssetClass)
|
||||||
|
{
|
||||||
|
string AssetClass = (string)groupedAssetClass.Key;
|
||||||
|
Series series = new Series(AssetClass, ViewType.FullStackedBar);
|
||||||
|
foreach (var seriesPoint in groupedAssetClass)
|
||||||
|
{
|
||||||
|
series.Points.Add(new SeriesPoint(seriesPoint["Codice Portafoglio"], seriesPoint["Esposizione"]));
|
||||||
|
}
|
||||||
|
series.ArgumentScaleType = ScaleType.Qualitative;
|
||||||
|
series.CrosshairContentShowMode = CrosshairContentShowMode.Default;
|
||||||
|
series.CrosshairLabelPattern = "{S}: {V:F2}%"; // ref link : https://docs.devexpress.com/CoreLibraries/DevExpress.XtraCharts.SeriesBase.CrosshairLabelPattern
|
||||||
|
|
||||||
|
FullStackedBarSeriesView seriesView = (FullStackedBarSeriesView)series.View;
|
||||||
|
switch (AssetClass)
|
||||||
|
{
|
||||||
|
case "Fondi Bilanciati e Flessibili":
|
||||||
|
seriesView.Color = Color.LightCyan;
|
||||||
|
break;
|
||||||
|
case "Liquidità":
|
||||||
|
seriesView.Color = Color.LightGreen;
|
||||||
|
break;
|
||||||
|
case "Obbligazioni e Fondi Obbligazionari":
|
||||||
|
seriesView.Color = Color.LightSalmon;
|
||||||
|
break;
|
||||||
|
case "Prodotti Strutturati":
|
||||||
|
seriesView.Color = Color.MediumPurple;
|
||||||
|
break;
|
||||||
|
case "Azioni e Fondi Azionari":
|
||||||
|
seriesView.Color = Color.OrangeRed;
|
||||||
|
break;
|
||||||
|
case "Real Estate":
|
||||||
|
seriesView.Color = Color.Orange;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
seriesView.BarWidth = 0.4;
|
||||||
|
fullStackedBarChart.Series.Add(series);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Posiziona la legenda sopra e fuori dal grafico
|
||||||
|
// ref link: https://docs.devexpress.com/CoreLibraries/DevExpress.XtraCharts.LegendBase.AlignmentHorizontal
|
||||||
|
Legend legend = fullStackedBarChart.Legend;
|
||||||
|
legend.AlignmentHorizontal = LegendAlignmentHorizontal.Center;
|
||||||
|
legend.AlignmentVertical = LegendAlignmentVertical.TopOutside;
|
||||||
|
legend.MaxHorizontalPercentage = 100;
|
||||||
|
legend.Direction = LegendDirection.LeftToRight;
|
||||||
|
|
||||||
|
// Hide the legend (if necessary).
|
||||||
|
fullStackedBarChart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
fullStackedBarChart.CrosshairOptions.GroupHeaderPattern = "Portafoglio: {A}";
|
||||||
|
|
||||||
|
// Add the chart to the form.
|
||||||
|
//this.Controls.Add(fullStackedBarChart);
|
||||||
|
|
||||||
|
// Ruota etichetta sulle ascisse di 180
|
||||||
|
XYDiagram diagram = (XYDiagram)fullStackedBarChart.Diagram;
|
||||||
|
if (diagram != null)
|
||||||
|
{
|
||||||
|
// Ruota etichetta sulle ascisse di 180
|
||||||
|
diagram.AxisX.Label.Angle = -90;
|
||||||
|
diagram.AxisX.QualitativeScaleOptions.AutoGrid = false; // ref link: https://supportcenter.devexpress.com/ticket/details/t567170/how-to-force-displaying-all-axis-labels-when-the-qualitative-scale-type-is-used
|
||||||
|
diagram.AxisX.QualitativeScaleOptions.GridSpacing = 1;
|
||||||
|
|
||||||
|
// Rimuove margini su asse Y
|
||||||
|
diagram.AxisY.WholeRange.AutoSideMargins = false;
|
||||||
|
diagram.AxisY.WholeRange.EndSideMargin = 0;
|
||||||
|
diagram.AxisY.WholeRange.StartSideMargin = 0;
|
||||||
|
|
||||||
|
// Setta Ordinate (Asse Y) in percentuale
|
||||||
|
diagram.AxisY.Label.TextPattern = "{VP:P0}";
|
||||||
|
|
||||||
|
// Aggiunge legenda relativa ai ptf in basso
|
||||||
|
Legend ptfLegend = new Legend();
|
||||||
|
fullStackedBarChart.Legends.Add(ptfLegend);
|
||||||
|
|
||||||
|
ptfLegend.DockTarget = diagram.Panes.GetPaneByName("Default");
|
||||||
|
ptfLegend.AlignmentHorizontal = LegendAlignmentHorizontal.Center;
|
||||||
|
ptfLegend.AlignmentVertical = LegendAlignmentVertical.BottomOutside;
|
||||||
|
ptfLegend.ItemVisibilityMode = LegendItemVisibilityMode.AutoGeneratedAndCustom;
|
||||||
|
ptfLegend.MarkerMode = LegendMarkerMode.None;
|
||||||
|
ptfLegend.MaxHorizontalPercentage = 100;
|
||||||
|
ptfLegend.Direction = LegendDirection.LeftToRight;
|
||||||
|
|
||||||
|
AggiungeItemLegend(ptfLegend, "(A) = ATTIVO");
|
||||||
|
AggiungeItemLegend(ptfLegend, "(AR) = ATTIVO-RIC");
|
||||||
|
AggiungeItemLegend(ptfLegend, "(V) = VIRTUALE");
|
||||||
|
//AggiungeItemLegend(ptfLegend, "(P) = PENDING");
|
||||||
|
//AggiungeItemLegend(ptfLegend, "(C) = IN CHIUSURA");
|
||||||
|
}
|
||||||
|
|
||||||
|
fullStackedBarChart.DataBind();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AggiungeItemLegend(Legend ptfLegend, string legendText)
|
||||||
|
{
|
||||||
|
CustomLegendItem item = new CustomLegendItem
|
||||||
|
{
|
||||||
|
Text = legendText
|
||||||
|
};
|
||||||
|
ptfLegend.CustomItems.Add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
private string TitoloFiltri()
|
||||||
|
{
|
||||||
|
string filtro = String.Empty;
|
||||||
|
if (String.IsNullOrEmpty(cod_ges) == true) { filtro += "Gestore: tutti "; } else { filtro += $"Gestore: {cod_ges} "; }
|
||||||
|
//if (String.IsNullOrEmpty(cod_adv) == true) { filtro += "Advisor: tutti "; } else { filtro += $"Advisor: {cod_adv} "; }
|
||||||
|
if (String.IsNullOrEmpty(cod_lin) == true) { filtro += "Linea: tutti "; } else { filtro += $"Linea: {cod_lin} "; }
|
||||||
|
return (filtro);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SettaTitoloGrafico(WebChartControl chartControl)
|
||||||
|
{
|
||||||
|
// Create chart titles.
|
||||||
|
ChartTitle chartTitle1 = new ChartTitle();
|
||||||
|
ChartTitle chartTitle2 = new ChartTitle();
|
||||||
|
// Define the text for the titles.
|
||||||
|
chartTitle1.Text = "<b>GPM ASSET ALLOCATION</b>";
|
||||||
|
|
||||||
|
chartTitle2.Text = TitoloFiltri();
|
||||||
|
|
||||||
|
chartTitle2.WordWrap = true;
|
||||||
|
chartTitle2.MaxLineCount = 2;
|
||||||
|
|
||||||
|
// Define the alignment of the titles.
|
||||||
|
chartTitle1.Alignment = StringAlignment.Center;
|
||||||
|
chartTitle2.Alignment = StringAlignment.Center;
|
||||||
|
|
||||||
|
// Place the titles where it's required.
|
||||||
|
chartTitle1.Dock = ChartTitleDockStyle.Top;
|
||||||
|
chartTitle2.Dock = ChartTitleDockStyle.Top;
|
||||||
|
|
||||||
|
// Customize a title's appearance.
|
||||||
|
chartTitle1.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
chartTitle1.Font = new Font("Tahoma", 14, FontStyle.Bold);
|
||||||
|
chartTitle1.TextColor = Color.Blue;
|
||||||
|
chartTitle1.Indent = 10;
|
||||||
|
|
||||||
|
// Customize a title's appearance.
|
||||||
|
chartTitle2.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
chartTitle2.Font = new Font("Arial", 10, FontStyle.Bold);
|
||||||
|
chartTitle2.TextColor = Color.Black;
|
||||||
|
chartTitle2.Indent = 10;
|
||||||
|
|
||||||
|
// Add the titles to the chart.
|
||||||
|
chartControl.Titles.AddRange(new ChartTitle[] { chartTitle1, chartTitle2 });
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void buttonEsportaPdf_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Esporta grafico in pdf
|
||||||
|
var ps = new PrintingSystem();
|
||||||
|
ps.PageSettings.Landscape = true;
|
||||||
|
var link1 = new PrintableComponentLink();
|
||||||
|
fullStackedBarChart.DataBind();
|
||||||
|
link1.Component = ((IChartContainer)fullStackedBarChart).Chart;
|
||||||
|
link1.Landscape = true;
|
||||||
|
link1.PrintingSystem = ps;
|
||||||
|
link1.CreateDocument();
|
||||||
|
ps.Document.AutoFitToPagesWidth = 1; // Fit to page
|
||||||
|
|
||||||
|
using (var stream = new MemoryStream())
|
||||||
|
{
|
||||||
|
link1.PrintingSystem.ExportToPdf(stream);
|
||||||
|
Response.Clear();
|
||||||
|
Response.Buffer = false;
|
||||||
|
Response.AppendHeader("Content-Type", "application/pdf");
|
||||||
|
Response.AppendHeader("Content-Transfer-Encoding", "binary");
|
||||||
|
Response.AppendHeader("Content-Disposition", $"attachment; filename=GPMAssetAllocation_{cod_ges}_{cod_lin}_{DateTime.Now.Date.ToString("yyyyMMdd")}.pdf");
|
||||||
|
Response.BinaryWrite(stream.GetBuffer());
|
||||||
|
Response.End();
|
||||||
|
}
|
||||||
|
ps.Dispose();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//public partial class GPMAssetAllocationAPI : System.Web.UI.Page
|
||||||
|
//{
|
||||||
|
// string cod_ges = String.Empty;
|
||||||
|
// string cod_pro = String.Empty;
|
||||||
|
// string cod_lin = String.Empty;
|
||||||
|
|
||||||
|
// protected void Page_Load(object sender, EventArgs e) // Parametri input : cod_ges,cod_pro,cod_lin
|
||||||
|
// {
|
||||||
|
// // (@cod_ges AS VARCHAR(50), @cod_pro AS VARCHAR(50), @cod_lin AS VARCHAR(50))
|
||||||
|
// cod_ges = Request.QueryString["cod_ges"];
|
||||||
|
// cod_pro = Request.QueryString["cod_pro"];
|
||||||
|
// cod_lin = Request.QueryString["cod_lin"];
|
||||||
|
|
||||||
|
// Session["cod_ges"] = cod_ges; // serve per popolare gridlookupLinea!!
|
||||||
|
|
||||||
|
// PlottaFullStackedBar();
|
||||||
|
|
||||||
|
// buttonEsportaPdf_Click(this, null);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// protected void buttonGeneraGrafici_Click(object sender, EventArgs e)
|
||||||
|
// {
|
||||||
|
// PlottaFullStackedBar();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// private void PlottaFullStackedBar()
|
||||||
|
// {
|
||||||
|
// if (!(String.IsNullOrEmpty(cod_ges) == false && String.IsNullOrEmpty(cod_pro) == false && String.IsNullOrEmpty(cod_lin) == false)) return;
|
||||||
|
|
||||||
|
// // Carica dati in dtStackedBarsData
|
||||||
|
|
||||||
|
// DataTable dtStackedBarsData = CommonClass.execQuery_Datatable_Sql("GDN_GPMAssetAllocation_StackedBars", Properties.Settings.Default.SqlConnection, cod_ges, cod_pro, cod_lin);
|
||||||
|
// Session["dtStackedBarsData"] = dtStackedBarsData;
|
||||||
|
// var listAssetClass = (from r in dtStackedBarsData.AsEnumerable()
|
||||||
|
// group r by r["Asset Class"]);
|
||||||
|
|
||||||
|
|
||||||
|
// fullStackedBarChart.DataSource = dtStackedBarsData;
|
||||||
|
|
||||||
|
// // Cancella tutte le serie prima di plottare
|
||||||
|
// fullStackedBarChart.Series.Clear();
|
||||||
|
|
||||||
|
// // Cancella tutti i titoli della serie prima di plottare
|
||||||
|
// fullStackedBarChart.Titles.Clear();
|
||||||
|
|
||||||
|
// // Rimuove legenda aggiuntiva dei portafogli
|
||||||
|
// fullStackedBarChart.Legends.Clear();
|
||||||
|
|
||||||
|
// // Setta titolo del grafico
|
||||||
|
// SettaTitoloGrafico(fullStackedBarChart);
|
||||||
|
|
||||||
|
|
||||||
|
// foreach (var groupedAssetClass in listAssetClass)
|
||||||
|
// {
|
||||||
|
// string AssetClass = (string)groupedAssetClass.Key;
|
||||||
|
// Series series = new Series(AssetClass, ViewType.FullStackedBar);
|
||||||
|
// foreach (var seriesPoint in groupedAssetClass)
|
||||||
|
// {
|
||||||
|
// series.Points.Add(new SeriesPoint(seriesPoint["Codice Portafoglio"], seriesPoint["Esposizione"]));
|
||||||
|
// }
|
||||||
|
// series.ArgumentScaleType = ScaleType.Qualitative;
|
||||||
|
// series.CrosshairContentShowMode = CrosshairContentShowMode.Default;
|
||||||
|
// series.CrosshairLabelPattern = "{S}: {V:F2}%"; // ref link : https://docs.devexpress.com/CoreLibraries/DevExpress.XtraCharts.SeriesBase.CrosshairLabelPattern
|
||||||
|
|
||||||
|
// FullStackedBarSeriesView seriesView = (FullStackedBarSeriesView)series.View;
|
||||||
|
// switch (AssetClass)
|
||||||
|
// {
|
||||||
|
// case "Fondi Bilanciati e Flessibili":
|
||||||
|
// seriesView.Color = Color.LightCyan;
|
||||||
|
// break;
|
||||||
|
// case "Liquidità":
|
||||||
|
// seriesView.Color = Color.LightGreen;
|
||||||
|
// break;
|
||||||
|
// case "Obbligazioni e Fondi Obbligazionari":
|
||||||
|
// seriesView.Color = Color.LightSalmon;
|
||||||
|
// break;
|
||||||
|
// case "Prodotti Strutturati":
|
||||||
|
// seriesView.Color = Color.MediumPurple;
|
||||||
|
// break;
|
||||||
|
// case "Azioni e Fondi Azionari":
|
||||||
|
// seriesView.Color = Color.OrangeRed;
|
||||||
|
// break;
|
||||||
|
// case "Real Estate":
|
||||||
|
// seriesView.Color = Color.Orange;
|
||||||
|
// break;
|
||||||
|
// default:
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// seriesView.BarWidth = 0.4;
|
||||||
|
// fullStackedBarChart.Series.Add(series);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // Posiziona la legenda sopra e fuori dal grafico
|
||||||
|
// // ref link: https://docs.devexpress.com/CoreLibraries/DevExpress.XtraCharts.LegendBase.AlignmentHorizontal
|
||||||
|
// Legend legend = fullStackedBarChart.Legend;
|
||||||
|
// legend.AlignmentHorizontal = LegendAlignmentHorizontal.Center;
|
||||||
|
// legend.AlignmentVertical = LegendAlignmentVertical.TopOutside;
|
||||||
|
// legend.MaxHorizontalPercentage = 100;
|
||||||
|
// legend.Direction = LegendDirection.LeftToRight;
|
||||||
|
|
||||||
|
// // Hide the legend (if necessary).
|
||||||
|
// fullStackedBarChart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
// fullStackedBarChart.CrosshairOptions.GroupHeaderPattern = "Portafoglio: {A}";
|
||||||
|
|
||||||
|
// // Add the chart to the form.
|
||||||
|
// //this.Controls.Add(fullStackedBarChart);
|
||||||
|
|
||||||
|
// // Ruota etichetta sulle ascisse di 180
|
||||||
|
// XYDiagram diagram = (XYDiagram)fullStackedBarChart.Diagram;
|
||||||
|
// if (diagram != null)
|
||||||
|
// {
|
||||||
|
// // Ruota etichetta sulle ascisse di 180
|
||||||
|
// diagram.AxisX.Label.Angle = -90;
|
||||||
|
// diagram.AxisX.QualitativeScaleOptions.AutoGrid = false; // ref link: https://supportcenter.devexpress.com/ticket/details/t567170/how-to-force-displaying-all-axis-labels-when-the-qualitative-scale-type-is-used
|
||||||
|
// diagram.AxisX.QualitativeScaleOptions.GridSpacing = 1;
|
||||||
|
|
||||||
|
// // Rimuove margini su asse Y
|
||||||
|
// diagram.AxisY.WholeRange.AutoSideMargins = false;
|
||||||
|
// diagram.AxisY.WholeRange.EndSideMargin = 0;
|
||||||
|
// diagram.AxisY.WholeRange.StartSideMargin = 0;
|
||||||
|
|
||||||
|
// // Setta Ordinate (Asse Y) in percentuale
|
||||||
|
// diagram.AxisY.Label.TextPattern = "{VP:P0}";
|
||||||
|
|
||||||
|
// // Aggiunge legenda relativa ai ptf in basso
|
||||||
|
// Legend ptfLegend = new Legend();
|
||||||
|
// fullStackedBarChart.Legends.Add(ptfLegend);
|
||||||
|
|
||||||
|
// ptfLegend.DockTarget = diagram.Panes.GetPaneByName("Default");
|
||||||
|
// ptfLegend.AlignmentHorizontal = LegendAlignmentHorizontal.Center;
|
||||||
|
// ptfLegend.AlignmentVertical = LegendAlignmentVertical.BottomOutside;
|
||||||
|
// ptfLegend.ItemVisibilityMode = LegendItemVisibilityMode.AutoGeneratedAndCustom;
|
||||||
|
// ptfLegend.MarkerMode = LegendMarkerMode.None;
|
||||||
|
// ptfLegend.MaxHorizontalPercentage = 100;
|
||||||
|
// ptfLegend.Direction = LegendDirection.LeftToRight;
|
||||||
|
|
||||||
|
// AggiungeItemLegend(ptfLegend, "(A) = ATTIVO");
|
||||||
|
// //AggiungeItemLegend(ptfLegend, "(C) = IN CHIUSURA");
|
||||||
|
// AggiungeItemLegend(ptfLegend, "(AR) = ATTIVO-RIC");
|
||||||
|
// AggiungeItemLegend(ptfLegend, "(V) = VIRTUALE");
|
||||||
|
// //AggiungeItemLegend(ptfLegend, "(P) = PENDING");
|
||||||
|
// }
|
||||||
|
|
||||||
|
// fullStackedBarChart.DataBind();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// private void AggiungeItemLegend(Legend ptfLegend, string legendText)
|
||||||
|
// {
|
||||||
|
// CustomLegendItem item = new CustomLegendItem
|
||||||
|
// {
|
||||||
|
// Text = legendText
|
||||||
|
// };
|
||||||
|
// ptfLegend.CustomItems.Add(item);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// private string TitoloFiltri()
|
||||||
|
// {
|
||||||
|
// string filtro = String.Empty;
|
||||||
|
// if (String.IsNullOrEmpty(cod_ges) == true) { filtro += "Gestore: tutti "; } else { filtro += $"Gestore: {cod_ges} "; }
|
||||||
|
// if (String.IsNullOrEmpty(cod_pro) == true) { filtro += "Consulente: tutti "; } else { filtro += $"Consulente: {cod_pro} "; }
|
||||||
|
// if (String.IsNullOrEmpty(cod_lin) == true) { filtro += "Linea: tutti "; } else { filtro += $"Linea: {cod_lin} "; }
|
||||||
|
// return (filtro);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// private void SettaTitoloGrafico(WebChartControl chartControl)
|
||||||
|
// {
|
||||||
|
// // Create chart titles.
|
||||||
|
// ChartTitle chartTitle1 = new ChartTitle();
|
||||||
|
// ChartTitle chartTitle2 = new ChartTitle();
|
||||||
|
// // Define the text for the titles.
|
||||||
|
// chartTitle1.Text = "<b>GPM ASSET ALLOCATION</b>";
|
||||||
|
|
||||||
|
// chartTitle2.Text = TitoloFiltri();
|
||||||
|
|
||||||
|
// chartTitle2.WordWrap = true;
|
||||||
|
// chartTitle2.MaxLineCount = 2;
|
||||||
|
|
||||||
|
// // Define the alignment of the titles.
|
||||||
|
// chartTitle1.Alignment = StringAlignment.Center;
|
||||||
|
// chartTitle2.Alignment = StringAlignment.Center;
|
||||||
|
|
||||||
|
// // Place the titles where it's required.
|
||||||
|
// chartTitle1.Dock = ChartTitleDockStyle.Top;
|
||||||
|
// chartTitle2.Dock = ChartTitleDockStyle.Top;
|
||||||
|
|
||||||
|
// // Customize a title's appearance.
|
||||||
|
// chartTitle1.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
// chartTitle1.Font = new Font("Tahoma", 14, FontStyle.Bold);
|
||||||
|
// chartTitle1.TextColor = Color.Blue;
|
||||||
|
// chartTitle1.Indent = 10;
|
||||||
|
|
||||||
|
// // Customize a title's appearance.
|
||||||
|
// chartTitle2.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
// chartTitle2.Font = new Font("Arial", 10, FontStyle.Bold);
|
||||||
|
// chartTitle2.TextColor = Color.Black;
|
||||||
|
// chartTitle2.Indent = 10;
|
||||||
|
|
||||||
|
// // Add the titles to the chart.
|
||||||
|
// chartControl.Titles.AddRange(new ChartTitle[] { chartTitle1, chartTitle2 });
|
||||||
|
// }
|
||||||
|
|
||||||
|
// protected void buttonEsportaPdf_Click(object sender, EventArgs e)
|
||||||
|
// {
|
||||||
|
|
||||||
|
// // Esporta grafico in pdf
|
||||||
|
// var ps = new PrintingSystem();
|
||||||
|
// ps.PageSettings.Landscape = true;
|
||||||
|
// var link1 = new PrintableComponentLink();
|
||||||
|
// fullStackedBarChart.DataBind();
|
||||||
|
// link1.Component = ((IChartContainer)fullStackedBarChart).Chart;
|
||||||
|
// link1.Landscape = true;
|
||||||
|
// link1.PrintingSystem = ps;
|
||||||
|
// link1.CreateDocument();
|
||||||
|
// ps.Document.AutoFitToPagesWidth = 1; // Fit to page
|
||||||
|
|
||||||
|
// using (var stream = new MemoryStream())
|
||||||
|
// {
|
||||||
|
// link1.PrintingSystem.ExportToPdf(stream);
|
||||||
|
// Response.Clear();
|
||||||
|
// Response.Buffer = false;
|
||||||
|
// Response.AppendHeader("Content-Type", "application/pdf");
|
||||||
|
// Response.AppendHeader("Content-Transfer-Encoding", "binary");
|
||||||
|
// Response.AppendHeader("Content-Disposition", $"attachment; filename=GPMAssetAllocation_{cod_ges}_{cod_lin}_{DateTime.Now.Date.ToString("yyyyMMdd")}.pdf");
|
||||||
|
// Response.BinaryWrite(stream.GetBuffer());
|
||||||
|
// Response.End();
|
||||||
|
// }
|
||||||
|
// ps.Dispose();
|
||||||
|
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
}
|
||||||
60
OlympiaIntranet/GPMAssetAllocationAPI.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet {
|
||||||
|
|
||||||
|
|
||||||
|
public partial class GPMAssetAllocationAPI {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxFormLayout1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxFormLayout ASPxFormLayout1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// buttonGeneraGrafici control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton buttonGeneraGrafici;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// buttonEsportaPdf control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton buttonEsportaPdf;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// fullStackedBarChart control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.XtraCharts.Web.WebChartControl fullStackedBarChart;
|
||||||
|
}
|
||||||
|
}
|
||||||
167
OlympiaIntranet/GPMDispRendRisk.aspx
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GPMDispRendRisk.aspx.cs" Inherits="OlympiaIntranet.GPMDispRendRisk" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.XtraCharts.v23.2.Web, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.XtraCharts.Web" TagPrefix="dx" %>
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
<style>
|
||||||
|
html {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
function ExportChartToPdf(e) {
|
||||||
|
e.processOnServer = false;
|
||||||
|
var chartPrintOptions = clientChart.GetPrintOptions();
|
||||||
|
chartPrintOptions.SetSizeMode('Stretch');
|
||||||
|
chartPrintOptions.SetLandscape(true);
|
||||||
|
const date = new Date();
|
||||||
|
var fileName = 'GPM_DispRendRisk_' + date.toLocaleDateString();
|
||||||
|
clientChart.SaveToDisk('pdf', fileName);
|
||||||
|
}
|
||||||
|
function OnFirstEndCallback(s, e) {
|
||||||
|
//clientgridLookupLinea.GetGridView().Refresh();
|
||||||
|
|
||||||
|
// azzera eventuale selezione in gridLookupLinea
|
||||||
|
clientgridLookupLinea.SetValue(null);
|
||||||
|
|
||||||
|
// azzera eventuale selezione in gridLookupAdvisor
|
||||||
|
//clientgridLookupAdvisor.SetValue(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
function OnFirstEndCallbackAdvisor(s, e) {
|
||||||
|
// azzera eventuale selezione in gridLookupLinea
|
||||||
|
clientgridLookupLinea.SetValue(null);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
<dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server" EnableTheming="True" Theme="Aqua">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutGroup Caption="Filtri Selezione" ColCount="6" ColSpan="1" ColumnCount="6">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="Gestore" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="gridLookupGestore" runat="server" Theme="Aqua" DataSourceID="SqlDSGestori" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Gestore" TextFormatString="{0}" OnValueChanged="gridLookupGestore_ValueChanged">
|
||||||
|
<ClientSideEvents EndCallback="OnFirstEndCallback" />
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<%-- <dx:LayoutItem Caption="Advisor" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="gridLookupAdvisor" ClientInstanceName="clientgridLookupAdvisor" runat="server" Theme="Aqua" DataSourceID="SqlDSAdvisor" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Advisor" TextFormatString="{0}" OnValueChanged="gridLookupAdvisor_ValueChanged">
|
||||||
|
<ClientSideEvents EndCallback="OnFirstEndCallbackAdvisor" />
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>--%>
|
||||||
|
<dx:LayoutItem Caption="Linea di Gestione" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="gridLookupLinea" ClientInstanceName="clientgridLookupLinea" runat="server" Theme="Aqua" DataSourceID="SqlDSLinee" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Linea" TextFormatString="{0}">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Data riferimento" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxDateEdit ID="dateEditDataIns" runat="server" Theme="Aqua" DisplayFormatString="dd/MM/yyyy">
|
||||||
|
</dx:ASPxDateEdit>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="buttonGeneraGrafici" runat="server" OnClick="buttonGeneraGrafici_Click" Theme="Aqua">
|
||||||
|
<Image IconID="chart_chart_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="buttonEsportaPdf" runat="server" AutoPostBack="False" OnClick="buttonEsportaPdf_Click" Theme="Aqua">
|
||||||
|
<ClientSideEvents Click="function(s, e) { ExportChartToPdf(e); }" />
|
||||||
|
<Image IconID="export_exporttopdf_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxFormLayout>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
<dx:WebChartControl ID="pointChart" ClientInstanceName="clientChart" runat="server" CrosshairEnabled="True" Height="720px" Width="1280px" RenderFormat="Svg" EnableViewState="False" AppearanceNameSerializable="Gray">
|
||||||
|
</dx:WebChartControl>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<asp:SqlDataSource ID="SqlDSGestori" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Gestori1" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="user" SessionField="user" />
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSLinee" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Linee3" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="cod_ges" SessionField="cod_ges" />
|
||||||
|
<%-- <asp:SessionParameter Name="cod_adv" SessionField="cod_adv" />--%>
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<%-- <asp:SqlDataSource ID="SqlDSAdvisor" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Advisor" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="cod_ges" SessionField="cod_ges" />
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>--%>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
341
OlympiaIntranet/GPMDispRendRisk.aspx.cs
Normal file
@@ -0,0 +1,341 @@
|
|||||||
|
using DevExpress.Web;
|
||||||
|
using DevExpress.XtraCharts;
|
||||||
|
using DevExpress.XtraCharts.Native;
|
||||||
|
using DevExpress.XtraCharts.Web;
|
||||||
|
using DevExpress.Pdf;
|
||||||
|
using DevExpress.XtraPrinting;
|
||||||
|
using DevExpress.XtraGrid;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
using DevExpress.Utils;
|
||||||
|
using DevExpress.XtraReports.UI;
|
||||||
|
using DevExpress.XtraReports.Web;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
|
||||||
|
public partial class GPMDispRendRisk : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
string[] adminUser = new string[] { "fcostalonga", "ecanziani", "fpisoni", "glicciardello" };
|
||||||
|
protected void Page_Init(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (DateTime.Now.Date.DayOfWeek == DayOfWeek.Monday) dateEditDataIns.Date = DateTime.Now.Date.AddDays(-3); // se è lunedì prende 3 giorni prima ossia venerdì
|
||||||
|
else
|
||||||
|
if (DateTime.Now.Date.DayOfWeek == DayOfWeek.Sunday) dateEditDataIns.Date = DateTime.Now.Date.AddDays(-2); // se è lunedì prende 2 giorni prima ossia venerdì
|
||||||
|
else
|
||||||
|
dateEditDataIns.Date = DateTime.Now.Date.AddDays(-1); // .. in tutti gli altri casi cioè se è martedì,...sabato allora prende il giorno precedente
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (HttpContext.Current.User.Identity.IsAuthenticated == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string loggedUser = HttpContext.Current.User.Identity.Name;
|
||||||
|
|
||||||
|
if (adminUser.Contains(loggedUser) == true) { gridLookupGestore.Enabled = true; }
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gridLookupGestore.Value = loggedUser.Substring(1).ToUpper();
|
||||||
|
gridLookupGestore.Enabled = false;
|
||||||
|
}
|
||||||
|
//switch (loggedUser)
|
||||||
|
//{
|
||||||
|
// // Gestori
|
||||||
|
// case "sbettinelli":
|
||||||
|
// gridLookupGestore.Value = "BETTINELLI";
|
||||||
|
// gridLookupGestore.Enabled = false;
|
||||||
|
// break;
|
||||||
|
// case "agamba":
|
||||||
|
// gridLookupGestore.Value = "GAMBA";
|
||||||
|
// gridLookupGestore.Enabled = false;
|
||||||
|
// break;
|
||||||
|
// case "rcammarino":
|
||||||
|
// gridLookupGestore.Value = "CAMMARINO";
|
||||||
|
// gridLookupGestore.Enabled = false;
|
||||||
|
// break;
|
||||||
|
// case "rtorre":
|
||||||
|
// gridLookupGestore.Value = "TORRE";
|
||||||
|
// gridLookupGestore.Enabled = false;
|
||||||
|
// break;
|
||||||
|
// case "adonini":
|
||||||
|
// gridLookupGestore.Value = "DONINI";
|
||||||
|
// gridLookupGestore.Enabled = false;
|
||||||
|
// break;
|
||||||
|
// case "lbrambilla":
|
||||||
|
// gridLookupGestore.Value = "BRAMBILLA";
|
||||||
|
// gridLookupGestore.Enabled = false;
|
||||||
|
// break;
|
||||||
|
// default:
|
||||||
|
// gridLookupGestore.Enabled = true; // gli altri gestori abilitati a vedere tutto sono fcostalonga, ecanziani, fpisoni, glicciardello
|
||||||
|
// break;
|
||||||
|
//}
|
||||||
|
|
||||||
|
Session["cod_ges"] = gridLookupGestore.Value; // serve per popolare gridlookupLinea!!
|
||||||
|
//Session["cod_adv"] = gridLookupAdvisor.Value; // serve per popolare gridlookupLinea!!
|
||||||
|
Session["user"] = loggedUser; // serve per popolare gridlookupGestore!!
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsPostBack) // Rielabora il grafico altrimenti il print non la stampa.
|
||||||
|
{
|
||||||
|
PlottaPointChart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PlottaPointChart()
|
||||||
|
{
|
||||||
|
// Carica dati in dtStackedBarsData
|
||||||
|
ASPxGridView grid = gridLookupGestore.GridView;
|
||||||
|
object objGestore = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Gestore" });
|
||||||
|
grid = gridLookupLinea.GridView;
|
||||||
|
object objLinea = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Linea" });
|
||||||
|
//grid = gridLookupAdvisor.GridView;
|
||||||
|
//object objAdvisor = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Advisor" });
|
||||||
|
//if (!(objGestore != null && objLinea != null && objAdvisor != null)) return;
|
||||||
|
if (!(objGestore != null && objLinea != null)) return;
|
||||||
|
|
||||||
|
// nota: esiste pure GDN_GPMDispRendRisk_PointCharts1 e GDN_GPM_Gestori1 perchè Filippo voleva avere l'opzione -- TUTTI -- sui gestori, ma poi il grafico si vedeva tutto incasinato e abbiamo desistito (07/06/2022)
|
||||||
|
DataTable dtPointsChartData = CommonClass.execQuery_Datatable_Sql("GDN_GPMDispRendRisk_PointCharts2",
|
||||||
|
Properties.Settings.Default.SqlConnection,
|
||||||
|
(string)objGestore,
|
||||||
|
"",
|
||||||
|
(string)objLinea
|
||||||
|
,
|
||||||
|
-1,
|
||||||
|
-1,
|
||||||
|
dateEditDataIns.Date,
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
null,
|
||||||
|
"");
|
||||||
|
|
||||||
|
Session["dtPointsChartData"] = dtPointsChartData;
|
||||||
|
|
||||||
|
pointChart.DataSource = dtPointsChartData;
|
||||||
|
|
||||||
|
// Cancella tutte le serie prima di plottare
|
||||||
|
pointChart.Series.Clear();
|
||||||
|
|
||||||
|
// Cancella tutti i titoli della serie prima di plottare
|
||||||
|
pointChart.Titles.Clear();
|
||||||
|
|
||||||
|
// Rimuove legenda aggiuntiva dei portafogli
|
||||||
|
pointChart.Legends.Clear();
|
||||||
|
|
||||||
|
// Setta titolo del grafico
|
||||||
|
SettaTitoloGrafico(pointChart);
|
||||||
|
|
||||||
|
string seriesName = $"{(string)objLinea}";
|
||||||
|
Series series = new Series(seriesName, ViewType.Point);
|
||||||
|
series.ArgumentScaleType = ScaleType.Numerical;
|
||||||
|
series.LabelsVisibility = DefaultBoolean.True;
|
||||||
|
series.Label.TextPattern = "{HINT}";
|
||||||
|
series.ArgumentDataMember = "VaR Medio 95";
|
||||||
|
series.ValueDataMembers[0] = "Performance YTD";
|
||||||
|
series.ShowInLegend = false;
|
||||||
|
series.CrosshairContentShowMode = CrosshairContentShowMode.Label;
|
||||||
|
//series.CrosshairHighlightPoints = DefaultBoolean.True; // non funziona
|
||||||
|
//pointChart.CrosshairOptions.HighlightPoints = true; // non funziona
|
||||||
|
|
||||||
|
(series.Label as PointSeriesLabel).ResolveOverlappingMode = ResolveOverlappingMode.JustifyAroundPoint;
|
||||||
|
foreach (DataRow row in dtPointsChartData.Rows)
|
||||||
|
{
|
||||||
|
if (
|
||||||
|
((string)objLinea != "-- TUTTI --") // E' selezionata la singola linea allora deve visualizzare il singolo punto limite var che è uguale per tutti i ptf.
|
||||||
|
|| // oppure
|
||||||
|
((string)objLinea == "-- TUTTI --" && row["Codice Portafoglio"].ToString() != "LIMITE VAR") // Sono selezionate tutte le linee ma viene escluso ptf=LIMITE VAR per plottare tutti i punti
|
||||||
|
)
|
||||||
|
{
|
||||||
|
SeriesPoint sp = new SeriesPoint(row["VaR Medio 95"], row["Performance YTD"]);
|
||||||
|
sp.Tag = new { Portafoglio = $"Portafoglio: {row["Codice Portafoglio"]}", Cliente = $"Cliente: {row["Cliente"]}" }; // link https://supportcenter.devexpress.com/ticket/details/t757258/how-to-display-custom-data-in-the-crosshair-label-text
|
||||||
|
//if (row["Codice Portafoglio"].ToString() != "LIMITE VAR") sp.ToolTipHint = string.Format("{0} - {1}", row["Codice Portafoglio"], row["Cliente"]); // tolto su richiesta di Filippo e spostato in proprietà CrosshairLabelPattern
|
||||||
|
series.Points.Add(sp);
|
||||||
|
}
|
||||||
|
//if ((string)objLinea == "-- TUTTI --" && row["Codice Portafoglio"].ToString() != "LIMITE VAR") // se sono selezionate tutte le linee allora non deve visualizzare punto limite var perchè ce ne sarebbero più di uno
|
||||||
|
//{
|
||||||
|
// SeriesPoint sp = new SeriesPoint(row["VaR Medio 95"], row["Performance YTD"]);
|
||||||
|
// sp.Tag = new { Portafoglio = $"Portafoglio: {row["Codice Portafoglio"]}", Cliente = $"Cliente: {row["Cliente"]}" }; // link https://supportcenter.devexpress.com/ticket/details/t757258/how-to-display-custom-data-in-the-crosshair-label-text
|
||||||
|
// series.Points.Add(sp);
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
series.CrosshairLabelPattern = "{Portafoglio} \r\n {Cliente} \r\n Var Medio 95%: {A:F2}% \r\n Perf YTD: {V:F2}%"; // ref link : https://docs.devexpress.com/CoreLibraries/DevExpress.XtraCharts.SeriesBase.CrosshairLabelPattern
|
||||||
|
pointChart.Series.Add(series);
|
||||||
|
|
||||||
|
XYDiagram diagram = (XYDiagram)pointChart.Diagram;
|
||||||
|
if (diagram != null)
|
||||||
|
{
|
||||||
|
diagram.AxisX.Title.Text = "VAR MEDIO 95%";
|
||||||
|
diagram.AxisX.Title.Visibility = DefaultBoolean.True;
|
||||||
|
diagram.AxisY.Title.Text = "PERFORMANCE YTD";
|
||||||
|
diagram.AxisY.Title.Visibility = DefaultBoolean.True;
|
||||||
|
|
||||||
|
// Setta var max sul grafico (plottato solo se una linea è selezionata)
|
||||||
|
SettaVarMax(pointChart, dtPointsChartData, (string)objLinea);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SettaVarMax(WebChartControl pointChart, DataTable dtPointsChartData, string Linea)
|
||||||
|
{
|
||||||
|
// Cancella eventuali precedenti linee verticali
|
||||||
|
XYDiagram diagram = (XYDiagram)pointChart.Diagram;
|
||||||
|
diagram.AxisX.ConstantLines.Clear();
|
||||||
|
|
||||||
|
// Se è selezionata una singola linea, allora rileva il limite var prendendo il primo ptf in dtPointsChartData e leggendo il valore da tabraplim
|
||||||
|
if (Linea != "-- TUTTI --")
|
||||||
|
{
|
||||||
|
double limiteVar = (from r in dtPointsChartData.AsEnumerable()
|
||||||
|
select Convert.ToDouble(r["LimiteVar"])).FirstOrDefault();
|
||||||
|
ConstantLine cl1 = new ConstantLine("Limite VaR");
|
||||||
|
|
||||||
|
cl1.AxisValue = limiteVar;
|
||||||
|
cl1.Visible = true;
|
||||||
|
cl1.ShowBehind = false;
|
||||||
|
cl1.Color = System.Drawing.Color.Red;
|
||||||
|
cl1.LineStyle.DashStyle = DashStyle.Solid;
|
||||||
|
cl1.LineStyle.Thickness = 2;
|
||||||
|
cl1.ShowInLegend = false;
|
||||||
|
|
||||||
|
diagram.AxisX.ConstantLines.Add(cl1);
|
||||||
|
|
||||||
|
// Define the whole range for the X-axis.
|
||||||
|
//diagram.AxisX.WholeRange.Auto = false;
|
||||||
|
//diagram.AxisX.WholeRange.SetMinMaxValues(0, limiteVar * 0.2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SettaTitoloGrafico(WebChartControl chartControl)
|
||||||
|
{
|
||||||
|
// Create chart titles.
|
||||||
|
ChartTitle chartTitle1 = new ChartTitle();
|
||||||
|
ChartTitle chartTitle2 = new ChartTitle();
|
||||||
|
// Define the text for the titles.
|
||||||
|
chartTitle1.Text = "<b>GPM DISPERSION RISK / REND</b>";
|
||||||
|
|
||||||
|
chartTitle2.Text = TitoloFiltri();
|
||||||
|
|
||||||
|
chartTitle2.WordWrap = true;
|
||||||
|
chartTitle2.MaxLineCount = 2;
|
||||||
|
|
||||||
|
// Define the alignment of the titles.
|
||||||
|
chartTitle1.Alignment = StringAlignment.Center;
|
||||||
|
chartTitle2.Alignment = StringAlignment.Center;
|
||||||
|
|
||||||
|
// Place the titles where it's required.
|
||||||
|
chartTitle1.Dock = ChartTitleDockStyle.Top;
|
||||||
|
chartTitle2.Dock = ChartTitleDockStyle.Top;
|
||||||
|
|
||||||
|
// Customize a title's appearance.
|
||||||
|
chartTitle1.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
chartTitle1.Font = new Font("Tahoma", 14, FontStyle.Bold);
|
||||||
|
chartTitle1.TextColor = Color.Blue;
|
||||||
|
chartTitle1.Indent = 10;
|
||||||
|
|
||||||
|
// Customize a title's appearance.
|
||||||
|
chartTitle2.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
chartTitle2.Font = new Font("Arial", 10, FontStyle.Bold);
|
||||||
|
chartTitle2.TextColor = Color.Black;
|
||||||
|
chartTitle2.Indent = 10;
|
||||||
|
|
||||||
|
// Add the titles to the chart.
|
||||||
|
chartControl.Titles.AddRange(new ChartTitle[] { chartTitle1, chartTitle2 });
|
||||||
|
}
|
||||||
|
private string TitoloFiltri()
|
||||||
|
{
|
||||||
|
string filtro = String.Empty;
|
||||||
|
if (String.IsNullOrEmpty(gridLookupGestore.Text) == true) { filtro += "Gestore: tutti "; } else { filtro += $"Gestore: {gridLookupGestore.Text} "; }
|
||||||
|
//if (String.IsNullOrEmpty(gridLookupAdvisor.Text) == true) { filtro += "Advisor: tutti "; } else { filtro += $"Advisor: {gridLookupAdvisor.Text} "; }
|
||||||
|
if (String.IsNullOrEmpty(gridLookupLinea.Text) == true) { filtro += "Linea: tutti "; } else { filtro += $"Linea: {gridLookupLinea.Text} "; }
|
||||||
|
return (filtro);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void buttonGeneraGrafici_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
PlottaPointChart();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void buttonEsportaPdf_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
// Esporta grafico in pdf
|
||||||
|
var ps = new PrintingSystem();
|
||||||
|
ps.PageSettings.Landscape = true;
|
||||||
|
var link1 = new PrintableComponentLink();
|
||||||
|
pointChart.DataBind();
|
||||||
|
|
||||||
|
link1.Component = ((IChartContainer)pointChart).Chart;
|
||||||
|
link1.Landscape = true;
|
||||||
|
link1.PrintingSystem = ps;
|
||||||
|
link1.CreateDocument();
|
||||||
|
ps.Document.AutoFitToPagesWidth = 1; // Fit to page
|
||||||
|
|
||||||
|
using (var stream = new MemoryStream())
|
||||||
|
{
|
||||||
|
link1.PrintingSystem.ExportToPdf(stream);
|
||||||
|
Response.Clear();
|
||||||
|
Response.Buffer = false;
|
||||||
|
Response.AppendHeader("Content-Type", "application/pdf");
|
||||||
|
Response.AppendHeader("Content-Transfer-Encoding", "binary");
|
||||||
|
Response.AppendHeader("Content-Disposition", $"attachment; filename=GPMDispRendRisk_{DateTime.Now.Date.ToString("yyyyMMdd")}.pdf");
|
||||||
|
Response.BinaryWrite(stream.GetBuffer());
|
||||||
|
Response.End();
|
||||||
|
}
|
||||||
|
ps.Dispose();
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
XtraReport r = new XtraReport();
|
||||||
|
r.Bands.Add(new DetailBand());
|
||||||
|
r.Bands[BandKind.Detail].Height = Convert.ToInt32(pointChart.Height.Value * pointChart.Width.Value / (r.PageWidth - r.Margins.Left - r.Margins.Right));
|
||||||
|
XRChart chart = new XRChart();
|
||||||
|
((IChartContainer)chart).Assign(((IChartContainer)pointChart).Chart);
|
||||||
|
r.Bands[BandKind.Detail].Controls.Add(chart);
|
||||||
|
chart.Size = new Size(r.PageWidth - r.Margins.Left - r.Margins.Right, r.Bands[BandKind.Detail].Height);
|
||||||
|
|
||||||
|
ReportViewer rv = new ReportViewer();
|
||||||
|
rv.Report = r;
|
||||||
|
r.ExportOptions.Pdf.ShowPrintDialogOnOpen = true;
|
||||||
|
r.Landscape = true;
|
||||||
|
rv.WritePdfTo(this.Response);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gridLookupGestore_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// ref: https://supportcenter.devexpress.com/ticket/details/q340370/aspxgridlookup-how-to-refresh-the-control-after-some-data-is-changed
|
||||||
|
// note: Per refreshare gridlookupLinea e gridlookupAdvisor sulla base del valore di gridLookupGestore, salvo il valore gestore in una variabile di sessione Session["cod_ges"]
|
||||||
|
// e poi il refresh/rebind di SqlDSLinee e SqlDSAdvisor verrà effettuato nell'evento lato client EndCallBack
|
||||||
|
|
||||||
|
ASPxGridView grid = gridLookupGestore.GridView;
|
||||||
|
object objGestore = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Gestore" });
|
||||||
|
|
||||||
|
if (objGestore != null)
|
||||||
|
{
|
||||||
|
Session["cod_ges"] = (string)objGestore;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//protected void gridLookupAdvisor_ValueChanged(object sender, EventArgs e)
|
||||||
|
//{
|
||||||
|
// ASPxGridView grid = gridLookupAdvisor.GridView;
|
||||||
|
// object objAdvisor = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Advisor" });
|
||||||
|
|
||||||
|
// if (objAdvisor != null)
|
||||||
|
// {
|
||||||
|
// Session["cod_adv"] = (string)objAdvisor;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
}
|
||||||
107
OlympiaIntranet/GPMDispRendRisk.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public partial class GPMDispRendRisk
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxFormLayout1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxFormLayout ASPxFormLayout1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gridLookupGestore control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup gridLookupGestore;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gridLookupLinea control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup gridLookupLinea;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// dateEditDataIns control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxDateEdit dateEditDataIns;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// buttonGeneraGrafici control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton buttonGeneraGrafici;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// buttonEsportaPdf control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton buttonEsportaPdf;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// pointChart control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.XtraCharts.Web.WebChartControl pointChart;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSGestori control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSGestori;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSLinee control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSLinee;
|
||||||
|
}
|
||||||
|
}
|
||||||
164
OlympiaIntranet/GPMDispRendRiskAPI.aspx
Normal file
@@ -0,0 +1,164 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GPMDispRendRiskAPI.aspx.cs" Inherits="OlympiaIntranet.GPMDispRendRiskAPI" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.XtraCharts.v23.2.Web, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.XtraCharts.Web" TagPrefix="dx" %>
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
<style>
|
||||||
|
html {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
function ExportChartToPdf(e) {
|
||||||
|
/*
|
||||||
|
e.processOnServer = false;
|
||||||
|
var chartPrintOptions = clientChart.GetPrintOptions();
|
||||||
|
chartPrintOptions.SetSizeMode('Stretch');
|
||||||
|
chartPrintOptions.SetLandscape(true);
|
||||||
|
const date = new Date();
|
||||||
|
var fileName = 'GPM_DispRendRisk_' + date.toLocaleDateString();
|
||||||
|
clientChart.SaveToDisk('pdf', fileName);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
function OnFirstEndCallback(s, e) {
|
||||||
|
//clientgridLookupLinea.GetGridView().Refresh();
|
||||||
|
//clientgridLookupConsulente.GetGridView().Refresh();
|
||||||
|
|
||||||
|
// azzera eventuale selezione in gridLookupLinea
|
||||||
|
clientgridLookupLinea.SetValue(null);
|
||||||
|
|
||||||
|
// azzera eventuale selezione in gridLookupConsulente
|
||||||
|
clientgridLookupConsulente.SetValue(null);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
<dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server" EnableTheming="True" Theme="Aqua">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutGroup Caption="Filtri Selezione" ColCount="6" ColSpan="1" ColumnCount="6">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="Gestore" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<%-- <dx:ASPxGridLookup ID="gridLookupGestore" runat="server" Theme="Aqua" DataSourceID="SqlDSGestori" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Gestore" TextFormatString="{0}" OnValueChanged="gridLookupGestore_ValueChanged">
|
||||||
|
<ClientSideEvents EndCallback="OnFirstEndCallback" />
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>--%>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Consulente" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<%-- <dx:ASPxGridLookup ID="gridLookupConsulente" ClientInstanceName="clientgridLookupConsulente" runat="server" Theme="Aqua" DataSourceID="SqlDSConsulenti" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Consulente" TextFormatString="{0}">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>--%>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Linea di Gestione" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<%-- <dx:ASPxGridLookup ID="gridLookupLinea" ClientInstanceName="clientgridLookupLinea" runat="server" Theme="Aqua" DataSourceID="SqlDSLinee" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Linea" TextFormatString="{0}">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>--%>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Data riferimento" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<%-- <dx:ASPxDateEdit ID="dateEditDataIns" runat="server" Theme="Aqua" DisplayFormatString="dd/MM/yyyy">
|
||||||
|
</dx:ASPxDateEdit>--%>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="buttonGeneraGrafici" runat="server" OnClick="buttonGeneraGrafici_Click" Theme="Aqua">
|
||||||
|
<Image IconID="chart_chart_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="buttonEsportaPdf" runat="server" AutoPostBack="False" OnClick="buttonEsportaPdf_Click" Theme="Aqua">
|
||||||
|
<ClientSideEvents Click="function(s, e) { ExportChartToPdf(e); }" />
|
||||||
|
<Image IconID="export_exporttopdf_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxFormLayout>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
<dx:WebChartControl ID="pointChart" ClientInstanceName="clientChart" runat="server" CrosshairEnabled="True" Height="720px" Width="1280px" RenderFormat="Svg" EnableViewState="False" AppearanceNameSerializable="Gray" OnDataBound="pointChart_DataBound">
|
||||||
|
</dx:WebChartControl>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<%-- <asp:SqlDataSource ID="SqlDSGestori" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Gestori" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSLinee" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Linee1" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="cod_ges" SessionField="cod_ges" />
|
||||||
|
<asp:SessionParameter Name="user" SessionField="user" />
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSConsulenti" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_GPM_Consulenti" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="cod_ges" SessionField="cod_ges" />
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>--%>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
||||||
540
OlympiaIntranet/GPMDispRendRiskAPI.aspx.cs
Normal file
@@ -0,0 +1,540 @@
|
|||||||
|
using DevExpress.Web;
|
||||||
|
using DevExpress.XtraCharts;
|
||||||
|
using DevExpress.XtraCharts.Native;
|
||||||
|
using DevExpress.XtraCharts.Web;
|
||||||
|
using DevExpress.Pdf;
|
||||||
|
using DevExpress.XtraPrinting;
|
||||||
|
using DevExpress.XtraGrid;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
using DevExpress.Utils;
|
||||||
|
using DevExpress.XtraReports.UI;
|
||||||
|
using DevExpress.XtraReports.Web;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class GPMDispRendRiskAPI : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
string cod_ges = String.Empty;
|
||||||
|
//string cod_adv = String.Empty;
|
||||||
|
string cod_lin = String.Empty;
|
||||||
|
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
cod_ges = Request.QueryString["cod_ges"];
|
||||||
|
//cod_adv = Request.QueryString["cod_adv"];
|
||||||
|
cod_lin = Request.QueryString["cod_lin"];
|
||||||
|
|
||||||
|
//Session["cod_ges"] = cod_ges; // serve per popolare gridlookupLinea!!
|
||||||
|
//if (String.IsNullOrEmpty(cod_ges) == true || String.IsNullOrEmpty(cod_adv) == true || String.IsNullOrEmpty(cod_lin) == true)
|
||||||
|
//{
|
||||||
|
// CommonClass.MessageBox(this, "Parametri mancanti ricontrollare!");
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
if (String.IsNullOrEmpty(cod_ges) == true || String.IsNullOrEmpty(cod_lin) == true)
|
||||||
|
{
|
||||||
|
CommonClass.MessageBox(this, "Parametri mancanti ricontrollare!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
PlottaPointChart();
|
||||||
|
|
||||||
|
buttonEsportaPdf_Click(this, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PlottaPointChart()
|
||||||
|
{
|
||||||
|
|
||||||
|
//if (!(String.IsNullOrEmpty(cod_ges) == false && String.IsNullOrEmpty(cod_adv) == false && String.IsNullOrEmpty(cod_lin) == false)) return;
|
||||||
|
if (!(String.IsNullOrEmpty(cod_ges) == false && String.IsNullOrEmpty(cod_lin) == false)) return;
|
||||||
|
|
||||||
|
// nota: esiste pure GDN_GPMDispRendRisk_PointCharts1 e GDN_GPM_Gestori1 perchè Filippo voleva avere l'opzione -- TUTTI -- sui gestori, ma poi il grafico si vedeva tutto incasinato e abbiamo desistito (07/06/2022)
|
||||||
|
DataTable dtPointsChartData = CommonClass.execQuery_Datatable_Sql("GDN_GPMDispRendRisk_PointCharts2",
|
||||||
|
Properties.Settings.Default.SqlConnection,
|
||||||
|
cod_ges,
|
||||||
|
"",
|
||||||
|
cod_lin,
|
||||||
|
-1,
|
||||||
|
-1,
|
||||||
|
CommonClass.AddBusinessDays(DateTime.Today.Date, -1), // prende l'ultimo giorno lavorativo del mese precedente
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
null,
|
||||||
|
"");
|
||||||
|
Session["dtPointsChartData"] = dtPointsChartData;
|
||||||
|
|
||||||
|
//var listAssetClass = (from r in dtPointsChartData.AsEnumerable()
|
||||||
|
// select r);
|
||||||
|
|
||||||
|
|
||||||
|
pointChart.DataSource = dtPointsChartData;
|
||||||
|
|
||||||
|
// Cancella tutte le serie prima di plottare
|
||||||
|
pointChart.Series.Clear();
|
||||||
|
|
||||||
|
// Cancella tutti i titoli della serie prima di plottare
|
||||||
|
pointChart.Titles.Clear();
|
||||||
|
|
||||||
|
// Rimuove legenda aggiuntiva dei portafogli
|
||||||
|
pointChart.Legends.Clear();
|
||||||
|
|
||||||
|
// Setta titolo del grafico
|
||||||
|
SettaTitoloGrafico(pointChart);
|
||||||
|
|
||||||
|
string seriesName = $"{cod_lin}";
|
||||||
|
Series series = new Series(seriesName, ViewType.Point);
|
||||||
|
series.ArgumentScaleType = ScaleType.Numerical;
|
||||||
|
series.LabelsVisibility = DefaultBoolean.True;
|
||||||
|
series.Label.TextPattern = "{HINT}";
|
||||||
|
series.ArgumentDataMember = "VaR Medio 95";
|
||||||
|
series.ValueDataMembers[0] = "Performance YTD";
|
||||||
|
series.ShowInLegend = false;
|
||||||
|
series.CrosshairContentShowMode = CrosshairContentShowMode.Default;
|
||||||
|
series.CrosshairLabelPattern = "Var Medio 95%: {A:F2}% \r\n Perf YTD: {V:F2}%"; // ref link : https://docs.devexpress.com/CoreLibraries/DevExpress.XtraCharts.SeriesBase.CrosshairLabelPattern
|
||||||
|
(series.Label as PointSeriesLabel).ResolveOverlappingMode = ResolveOverlappingMode.JustifyAroundPoint;
|
||||||
|
foreach (DataRow row in dtPointsChartData.Rows)
|
||||||
|
{
|
||||||
|
SeriesPoint sp = new SeriesPoint(row["VaR Medio 95"], row["Performance YTD"]);
|
||||||
|
if (row["Codice Portafoglio"].ToString() != "LIMITE VAR") sp.ToolTipHint = $"{row["Codice Portafoglio"]} - {row["Cliente"]}";
|
||||||
|
series.Points.Add(sp);
|
||||||
|
}
|
||||||
|
|
||||||
|
pointChart.Series.Add(series);
|
||||||
|
|
||||||
|
XYDiagram diagram = (XYDiagram)pointChart.Diagram;
|
||||||
|
if (diagram != null)
|
||||||
|
{
|
||||||
|
diagram.AxisX.Title.Text = "VAR MEDIO 95%";
|
||||||
|
diagram.AxisX.Title.Visibility = DefaultBoolean.True;
|
||||||
|
diagram.AxisY.Title.Text = "PERFORMANCE YTD";
|
||||||
|
diagram.AxisY.Title.Visibility = DefaultBoolean.True;
|
||||||
|
|
||||||
|
// Setta var max sul grafico (plottato solo se una linea è selezionata)
|
||||||
|
SettaVarMax(pointChart, dtPointsChartData, cod_lin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SettaVarMax(WebChartControl pointChart, DataTable dtPointsChartData, string Linea)
|
||||||
|
{
|
||||||
|
// Cancella eventuali precedenti linee verticali
|
||||||
|
XYDiagram diagram = (XYDiagram)pointChart.Diagram;
|
||||||
|
diagram.AxisX.ConstantLines.Clear();
|
||||||
|
|
||||||
|
// Se è selezionata una singola linea, allora rileva il limite var prendendo il primo ptf in dtPointsChartData e leggendo il valore da tabraplim
|
||||||
|
if (Linea != "-- TUTTI --")
|
||||||
|
{
|
||||||
|
double limiteVar = (from r in dtPointsChartData.AsEnumerable()
|
||||||
|
select Convert.ToDouble(r["LimiteVar"])).FirstOrDefault();
|
||||||
|
ConstantLine cl1 = new ConstantLine("Limite VaR");
|
||||||
|
|
||||||
|
cl1.AxisValue = limiteVar;
|
||||||
|
cl1.Visible = true;
|
||||||
|
cl1.ShowBehind = false;
|
||||||
|
cl1.Color = System.Drawing.Color.Red;
|
||||||
|
cl1.LineStyle.DashStyle = DashStyle.Solid;
|
||||||
|
cl1.LineStyle.Thickness = 2;
|
||||||
|
cl1.ShowInLegend = false;
|
||||||
|
|
||||||
|
diagram.AxisX.ConstantLines.Add(cl1);
|
||||||
|
|
||||||
|
// Define the whole range for the X-axis.
|
||||||
|
//diagram.AxisX.WholeRange.Auto = false;
|
||||||
|
//diagram.AxisX.WholeRange.SetMinMaxValues(0, limiteVar * 0.2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SettaTitoloGrafico(WebChartControl chartControl)
|
||||||
|
{
|
||||||
|
// Create chart titles.
|
||||||
|
ChartTitle chartTitle1 = new ChartTitle();
|
||||||
|
ChartTitle chartTitle2 = new ChartTitle();
|
||||||
|
// Define the text for the titles.
|
||||||
|
chartTitle1.Text = "<b>GPM DISPERSION RISK / REND</b>";
|
||||||
|
|
||||||
|
chartTitle2.Text = TitoloFiltri();
|
||||||
|
|
||||||
|
chartTitle2.WordWrap = true;
|
||||||
|
chartTitle2.MaxLineCount = 2;
|
||||||
|
|
||||||
|
// Define the alignment of the titles.
|
||||||
|
chartTitle1.Alignment = StringAlignment.Center;
|
||||||
|
chartTitle2.Alignment = StringAlignment.Center;
|
||||||
|
|
||||||
|
// Place the titles where it's required.
|
||||||
|
chartTitle1.Dock = ChartTitleDockStyle.Top;
|
||||||
|
chartTitle2.Dock = ChartTitleDockStyle.Top;
|
||||||
|
|
||||||
|
// Customize a title's appearance.
|
||||||
|
chartTitle1.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
chartTitle1.Font = new Font("Tahoma", 14, FontStyle.Bold);
|
||||||
|
chartTitle1.TextColor = Color.Blue;
|
||||||
|
chartTitle1.Indent = 10;
|
||||||
|
|
||||||
|
// Customize a title's appearance.
|
||||||
|
chartTitle2.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
chartTitle2.Font = new Font("Arial", 10, FontStyle.Bold);
|
||||||
|
chartTitle2.TextColor = Color.Black;
|
||||||
|
chartTitle2.Indent = 10;
|
||||||
|
|
||||||
|
// Add the titles to the chart.
|
||||||
|
chartControl.Titles.AddRange(new ChartTitle[] { chartTitle1, chartTitle2 });
|
||||||
|
}
|
||||||
|
private string TitoloFiltri()
|
||||||
|
{
|
||||||
|
string filtro = String.Empty;
|
||||||
|
if (String.IsNullOrEmpty(cod_ges) == true) { filtro += "Gestore: tutti "; } else { filtro += $"Gestore: {cod_ges} "; }
|
||||||
|
//if (String.IsNullOrEmpty(cod_adv) == true) { filtro += "Advisor: tutti "; } else { filtro += $"Advisor: {cod_adv} "; }
|
||||||
|
if (String.IsNullOrEmpty(cod_lin) == true) { filtro += "Linea: tutti "; } else { filtro += $"Linea: {cod_lin} "; }
|
||||||
|
return (filtro);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void buttonGeneraGrafici_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
PlottaPointChart();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void buttonEsportaPdf_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Esporta grafico in pdf
|
||||||
|
/*
|
||||||
|
var ps = new PrintingSystem();
|
||||||
|
ps.PageSettings.Landscape = true;
|
||||||
|
var link1 = new PrintableComponentLink();
|
||||||
|
pointChart.DataBind();
|
||||||
|
|
||||||
|
link1.Component = ((IChartContainer)pointChart).Chart;
|
||||||
|
link1.Landscape = true;
|
||||||
|
link1.PrintingSystem = ps;
|
||||||
|
link1.CreateDocument();
|
||||||
|
ps.Document.AutoFitToPagesWidth = 1; // Fit to page
|
||||||
|
|
||||||
|
using (var stream = new MemoryStream())
|
||||||
|
{
|
||||||
|
link1.PrintingSystem.ExportToPdf(stream);
|
||||||
|
Response.Clear();
|
||||||
|
Response.Buffer = false;
|
||||||
|
Response.AppendHeader("Content-Type", "application/pdf");
|
||||||
|
Response.AppendHeader("Content-Transfer-Encoding", "binary");
|
||||||
|
Response.AppendHeader("Content-Disposition", $"attachment; filename=GPMDispRendRisk_{DateTime.Now.Date.ToString("yyyyMMdd")}.pdf");
|
||||||
|
Response.BinaryWrite(stream.GetBuffer());
|
||||||
|
Response.End();
|
||||||
|
}
|
||||||
|
ps.Dispose();
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
XtraReport r = new XtraReport();
|
||||||
|
r.Bands.Add(new DetailBand());
|
||||||
|
r.Bands[BandKind.Detail].Height = Convert.ToInt32(pointChart.Height.Value * pointChart.Width.Value / (r.PageWidth - r.Margins.Left - r.Margins.Right));
|
||||||
|
XRChart chart = new XRChart();
|
||||||
|
((IChartContainer)chart).Assign(((IChartContainer)pointChart).Chart);
|
||||||
|
r.Bands[BandKind.Detail].Controls.Add(chart);
|
||||||
|
chart.Size = new Size(r.PageWidth - r.Margins.Left - r.Margins.Right, r.Bands[BandKind.Detail].Height);
|
||||||
|
|
||||||
|
ReportViewer rv = new ReportViewer();
|
||||||
|
rv.Report = r;
|
||||||
|
r.ExportOptions.Pdf.ShowPrintDialogOnOpen = false;
|
||||||
|
r.Landscape = true;
|
||||||
|
rv.WritePdfTo(this.Response);
|
||||||
|
*/
|
||||||
|
|
||||||
|
XtraReport r = new XtraReport();
|
||||||
|
r.Bands.Add(new DetailBand());
|
||||||
|
//int charts_height = Convert.ToInt32(pointChart.Height.Value * pointChart.Width.Value / (r.PageWidth - r.Margins.Left - r.Margins.Right));
|
||||||
|
r.Bands[BandKind.Detail].Height = 720;
|
||||||
|
XRChart chart = new XRChart();
|
||||||
|
chart.Size = new Size(1280, 720);
|
||||||
|
((IChartContainer)chart).Assign(((IChartContainer)pointChart).Chart);
|
||||||
|
r.ExportOptions.Pdf.ShowPrintDialogOnOpen = false;
|
||||||
|
r.ExportOptions.Pdf.ConvertImagesToJpeg = true;
|
||||||
|
r.PrintingSystem.Document.AutoFitToPagesWidth = 1;
|
||||||
|
r.Landscape = true;
|
||||||
|
r.Bands[BandKind.Detail].Controls.Add(chart);
|
||||||
|
ReportViewer rv = new ReportViewer();
|
||||||
|
rv.Report = r;
|
||||||
|
rv.WritePdfTo(this.Response);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gridLookupGestore_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// ref: https://supportcenter.devexpress.com/ticket/details/q340370/aspxgridlookup-how-to-refresh-the-control-after-some-data-is-changed
|
||||||
|
// note: Per refreshare gridlookupLinea e gridlookupConsulente sulla base del valore di gridLookupGestore, salvo il valore gestore in una variabile di sessione Session["cod_ges"]
|
||||||
|
// e poi il refresh/rebind di SqlDSLinee e SqlDSConsulente verrà effettuato nell'evento lato client EndCallBack
|
||||||
|
|
||||||
|
//ASPxGridView grid = gridLookupGestore.GridView;
|
||||||
|
//object objGestore = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Gestore" });
|
||||||
|
|
||||||
|
//if (objGestore != null)
|
||||||
|
//{
|
||||||
|
// Session["cod_ges"] = (string)objGestore;
|
||||||
|
//}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void pointChart_DataBound(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//foreach (Series series in pointChart.Series)
|
||||||
|
// foreach (SeriesPoint point in series.Points)
|
||||||
|
// point.ToolTipHint = "porca troia";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//public partial class GPMDispRendRiskAPI : System.Web.UI.Page
|
||||||
|
//{
|
||||||
|
// string cod_ges = String.Empty;
|
||||||
|
// string cod_pro = String.Empty;
|
||||||
|
// string cod_lin = String.Empty;
|
||||||
|
|
||||||
|
// protected void Page_Load(object sender, EventArgs e)
|
||||||
|
// {
|
||||||
|
// cod_ges = Request.QueryString["cod_ges"];
|
||||||
|
// cod_pro = Request.QueryString["cod_pro"];
|
||||||
|
// cod_lin = Request.QueryString["cod_lin"];
|
||||||
|
|
||||||
|
// Session["cod_ges"] = cod_ges; // serve per popolare gridlookupLinea!!
|
||||||
|
|
||||||
|
// PlottaPointChart();
|
||||||
|
|
||||||
|
// buttonEsportaPdf_Click(this, null);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// private void PlottaPointChart()
|
||||||
|
// {
|
||||||
|
|
||||||
|
// if (!(String.IsNullOrEmpty(cod_ges) == false && String.IsNullOrEmpty(cod_pro) == false && String.IsNullOrEmpty(cod_lin) == false)) return;
|
||||||
|
|
||||||
|
// // nota: esiste pure GDN_GPMDispRendRisk_PointCharts1 e GDN_GPM_Gestori1 perchè Filippo voleva avere l'opzione -- TUTTI -- sui gestori, ma poi il grafico si vedeva tutto incasinato e abbiamo desistito (07/06/2022)
|
||||||
|
// DataTable dtPointsChartData = CommonClass.execQuery_Datatable_Sql("GDN_GPMDispRendRisk_PointCharts", Properties.Settings.Default.SqlConnection, cod_ges, cod_pro, cod_lin, -1, -1, CommonClass.AddBusinessDays(DateTime.Today.Date,-1)); // prende l'ultimo giorno lavorativo del mese precedente
|
||||||
|
// Session["dtPointsChartData"] = dtPointsChartData;
|
||||||
|
|
||||||
|
// //var listAssetClass = (from r in dtPointsChartData.AsEnumerable()
|
||||||
|
// // select r);
|
||||||
|
|
||||||
|
|
||||||
|
// pointChart.DataSource = dtPointsChartData;
|
||||||
|
|
||||||
|
// // Cancella tutte le serie prima di plottare
|
||||||
|
// pointChart.Series.Clear();
|
||||||
|
|
||||||
|
// // Cancella tutti i titoli della serie prima di plottare
|
||||||
|
// pointChart.Titles.Clear();
|
||||||
|
|
||||||
|
// // Rimuove legenda aggiuntiva dei portafogli
|
||||||
|
// pointChart.Legends.Clear();
|
||||||
|
|
||||||
|
// // Setta titolo del grafico
|
||||||
|
// SettaTitoloGrafico(pointChart);
|
||||||
|
|
||||||
|
// string seriesName = $"{cod_lin}";
|
||||||
|
// Series series = new Series(seriesName, ViewType.Point);
|
||||||
|
// series.ArgumentScaleType = ScaleType.Numerical;
|
||||||
|
// series.LabelsVisibility = DefaultBoolean.True;
|
||||||
|
// series.Label.TextPattern = "{HINT}";
|
||||||
|
// series.ArgumentDataMember = "VaR Medio 95";
|
||||||
|
// series.ValueDataMembers[0] = "Performance YTD";
|
||||||
|
// series.ShowInLegend = false;
|
||||||
|
// series.CrosshairContentShowMode = CrosshairContentShowMode.Default;
|
||||||
|
// series.CrosshairLabelPattern = "Var Medio 95%: {A:F2}% \r\n Perf YTD: {V:F2}%"; // ref link : https://docs.devexpress.com/CoreLibraries/DevExpress.XtraCharts.SeriesBase.CrosshairLabelPattern
|
||||||
|
// (series.Label as PointSeriesLabel).ResolveOverlappingMode = ResolveOverlappingMode.JustifyAroundPoint;
|
||||||
|
// foreach (DataRow row in dtPointsChartData.Rows)
|
||||||
|
// {
|
||||||
|
// SeriesPoint sp = new SeriesPoint(row["VaR Medio 95"], row["Performance YTD"]);
|
||||||
|
// if (row["Codice Portafoglio"].ToString() != "LIMITE VAR") sp.ToolTipHint = $"{row["Codice Portafoglio"]} - {row["Cliente"]}";
|
||||||
|
// series.Points.Add(sp);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// pointChart.Series.Add(series);
|
||||||
|
|
||||||
|
// XYDiagram diagram = (XYDiagram)pointChart.Diagram;
|
||||||
|
// if (diagram != null)
|
||||||
|
// {
|
||||||
|
// diagram.AxisX.Title.Text = "VAR MEDIO 95%";
|
||||||
|
// diagram.AxisX.Title.Visibility = DefaultBoolean.True;
|
||||||
|
// diagram.AxisY.Title.Text = "PERFORMANCE YTD";
|
||||||
|
// diagram.AxisY.Title.Visibility = DefaultBoolean.True;
|
||||||
|
|
||||||
|
// // Setta var max sul grafico (plottato solo se una linea è selezionata)
|
||||||
|
// SettaVarMax(pointChart, dtPointsChartData, cod_lin);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// private void SettaVarMax(WebChartControl pointChart, DataTable dtPointsChartData, string Linea)
|
||||||
|
// {
|
||||||
|
// // Cancella eventuali precedenti linee verticali
|
||||||
|
// XYDiagram diagram = (XYDiagram)pointChart.Diagram;
|
||||||
|
// diagram.AxisX.ConstantLines.Clear();
|
||||||
|
|
||||||
|
// // Se è selezionata una singola linea, allora rileva il limite var prendendo il primo ptf in dtPointsChartData e leggendo il valore da tabraplim
|
||||||
|
// if (Linea != "-- TUTTI --")
|
||||||
|
// {
|
||||||
|
// double limiteVar = (from r in dtPointsChartData.AsEnumerable()
|
||||||
|
// select Convert.ToDouble(r["LimiteVar"])).FirstOrDefault();
|
||||||
|
// ConstantLine cl1 = new ConstantLine("Limite VaR");
|
||||||
|
|
||||||
|
// cl1.AxisValue = limiteVar;
|
||||||
|
// cl1.Visible = true;
|
||||||
|
// cl1.ShowBehind = false;
|
||||||
|
// cl1.Color = System.Drawing.Color.Red;
|
||||||
|
// cl1.LineStyle.DashStyle = DashStyle.Solid;
|
||||||
|
// cl1.LineStyle.Thickness = 2;
|
||||||
|
// cl1.ShowInLegend = false;
|
||||||
|
|
||||||
|
// diagram.AxisX.ConstantLines.Add(cl1);
|
||||||
|
|
||||||
|
// // Define the whole range for the X-axis.
|
||||||
|
// //diagram.AxisX.WholeRange.Auto = false;
|
||||||
|
// //diagram.AxisX.WholeRange.SetMinMaxValues(0, limiteVar * 0.2);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// private void SettaTitoloGrafico(WebChartControl chartControl)
|
||||||
|
// {
|
||||||
|
// // Create chart titles.
|
||||||
|
// ChartTitle chartTitle1 = new ChartTitle();
|
||||||
|
// ChartTitle chartTitle2 = new ChartTitle();
|
||||||
|
// // Define the text for the titles.
|
||||||
|
// chartTitle1.Text = "<b>GPM DISPERSION RISK / REND</b>";
|
||||||
|
|
||||||
|
// chartTitle2.Text = TitoloFiltri();
|
||||||
|
|
||||||
|
// chartTitle2.WordWrap = true;
|
||||||
|
// chartTitle2.MaxLineCount = 2;
|
||||||
|
|
||||||
|
// // Define the alignment of the titles.
|
||||||
|
// chartTitle1.Alignment = StringAlignment.Center;
|
||||||
|
// chartTitle2.Alignment = StringAlignment.Center;
|
||||||
|
|
||||||
|
// // Place the titles where it's required.
|
||||||
|
// chartTitle1.Dock = ChartTitleDockStyle.Top;
|
||||||
|
// chartTitle2.Dock = ChartTitleDockStyle.Top;
|
||||||
|
|
||||||
|
// // Customize a title's appearance.
|
||||||
|
// chartTitle1.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
// chartTitle1.Font = new Font("Tahoma", 14, FontStyle.Bold);
|
||||||
|
// chartTitle1.TextColor = Color.Blue;
|
||||||
|
// chartTitle1.Indent = 10;
|
||||||
|
|
||||||
|
// // Customize a title's appearance.
|
||||||
|
// chartTitle2.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
// chartTitle2.Font = new Font("Arial", 10, FontStyle.Bold);
|
||||||
|
// chartTitle2.TextColor = Color.Black;
|
||||||
|
// chartTitle2.Indent = 10;
|
||||||
|
|
||||||
|
// // Add the titles to the chart.
|
||||||
|
// chartControl.Titles.AddRange(new ChartTitle[] { chartTitle1, chartTitle2 });
|
||||||
|
// }
|
||||||
|
// private string TitoloFiltri()
|
||||||
|
// {
|
||||||
|
// string filtro = String.Empty;
|
||||||
|
// //if (String.IsNullOrEmpty(gridLookupGestore.Text) == true) { filtro += "Gestore: tutti "; } else { filtro += $"Gestore: {gridLookupGestore.Text} "; }
|
||||||
|
// //if (String.IsNullOrEmpty(gridLookupConsulente.Text) == true) { filtro += "Consulente: tutti "; } else { filtro += $"Consulente: {gridLookupConsulente.Text} "; }
|
||||||
|
// //if (String.IsNullOrEmpty(gridLookupLinea.Text) == true) { filtro += "Linea: tutti "; } else { filtro += $"Linea: {gridLookupLinea.Text} "; }
|
||||||
|
// if (String.IsNullOrEmpty(cod_ges) == true) { filtro += "Gestore: tutti "; } else { filtro += $"Gestore: {cod_ges} "; }
|
||||||
|
// if (String.IsNullOrEmpty(cod_pro) == true) { filtro += "Consulente: tutti "; } else { filtro += $"Consulente: {cod_pro} "; }
|
||||||
|
// if (String.IsNullOrEmpty(cod_lin) == true) { filtro += "Linea: tutti "; } else { filtro += $"Linea: {cod_lin} "; }
|
||||||
|
// return (filtro);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// protected void buttonGeneraGrafici_Click(object sender, EventArgs e)
|
||||||
|
// {
|
||||||
|
// PlottaPointChart();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// protected void buttonEsportaPdf_Click(object sender, EventArgs e)
|
||||||
|
// {
|
||||||
|
|
||||||
|
// // Esporta grafico in pdf
|
||||||
|
// /*
|
||||||
|
// var ps = new PrintingSystem();
|
||||||
|
// ps.PageSettings.Landscape = true;
|
||||||
|
// var link1 = new PrintableComponentLink();
|
||||||
|
// pointChart.DataBind();
|
||||||
|
|
||||||
|
// link1.Component = ((IChartContainer)pointChart).Chart;
|
||||||
|
// link1.Landscape = true;
|
||||||
|
// link1.PrintingSystem = ps;
|
||||||
|
// link1.CreateDocument();
|
||||||
|
// ps.Document.AutoFitToPagesWidth = 1; // Fit to page
|
||||||
|
|
||||||
|
// using (var stream = new MemoryStream())
|
||||||
|
// {
|
||||||
|
// link1.PrintingSystem.ExportToPdf(stream);
|
||||||
|
// Response.Clear();
|
||||||
|
// Response.Buffer = false;
|
||||||
|
// Response.AppendHeader("Content-Type", "application/pdf");
|
||||||
|
// Response.AppendHeader("Content-Transfer-Encoding", "binary");
|
||||||
|
// Response.AppendHeader("Content-Disposition", $"attachment; filename=GPMDispRendRisk_{DateTime.Now.Date.ToString("yyyyMMdd")}.pdf");
|
||||||
|
// Response.BinaryWrite(stream.GetBuffer());
|
||||||
|
// Response.End();
|
||||||
|
// }
|
||||||
|
// ps.Dispose();
|
||||||
|
// */
|
||||||
|
|
||||||
|
|
||||||
|
// /*
|
||||||
|
// XtraReport r = new XtraReport();
|
||||||
|
// r.Bands.Add(new DetailBand());
|
||||||
|
// r.Bands[BandKind.Detail].Height = Convert.ToInt32(pointChart.Height.Value * pointChart.Width.Value / (r.PageWidth - r.Margins.Left - r.Margins.Right));
|
||||||
|
// XRChart chart = new XRChart();
|
||||||
|
// ((IChartContainer)chart).Assign(((IChartContainer)pointChart).Chart);
|
||||||
|
// r.Bands[BandKind.Detail].Controls.Add(chart);
|
||||||
|
// chart.Size = new Size(r.PageWidth - r.Margins.Left - r.Margins.Right, r.Bands[BandKind.Detail].Height);
|
||||||
|
|
||||||
|
// ReportViewer rv = new ReportViewer();
|
||||||
|
// rv.Report = r;
|
||||||
|
// r.ExportOptions.Pdf.ShowPrintDialogOnOpen = false;
|
||||||
|
// r.Landscape = true;
|
||||||
|
// rv.WritePdfTo(this.Response);
|
||||||
|
// */
|
||||||
|
|
||||||
|
// XtraReport r = new XtraReport();
|
||||||
|
// r.Bands.Add(new DetailBand());
|
||||||
|
// //int charts_height = Convert.ToInt32(pointChart.Height.Value * pointChart.Width.Value / (r.PageWidth - r.Margins.Left - r.Margins.Right));
|
||||||
|
// r.Bands[BandKind.Detail].Height = 720;
|
||||||
|
// XRChart chart = new XRChart();
|
||||||
|
// chart.Size = new Size(1280, 720);
|
||||||
|
// ((IChartContainer)chart).Assign(((IChartContainer)pointChart).Chart);
|
||||||
|
// r.ExportOptions.Pdf.ShowPrintDialogOnOpen = false;
|
||||||
|
// r.ExportOptions.Pdf.ConvertImagesToJpeg = true;
|
||||||
|
// r.PrintingSystem.Document.AutoFitToPagesWidth = 1;
|
||||||
|
// r.Landscape = true;
|
||||||
|
// r.Bands[BandKind.Detail].Controls.Add(chart);
|
||||||
|
// ReportViewer rv = new ReportViewer();
|
||||||
|
// rv.Report = r;
|
||||||
|
// rv.WritePdfTo(this.Response);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// protected void gridLookupGestore_ValueChanged(object sender, EventArgs e)
|
||||||
|
// {
|
||||||
|
// // ref: https://supportcenter.devexpress.com/ticket/details/q340370/aspxgridlookup-how-to-refresh-the-control-after-some-data-is-changed
|
||||||
|
// // note: Per refreshare gridlookupLinea e gridlookupConsulente sulla base del valore di gridLookupGestore, salvo il valore gestore in una variabile di sessione Session["cod_ges"]
|
||||||
|
// // e poi il refresh/rebind di SqlDSLinee e SqlDSConsulente verrà effettuato nell'evento lato client EndCallBack
|
||||||
|
|
||||||
|
// //ASPxGridView grid = gridLookupGestore.GridView;
|
||||||
|
// //object objGestore = grid.GetRowValues(grid.FocusedRowIndex, new string[] { "Gestore" });
|
||||||
|
|
||||||
|
// //if (objGestore != null)
|
||||||
|
// //{
|
||||||
|
// // Session["cod_ges"] = (string)objGestore;
|
||||||
|
// //}
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// protected void pointChart_DataBound(object sender, EventArgs e)
|
||||||
|
// {
|
||||||
|
// //foreach (Series series in pointChart.Series)
|
||||||
|
// // foreach (SeriesPoint point in series.Points)
|
||||||
|
// // point.ToolTipHint = "porca troia";
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
}
|
||||||
60
OlympiaIntranet/GPMDispRendRiskAPI.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet {
|
||||||
|
|
||||||
|
|
||||||
|
public partial class GPMDispRendRiskAPI {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxFormLayout1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxFormLayout ASPxFormLayout1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// buttonGeneraGrafici control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton buttonGeneraGrafici;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// buttonEsportaPdf control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton buttonEsportaPdf;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// pointChart control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.XtraCharts.Web.WebChartControl pointChart;
|
||||||
|
}
|
||||||
|
}
|
||||||
759
OlympiaIntranet/GestioneOrdini.aspx
Normal file
@@ -0,0 +1,759 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GestioneOrdini.aspx.cs" Inherits="OlympiaIntranet.GestioneOrdiniGuardian" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
<%--<%@ Register Src="~/MemberPages/menu.ascx" TagPrefix="mc" TagName="menuControl" %>--%>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<div>
|
||||||
|
<%-- <mc:menuControl ID="menu" runat="server" GridID="CERTIFICATESPAGE" Visible="True" />--%>
|
||||||
|
<dx:ASPxPageControl ID="ASPxPageControl1" runat="server" ActiveTabIndex="3" EnableTheming="True" Theme="MetropolisBlue" OnActiveTabChanged="ASPxPageControl1_ActiveTabChanged">
|
||||||
|
<TabPages>
|
||||||
|
<dx:TabPage Text="Anagrafica Clienti">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" HeaderText="" ShowCollapseButton="True" Theme="MetropolisBlue" View="GroupBox" Width="200px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server">
|
||||||
|
<dx:ASPxGridView ID="ASPxGVClienti" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDSClienti" EnableTheming="True" KeyFieldName="IDClienti" Theme="MetropolisBlue">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
|
||||||
|
<SettingsPager Mode="ShowAllRecords" Visible="False">
|
||||||
|
</SettingsPager>
|
||||||
|
<Settings ShowFilterRow="True" />
|
||||||
|
<SettingsBehavior ConfirmDelete="True" />
|
||||||
|
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewCommandColumn ShowClearFilterButton="True" ShowEditButton="True" ShowInCustomizationForm="True" ShowNewButtonInHeader="True" VisibleIndex="0" ShowDeleteButton="True">
|
||||||
|
</dx:GridViewCommandColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="IDClienti" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="1">
|
||||||
|
<EditFormSettings Visible="False" />
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Nome" ShowInCustomizationForm="True" VisibleIndex="2">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="NumRapporto" ShowInCustomizationForm="True" VisibleIndex="3">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataComboBoxColumn FieldName="DivisaRapporto" ShowInCustomizationForm="True" VisibleIndex="5">
|
||||||
|
<PropertiesComboBox>
|
||||||
|
<Items>
|
||||||
|
<dx:ListEditItem Text="CHF" Value="CHF" />
|
||||||
|
<dx:ListEditItem Text="EUR" Value="EUR" />
|
||||||
|
<dx:ListEditItem Text="GBP" Value="GBP" />
|
||||||
|
<dx:ListEditItem Text="USD" Value="USD" />
|
||||||
|
</Items>
|
||||||
|
</PropertiesComboBox>
|
||||||
|
</dx:GridViewDataComboBoxColumn>
|
||||||
|
<dx:GridViewDataComboBoxColumn FieldName="Gruppo" ShowInCustomizationForm="True" VisibleIndex="6">
|
||||||
|
<PropertiesComboBox>
|
||||||
|
<Items>
|
||||||
|
<dx:ListEditItem Text="ANNA_BIL" Value="ANNA_BIL" />
|
||||||
|
<dx:ListEditItem Text="ANNA_UBS" Value="ANNA_UBS" />
|
||||||
|
<dx:ListEditItem Text="ANNA_UBS_CH" Value="ANNA_UBS_CH" />
|
||||||
|
<%-- <dx:ListEditItem Text="CALD" Value="CALD" />
|
||||||
|
<dx:ListEditItem Text="FEDE" Value="FEDE" />
|
||||||
|
<dx:ListEditItem Text="ROMA" Value="ROMA" />--%>
|
||||||
|
</Items>
|
||||||
|
</PropertiesComboBox>
|
||||||
|
</dx:GridViewDataComboBoxColumn>
|
||||||
|
<dx:GridViewDataComboBoxColumn FieldName="Banca" ShowInCustomizationForm="True" VisibleIndex="4">
|
||||||
|
<PropertiesComboBox>
|
||||||
|
<Items>
|
||||||
|
<dx:ListEditItem Text="BANCA SELLA" Value="BS" />
|
||||||
|
<dx:ListEditItem Text="BILLUX" Value="BILLUX" />
|
||||||
|
<dx:ListEditItem Text="UBSI" Value="UBSI" />
|
||||||
|
<dx:ListEditItem Text="UBSLUG" Value="UBSLUG" />
|
||||||
|
</Items>
|
||||||
|
</PropertiesComboBox>
|
||||||
|
</dx:GridViewDataComboBoxColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxRoundPanel>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>
|
||||||
|
<dx:TabPage Text="Anagrafica Mercati" Visible="False">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<dx:ASPxRoundPanel ID="ASPxRoundPanel2" runat="server" HeaderText="" ShowCollapseButton="True" Theme="MetropolisBlue" View="GroupBox" Width="200px">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server">
|
||||||
|
<dx:ASPxGridView ID="ASPxGVMercati" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDSMercati" EnableTheming="True" KeyFieldName="IDMercati" Theme="MetropolisBlue">
|
||||||
|
<ClientSideEvents EndCallback="function(s, e) {
|
||||||
|
comboboxMercati.PerformCallback();
|
||||||
|
}" />
|
||||||
|
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
|
||||||
|
<SettingsPager Mode="ShowAllRecords" Visible="False">
|
||||||
|
</SettingsPager>
|
||||||
|
<Settings ShowFilterRow="True" />
|
||||||
|
<SettingsDataSecurity AllowDelete="False" />
|
||||||
|
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewCommandColumn ShowEditButton="True" ShowInCustomizationForm="True" ShowNewButtonInHeader="True" VisibleIndex="0">
|
||||||
|
</dx:GridViewCommandColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="IDMercati" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="1">
|
||||||
|
<EditFormSettings Visible="False" />
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Codice" ShowInCustomizationForm="True" VisibleIndex="2">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Descrizione" ShowInCustomizationForm="True" VisibleIndex="3">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxRoundPanel>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>
|
||||||
|
<dx:TabPage Text="Inserimento Ordini">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<dx:ASPxFormLayout ID="ASPxFLTitoli" runat="server" EnableTheming="True" Theme="MetropolisBlue">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutGroup Caption="">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutGroup Caption=" " ColCount="2">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="Codice Titolo">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxTextBox ID="ASPxCodiceTitolo" runat="server" Theme="MetropolisBlue">
|
||||||
|
</dx:ASPxTextBox>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxRadioButtonList ID="ASPxRBLTipoTitolo" runat="server" OnSelectedIndexChanged="ASPxRBLTipoTitolo_SelectedIndexChanged" RepeatDirection="Horizontal" ClientInstanceName="rblTipoTitolo">
|
||||||
|
<Items>
|
||||||
|
<dx:ListEditItem Text="ISIN" Value="0" />
|
||||||
|
<dx:ListEditItem Text="Ticker BBG" Value="1" />
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxRadioButtonList>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
<dx:LayoutItem Caption="Strumento">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxComboBox ID="ASPxStrumento" runat="server" Theme="MetropolisBlue" ClientInstanceName="comboboxStrumento">
|
||||||
|
<Items>
|
||||||
|
<dx:ListEditItem Text="Azioni" Value="Azioni" />
|
||||||
|
<dx:ListEditItem Text="Certificates" Value="Certificates" />
|
||||||
|
<dx:ListEditItem Text="ETF" Value="ETF" />
|
||||||
|
<dx:ListEditItem Text="Fondi" Value="Fondi" />
|
||||||
|
<dx:ListEditItem Text="Obbligazioni" Value="Obbligazioni" />
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxComboBox>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Mercato" Visible="False">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxComboBox ID="ASPxMercato" runat="server" ClientInstanceName="comboboxMercati" DataSourceID="SqlDSMercati" TextField="Descrizione" Theme="MetropolisBlue" ValueField="IDMercati" OnCallback="ASPxMercato_Callback" ValueType="System.Int32">
|
||||||
|
</dx:ASPxComboBox>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="PCS (Solo Obbligazioni)" Visible="False">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxComboBox ID="ASPxPCSObbligazioni" runat="server" Theme="MetropolisBlue">
|
||||||
|
<Items>
|
||||||
|
<dx:ListEditItem Text="GERM" Value="GERM" />
|
||||||
|
<dx:ListEditItem Text="MILA" Value="MILA" />
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxComboBox>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="PCS (Solo Obbligazioni)">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxTextBox ID="ASPxPCS" runat="server">
|
||||||
|
</dx:ASPxTextBox>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutGroup Caption="Rileva dati da BBG">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutGroup Caption="">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="ISIN">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxLabel ID="ASPxLabelISIN" runat="server">
|
||||||
|
</dx:ASPxLabel>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Descrizione">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxLabel ID="ASPxLabelDescrizioneBBG" runat="server">
|
||||||
|
</dx:ASPxLabel>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Prezzo" Name="ASPxLayoutItemPrezzo">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxLabel ID="ASPxLabelPrezzoBBG" runat="server">
|
||||||
|
</dx:ASPxLabel>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Data Prezzo">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxLabel ID="ASPxLabelDataPrezzoBBG" runat="server">
|
||||||
|
</dx:ASPxLabel>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Divisa Titolo">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxLabel ID="ASPxLabelDivisaTitoloBBG" runat="server">
|
||||||
|
</dx:ASPxLabel>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Query Status ">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxLabel ID="ASPxLabelQueryStatus" runat="server" Font-Bold="True">
|
||||||
|
</dx:ASPxLabel>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
<dx:LayoutItem Caption="">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="ASPxButtonQueryBBG" runat="server" OnClick="ASPxButtonQueryBBG_Click" Text="Query BBG" Theme="MetropolisBlue">
|
||||||
|
<Image IconID="miscellaneous_viewonweb_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxFormLayout>
|
||||||
|
<dx:ASPxRoundPanel ID="ASPxRoundPanel3" runat="server" ShowCollapseButton="true" Width="200px" HeaderText="Inserimento Ordini" Theme="MetropolisBlue" View="GroupBox">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxCheckBoxList ID="ASPxCBLGruppi" runat="server" RepeatColumns="7" Theme="MetropolisBlue" SelectedIndex="0">
|
||||||
|
<Items>
|
||||||
|
<dx:ListEditItem Text="ANNA_BIL" Value="ANNA_BIL" />
|
||||||
|
<dx:ListEditItem Text="ANNA_UBS" Value="ANNA_UBS" />
|
||||||
|
<dx:ListEditItem Text="ANNA_UBS_CH" Value="ANNA_UBS_CH" />
|
||||||
|
<%-- <dx:ListEditItem Text="CALD" Value="CALD" />
|
||||||
|
<dx:ListEditItem Text="FEDE" Value="FEDE" />
|
||||||
|
<dx:ListEditItem Text="ROMA" Value="ROMA" />--%>
|
||||||
|
<dx:ListEditItem Text="STE ITA" Value="STE ITA" />
|
||||||
|
<dx:ListEditItem Text="STE EST" Value="STE EST" />
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxCheckBoxList>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxButton ID="ASPxButtonCaricaOrdini" runat="server" Theme="MetropolisBlue" OnClick="ASPxButtonCaricaClienti_Click">
|
||||||
|
<Image IconID="actions_refresh_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxButton ID="ASPxButtonCancellaOrdini" runat="server" Theme="MetropolisBlue" OnClick="ASPxButtonCancellaOrdini_Click">
|
||||||
|
<ClientSideEvents Click="function(s, e) {
|
||||||
|
e.processOnServer = confirm('Cancellare ordini per titolo selezionato?');
|
||||||
|
}" />
|
||||||
|
<Image IconID="actions_clear_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="Modifica Prezzo" Theme="MetropolisBlue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="ASPxTextBoxModificaPrezzo" runat="server" Width="170px"></dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxButton ID="ASPxButtonSavePrezzo" runat="server" OnClick="ASPxButtonSavePrezzo_Click">
|
||||||
|
<Image IconID="save_save_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel2" runat="server" Text="Modifica Data Validità" Theme="MetropolisBlue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxDateEdit ID="ASPxDateDataValidita" runat="server" Theme="MetropolisBlue"></dx:ASPxDateEdit>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxButton ID="ASPxButtonSaveDataValidita" runat="server" OnClick="ASPxButtonSaveDataValidita_Click">
|
||||||
|
<Image IconID="save_save_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxButton ID="ASPxCancellaDataValidita" runat="server" Theme="MetropolisBlue" OnClick="ASPxCancellaDataValidita_Click">
|
||||||
|
<ClientSideEvents Click="function(s, e) {
|
||||||
|
e.processOnServer = confirm('Azzerare data validita per titolo selezionato?');
|
||||||
|
}" />
|
||||||
|
<Image IconID="actions_clear_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel3" runat="server" Text="Modifica Tipo Operazione" Theme="MetropolisBlue"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxRadioButtonList ID="ASPxRBLTipoOp" runat="server" ValueType="System.String" EnableTheming="True" RepeatDirection="Horizontal" SelectedIndex="1" Theme="MetropolisBlue">
|
||||||
|
<Items>
|
||||||
|
<dx:ListEditItem Text="BUY" Value="B" />
|
||||||
|
<dx:ListEditItem Selected="True" Text="SELL" Value="S" />
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxRadioButtonList>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxButton ID="ASPxButtonSaveTipoOp" runat="server" OnClick="ASPxButtonSaveTipoOp_Click">
|
||||||
|
<Image IconID="save_save_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxButton ID="ASPxImportaQty" runat="server" Text="Importa Quantità" OnClick="ASPxImportaQty_Click" Theme="MetropolisBlue"></dx:ASPxButton>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<dx:ASPxGridView ID="ASPxGVOrdini" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDSOrdini" EnableTheming="True" KeyFieldName="IDOrdini" Theme="MetropolisBlue" OnBeforePerformDataSelect="ASPxGVOrdini_BeforePerformDataSelect" OnRowUpdated="ASPxGVOrdini_RowUpdated" OnHtmlDataCellPrepared="ASPxGVOrdini_HtmlDataCellPrepared">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
|
||||||
|
<SettingsPager Mode="ShowAllRecords" Visible="False">
|
||||||
|
</SettingsPager>
|
||||||
|
<Settings ShowFilterRow="True" />
|
||||||
|
<SettingsDataSecurity AllowDelete="False" AllowInsert="False" />
|
||||||
|
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewCommandColumn ShowEditButton="True" ShowInCustomizationForm="True" VisibleIndex="0">
|
||||||
|
</dx:GridViewCommandColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="IDOrdini" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="1">
|
||||||
|
<EditFormSettings Visible="False" />
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Titolo" ShowInCustomizationForm="True" VisibleIndex="2">
|
||||||
|
<EditFormSettings Visible="False" />
|
||||||
|
<CellStyle BackColor="#F2F2F2">
|
||||||
|
</CellStyle>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Cliente" ShowInCustomizationForm="True" VisibleIndex="5">
|
||||||
|
<EditFormSettings Visible="False" />
|
||||||
|
<CellStyle BackColor="#F2F2F2">
|
||||||
|
</CellStyle>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Gruppo" ShowInCustomizationForm="True" VisibleIndex="6">
|
||||||
|
<EditFormSettings Visible="False" />
|
||||||
|
<CellStyle BackColor="#F2F2F2">
|
||||||
|
</CellStyle>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Quantita" ShowInCustomizationForm="True" VisibleIndex="7">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="F2">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Prezzo" ShowInCustomizationForm="True" VisibleIndex="8">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="n2">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="DivisaTitolo" ShowInCustomizationForm="True" VisibleIndex="11">
|
||||||
|
<EditFormSettings Visible="False" />
|
||||||
|
<CellStyle BackColor="#F2F2F2">
|
||||||
|
</CellStyle>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="ControvaloreDT" ShowInCustomizationForm="True" VisibleIndex="12">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="n2">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
<EditFormSettings Visible="False" />
|
||||||
|
<CellStyle BackColor="#F2F2F2">
|
||||||
|
</CellStyle>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="DivisaRapporto" ShowInCustomizationForm="True" VisibleIndex="13">
|
||||||
|
<EditFormSettings Visible="False" />
|
||||||
|
<CellStyle BackColor="#F2F2F2">
|
||||||
|
</CellStyle>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="ControvaloreDR" ShowInCustomizationForm="True" VisibleIndex="14">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="n2">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
<EditFormSettings Visible="False" />
|
||||||
|
<CellStyle BackColor="#F2F2F2">
|
||||||
|
</CellStyle>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Cambio" ShowInCustomizationForm="True" VisibleIndex="15">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="n4">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
<EditFormSettings Visible="False" />
|
||||||
|
<CellStyle BackColor="#F2F2F2">
|
||||||
|
</CellStyle>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataDateColumn FieldName="DataValidita" ShowInCustomizationForm="True" VisibleIndex="9">
|
||||||
|
<PropertiesDateEdit DisplayFormatString="dd/MM/yyyy" EditFormat="Custom" EditFormatString="dd/MM/yyyy">
|
||||||
|
</PropertiesDateEdit>
|
||||||
|
</dx:GridViewDataDateColumn>
|
||||||
|
<dx:GridViewDataComboBoxColumn FieldName="TipoOperazione" ShowInCustomizationForm="True" VisibleIndex="10">
|
||||||
|
<PropertiesComboBox>
|
||||||
|
<Items>
|
||||||
|
<dx:ListEditItem Text="B" Value="B" />
|
||||||
|
<dx:ListEditItem Text="S" Value="S" />
|
||||||
|
</Items>
|
||||||
|
</PropertiesComboBox>
|
||||||
|
</dx:GridViewDataComboBoxColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Descrizione" ShowInCustomizationForm="True" VisibleIndex="3">
|
||||||
|
<EditFormSettings Visible="False" />
|
||||||
|
<CellStyle BackColor="#F2F2F2">
|
||||||
|
</CellStyle>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataDateColumn FieldName="DataUltimaModifica" ShowInCustomizationForm="True" VisibleIndex="16">
|
||||||
|
<PropertiesDateEdit DisplayFormatString="dd/MM/yyyy" EditFormat="Custom" EditFormatString="dd/MM/yyyy">
|
||||||
|
</PropertiesDateEdit>
|
||||||
|
<EditFormSettings Visible="False" />
|
||||||
|
<CellStyle BackColor="#F2F2F2">
|
||||||
|
</CellStyle>
|
||||||
|
</dx:GridViewDataDateColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="QtaInPtf" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="17">
|
||||||
|
<EditFormSettings Visible="False" />
|
||||||
|
<CellStyle BackColor="#F2F2F2">
|
||||||
|
</CellStyle>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Cash In Ptf" FieldName="CashPtf" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="19">
|
||||||
|
<EditFormSettings Visible="False" />
|
||||||
|
<CellStyle BackColor="#F2F2F2">
|
||||||
|
</CellStyle>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="DivisaRegolamento" ShowInCustomizationForm="True" VisibleIndex="18">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="N. Conto" FieldName="NumRapporto" ShowInCustomizationForm="True" VisibleIndex="4">
|
||||||
|
<EditFormSettings Visible="False" />
|
||||||
|
<CellStyle BackColor="#F2F2F2">
|
||||||
|
</CellStyle>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxRoundPanel>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>
|
||||||
|
<dx:TabPage Text="Crea Excel">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<dx:ASPxFormLayout runat="server" EnableTheming="True" Theme="MetropolisBlue">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutGroup Caption="" ColCount="2">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="Gruppi">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxCheckBoxList ID="ASPxCBLGruppiExcel" runat="server" RepeatColumns="7">
|
||||||
|
</dx:ASPxCheckBoxList>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:EmptyLayoutItem>
|
||||||
|
</dx:EmptyLayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Mostra ordini a partire da">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxDateEdit ID="ASPxDataUltimaModifica" runat="server" DisplayFormatString="dd/MM/yyyy" Theme="MetropolisBlue" EditFormat="Custom" EditFormatString="dd/MM/yyyy">
|
||||||
|
</dx:ASPxDateEdit>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="ASPxButtonCaricaOrdiniExcel" runat="server" OnClick="ASPxButtonCaricaOrdiniExcel_Click">
|
||||||
|
<Image IconID="actions_refresh_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Data Invio Excel">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxDateEdit ID="ASPxDataInvio" runat="server" DisplayFormatString="dd/MM/yyyy" Theme="MetropolisBlue" EditFormat="Custom" EditFormatString="dd/MM/yyyy">
|
||||||
|
</dx:ASPxDateEdit>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="ASPxButtonExportOrdiniExcel" runat="server" OnClick="ASPxButtonExportOrdiniExcel_Click">
|
||||||
|
<Image IconID="export_exporttoxls_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxFormLayout>
|
||||||
|
<dx:ASPxRoundPanel ID="ASPxRoundPanel4" runat="server" ShowCollapseButton="true" Width="200px" HeaderText="Ordini per Excel" Theme="MetropolisBlue" View="GroupBox">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server">
|
||||||
|
<dx:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" ExportedRowType="All" GridViewID="ASPxOrdiniPerExcel" ExportSelectedRowsOnly="true" OnRenderBrick="ASPxGridViewExporter1_RenderBrick">
|
||||||
|
</dx:ASPxGridViewExporter>
|
||||||
|
<dx:ASPxGridView ID="ASPxOrdiniPerExcel" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDSOrdiniPerExcel" EnableTheming="True" Theme="MetropolisBlue" KeyFieldName="IDOrdini" OnBeforePerformDataSelect="ASPxOrdiniPerExcel_BeforePerformDataSelect">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
|
||||||
|
<SettingsPager Mode="ShowAllRecords" Visible="False">
|
||||||
|
</SettingsPager>
|
||||||
|
<SettingsBehavior ProcessSelectionChangedOnServer="True" />
|
||||||
|
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="prog" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="2">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="rif" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="3">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="simulazione" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="4">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="spuntato" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="5">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="storicizzato" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="6">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="storno" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="7">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="annullato" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="8">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="ora_ope" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="11">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataDateColumn FieldName="data_val" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="12">
|
||||||
|
<PropertiesDateEdit DisplayFormatString="dd/MM/yyyy" EditFormat="Custom" EditFormatString="dd/MM/yyyy">
|
||||||
|
</PropertiesDateEdit>
|
||||||
|
</dx:GridViewDataDateColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_ope" ShowInCustomizationForm="True" VisibleIndex="13">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_rap" ShowInCustomizationForm="True" VisibleIndex="14">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_tit" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="15">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_div_tit" ShowInCustomizationForm="True" VisibleIndex="16">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_isin" ShowInCustomizationForm="True" VisibleIndex="17">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_bloomberg" ShowInCustomizationForm="True" VisibleIndex="18">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_esterno" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="19">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="qta" ShowInCustomizationForm="True" VisibleIndex="20">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="prezzo" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="21">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="rateo" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="22">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cambiom" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="23">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cambiod" ShowInCustomizationForm="True" VisibleIndex="24">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_ctp" ShowInCustomizationForm="True" VisibleIndex="25">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_dep_tit" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="26">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_dep_liq" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="27">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_dep_liq2" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="28">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_div_reg" ShowInCustomizationForm="True" VisibleIndex="29">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="ctv_tit_dn" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="30">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="ctv_rat_dn" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="31">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="comp_dep_dn" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="32">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="coma_dep_dn" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="33">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="comp_alt_dn" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="34">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="coma_alt_dn" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="35">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="spese_dn" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="36">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="imposte_dn" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="37">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="ctv_tot_dn" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="38">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="margini_dn" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="39">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="ctv_tit_dr" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="40">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="ctv_rat_dr" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="41">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="comp_dep_dr" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="42">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="coma_dep_dr" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="43">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="comp_alt_dr" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="44">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="coma_alt_dr" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="45">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="spese_dr" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="46">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="imposte_dr" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="47">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="ctv_tot_dr" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="48">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="des_mov" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="49">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="rif_est" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="50">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="coordinate1" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="51">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="coordinate2" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="52">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="data_sto" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="53">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="progr_sto" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="54">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="prezzo_car" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="55">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_div_ds" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="56">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cambiom_ds" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="57">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cambiod_ds" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="58">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="ctv_tot_ds" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="59">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_mer" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="60">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="param_prezzo" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="61">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="param_tempo" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="62">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cash" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="63">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="des_tit" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="64">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="divisore" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="65">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="moltiplicatore" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="66">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="leva" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="67">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewCommandColumn SelectAllCheckboxMode="AllPages" ShowInCustomizationForm="True" ShowSelectCheckbox="True" VisibleIndex="0">
|
||||||
|
</dx:GridViewCommandColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="IDOrdini" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="1">
|
||||||
|
<EditFormSettings Visible="False" />
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataDateColumn FieldName="data_ope" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="10">
|
||||||
|
<PropertiesDateEdit DisplayFormatString="dd/MM/yyyy" EditFormat="Custom" EditFormatString="dd/MM/yyyy">
|
||||||
|
</PropertiesDateEdit>
|
||||||
|
</dx:GridViewDataDateColumn>
|
||||||
|
<dx:GridViewDataDateColumn FieldName="data_ins" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="9">
|
||||||
|
<PropertiesDateEdit DisplayFormatString="dd/MM/yyyy" EditFormat="Custom" EditFormatString="dd/MM/yyyy">
|
||||||
|
</PropertiesDateEdit>
|
||||||
|
</dx:GridViewDataDateColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxRoundPanel>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>
|
||||||
|
</TabPages>
|
||||||
|
</dx:ASPxPageControl>
|
||||||
|
</div>
|
||||||
|
<asp:SqlDataSource ID="SqlDSOrdini" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection %>" SelectCommand="GDN_LoadOrdini_v3" UpdateCommand="dbo.GDN_OrdiniUPD_v1" SelectCommandType="StoredProcedure" UpdateCommandType="StoredProcedure" ProviderName="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection.ProviderName %>">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="ISIN" SessionField="ISIN" Type="String" />
|
||||||
|
<asp:Parameter Name="Gruppi" Type="String" />
|
||||||
|
</SelectParameters>
|
||||||
|
<UpdateParameters>
|
||||||
|
<asp:Parameter Name="IDOrdini" Type="Int32" />
|
||||||
|
<asp:Parameter Name="Quantita" Type="Double" />
|
||||||
|
<asp:Parameter Name="Prezzo" Type="Double" />
|
||||||
|
<asp:Parameter Name="TipoOperazione" Type="String" />
|
||||||
|
<asp:Parameter Name="Cambio" Type="Double" />
|
||||||
|
<asp:Parameter Name="DataValidita" DbType="Date" />
|
||||||
|
<asp:Parameter Name="DivisaRegolamento" Type="String" />
|
||||||
|
</UpdateParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSClienti" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection %>" SelectCommand="SELECT IDClienti,Nome,NumRapporto,Banca,DivisaRapporto,Gruppo FROM ClientiGDN
|
||||||
|
WHERE (Deleted = 0 or Deleted is null)"
|
||||||
|
InsertCommand="INSERT INTO ClientiGDN(Nome, NumRapporto, Banca, DivisaRapporto, Gruppo) VALUES (@Nome, @NumRapporto, @Banca, @DivisaRapporto, @Gruppo)" UpdateCommand="UPDATE ClientiGDN SET Nome = @Nome, NumRapporto = @NumRapporto, Banca = @Banca, DivisaRapporto = @DivisaRapporto, Gruppo = @Gruppo WHERE (IDClienti = @IDClienti)" DeleteCommand="UPDATE ClientiGDN
|
||||||
|
SET Deleted = 1
|
||||||
|
WHERE IDClienti = @IDClienti"
|
||||||
|
ProviderName="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection.ProviderName %>">
|
||||||
|
<DeleteParameters>
|
||||||
|
<asp:Parameter Name="IDClienti" />
|
||||||
|
</DeleteParameters>
|
||||||
|
<InsertParameters>
|
||||||
|
<asp:Parameter Name="Nome" />
|
||||||
|
<asp:Parameter Name="NumRapporto" />
|
||||||
|
<asp:Parameter Name="Banca" />
|
||||||
|
<asp:Parameter Name="DivisaRapporto" />
|
||||||
|
<asp:Parameter Name="Gruppo" />
|
||||||
|
</InsertParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSMercati" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection %>" SelectCommand="SELECT IDMercati,Codice,Descrizione FROM MercatiGDN ORDER BY Descrizione" ProviderName="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection.ProviderName %>" InsertCommand="INSERT INTO MercatiGDN(Codice, Descrizione) VALUES (@Codice, @Descrizione)" UpdateCommand="UPDATE MercatiGDN SET Descrizione = @Descrizione, Codice = @Codice WHERE (IDMercati = @IDMercati)">
|
||||||
|
<InsertParameters>
|
||||||
|
<asp:Parameter Name="Codice" />
|
||||||
|
<asp:Parameter Name="Descrizione" />
|
||||||
|
</InsertParameters>
|
||||||
|
<UpdateParameters>
|
||||||
|
<asp:Parameter Name="Descrizione" />
|
||||||
|
<asp:Parameter Name="Codice" />
|
||||||
|
<asp:Parameter Name="IDMercati" />
|
||||||
|
</UpdateParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSTitoli" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection %>" ProviderName="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection.ProviderName %>" SelectCommand="SELECT * FROM TitoliGDN"></asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSOrdiniPerExcel" runat="server" ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection %>" SelectCommand="GDN_LoadExcelOrdini_v3" SelectCommandType="StoredProcedure" ProviderName="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection.ProviderName %>">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter DbType="Date" Name="fromDate" SessionField="fromDate" />
|
||||||
|
<asp:SessionParameter DbType="String" Name="Gruppi" SessionField="Gruppi" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
928
OlympiaIntranet/GestioneOrdini.aspx.cs
Normal file
@@ -0,0 +1,928 @@
|
|||||||
|
using DevExpress.Export;
|
||||||
|
using DevExpress.Web;
|
||||||
|
using DevExpress.XtraPrinting;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class GestioneOrdiniGuardian : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
DataTable dtTitoli, dtClienti;
|
||||||
|
string Isin = "", Description = "", DivisaTitolo = "", LastDate = "";
|
||||||
|
string Last = "", Ask = "";
|
||||||
|
string paramGruppi = "";
|
||||||
|
DateTime LastDateNET = Convert.ToDateTime("01/01/1900");
|
||||||
|
|
||||||
|
protected void Page_Init(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Imposta data odierna di default
|
||||||
|
ASPxDataUltimaModifica.Date = DateTime.Now.Date;
|
||||||
|
ASPxDataInvio.Date = DateTime.Now.Date;
|
||||||
|
|
||||||
|
// Setta gruppi a seconda dell'utente
|
||||||
|
|
||||||
|
// Utenza Anna
|
||||||
|
ASPxCBLGruppi.Items.Clear();
|
||||||
|
ASPxCBLGruppiExcel.Items.Clear();
|
||||||
|
if (Page.User.Identity.Name == "anna" || Page.User.Identity.Name == "federico" || Page.User.Identity.Name == "admin" || Page.User.Identity.Name == "ecanziani" || Page.User.Identity.Name == "fcostalonga" || Page.User.Identity.Name == "agamba")
|
||||||
|
{
|
||||||
|
ASPxCBLGruppi.Items.Add("ANNA_BIL", "ANNA_BIL");
|
||||||
|
ASPxCBLGruppi.Items.Add("ANNA_UBS", "ANNA_UBS");
|
||||||
|
ASPxCBLGruppi.Items.Add("ANNA_UBS_CH", "ANNA_UBS_CH");
|
||||||
|
|
||||||
|
ASPxCBLGruppiExcel.Items.Add("ANNA_BIL", "ANNA_BIL");
|
||||||
|
ASPxCBLGruppiExcel.Items.Add("ANNA_UBS", "ANNA_UBS");
|
||||||
|
ASPxCBLGruppiExcel.Items.Add("ANNA_UBS_CH", "ANNA_UBS_CH");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Utenza Stefano
|
||||||
|
if (Page.User.Identity.Name == "stefano" || Page.User.Identity.Name == "sbettinelli")
|
||||||
|
{
|
||||||
|
ASPxCBLGruppi.Items.Add("STE_ITA", "STE_ITA");
|
||||||
|
ASPxCBLGruppi.Items.Add("STE_EST", "STE_EST");
|
||||||
|
|
||||||
|
ASPxCBLGruppiExcel.Items.Add("STE_ITA", "STE_ITA");
|
||||||
|
ASPxCBLGruppiExcel.Items.Add("STE_EST", "STE_EST");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (HttpContext.Current.User.Identity.IsAuthenticated == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
|
||||||
|
ReloadTables();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxRBLTipoTitolo_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Evento gestito tramite javascript in ClientSideEvents SelectedIndexChanged
|
||||||
|
// "function(s, e) {
|
||||||
|
|
||||||
|
// if (rblTipoTitolo.GetSelectedIndex() == 0) // Tipo Codice : ISIN
|
||||||
|
// {
|
||||||
|
// comboboxStrumento.SetEnabled(true);
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// if (rblTipoTitolo.GetSelectedIndex() == 1) // Tipo Codice : Ticker BBG
|
||||||
|
// {
|
||||||
|
// comboboxStrumento.SetSelectedIndex(-1);
|
||||||
|
// comboboxStrumento.SetEnabled(false);
|
||||||
|
// }
|
||||||
|
//}"
|
||||||
|
|
||||||
|
//if (ASPxRBLTipoTitolo.SelectedIndex == 0) // Tipo Codice : ISIN
|
||||||
|
//{
|
||||||
|
// ASPxStrumento.Enabled = true;
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//if (ASPxRBLTipoTitolo.SelectedIndex == 1) // Tipo Codice : Ticker BBG
|
||||||
|
//{
|
||||||
|
// ASPxStrumento.SelectedIndex = -1;
|
||||||
|
// ASPxStrumento.Enabled = false;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxButtonQueryBBG_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Pulisce Label varie
|
||||||
|
ASPxLabelQueryStatus.Text = "";
|
||||||
|
ASPxLabelDescrizioneBBG.Text = "";
|
||||||
|
ASPxLabelDivisaTitoloBBG.Text = "";
|
||||||
|
ASPxLabelPrezzoBBG.Text = "";
|
||||||
|
ASPxLabelDataPrezzoBBG.Text = "";
|
||||||
|
|
||||||
|
// Controllo Codice Titolo
|
||||||
|
if (String.IsNullOrEmpty(ASPxCodiceTitolo.Text))
|
||||||
|
{
|
||||||
|
ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", "alert(\"Codice Titolo mancante!\");", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Controllo Tipo Titolo
|
||||||
|
if (ASPxRBLTipoTitolo.SelectedIndex == -1)
|
||||||
|
{
|
||||||
|
ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", "alert(\"Selezionare tipo ISIN o Ticker BBG!\");", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Controllo correttezza ISIN (se selezionato ISIN in radiobuttonlist)
|
||||||
|
if (ASPxRBLTipoTitolo.SelectedIndex == 0 && (ASPxCodiceTitolo.Text.Length != 12 || (ASPxCodiceTitolo.Text.Any(Char.IsWhiteSpace))))
|
||||||
|
{
|
||||||
|
ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", "alert(\"Formato ISIN non corretto!\");", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Controllo Strumento (solo se è selezionato Tipo Codice ISIN)
|
||||||
|
//if (ASPxRBLTipoTitolo.SelectedIndex == 0 && ASPxStrumento.SelectedIndex == -1)
|
||||||
|
// Controllo Strumento
|
||||||
|
if (ASPxStrumento.SelectedIndex == -1)
|
||||||
|
{
|
||||||
|
ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", "alert(\"Selezionare Strumento!\");", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//// Controllo Mercato
|
||||||
|
//if (ASPxMercato.SelectedIndex == -1)
|
||||||
|
//{
|
||||||
|
// ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", "alert(\"Selezionare Mercato!\");", true);
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
|
||||||
|
// Controllo PCS Obbligazioni se è selezionato Obbligazioni come Strumento
|
||||||
|
//if (ASPxStrumento.SelectedIndex == 4 && ASPxPCSObbligazioni.SelectedIndex == -1)
|
||||||
|
//{
|
||||||
|
// ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", "alert(\"Selezionare PCS!\");", true);
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
|
||||||
|
// Compone link BBG
|
||||||
|
//string suffixBBG = "";
|
||||||
|
string security = "";
|
||||||
|
string field = "ID_ISIN,SECURITY_NAME,PX_LAST,CRNCY,PX_CLOSE_DT,PX_ASK"; // Nel caso di strumento = Certificates allora la descrizione la prenderò componendola dal DB
|
||||||
|
if (ASPxRBLTipoTitolo.SelectedIndex == 0) // Selezionato ISIN
|
||||||
|
{
|
||||||
|
if (ASPxStrumento.SelectedIndex != 4) security = "/isin/" + ASPxCodiceTitolo.Text.ToUpper();
|
||||||
|
else security = "/isin/" + ASPxCodiceTitolo.Text + "@"+ ASPxPCS.Text; // se Strumento è obbligazioni allora compone diversamente la security (esempio /isin/DE000A2GSB86@GERM)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (ASPxRBLTipoTitolo.SelectedIndex == 1) // Selezionato Ticker BBG
|
||||||
|
{
|
||||||
|
security = ASPxCodiceTitolo.Text;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Effettua chiamata a BBG
|
||||||
|
string IPBBG = CommonClass.IsBBGServiceOnline()[1]; // Scarica dati rt da Londra
|
||||||
|
bool callEsito = (IPBBG != "N/A");
|
||||||
|
int hits = 0;
|
||||||
|
int numFields = 6;
|
||||||
|
//string linkBBG = string.Format("http://188.172.147.202:50000/api/bbgservice?security={0}&field={1}&type=json",security,field);
|
||||||
|
if (!callEsito)
|
||||||
|
{
|
||||||
|
ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", "alert(\"BBG OFFLINE!\");", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
hits += numFields;
|
||||||
|
string linkBBG = string.Format("http://{0}/api/bbgservice?security={1}&field={2}&type=json", IPBBG, security, field);
|
||||||
|
string json = "";
|
||||||
|
string error = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (WebClient web = new WebClient())
|
||||||
|
{
|
||||||
|
json = web.DownloadString(linkBBG);
|
||||||
|
}
|
||||||
|
if (CommonClass.IsValidJson(json) == false)
|
||||||
|
{
|
||||||
|
ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", "alert(\"ERRORE CHIAMATA BBG SERVICE! ("+ linkBBG + ") \");", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
JArray root = JArray.Parse(json);
|
||||||
|
|
||||||
|
foreach (var item in root)
|
||||||
|
{
|
||||||
|
Isin = (string)item.SelectToken("ID_ISIN"); // usato solo se Tipo Titolo è Ticker BBG
|
||||||
|
Description = (string)item.SelectToken("SECURITY_NAME"); // usato solo se Strumento non è Certificates
|
||||||
|
//Last = Convert.ToDecimal(((string)item.SelectToken("PX_LAST")).Replace('.', ','));
|
||||||
|
//Ask = Convert.ToDecimal(((string)item.SelectToken("PX_ASK")).Replace('.', ','));
|
||||||
|
Last = (string)item.SelectToken("PX_LAST");
|
||||||
|
Ask = (string)item.SelectToken("PX_ASK");
|
||||||
|
DivisaTitolo = (string)item.SelectToken("CRNCY");
|
||||||
|
LastDate = (string)item.SelectToken("PX_CLOSE_DT");
|
||||||
|
if (LastDate != "0")
|
||||||
|
{
|
||||||
|
var arrLastDate = LastDate.Split('-'); // Splitta data in formato yyyy-mm-dd per convertirla in C#.Net
|
||||||
|
LastDateNET = new DateTime(Convert.ToInt16(arrLastDate[0]), Convert.ToInt16(arrLastDate[1]), Convert.ToInt16(arrLastDate[2]));
|
||||||
|
} else LastDateNET = new DateTime(1900, 01, 01);
|
||||||
|
}
|
||||||
|
|
||||||
|
CommonClass.SaveHits(1, hits);
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
error = ex.Message;
|
||||||
|
string Errore = string.Format("alert(\"{0} (Errore : {1})\");", "Errore esecuzione query su BBG Service!",error);
|
||||||
|
ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", Errore, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(error)) return; // Se s'è errore in Query BBG allora esce...
|
||||||
|
|
||||||
|
// Verifica esistenza Isin in tabella TitoliGDN e nel caso ne carica i dati altrimenti li salva e li visualizza
|
||||||
|
int IDTitoli = (from r in dtTitoli.AsEnumerable()
|
||||||
|
where r.Field<string>("ISIN").ToUpper() == Isin
|
||||||
|
select r.Field<int>("IDTitoli")).SingleOrDefault<int>();
|
||||||
|
if (IDTitoli == 0) // Se Isin non esiste nel DB allora lo salva
|
||||||
|
{
|
||||||
|
ASPxLabelISIN.Text = Isin;
|
||||||
|
if (ASPxStrumento.Text == "Certificates")
|
||||||
|
{
|
||||||
|
ASPxLabelDescrizioneBBG.Text = ExecSP("GDN_DescrizioneTitolo", Isin);
|
||||||
|
ASPxLabelPrezzoBBG.Text = String.Format("{0:F}", Ask);
|
||||||
|
var layoutItem = ASPxFLTitoli.FindItemOrGroupByName("ASPxLayoutItemPrezzo");
|
||||||
|
layoutItem.Caption = "Prezzo (Ask)";
|
||||||
|
ASPxLabelDataPrezzoBBG.Text = DateTime.Now.Date.ToString("dd-MM-yyyy");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ASPxLabelDescrizioneBBG.Text = Description;
|
||||||
|
ASPxLabelPrezzoBBG.Text = String.Format("{0:F}", Last);
|
||||||
|
var layoutItem = ASPxFLTitoli.FindItemOrGroupByName("ASPxLayoutItemPrezzo");
|
||||||
|
layoutItem.Caption = "Prezzo (Last)";
|
||||||
|
ASPxLabelDataPrezzoBBG.Text = LastDateNET.ToString("dd-MM-yyyy");
|
||||||
|
}
|
||||||
|
|
||||||
|
ASPxLabelDataPrezzoBBG.Text = LastDateNET.ToString("dd-MM-yyyy");
|
||||||
|
ASPxLabelDivisaTitoloBBG.Text = DivisaTitolo;
|
||||||
|
SalvaTitoli(); // salva record in TitoliGDN
|
||||||
|
ReloadTables();
|
||||||
|
ASPxLabelQueryStatus.Text = string.Format("Titolo {0} salvato nel database", ASPxCodiceTitolo.Text);
|
||||||
|
}
|
||||||
|
else // Se Isin esiste allora aggiorna Px_Last,Px_Date,MercatiID e TipoStrumento in tabella TitoliGDN e Prezzo in tabella OrdiniGDN per tutti i record che hanno quel titolo
|
||||||
|
{
|
||||||
|
AggiornaTitoli_Ordini();
|
||||||
|
ReloadTables();
|
||||||
|
ASPxLabelQueryStatus.Text = string.Format("Titolo {0} rilevato nel database, dati aggiornati", ASPxCodiceTitolo.Text);
|
||||||
|
ASPxLabelISIN.Text = Isin;
|
||||||
|
if (ASPxStrumento.Text == "Certificates")
|
||||||
|
{
|
||||||
|
var layoutItem = ASPxFLTitoli.FindItemOrGroupByName("ASPxLayoutItemPrezzo");
|
||||||
|
layoutItem.Caption = "Prezzo (Ask)";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var layoutItem = ASPxFLTitoli.FindItemOrGroupByName("ASPxLayoutItemPrezzo");
|
||||||
|
layoutItem.Caption = "Prezzo (Last)";
|
||||||
|
}
|
||||||
|
ASPxLabelDescrizioneBBG.Text = (from r in dtTitoli.AsEnumerable()
|
||||||
|
where r.Field<string>("ISIN").ToUpper() == Isin
|
||||||
|
select r.Field<string>("Descrizione")).SingleOrDefault<string>();
|
||||||
|
ASPxLabelPrezzoBBG.Text = String.Format("{0:F}",(from r in dtTitoli.AsEnumerable()
|
||||||
|
where r.Field<string>("ISIN").ToUpper() == Isin
|
||||||
|
select r.Field<double>("Px_Last")).SingleOrDefault<double>());
|
||||||
|
ASPxLabelDataPrezzoBBG.Text = (from r in dtTitoli.AsEnumerable()
|
||||||
|
where r.Field<string>("ISIN").ToUpper() == Isin
|
||||||
|
select r.Field<DateTime>("Px_Date")).SingleOrDefault<DateTime>().ToString("dd-MM-yyyy");
|
||||||
|
ASPxLabelDivisaTitoloBBG.Text = (from r in dtTitoli.AsEnumerable()
|
||||||
|
where r.Field<string>("ISIN").ToUpper() == Isin
|
||||||
|
select r.Field<string>("DivisaTitolo")).SingleOrDefault<string>();
|
||||||
|
//ASPxMercato.SelectedItem.Value = (from r in dtTitoli.AsEnumerable()
|
||||||
|
// where r.Field<string>("ISIN").ToUpper() == Isin
|
||||||
|
// select r.Field<int>("MercatiID")).SingleOrDefault<int>();
|
||||||
|
// if (ASPxRBLTipoTitolo.SelectedIndex == 0)
|
||||||
|
// {
|
||||||
|
ASPxStrumento.SelectedItem.Value = (from r in dtTitoli.AsEnumerable()
|
||||||
|
where r.Field<string>("ISIN").ToUpper() == Isin
|
||||||
|
select r.Field<string>("TipoStrumento")).SingleOrDefault<string>();
|
||||||
|
//}
|
||||||
|
//else ASPxStrumento.SelectedIndex = -1;
|
||||||
|
}
|
||||||
|
ReloadOrdini();
|
||||||
|
ReloadOrdiniPerExcel();
|
||||||
|
ASPxOrdiniPerExcel.Selection.SelectAll();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxMercato_Callback(object sender, DevExpress.Web.CallbackEventArgsBase e)
|
||||||
|
{
|
||||||
|
(sender as DevExpress.Web.ASPxComboBox).DataBind();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxGVOrdini_BeforePerformDataSelect(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Session["ISIN"] = ASPxLabelISIN.Text;
|
||||||
|
Session["fromDate"] = ASPxDataUltimaModifica.Date.ToString("yyyy-MM-dd");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxButtonCaricaClienti_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Controllo Codice Titolo
|
||||||
|
if (String.IsNullOrEmpty(ASPxCodiceTitolo.Text))
|
||||||
|
{
|
||||||
|
ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", "alert(\"Codice Titolo mancante!\");", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SalvaDataRegolamento();
|
||||||
|
|
||||||
|
ReloadOrdini();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SalvaDataRegolamento()
|
||||||
|
{
|
||||||
|
// Rileva gruppi selezionati per la visualizzazione degli ordini relativi ai clienti associati ai gruppi
|
||||||
|
paramGruppi = "";
|
||||||
|
foreach (ListEditItem item in ASPxCBLGruppi.SelectedItems)
|
||||||
|
{
|
||||||
|
paramGruppi = paramGruppi + item.Text + ",";
|
||||||
|
}
|
||||||
|
// Salva DataRegolamento per quelle righe (ordini) che hanno solo un conto (quindi una valuta) in modo che l'utente non debba editare le righe a manina.
|
||||||
|
string connectionString = Properties.Settings.Default.SqlConnection;
|
||||||
|
using (var con = new SqlConnection(connectionString))
|
||||||
|
{
|
||||||
|
var cmd = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = "dbo.GDN_OrdiniDataRegUPD",
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
cmd.Parameters.Add("@ISIN", SqlDbType.VarChar).Value = ASPxLabelISIN.Text;
|
||||||
|
cmd.Parameters.Add("@Gruppi", SqlDbType.VarChar).Value = paramGruppi;
|
||||||
|
con.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxButtonSavePrezzo_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Controlla Modifica prezzo valorizzato
|
||||||
|
if (String.IsNullOrEmpty(ASPxTextBoxModificaPrezzo.Text))
|
||||||
|
{
|
||||||
|
ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", "alert(\"Prezzo da aggiornare mancante!\");", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Controlla inserimento punto decimale invece che virgola
|
||||||
|
if (ASPxTextBoxModificaPrezzo.Text.IndexOf(",") != -1)
|
||||||
|
{
|
||||||
|
ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", "alert(\"Inserire prezzo con punto (.) come decimale (es: 900.25)\");", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Ciclo per rilevare IDOrdini in griglia ASPxGVOrdini
|
||||||
|
for (int i = 0; i < ASPxGVOrdini.VisibleRowCount; i++)
|
||||||
|
{
|
||||||
|
if (ASPxGVOrdini.GetRowLevel(i) == ASPxGVOrdini.GroupCount)
|
||||||
|
{
|
||||||
|
object keyValue = ASPxGVOrdini.GetRowValues(i, new string[] { ASPxGVOrdini.KeyFieldName });
|
||||||
|
if (keyValue != null)
|
||||||
|
//ASPxMemo1.Text += keyValue.ToString() + "\n";
|
||||||
|
AggiornaPrezzo_Ordini(Convert.ToInt16(keyValue),Convert.ToDouble(ASPxTextBoxModificaPrezzo.Text));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ReloadOrdini();
|
||||||
|
ReloadOrdiniPerExcel();
|
||||||
|
ASPxOrdiniPerExcel.Selection.SelectAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InserisceOrdini(string gruppo, string ISIN)
|
||||||
|
{
|
||||||
|
string connectionString = Properties.Settings.Default.SqlConnection;
|
||||||
|
using (var con = new SqlConnection(connectionString))
|
||||||
|
{
|
||||||
|
var cmd = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = "dbo.GDN_OrdiniINS_v1",
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
cmd.Parameters.Add("@Gruppo", SqlDbType.VarChar).Value = gruppo;
|
||||||
|
cmd.Parameters.Add("@ISIN", SqlDbType.VarChar).Value = ISIN;
|
||||||
|
con.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxButtonCaricaOrdiniExcel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (ASPxCBLGruppiExcel.SelectedItems.Count == 0)
|
||||||
|
{
|
||||||
|
ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", "alert(\"Selezionare almeno un gruppo!\");", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ReloadOrdiniPerExcel();
|
||||||
|
|
||||||
|
// Seleziona tutti i record (default)
|
||||||
|
ASPxOrdiniPerExcel.Selection.SelectAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AggiornaTitoli_Ordini()
|
||||||
|
{
|
||||||
|
string connectionString = Properties.Settings.Default.SqlConnection;
|
||||||
|
using (var con = new SqlConnection(connectionString))
|
||||||
|
{
|
||||||
|
var cmd = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = "dbo.GDN_TitoliUPD_v1",
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
//cmd.Parameters.Add("@MercatiID", SqlDbType.Int).Value = Convert.ToInt16(ASPxMercato.SelectedItem.Value);
|
||||||
|
cmd.Parameters.Add("@ISIN", SqlDbType.VarChar).Value = Isin;
|
||||||
|
if (ASPxStrumento.Text == "Certificates")
|
||||||
|
{
|
||||||
|
cmd.Parameters.Add("@Px_Last", SqlDbType.Float).Value = Ask;
|
||||||
|
cmd.Parameters.Add("@Px_Date", SqlDbType.Date).Value = DateTime.Now.Date;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cmd.Parameters.Add("@Px_Last", SqlDbType.Float).Value = Last;
|
||||||
|
cmd.Parameters.Add("@Px_Date", SqlDbType.Date).Value = LastDate;
|
||||||
|
}
|
||||||
|
cmd.Parameters.Add("@TipoStrumento", SqlDbType.VarChar).Value = ASPxStrumento.SelectedItem.Value;
|
||||||
|
cmd.Parameters.Add("@DivisaTitolo", SqlDbType.VarChar).Value = DivisaTitolo;
|
||||||
|
|
||||||
|
con.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxButtonExportOrdiniExcel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Controlla che la colonna cod_div_reg sia sempre valorizzata
|
||||||
|
bool bValutaMancante = false;
|
||||||
|
for (int i = 0; i < ASPxOrdiniPerExcel.VisibleRowCount; i++)
|
||||||
|
{
|
||||||
|
if (ASPxOrdiniPerExcel.Selection.IsRowSelected(i))
|
||||||
|
{
|
||||||
|
if (ASPxOrdiniPerExcel.GetRowLevel(i) == ASPxOrdiniPerExcel.GroupCount)
|
||||||
|
{
|
||||||
|
object keyValue = ASPxOrdiniPerExcel.GetRowValues(i, "cod_div_reg");
|
||||||
|
if (keyValue != null)
|
||||||
|
{
|
||||||
|
if (String.IsNullOrEmpty(keyValue.ToString()))
|
||||||
|
{
|
||||||
|
bValutaMancante = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (bValutaMancante)
|
||||||
|
{
|
||||||
|
ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", "alert(\"Verificare colonna Divisa Regolamento (cod_div_reg) , valuta mancante individuata in una o più righe!\");", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Aggiorna data invio in tutti gli ordini selezionati prima di generare l'excel
|
||||||
|
// Ciclo per rilevare IDOrdini in griglia ASPxGVOrdini
|
||||||
|
for (int i = 0; i < ASPxOrdiniPerExcel.VisibleRowCount; i++)
|
||||||
|
{
|
||||||
|
if (ASPxOrdiniPerExcel.Selection.IsRowSelected(i))
|
||||||
|
{
|
||||||
|
if (ASPxOrdiniPerExcel.GetRowLevel(i) == ASPxOrdiniPerExcel.GroupCount)
|
||||||
|
{
|
||||||
|
object keyValue = ASPxOrdiniPerExcel.GetRowValues(i, new string[] { ASPxOrdiniPerExcel.KeyFieldName });
|
||||||
|
if (keyValue != null)
|
||||||
|
AggiornaDataInvio_Ordini(Convert.ToInt16(keyValue), ASPxDataInvio.Date);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ReloadOrdiniPerExcel();
|
||||||
|
|
||||||
|
// Esporta Griglia in Excel
|
||||||
|
SettaColonneExcel(true);
|
||||||
|
ASPxGridViewExporter1.FileName = DateTime.Now.ToString("yyyyMMdd_HHmm") + " - ordini";
|
||||||
|
XlsxExportOptionsEx option = new XlsxExportOptionsEx { ExportType = ExportType.DataAware, TextExportMode = TextExportMode.Value };
|
||||||
|
ASPxGridViewExporter1.WriteXlsxToResponse(option);
|
||||||
|
SettaColonneExcel(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxGridViewExporter1_RenderBrick(object sender, ASPxGridViewExportRenderingEventArgs e)
|
||||||
|
{
|
||||||
|
// ref : https://www.devexpress.com/Support/Center/Question/Details/Q444559
|
||||||
|
// Disabilita esportazione griglia in Excel
|
||||||
|
e.BrickStyle.BorderWidth = 1;
|
||||||
|
|
||||||
|
// ref : https://www.devexpress.com/Support/Center/Question/Details/S37578
|
||||||
|
// Formatta campo prezzo in excel in formato numerico (non usato perchè non risolve problema importazione in Guardian)
|
||||||
|
//GridViewDataColumn dataColumn = e.Column as GridViewDataColumn;
|
||||||
|
//if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.FieldName == "prezzo")
|
||||||
|
//{
|
||||||
|
// e.TextValueFormatString = "{0:N2}";
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AggiornaDataInvio_Ordini(int idOrdini, DateTime dataInvio)
|
||||||
|
{
|
||||||
|
string connectionString = Properties.Settings.Default.SqlConnection;
|
||||||
|
using (var con = new SqlConnection(connectionString))
|
||||||
|
{
|
||||||
|
var cmd = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = "dbo.GDN_DataInvioOrdiniUPD",
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
cmd.Parameters.Add("@IDOrdini", SqlDbType.Int).Value = idOrdini;
|
||||||
|
cmd.Parameters.Add("@DataInvio", SqlDbType.Date).Value = dataInvio;
|
||||||
|
con.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AggiornaDataValidita_Ordini(int idOrdini, DateTime? dataValidita)
|
||||||
|
{
|
||||||
|
string connectionString = Properties.Settings.Default.SqlConnection;
|
||||||
|
using (var con = new SqlConnection(connectionString))
|
||||||
|
{
|
||||||
|
var cmd = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = "dbo.GDN_DataValiditaOrdiniUPD",
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
cmd.Parameters.Add("@IDOrdini", SqlDbType.Int).Value = idOrdini;
|
||||||
|
if (dataValidita != null) cmd.Parameters.Add("@DataValidita", SqlDbType.Date).Value = dataValidita;
|
||||||
|
else cmd.Parameters.Add("@DataValidita", SqlDbType.Date).Value = DBNull.Value;
|
||||||
|
con.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void SalvaTitoli()
|
||||||
|
{
|
||||||
|
string connectionString = Properties.Settings.Default.SqlConnection;
|
||||||
|
using (var con = new SqlConnection(connectionString))
|
||||||
|
{
|
||||||
|
var cmd = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = "dbo.GDN_TitoliINS",
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
//cmd.Parameters.Add("@MercatiID", SqlDbType.Int).Value = Convert.ToInt16(ASPxMercato.SelectedItem.Value);
|
||||||
|
cmd.Parameters.Add("@ISIN", SqlDbType.VarChar).Value = Isin;
|
||||||
|
if (ASPxRBLTipoTitolo.SelectedIndex == 1) cmd.Parameters.Add("@Ticker_bbg", SqlDbType.VarChar).Value = ASPxCodiceTitolo.Text;
|
||||||
|
if (ASPxRBLTipoTitolo.SelectedIndex == 0) cmd.Parameters.Add("@Ticker_bbg", SqlDbType.VarChar).Value = DBNull.Value;
|
||||||
|
cmd.Parameters.Add("@Descrizione", SqlDbType.VarChar).Value = ASPxLabelDescrizioneBBG.Text;
|
||||||
|
if (ASPxStrumento.Text == "Certificates") cmd.Parameters.Add("@Px_Last", SqlDbType.Float).Value = Ask;
|
||||||
|
else cmd.Parameters.Add("@Px_Last", SqlDbType.Float).Value = Last;
|
||||||
|
cmd.Parameters.Add("@Px_Date", SqlDbType.Date).Value = LastDateNET;
|
||||||
|
cmd.Parameters.Add("@DivisaTitolo", SqlDbType.VarChar).Value = DivisaTitolo;
|
||||||
|
cmd.Parameters.Add("@TipoStrumento", SqlDbType.VarChar).Value = ASPxStrumento.SelectedItem.Value;
|
||||||
|
con.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxPageControl1_ActiveTabChanged(object source, TabControlEventArgs e)
|
||||||
|
{
|
||||||
|
//if (ASPxPageControl1.ActiveTabPage.Name=="Crea Excel")
|
||||||
|
//{
|
||||||
|
// ReloadOrdiniPerExcel();
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxGVOrdini_RowUpdated(object sender, DevExpress.Web.Data.ASPxDataUpdatedEventArgs e)
|
||||||
|
{
|
||||||
|
ReloadOrdiniPerExcel();
|
||||||
|
ASPxOrdiniPerExcel.Selection.SelectAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxButtonCancellaOrdini_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Controllo Codice Titolo
|
||||||
|
if (String.IsNullOrEmpty(ASPxCodiceTitolo.Text))
|
||||||
|
{
|
||||||
|
ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", "alert(\"Codice Titolo mancante!\");", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Esegue codice sottostante solo se è stato accettato il confirm in ClientSideEvent in ASPxButtonCancellaOrdini
|
||||||
|
CancellaOrdini();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CancellaOrdini()
|
||||||
|
{
|
||||||
|
string connectionString = Properties.Settings.Default.SqlConnection;
|
||||||
|
using (var con = new SqlConnection(connectionString))
|
||||||
|
{
|
||||||
|
var cmd = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = "dbo.GDN_CancellaOrdiniPerTitolo",
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
cmd.Parameters.Add("@ISIN", SqlDbType.VarChar).Value = ASPxCodiceTitolo.Text;
|
||||||
|
con.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", "alert(\"Ordini cancellati per "+ ASPxCodiceTitolo.Text+" !\");", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxButtonSaveDataValidita_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Controlla Modifica Data Validità valorizzato
|
||||||
|
if (String.IsNullOrEmpty(ASPxDateDataValidita.Text))
|
||||||
|
{
|
||||||
|
ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", "alert(\"Data Validità da aggiornare mancante!\");", true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ciclo per rilevare IDOrdini in griglia ASPxGVOrdini
|
||||||
|
for (int i = 0; i < ASPxGVOrdini.VisibleRowCount; i++)
|
||||||
|
{
|
||||||
|
if (ASPxGVOrdini.GetRowLevel(i) == ASPxGVOrdini.GroupCount)
|
||||||
|
{
|
||||||
|
object keyValue = ASPxGVOrdini.GetRowValues(i, new string[] { ASPxGVOrdini.KeyFieldName });
|
||||||
|
if (keyValue != null)
|
||||||
|
AggiornaDataValidita_Ordini(Convert.ToInt16(keyValue), ASPxDateDataValidita.Date);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ReloadOrdini();
|
||||||
|
ReloadOrdiniPerExcel();
|
||||||
|
ASPxOrdiniPerExcel.Selection.SelectAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxCancellaDataValidita_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Ciclo per rilevare IDOrdini in griglia ASPxGVOrdini
|
||||||
|
for (int i = 0; i < ASPxGVOrdini.VisibleRowCount; i++)
|
||||||
|
{
|
||||||
|
if (ASPxGVOrdini.GetRowLevel(i) == ASPxGVOrdini.GroupCount)
|
||||||
|
{
|
||||||
|
object keyValue = ASPxGVOrdini.GetRowValues(i, new string[] { ASPxGVOrdini.KeyFieldName });
|
||||||
|
if (keyValue != null)
|
||||||
|
{
|
||||||
|
DateTime? dataValidita = null;
|
||||||
|
AggiornaDataValidita_Ordini(Convert.ToInt16(keyValue), dataValidita);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ReloadOrdini();
|
||||||
|
ReloadOrdiniPerExcel();
|
||||||
|
ASPxOrdiniPerExcel.Selection.SelectAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxOrdiniPerExcel_BeforePerformDataSelect(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
string paramGruppi = "";
|
||||||
|
if (ASPxCBLGruppiExcel.SelectedItems.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (ListEditItem item in ASPxCBLGruppiExcel.SelectedItems)
|
||||||
|
{
|
||||||
|
paramGruppi = paramGruppi + item.Text + ",";
|
||||||
|
}
|
||||||
|
|
||||||
|
Session["Gruppi"] = paramGruppi;
|
||||||
|
Session["fromDate"] = ASPxDataUltimaModifica.Date;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxButtonSaveTipoOp_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Ciclo per rilevare IDOrdini in griglia ASPxGVOrdini
|
||||||
|
for (int i = 0; i < ASPxGVOrdini.VisibleRowCount; i++)
|
||||||
|
{
|
||||||
|
if (ASPxGVOrdini.GetRowLevel(i) == ASPxGVOrdini.GroupCount)
|
||||||
|
{
|
||||||
|
object keyValue = ASPxGVOrdini.GetRowValues(i, new string[] { ASPxGVOrdini.KeyFieldName });
|
||||||
|
if (keyValue != null)
|
||||||
|
AggiornaTipoOp_Ordini(Convert.ToInt16(keyValue), ASPxRBLTipoOp.SelectedItem.Value.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ReloadOrdini();
|
||||||
|
ReloadOrdiniPerExcel();
|
||||||
|
ASPxOrdiniPerExcel.Selection.SelectAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AggiornaTipoOp_Ordini(int idOrdini, string tipoOp)
|
||||||
|
{
|
||||||
|
string connectionString = Properties.Settings.Default.SqlConnection;
|
||||||
|
using (var con = new SqlConnection(connectionString))
|
||||||
|
{
|
||||||
|
var cmd = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = "dbo.GDN_TipoOpOrdiniUPD",
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
cmd.Parameters.Add("@IDOrdini", SqlDbType.Int).Value = idOrdini;
|
||||||
|
cmd.Parameters.Add("@TipoOp", SqlDbType.VarChar).Value = tipoOp;
|
||||||
|
con.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//private void AzzeraDataValidita_Ordini(int idOrdini)
|
||||||
|
//{
|
||||||
|
// string connectionString = Properties.Settings.Default.DBSettings;
|
||||||
|
// using (var con = new SqlConnection(connectionString))
|
||||||
|
// {
|
||||||
|
// var cmd = new SqlCommand
|
||||||
|
// {
|
||||||
|
// CommandText = "dbo.GDN_DataValiditaNULLOrdiniUPD",
|
||||||
|
// CommandType = CommandType.StoredProcedure,
|
||||||
|
// Connection = con
|
||||||
|
// };
|
||||||
|
// cmd.Parameters.Add("@IDOrdini", SqlDbType.Int).Value = idOrdini;
|
||||||
|
// con.Open();
|
||||||
|
// cmd.ExecuteNonQuery();
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
private static string ExecSP(string proc, string param)
|
||||||
|
{
|
||||||
|
string result;
|
||||||
|
string connectionString = Properties.Settings.Default.SqlConnection;
|
||||||
|
using (var con = new SqlConnection(connectionString))
|
||||||
|
{
|
||||||
|
var cmd = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = proc,
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
cmd.Parameters.Add("@Isin", SqlDbType.VarChar).Value = param;
|
||||||
|
con.Open(); // Open the SqlConnection.
|
||||||
|
result = cmd.ExecuteScalar().ToString();
|
||||||
|
}
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxImportaQty_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Ciclo per rilevare IDOrdini in griglia ASPxGVOrdini
|
||||||
|
for (int i = 0; i < ASPxGVOrdini.VisibleRowCount; i++)
|
||||||
|
{
|
||||||
|
if (ASPxGVOrdini.GetRowLevel(i) == ASPxGVOrdini.GroupCount)
|
||||||
|
{
|
||||||
|
object keyValue = ASPxGVOrdini.GetRowValues(i, new string[] { ASPxGVOrdini.KeyFieldName });
|
||||||
|
object Qta = ASPxGVOrdini.GetRowValues(i, "QtaInPtf");
|
||||||
|
if (keyValue != null) AggiornaQty_Ordini(Convert.ToInt16(keyValue), Convert.ToDecimal(Qta));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ReloadOrdini();
|
||||||
|
ReloadOrdiniPerExcel();
|
||||||
|
ASPxOrdiniPerExcel.Selection.SelectAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AggiornaQty_Ordini(int idOrdini, Decimal QtaInPtf)
|
||||||
|
{
|
||||||
|
string connectionString = Properties.Settings.Default.SqlConnection;
|
||||||
|
using (var con = new SqlConnection(connectionString))
|
||||||
|
{
|
||||||
|
var cmd = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = "dbo.GDN_QtaOrdiniUPD",
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
cmd.Parameters.Add("@IDOrdini", SqlDbType.Int).Value = idOrdini;
|
||||||
|
cmd.Parameters.Add("@Qta", SqlDbType.Decimal).Value = QtaInPtf;
|
||||||
|
con.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
//ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", "alert(\"ID Ordini = "+idOrdini + " QtaInPtf = " + QtaInPtf + "\");", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxGVOrdini_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
|
||||||
|
{
|
||||||
|
// Colora cella della colonna DivisaRegolamento se è presente (*) ovvero non è salvato nel db il valore
|
||||||
|
if (e.DataColumn.FieldName.Contains("DivisaRegolamento") && e.CellValue.ToString().IndexOf("(*)") != -1)
|
||||||
|
{
|
||||||
|
e.Cell.BackColor = System.Drawing.Color.OrangeRed;
|
||||||
|
}
|
||||||
|
// Colora cella della colonna DivisaRegolamento se è vuota
|
||||||
|
if (e.DataColumn.FieldName.Contains("DivisaRegolamento") && String.IsNullOrEmpty(e.CellValue.ToString()))
|
||||||
|
{
|
||||||
|
e.Cell.BackColor = System.Drawing.Color.Red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//protected void ASPxStrumento_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
//{
|
||||||
|
// ASPxPCSObbligazioni.Enabled = (ASPxStrumento.SelectedIndex == 4);
|
||||||
|
//}
|
||||||
|
|
||||||
|
private void ReloadTables()
|
||||||
|
{
|
||||||
|
//dtMercati = ((DataView)SqlDSMercati.Select(DataSourceSelectArguments.Empty)).Table;
|
||||||
|
dtTitoli = ((DataView)SqlDSTitoli.Select(DataSourceSelectArguments.Empty)).Table;
|
||||||
|
dtClienti = ((DataView)SqlDSClienti.Select(DataSourceSelectArguments.Empty)).Table;
|
||||||
|
//ReloadOrdini();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ReloadOrdini()
|
||||||
|
{
|
||||||
|
// Rileva gruppi selezionati per la visualizzazione degli ordini relativi ai clienti associati ai gruppi
|
||||||
|
paramGruppi = "";
|
||||||
|
foreach (ListEditItem item in ASPxCBLGruppi.SelectedItems)
|
||||||
|
{
|
||||||
|
InserisceOrdini(item.Text, ASPxLabelISIN.Text); // *** da rimettere
|
||||||
|
//InserisceOrdini(item.Text, "XS1119159546"); *** per debug
|
||||||
|
paramGruppi = paramGruppi + item.Text + ",";
|
||||||
|
}
|
||||||
|
|
||||||
|
SqlDSOrdini.SelectCommand = "GDN_LoadOrdini_v3";
|
||||||
|
SqlDSOrdini.SelectCommandType = SqlDataSourceCommandType.StoredProcedure;
|
||||||
|
Parameter p = SqlDSOrdini.SelectParameters["ISIN"];
|
||||||
|
SqlDSOrdini.SelectParameters.Remove(p);
|
||||||
|
Parameter q = SqlDSOrdini.SelectParameters["Gruppi"];
|
||||||
|
SqlDSOrdini.SelectParameters.Remove(q);
|
||||||
|
SqlDSOrdini.SelectParameters.Add("ISIN", ASPxLabelISIN.Text); //*** da rimettere
|
||||||
|
//SqlDSOrdini.SelectParameters.Add("ISIN", "XS1119159546"); *** per debug
|
||||||
|
SqlDSOrdini.SelectParameters.Add("Gruppi", paramGruppi);
|
||||||
|
ASPxGVOrdini.KeyFieldName = "IDOrdini";
|
||||||
|
ASPxGVOrdini.DataBind();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ReloadOrdiniPerExcel()
|
||||||
|
{
|
||||||
|
// Rileva gruppi selezionati per il caricamento degli ordini relativi ai clienti associati ai gruppi
|
||||||
|
string paramGruppi = "";
|
||||||
|
if (ASPxCBLGruppiExcel.SelectedItems.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (ListEditItem item in ASPxCBLGruppiExcel.SelectedItems)
|
||||||
|
{
|
||||||
|
paramGruppi = paramGruppi + item.Text + ",";
|
||||||
|
}
|
||||||
|
|
||||||
|
SqlDSOrdiniPerExcel.SelectCommand = "GDN_LoadExcelOrdini_v3";
|
||||||
|
SqlDSOrdiniPerExcel.SelectCommandType = SqlDataSourceCommandType.StoredProcedure;
|
||||||
|
Parameter p = SqlDSOrdiniPerExcel.SelectParameters["fromDate"];
|
||||||
|
SqlDSOrdiniPerExcel.SelectParameters.Remove(p);
|
||||||
|
Parameter q = SqlDSOrdiniPerExcel.SelectParameters["Gruppi"];
|
||||||
|
SqlDSOrdiniPerExcel.SelectParameters.Remove(q);
|
||||||
|
SqlDSOrdiniPerExcel.SelectParameters.Add("fromDate", ASPxDataUltimaModifica.Date.ToString("yyyy-MM-dd"));
|
||||||
|
SqlDSOrdiniPerExcel.SelectParameters.Add("Gruppi", paramGruppi);
|
||||||
|
ASPxOrdiniPerExcel.KeyFieldName = "IDOrdini";
|
||||||
|
ASPxOrdiniPerExcel.DataBind();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AggiornaPrezzo_Ordini(int idOrdini, double prezzo)
|
||||||
|
{
|
||||||
|
string connectionString = Properties.Settings.Default.SqlConnection;
|
||||||
|
using (var con = new SqlConnection(connectionString))
|
||||||
|
{
|
||||||
|
var cmd = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = "dbo.GDN_PrezzoOrdiniUPD",
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
cmd.Parameters.Add("@IDOrdini", SqlDbType.Int).Value = idOrdini;
|
||||||
|
cmd.Parameters.Add("@Prezzo", SqlDbType.Float).Value = prezzo;
|
||||||
|
con.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SettaColonneExcel(bool Show)
|
||||||
|
{
|
||||||
|
ASPxOrdiniPerExcel.Columns["prog"].Visible = Show;
|
||||||
|
//ASPxOrdiniPerExcel.Columns["prog"].ExportWidth = 5;
|
||||||
|
ASPxOrdiniPerExcel.Columns["rif"].Visible = Show;
|
||||||
|
//ASPxOrdiniPerExcel.Columns["rif"].ExportWidth = 5;
|
||||||
|
ASPxOrdiniPerExcel.Columns["simulazione"].Visible = Show;
|
||||||
|
//ASPxOrdiniPerExcel.Columns["simulazione"].ExportWidth = 5;
|
||||||
|
ASPxOrdiniPerExcel.Columns["spuntato"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["storicizzato"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["storno"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["annullato"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["ora_ope"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["cod_tit"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["cod_esterno"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["rateo"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["cambiom"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["cod_dep_liq"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["cod_dep_liq2"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["ctv_rat_dn"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["comp_dep_dn"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["coma_dep_dn"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["comp_alt_dn"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["coma_alt_dn"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["spese_dn"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["imposte_dn"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["margini_dn"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["ctv_rat_dr"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["comp_dep_dr"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["coma_dep_dr"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["comp_alt_dr"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["coma_alt_dr"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["spese_dr"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["imposte_dr"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["des_mov"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["rif_est"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["coordinate1"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["coordinate2"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["data_sto"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["progr_sto"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["prezzo_car"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["cod_div_ds"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["cambiom_ds"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["cambiod_ds"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["ctv_tot_ds"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["cod_mer"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["cash"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["des_tit"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["divisore"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["moltiplicatore"].Visible = Show;
|
||||||
|
ASPxOrdiniPerExcel.Columns["leva"].Visible = Show;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
456
OlympiaIntranet/GestioneOrdini.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,456 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet {
|
||||||
|
|
||||||
|
|
||||||
|
public partial class GestioneOrdiniGuardian {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPageControl1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPageControl ASPxPageControl1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxRoundPanel1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxRoundPanel ASPxRoundPanel1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxGVClienti control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView ASPxGVClienti;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxRoundPanel2 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxRoundPanel ASPxRoundPanel2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxGVMercati control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView ASPxGVMercati;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxFLTitoli control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxFormLayout ASPxFLTitoli;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxCodiceTitolo control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox ASPxCodiceTitolo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxRBLTipoTitolo control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxRadioButtonList ASPxRBLTipoTitolo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxStrumento control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxComboBox ASPxStrumento;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxMercato control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxComboBox ASPxMercato;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPCSObbligazioni control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxComboBox ASPxPCSObbligazioni;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPCS control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox ASPxPCS;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabelISIN control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabelISIN;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabelDescrizioneBBG control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabelDescrizioneBBG;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabelPrezzoBBG control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabelPrezzoBBG;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabelDataPrezzoBBG control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabelDataPrezzoBBG;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabelDivisaTitoloBBG control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabelDivisaTitoloBBG;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabelQueryStatus control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabelQueryStatus;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxButtonQueryBBG control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton ASPxButtonQueryBBG;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxRoundPanel3 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxRoundPanel ASPxRoundPanel3;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxCBLGruppi control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxCheckBoxList ASPxCBLGruppi;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxButtonCaricaOrdini control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton ASPxButtonCaricaOrdini;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxButtonCancellaOrdini control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton ASPxButtonCancellaOrdini;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxTextBoxModificaPrezzo control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox ASPxTextBoxModificaPrezzo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxButtonSavePrezzo control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton ASPxButtonSavePrezzo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel2 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxDateDataValidita control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxDateEdit ASPxDateDataValidita;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxButtonSaveDataValidita control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton ASPxButtonSaveDataValidita;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxCancellaDataValidita control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton ASPxCancellaDataValidita;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel3 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel3;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxRBLTipoOp control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxRadioButtonList ASPxRBLTipoOp;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxButtonSaveTipoOp control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton ASPxButtonSaveTipoOp;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxImportaQty control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton ASPxImportaQty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxGVOrdini control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView ASPxGVOrdini;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxCBLGruppiExcel control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxCheckBoxList ASPxCBLGruppiExcel;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxDataUltimaModifica control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxDateEdit ASPxDataUltimaModifica;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxButtonCaricaOrdiniExcel control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton ASPxButtonCaricaOrdiniExcel;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxDataInvio control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxDateEdit ASPxDataInvio;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxButtonExportOrdiniExcel control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton ASPxButtonExportOrdiniExcel;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxRoundPanel4 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxRoundPanel ASPxRoundPanel4;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxGridViewExporter1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridViewExporter ASPxGridViewExporter1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxOrdiniPerExcel control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView ASPxOrdiniPerExcel;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSOrdini control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSOrdini;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSClienti control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSClienti;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSMercati control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSMercati;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSTitoli control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSTitoli;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSOrdiniPerExcel control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSOrdiniPerExcel;
|
||||||
|
}
|
||||||
|
}
|
||||||
1
OlympiaIntranet/Global.asax
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%@ Application Codebehind="Global.asax.cs" Inherits="OlympiaIntranet.Global" Language="C#" %>
|
||||||
17
OlympiaIntranet/Global.asax.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.Security;
|
||||||
|
using System.Web.SessionState;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public class Global : System.Web.HttpApplication
|
||||||
|
{
|
||||||
|
protected void Application_Start(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DevExpress.XtraReports.Web.ASPxReportDesigner.StaticInitialize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
OlympiaIntranet/Images/list.png
Normal file
|
After Width: | Height: | Size: 503 B |
BIN
OlympiaIntranet/Images/lock.png
Normal file
|
After Width: | Height: | Size: 749 B |
BIN
OlympiaIntranet/Images/lock_open.png
Normal file
|
After Width: | Height: | Size: 727 B |
BIN
OlympiaIntranet/Images/logo_Olympia.jpg
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
OlympiaIntranet/Images/logo_bbg.jpg
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
OlympiaIntranet/Images/logo_sito.jpg
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
102
OlympiaIntranet/JsonInfoPortafoglio.cs
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
|
||||||
|
namespace InfoPortafoglio
|
||||||
|
{
|
||||||
|
public partial class JsonInfoPortafoglio
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public Error[][] Errors { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("results")]
|
||||||
|
public Results Results { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class Results
|
||||||
|
{
|
||||||
|
[JsonProperty("covered_exposure")]
|
||||||
|
public double CoveredExposure { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial struct Error
|
||||||
|
{
|
||||||
|
public long? Integer;
|
||||||
|
public string String;
|
||||||
|
public string[] StringArray;
|
||||||
|
|
||||||
|
public bool IsNull => StringArray == null && Integer == null && String == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class JsonInfoPortafoglio
|
||||||
|
{
|
||||||
|
public static JsonInfoPortafoglio FromJson(string json) => JsonConvert.DeserializeObject<JsonInfoPortafoglio>(json, InfoPortafoglio.Converter.Settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Serialize
|
||||||
|
{
|
||||||
|
public static string ToJson(this JsonInfoPortafoglio self) => JsonConvert.SerializeObject(self, InfoPortafoglio.Converter.Settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static class Converter
|
||||||
|
{
|
||||||
|
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
|
||||||
|
{
|
||||||
|
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
|
||||||
|
DateParseHandling = DateParseHandling.None,
|
||||||
|
Converters = {
|
||||||
|
ErrorConverter.Singleton,
|
||||||
|
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class ErrorConverter : JsonConverter
|
||||||
|
{
|
||||||
|
public override bool CanConvert(Type t) => t == typeof(Error) || t == typeof(Error?);
|
||||||
|
|
||||||
|
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
|
||||||
|
{
|
||||||
|
switch (reader.TokenType)
|
||||||
|
{
|
||||||
|
case JsonToken.Integer:
|
||||||
|
var integerValue = serializer.Deserialize<long>(reader);
|
||||||
|
return new Error { Integer = integerValue };
|
||||||
|
case JsonToken.String:
|
||||||
|
case JsonToken.Date:
|
||||||
|
var stringValue = serializer.Deserialize<string>(reader);
|
||||||
|
return new Error { String = stringValue };
|
||||||
|
case JsonToken.StartArray:
|
||||||
|
var arrayValue = serializer.Deserialize<string[]>(reader);
|
||||||
|
return new Error { StringArray = arrayValue };
|
||||||
|
}
|
||||||
|
throw new Exception("Cannot unmarshal type Error");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
|
||||||
|
{
|
||||||
|
var value = (Error)untypedValue;
|
||||||
|
if (value.Integer != null)
|
||||||
|
{
|
||||||
|
serializer.Serialize(writer, value.Integer.Value);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (value.String != null)
|
||||||
|
{
|
||||||
|
serializer.Serialize(writer, value.String);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (value.StringArray != null)
|
||||||
|
{
|
||||||
|
serializer.Serialize(writer, value.StringArray);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
throw new Exception("Cannot marshal type Error");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly ErrorConverter Singleton = new ErrorConverter();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
116
OlympiaIntranet/JsonVarPortafoglio.cs
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
using System.Globalization;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
|
||||||
|
namespace VarPortafoglio
|
||||||
|
{
|
||||||
|
|
||||||
|
public partial class JsonVarPortafoglio
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public Error[][] Errors { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("results")]
|
||||||
|
public Result[] Results { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class Result
|
||||||
|
{
|
||||||
|
[JsonProperty("var")]
|
||||||
|
//public double Var { get; set; }
|
||||||
|
public double? Var { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("percentile")]
|
||||||
|
public double Percentile { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("frequency")]
|
||||||
|
public long Frequency { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("horizon")]
|
||||||
|
public long Horizon { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("lookback_days")]
|
||||||
|
public long LookbackDays { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial struct Error
|
||||||
|
{
|
||||||
|
public long? Integer;
|
||||||
|
public string String;
|
||||||
|
public string[] StringArray;
|
||||||
|
|
||||||
|
public bool IsNull => StringArray == null && Integer == null && String == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class JsonVarPortafoglio
|
||||||
|
{
|
||||||
|
public static JsonVarPortafoglio FromJson(string json) => JsonConvert.DeserializeObject<JsonVarPortafoglio>(json, Converter.Settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Serialize
|
||||||
|
{
|
||||||
|
public static string ToJson(this JsonVarPortafoglio self) => JsonConvert.SerializeObject(self, Converter.Settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static class Converter
|
||||||
|
{
|
||||||
|
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
|
||||||
|
{
|
||||||
|
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
|
||||||
|
DateParseHandling = DateParseHandling.None,
|
||||||
|
Converters = {
|
||||||
|
ErrorConverter.Singleton,
|
||||||
|
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class ErrorConverter : JsonConverter
|
||||||
|
{
|
||||||
|
public override bool CanConvert(Type t) => t == typeof(Error) || t == typeof(Error?);
|
||||||
|
|
||||||
|
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
|
||||||
|
{
|
||||||
|
switch (reader.TokenType)
|
||||||
|
{
|
||||||
|
case JsonToken.Integer:
|
||||||
|
var integerValue = serializer.Deserialize<long>(reader);
|
||||||
|
return new Error { Integer = integerValue };
|
||||||
|
case JsonToken.String:
|
||||||
|
case JsonToken.Date:
|
||||||
|
var stringValue = serializer.Deserialize<string>(reader);
|
||||||
|
return new Error { String = stringValue };
|
||||||
|
case JsonToken.StartArray:
|
||||||
|
var arrayValue = serializer.Deserialize<string[]>(reader);
|
||||||
|
return new Error { StringArray = arrayValue };
|
||||||
|
}
|
||||||
|
throw new Exception("Cannot unmarshal type Error");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
|
||||||
|
{
|
||||||
|
var value = (Error)untypedValue;
|
||||||
|
if (value.Integer != null)
|
||||||
|
{
|
||||||
|
serializer.Serialize(writer, value.Integer.Value);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (value.String != null)
|
||||||
|
{
|
||||||
|
serializer.Serialize(writer, value.String);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (value.StringArray != null)
|
||||||
|
{
|
||||||
|
serializer.Serialize(writer, value.StringArray);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
throw new Exception("Cannot marshal type Error");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly ErrorConverter Singleton = new ErrorConverter();
|
||||||
|
}
|
||||||
|
}
|
||||||
116
OlympiaIntranet/JsonVarTitolo.cs
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
|
||||||
|
namespace VarTitolo
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public partial class JsonVarTitolo
|
||||||
|
{
|
||||||
|
[JsonProperty("errors")]
|
||||||
|
public Error[][] Errors { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("results")]
|
||||||
|
public Result[] Results { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class Result
|
||||||
|
{
|
||||||
|
[JsonProperty("var")]
|
||||||
|
//public object Var { get; set; }
|
||||||
|
public double? Var { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("percentile")]
|
||||||
|
public double Percentile { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("frequency")]
|
||||||
|
public long Frequency { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("horizon")]
|
||||||
|
public long Horizon { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("lookback_days")]
|
||||||
|
public long LookbackDays { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial struct Error
|
||||||
|
{
|
||||||
|
public long? Integer;
|
||||||
|
public string String;
|
||||||
|
public string[] StringArray;
|
||||||
|
|
||||||
|
public bool IsNull => StringArray == null && Integer == null && String == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class JsonVarTitolo
|
||||||
|
{
|
||||||
|
public static JsonVarTitolo FromJson(string json) => JsonConvert.DeserializeObject<JsonVarTitolo>(json, Converter.Settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Serialize
|
||||||
|
{
|
||||||
|
public static string ToJson(this JsonVarTitolo self) => JsonConvert.SerializeObject(self, Converter.Settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static class Converter
|
||||||
|
{
|
||||||
|
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
|
||||||
|
{
|
||||||
|
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
|
||||||
|
DateParseHandling = DateParseHandling.None,
|
||||||
|
Converters = {
|
||||||
|
ErrorConverter.Singleton,
|
||||||
|
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class ErrorConverter : JsonConverter
|
||||||
|
{
|
||||||
|
public override bool CanConvert(Type t) => t == typeof(Error) || t == typeof(Error?);
|
||||||
|
|
||||||
|
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
|
||||||
|
{
|
||||||
|
switch (reader.TokenType)
|
||||||
|
{
|
||||||
|
case JsonToken.Integer:
|
||||||
|
var integerValue = serializer.Deserialize<long>(reader);
|
||||||
|
return new Error { Integer = integerValue };
|
||||||
|
case JsonToken.String:
|
||||||
|
case JsonToken.Date:
|
||||||
|
var stringValue = serializer.Deserialize<string>(reader);
|
||||||
|
return new Error { String = stringValue };
|
||||||
|
case JsonToken.StartArray:
|
||||||
|
var arrayValue = serializer.Deserialize<string[]>(reader);
|
||||||
|
return new Error { StringArray = arrayValue };
|
||||||
|
}
|
||||||
|
throw new Exception("Cannot unmarshal type Error");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
|
||||||
|
{
|
||||||
|
var value = (Error)untypedValue;
|
||||||
|
if (value.Integer != null)
|
||||||
|
{
|
||||||
|
serializer.Serialize(writer, value.Integer.Value);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (value.String != null)
|
||||||
|
{
|
||||||
|
serializer.Serialize(writer, value.String);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (value.StringArray != null)
|
||||||
|
{
|
||||||
|
serializer.Serialize(writer, value.StringArray);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
throw new Exception("Cannot marshal type Error");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly ErrorConverter Singleton = new ErrorConverter();
|
||||||
|
}
|
||||||
|
}
|
||||||
141
OlympiaIntranet/LimitiUcits.aspx
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LimitiUcits.aspx.cs" Inherits="OlympiaIntranet.LimitiUcits" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
<style type="text/css">
|
||||||
|
.height,
|
||||||
|
height * {
|
||||||
|
height: 28px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<div>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="Portafoglio" Theme="DevEx">
|
||||||
|
</dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel29" runat="server" Width="10px"></dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxTextBox ID="txtPortafoglio" runat="server" Theme="DevEx" Width="170px" CssClass="height">
|
||||||
|
</dx:ASPxTextBox>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel1" runat="server" Width="10px"></dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxButton ID="btnCaricaDati" runat="server" Theme="DevEx" OnClick="btnCaricaDati_Click" CssClass="height" >
|
||||||
|
<%--<ClientSideEvents Click="function(s, e) {
|
||||||
|
if (clientEsposizioneTitoli.GetVisibleRowsOnPage() == 0) { alert('Consultare la posizione in Guardian e ripetere la richiesta!'); }
|
||||||
|
}" />--%>
|
||||||
|
<Image IconID="arrows_next_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxPanel ID="ASPxPanel2" runat="server" Width="10px"></dx:ASPxPanel>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxButton ID="btnEsportaExcel" runat="server" Theme="DevEx" CssClass="height" OnClick="btnEsportaExcel_Click">
|
||||||
|
<Image IconID="export_exporttoxlsx_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<dx:ASPxGridView ID="gvLimitiUcits" runat="server" Theme="DevEx" AutoGenerateColumns="False" DataSourceID="SqlDSEsposizioneTitoli" OnHtmlRowPrepared="gvLimitiUcits_HtmlRowPrepared" ClientInstanceName="clientEsposizioneTitoli" OnCustomErrorText="gvLimitiUcits_CustomErrorText" OnHtmlDataCellPrepared="gvLimitiUcits_HtmlDataCellPrepared">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<SettingsPager AlwaysShowPager="True" PageSize="30">
|
||||||
|
<PageSizeItemSettings Visible="True">
|
||||||
|
</PageSizeItemSettings>
|
||||||
|
</SettingsPager>
|
||||||
|
<Settings ShowFilterRow="True" ShowFooter="True" />
|
||||||
|
<TotalSummary>
|
||||||
|
<dx:ASPxSummaryItem FieldName="5%-40% (OLY)" SummaryType="Sum" />
|
||||||
|
<dx:ASPxSummaryItem FieldName="10% (OLY)" SummaryType="Sum" />
|
||||||
|
<dx:ASPxSummaryItem FieldName="5%-40% (C4F)" SummaryType="Sum" />
|
||||||
|
<dx:ASPxSummaryItem FieldName="10% (C4F)" SummaryType="Sum" />
|
||||||
|
</TotalSummary>
|
||||||
|
<SettingsDataSecurity AllowDelete="False" AllowEdit="False" AllowInsert="False" />
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="ISIN" ReadOnly="True" VisibleIndex="0">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Descrizione" ReadOnly="True" VisibleIndex="1">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Emittente" ReadOnly="True" VisibleIndex="2">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Country" ReadOnly="True" VisibleIndex="3">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Sector" ReadOnly="True" VisibleIndex="4">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewBandColumn Caption="Olympia" Name="Olympia" VisibleIndex="5" Visible="False">
|
||||||
|
<HeaderStyle HorizontalAlign="Center" />
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn Caption="CTV" FieldName="CTV_OLY" ReadOnly="True" VisibleIndex="0">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="F2">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Esposizione" FieldName="Esp_OLY" ReadOnly="True" VisibleIndex="1">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="P2">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="5%-40%" FieldName="5%-40% (OLY)" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="2">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="P2">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="10%" FieldName="10% (OLY)" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="3">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="P2">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:GridViewBandColumn>
|
||||||
|
<dx:GridViewBandColumn Caption="Casa for Funds" Name="Casa for Funds" VisibleIndex="7">
|
||||||
|
<HeaderStyle HorizontalAlign="Center" />
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn Caption="CTV" FieldName="CTV_C4F" ReadOnly="True" VisibleIndex="0">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="F2">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="Esposizione" FieldName="Esp_C4F" ReadOnly="True" VisibleIndex="1">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="P2">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="5%-40%" FieldName="5%-40% (C4F)" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="2">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="P2">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn Caption="10%" FieldName="10% (C4F)" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="3">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="P2">
|
||||||
|
</PropertiesTextEdit>
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:GridViewBandColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</div>
|
||||||
|
<asp:SqlDataSource ID="SqlDSEsposizioneTitoli" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="GDN_LimitiUCITS" SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="cod_rap" SessionField="cod_rap" />
|
||||||
|
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
<dx:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="gvLimitiUcits">
|
||||||
|
</dx:ASPxGridViewExporter>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
155
OlympiaIntranet/LimitiUcits.aspx.cs
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
using DevExpress.Export;
|
||||||
|
using DevExpress.Web;
|
||||||
|
using DevExpress.XtraPrinting;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class LimitiUcits : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (HttpContext.Current.User.Identity.IsAuthenticated == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void btnCaricaDati_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Session["cod_rap"] = txtPortafoglio.Text;
|
||||||
|
|
||||||
|
// Formattazioni condizionali - colonna 10% (OLY)
|
||||||
|
GridViewFormatConditionHighlight Rule1 = new GridViewFormatConditionHighlight();
|
||||||
|
Rule1.FieldName = "10% (OLY)";
|
||||||
|
Rule1.Expression = "[10% (OLY)] <= 0.1 and [10% (OLY)] > 0";
|
||||||
|
Rule1.Format = GridConditionHighlightFormat.YellowFillWithDarkYellowText;
|
||||||
|
gvLimitiUcits.FormatConditions.Add(Rule1);
|
||||||
|
|
||||||
|
GridViewFormatConditionHighlight Rule11 = new GridViewFormatConditionHighlight();
|
||||||
|
Rule11.FieldName = "10% (OLY)";
|
||||||
|
Rule11.Expression = "[10% (OLY)] > 0.1";
|
||||||
|
Rule11.Format = GridConditionHighlightFormat.LightRedFillWithDarkRedText;
|
||||||
|
gvLimitiUcits.FormatConditions.Add(Rule11);
|
||||||
|
|
||||||
|
// Formattazioni condizionali - colonna 10% (C4F)
|
||||||
|
GridViewFormatConditionHighlight Rule2 = new GridViewFormatConditionHighlight();
|
||||||
|
Rule2.FieldName = "10% (C4F)";
|
||||||
|
Rule2.Expression = "[10% (C4F)] <= 0.1 and [10% (C4F)] > 0";
|
||||||
|
Rule2.Format = GridConditionHighlightFormat.YellowFillWithDarkYellowText;
|
||||||
|
gvLimitiUcits.FormatConditions.Add(Rule2);
|
||||||
|
|
||||||
|
GridViewFormatConditionHighlight Rule21 = new GridViewFormatConditionHighlight();
|
||||||
|
Rule21.FieldName = "10% (C4F)";
|
||||||
|
Rule21.Expression = "[10% (C4F)] > 0.1";
|
||||||
|
Rule21.Format = GridConditionHighlightFormat.LightRedFillWithDarkRedText;
|
||||||
|
gvLimitiUcits.FormatConditions.Add(Rule21);
|
||||||
|
|
||||||
|
// Formattazioni condizionali - colonna 5%-40% (OLY)
|
||||||
|
GridViewFormatConditionHighlight Rule3 = new GridViewFormatConditionHighlight();
|
||||||
|
Rule3.FieldName = "5%-40% (OLY)";
|
||||||
|
Rule3.Expression = "[5%-40% (OLY)] >= 0.05 and [5%-40% (OLY)] <= 0.1";
|
||||||
|
Rule3.Format = GridConditionHighlightFormat.YellowFillWithDarkYellowText;
|
||||||
|
gvLimitiUcits.FormatConditions.Add(Rule3);
|
||||||
|
|
||||||
|
GridViewFormatConditionHighlight Rule31 = new GridViewFormatConditionHighlight();
|
||||||
|
Rule31.FieldName = "5%-40% (OLY)";
|
||||||
|
Rule31.Expression = "[5%-40% (OLY)] > 0.1 and [5%-40% (OLY)] <> 0";
|
||||||
|
Rule31.Format = GridConditionHighlightFormat.LightRedFillWithDarkRedText;
|
||||||
|
gvLimitiUcits.FormatConditions.Add(Rule31);
|
||||||
|
|
||||||
|
// Formattazioni condizionali - colonna 10% (C4F)
|
||||||
|
GridViewFormatConditionHighlight Rule4 = new GridViewFormatConditionHighlight();
|
||||||
|
Rule4.FieldName = "5%-40% (C4F)";
|
||||||
|
Rule4.Expression = "[5%-40% (C4F)] >= 0.05 and [5%-40% (C4F)] <= 0.1";
|
||||||
|
Rule4.Format = GridConditionHighlightFormat.YellowFillWithDarkYellowText;
|
||||||
|
gvLimitiUcits.FormatConditions.Add(Rule4);
|
||||||
|
|
||||||
|
GridViewFormatConditionHighlight Rule41 = new GridViewFormatConditionHighlight();
|
||||||
|
Rule41.FieldName = "5%-40% (C4F)";
|
||||||
|
Rule41.Expression = "[5%-40% (C4F)] > 0.1 and [5%-40% (C4F)] <> 0";
|
||||||
|
Rule41.Format = GridConditionHighlightFormat.LightRedFillWithDarkRedText;
|
||||||
|
gvLimitiUcits.FormatConditions.Add(Rule41);
|
||||||
|
|
||||||
|
gvLimitiUcits.DataBind();
|
||||||
|
|
||||||
|
if (gvLimitiUcits.VisibleRowCount == 0)
|
||||||
|
{
|
||||||
|
CommonClass.MessageBox(this,"Consultare la posizione in Guardian e ripetere la richiesta!");
|
||||||
|
// throw new MyException("Consultare la posizione in Guardian e ripetere la richiesta!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvLimitiUcits_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.RowType != GridViewRowType.Data) return;
|
||||||
|
|
||||||
|
// Colora sottostanti che non hanno emittente
|
||||||
|
string Emittente = e.GetValue("Emittente").ToString();
|
||||||
|
string Descrizione = e.GetValue("Descrizione").ToString();
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(Emittente) && Descrizione== "SOTTOSTANTE NON TROVATO!")
|
||||||
|
{
|
||||||
|
e.Row.BackColor = Color.OrangeRed;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void btnEsportaExcel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ASPxGridViewExporter1.ExportSelectedRowsOnly = false;
|
||||||
|
ASPxGridViewExporter1.FileName = DateTime.Now.ToString("yyyyMMdd_HHmm") + " - Esposizione Titoli";
|
||||||
|
XlsxExportOptionsEx op = new XlsxExportOptionsEx() { ExportType = ExportType.WYSIWYG };
|
||||||
|
ASPxGridViewExporter1.WriteXlsxToResponse(op);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvLimitiUcits_CustomErrorText(object sender, ASPxGridViewCustomErrorTextEventArgs e)
|
||||||
|
{
|
||||||
|
// https://supportcenter.devexpress.com/ticket/details/e59/how-to-show-an-error-message-when-a-record-cannot-be-deleted
|
||||||
|
if (e.Exception is MyException) e.ErrorText = e.Exception.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvLimitiUcits_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.DataColumn.FieldName == "Descrizione")
|
||||||
|
{
|
||||||
|
if (e.CellValue != null)
|
||||||
|
{
|
||||||
|
// Se viene rilevato un sintetico , allora viene caricato l'elenco dei possibili certificati all'interno del portafoglio guardian eventualmente da controllare
|
||||||
|
if (e.CellValue.ToString() == "POSSIBILE SINTETICO")
|
||||||
|
{
|
||||||
|
e.Cell.BackColor = ColorTranslator.FromHtml("#e44e2f"); // evidenzia cella con possibile errore da sistemare
|
||||||
|
|
||||||
|
if (Session["cod_rap"] != null)
|
||||||
|
{
|
||||||
|
using (var con = new SqlConnection(Properties.Settings.Default.SqlConnection))
|
||||||
|
{
|
||||||
|
var cmd = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = "GDN_EsposizioneTitoli_CTF",
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
cmd.Parameters.Add("@cod_rap", SqlDbType.VarChar).Value = Session["cod_rap"].ToString();
|
||||||
|
con.Open(); // Open the SqlConnection.
|
||||||
|
object objResult = cmd.ExecuteScalar();
|
||||||
|
if (objResult != null)
|
||||||
|
{
|
||||||
|
e.Cell.ToolTip = (string)objResult;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
114
OlympiaIntranet/LimitiUcits.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet {
|
||||||
|
|
||||||
|
|
||||||
|
public partial class LimitiUcits {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxLabel1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel ASPxLabel1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel29 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel29;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtPortafoglio control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxTextBox txtPortafoglio;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnCaricaDati control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton btnCaricaDati;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPanel2 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPanel ASPxPanel2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnEsportaExcel control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton btnEsportaExcel;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvLimitiUcits control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvLimitiUcits;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSEsposizioneTitoli control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSEsposizioneTitoli;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxGridViewExporter1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridViewExporter ASPxGridViewExporter1;
|
||||||
|
}
|
||||||
|
}
|
||||||
125
OlympiaIntranet/LimitiViolati.aspx
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LimitiViolati.aspx.cs" Inherits="OlympiaIntranet.LimitiViolati" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title>Limiti Violati</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
<dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server" ColCount="2" EnableTheming="True" Theme="Aqua" ColumnCount="2">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutGroup Caption="Controllo Limiti Violati" ColCount="5" ColSpan="1" ColumnCount="5">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="Gestore" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="gridLookupGestore" runat="server"
|
||||||
|
Theme="Aqua"
|
||||||
|
DataSourceID="SqlDSGestori"
|
||||||
|
DropDownStyle="DropDownList"
|
||||||
|
EnableTheming="True"
|
||||||
|
KeyFieldName="Gestore"
|
||||||
|
TextFormatString="{0}"
|
||||||
|
AutoPostBack="true"
|
||||||
|
OnValueChanged="gridLookupGestore_ValueChanged">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords" />
|
||||||
|
</GridViewProperties>
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Gestore" Caption="Gestore" />
|
||||||
|
</Columns>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1" ShowCaption="False">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxLabel ID="lblMeseRiferimento" runat="server" Text="" Theme="Aqua" Font-Bold="True" Font-Size="Medium" />
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxFormLayout>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
<dx:ASPxGridView ID="gvLimitiViolati" runat="server"
|
||||||
|
EnableTheming="True"
|
||||||
|
Theme="Office2010Blue"
|
||||||
|
AutoGenerateColumns="False"
|
||||||
|
KeyFieldName="Id"
|
||||||
|
OnRowUpdating="gvLimitiViolati_RowUpdating"
|
||||||
|
OnCellEditorInitialize="gvLimitiViolati_CellEditorInitialize"
|
||||||
|
OnDataBound="gvLimitiViolati_DataBound"
|
||||||
|
OnCancelRowEditing="gvLimitiViolati_CancelRowEditing"
|
||||||
|
OnHtmlDataCellPrepared="gvLimitiViolati_HtmlDataCellPrepared"
|
||||||
|
OnDataBinding="gvLimitiViolati_DataBinding">
|
||||||
|
<SettingsPager Mode="ShowAllRecords" />
|
||||||
|
<Settings ShowFilterRow="True" ShowHeaderFilterButton="True" ShowFilterBar="Visible" VerticalScrollBarMode="Visible" VerticalScrollableHeight="750" />
|
||||||
|
<SettingsBehavior FilterRowMode="Auto" AllowFocusedRow="True" />
|
||||||
|
<SettingsEditing Mode="Inline" />
|
||||||
|
|
||||||
|
<SettingsPopup>
|
||||||
|
<FilterControl AutoUpdatePosition="False" />
|
||||||
|
</SettingsPopup>
|
||||||
|
|
||||||
|
<SettingsFilterControl ViewMode="VisualAndText" />
|
||||||
|
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewCommandColumn ShowEditButton="True" VisibleIndex="0" Width="70px" Caption=" " />
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Id" VisibleIndex="1" Visible="false" ReadOnly="true" />
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Portafoglio" Caption="Portafoglio" VisibleIndex="2" ReadOnly="true" Width="100px" />
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Intestazione" Caption="Intestazione" VisibleIndex="3" ReadOnly="true" Width="200px" />
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Gestore" Caption="Gestore" VisibleIndex="4" ReadOnly="true" Width="100px" />
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Limite" Caption="Limite" VisibleIndex="5" ReadOnly="true" Width="100px" />
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Descrizione" Caption="Descrizione" VisibleIndex="6" ReadOnly="true" Width="200px" />
|
||||||
|
<dx:GridViewDataTextColumn FieldName="PesoMinimo" Caption="Peso Min" VisibleIndex="7" ReadOnly="true" Width="80px">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="N2" />
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="PesoMassimo" Caption="Peso Max" VisibleIndex="8" ReadOnly="true" Width="80px">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="N2" />
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="PesoInPortafoglio" Caption="Peso Ptf" VisibleIndex="9" ReadOnly="true" Width="80px">
|
||||||
|
<PropertiesTextEdit DisplayFormatString="N2" />
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="Note" Caption="Note" VisibleIndex="10" ReadOnly="true" Width="150px" />
|
||||||
|
<dx:GridViewDataMemoColumn FieldName="Commento" Caption="Commento" VisibleIndex="11" Width="250px">
|
||||||
|
<PropertiesMemoEdit Rows="3" />
|
||||||
|
</dx:GridViewDataMemoColumn>
|
||||||
|
<dx:GridViewDataCheckColumn FieldName="BloccoCommento" Caption="Bloccato" VisibleIndex="12" Width="70px" />
|
||||||
|
<dx:GridViewDataTextColumn FieldName="DataRiferimento" Caption="Data Rif." VisibleIndex="13" ReadOnly="true" Visible="false" />
|
||||||
|
<dx:GridViewDataTextColumn FieldName="MeseRiferimento" Caption="Mese" VisibleIndex="14" ReadOnly="true" Visible="false" />
|
||||||
|
</Columns>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<asp:SqlDataSource ID="SqlDSGestori" runat="server"
|
||||||
|
ConnectionString="<%$ ConnectionStrings:OlympiaIntranet.Properties.Settings.SqlConnection %>"
|
||||||
|
SelectCommand="GDN_ElencoGestoriLimitiViolati"
|
||||||
|
SelectCommandType="StoredProcedure">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:SessionParameter Name="IsRiskManager" SessionField="is_risk" DbType="Boolean" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:SqlDataSource>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
323
OlympiaIntranet/LimitiViolati.aspx.cs
Normal file
@@ -0,0 +1,323 @@
|
|||||||
|
using DevExpress.Web;
|
||||||
|
using System;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class LimitiViolati : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
private static readonly string[] AdminUsers = { "fcostalonga", "fpisoni", "glicciardello", "erigo", "malfonsi" };
|
||||||
|
|
||||||
|
protected bool IsRiskManager
|
||||||
|
{
|
||||||
|
get { return Session["is_risk"] != null && (bool)Session["is_risk"]; }
|
||||||
|
}
|
||||||
|
|
||||||
|
private string ConnectionString
|
||||||
|
{
|
||||||
|
get { return System.Configuration.ConfigurationManager.ConnectionStrings["OlympiaIntranet.Properties.Settings.SqlConnection"].ConnectionString; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// http://localhost:63155/LimitiViolati.aspx → usa l'utente loggato
|
||||||
|
// http://localhost:63155/LimitiViolati.aspx?user=fcostalonga → simula Risk Manager
|
||||||
|
// http://localhost:63155/LimitiViolati.aspx → usa l'utente loggato
|
||||||
|
|
||||||
|
//protected void Page_Load(object sender, EventArgs e)
|
||||||
|
//{
|
||||||
|
// if (!HttpContext.Current.User.Identity.IsAuthenticated)
|
||||||
|
// {
|
||||||
|
// Response.Redirect("~/SignIn.aspx");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // Usa il parametro URL se presente (solo per debug), altrimenti l'utente loggato
|
||||||
|
// string loggedUser = Request.QueryString["user"];
|
||||||
|
// if (string.IsNullOrEmpty(loggedUser))
|
||||||
|
// {
|
||||||
|
// loggedUser = HttpContext.Current.User.Identity.Name;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (!IsPostBack)
|
||||||
|
// {
|
||||||
|
// bool isRisk = AdminUsers.Contains(loggedUser);
|
||||||
|
// Session["is_risk"] = isRisk;
|
||||||
|
// Session["user_display"] = loggedUser;
|
||||||
|
|
||||||
|
// if (isRisk)
|
||||||
|
// {
|
||||||
|
// Session["user"] = loggedUser;
|
||||||
|
// gridLookupGestore.Enabled = true;
|
||||||
|
// Session["cod_ges"] = string.Empty;
|
||||||
|
|
||||||
|
// gridLookupGestore.DataBind();
|
||||||
|
// gridLookupGestore.Value = "-- TUTTI --";
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// string gestoreCode = loggedUser.Length > 1
|
||||||
|
// ? loggedUser.Substring(1).ToUpper()
|
||||||
|
// : loggedUser.ToUpper();
|
||||||
|
|
||||||
|
// Session["user"] = loggedUser;
|
||||||
|
// Session["cod_ges"] = gestoreCode;
|
||||||
|
// gridLookupGestore.Enabled = false;
|
||||||
|
|
||||||
|
// gridLookupGestore.DataBind();
|
||||||
|
// gridLookupGestore.Value = gestoreCode;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// // Bind SEMPRE - necessario per DevExpress
|
||||||
|
// BindGrid();
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!HttpContext.Current.User.Identity.IsAuthenticated)
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Usa il parametro URL se presente (solo per debug), altrimenti l'utente loggato
|
||||||
|
string loggedUser = Request.QueryString["user"];
|
||||||
|
if (string.IsNullOrEmpty(loggedUser))
|
||||||
|
{
|
||||||
|
loggedUser = HttpContext.Current.User.Identity.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
// SEMPRE determinare e impostare il ruolo ad ogni request
|
||||||
|
bool isRisk = AdminUsers.Contains(loggedUser);
|
||||||
|
Session["is_risk"] = isRisk;
|
||||||
|
Session["user_display"] = loggedUser;
|
||||||
|
Session["user"] = loggedUser;
|
||||||
|
|
||||||
|
if (!IsPostBack)
|
||||||
|
{
|
||||||
|
// Forza il rebind del dropdown con l'utente corretto
|
||||||
|
gridLookupGestore.DataBind();
|
||||||
|
|
||||||
|
if (isRisk)
|
||||||
|
{
|
||||||
|
gridLookupGestore.Enabled = true;
|
||||||
|
Session["cod_ges"] = string.Empty;
|
||||||
|
gridLookupGestore.Value = "-- TUTTI --";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string gestoreCode = loggedUser.Length > 1
|
||||||
|
? loggedUser.Substring(1).ToUpper()
|
||||||
|
: loggedUser.ToUpper();
|
||||||
|
|
||||||
|
Session["cod_ges"] = gestoreCode;
|
||||||
|
gridLookupGestore.Enabled = false;
|
||||||
|
gridLookupGestore.Value = gestoreCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
BindGrid();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gridLookupGestore_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var gridLookup = sender as ASPxGridLookup;
|
||||||
|
|
||||||
|
if (gridLookup?.Value != null)
|
||||||
|
{
|
||||||
|
string selectedValue = gridLookup.Value.ToString();
|
||||||
|
Session["cod_ges"] = (selectedValue == "-- TUTTI --") ? string.Empty : selectedValue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Session["cod_ges"] = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
BindGrid();
|
||||||
|
}
|
||||||
|
|
||||||
|
//private void BindGrid()
|
||||||
|
//{
|
||||||
|
// string gestore = Session["cod_ges"]?.ToString() ?? string.Empty;
|
||||||
|
|
||||||
|
// using (var conn = new SqlConnection(ConnectionString))
|
||||||
|
// {
|
||||||
|
// using (var cmd = new SqlCommand("GDN_GetLimitiViolatiMensili", conn))
|
||||||
|
// {
|
||||||
|
// cmd.CommandType = CommandType.StoredProcedure;
|
||||||
|
// cmd.Parameters.AddWithValue("@Gestore", gestore);
|
||||||
|
|
||||||
|
// var adapter = new SqlDataAdapter(cmd);
|
||||||
|
// var dt = new DataTable();
|
||||||
|
// adapter.Fill(dt);
|
||||||
|
|
||||||
|
// gvLimitiViolati.DataSource = dt;
|
||||||
|
// gvLimitiViolati.DataBind();
|
||||||
|
|
||||||
|
// // Aggiorna label mese riferimento
|
||||||
|
// if (dt.Rows.Count > 0 && dt.Columns.Contains("DataRiferimento"))
|
||||||
|
// {
|
||||||
|
// object dataRif = dt.Rows[0]["DataRiferimento"];
|
||||||
|
// if (dataRif != null && dataRif != DBNull.Value)
|
||||||
|
// {
|
||||||
|
// DateTime data = Convert.ToDateTime(dataRif);
|
||||||
|
// lblMeseRiferimento.Text = "Data di riferimento: " + data.ToString("dd-MM-yyyy");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// lblMeseRiferimento.Text = "Nessun limite violato trovato";
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
protected void gvLimitiViolati_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int id = Convert.ToInt32(e.Keys["Id"]);
|
||||||
|
string commento = e.NewValues["Commento"]?.ToString() ?? string.Empty;
|
||||||
|
bool bloccoCommento = e.NewValues["BloccoCommento"] != null && Convert.ToBoolean(e.NewValues["BloccoCommento"]);
|
||||||
|
string utente = Session["user_display"]?.ToString() ?? "unknown";
|
||||||
|
bool isRiskManager = IsRiskManager;
|
||||||
|
|
||||||
|
using (var conn = new SqlConnection(ConnectionString))
|
||||||
|
{
|
||||||
|
using (var cmd = new SqlCommand("GDN_AggiornaCommentoLimite", conn))
|
||||||
|
{
|
||||||
|
cmd.CommandType = CommandType.StoredProcedure;
|
||||||
|
cmd.Parameters.AddWithValue("@Id", id);
|
||||||
|
cmd.Parameters.AddWithValue("@Commento", commento);
|
||||||
|
cmd.Parameters.AddWithValue("@BloccoCommento", bloccoCommento);
|
||||||
|
cmd.Parameters.AddWithValue("@Utente", utente);
|
||||||
|
cmd.Parameters.AddWithValue("@IsRiskManager", isRiskManager);
|
||||||
|
|
||||||
|
conn.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
e.Cancel = true;
|
||||||
|
gvLimitiViolati.CancelEdit();
|
||||||
|
BindGrid();
|
||||||
|
}
|
||||||
|
catch (SqlException ex)
|
||||||
|
{
|
||||||
|
e.Cancel = true;
|
||||||
|
gvLimitiViolati.CancelEdit();
|
||||||
|
lblMeseRiferimento.Text = "Errore: " + ex.Message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvLimitiViolati_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e)
|
||||||
|
{
|
||||||
|
var grid = sender as ASPxGridView;
|
||||||
|
|
||||||
|
if (e.Column.FieldName == "Commento")
|
||||||
|
{
|
||||||
|
bool bloccato = false;
|
||||||
|
object valBlocco = grid.GetRowValues(e.VisibleIndex, "BloccoCommento");
|
||||||
|
if (valBlocco != null && valBlocco != DBNull.Value)
|
||||||
|
{
|
||||||
|
bloccato = Convert.ToBoolean(valBlocco);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bloccato && !IsRiskManager)
|
||||||
|
{
|
||||||
|
e.Editor.ReadOnly = true;
|
||||||
|
e.Editor.BackColor = Color.LightGray;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.Column.FieldName == "BloccoCommento")
|
||||||
|
{
|
||||||
|
if (!IsRiskManager)
|
||||||
|
{
|
||||||
|
e.Editor.ReadOnly = true;
|
||||||
|
e.Editor.Enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvLimitiViolati_DataBound(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Lasciato vuoto - la label viene aggiornata in BindGrid()
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvLimitiViolati_CancelRowEditing(object sender, DevExpress.Web.Data.ASPxStartRowEditingEventArgs e)
|
||||||
|
{
|
||||||
|
// Gestione annullamento edit
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvLimitiViolati_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
|
||||||
|
{
|
||||||
|
// Solo per la colonna Commento
|
||||||
|
if (e.DataColumn.FieldName != "Commento")
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Leggi il valore di BloccoCommento per questa riga
|
||||||
|
object valBlocco = e.GetValue("BloccoCommento");
|
||||||
|
bool bloccato = valBlocco != null && valBlocco != DBNull.Value && Convert.ToBoolean(valBlocco);
|
||||||
|
|
||||||
|
if (bloccato)
|
||||||
|
{
|
||||||
|
e.Cell.BackColor = Color.FromArgb(255, 230, 230); // Rosso chiaro/rosa
|
||||||
|
e.Cell.ToolTip = "Commento bloccato";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private DataTable GetLimitiViolatiData()
|
||||||
|
{
|
||||||
|
string gestore = Session["cod_ges"]?.ToString() ?? string.Empty;
|
||||||
|
|
||||||
|
using (var conn = new SqlConnection(ConnectionString))
|
||||||
|
{
|
||||||
|
using (var cmd = new SqlCommand("GDN_GetLimitiViolatiMensili", conn))
|
||||||
|
{
|
||||||
|
cmd.CommandType = CommandType.StoredProcedure;
|
||||||
|
cmd.Parameters.AddWithValue("@Gestore", gestore);
|
||||||
|
|
||||||
|
var adapter = new SqlDataAdapter(cmd);
|
||||||
|
var dt = new DataTable();
|
||||||
|
adapter.Fill(dt);
|
||||||
|
return dt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BindGrid()
|
||||||
|
{
|
||||||
|
var dt = GetLimitiViolatiData();
|
||||||
|
|
||||||
|
gvLimitiViolati.DataSource = dt;
|
||||||
|
gvLimitiViolati.DataBind();
|
||||||
|
|
||||||
|
// Aggiorna label mese riferimento
|
||||||
|
if (dt.Rows.Count > 0 && dt.Columns.Contains("DataRiferimento"))
|
||||||
|
{
|
||||||
|
object dataRif = dt.Rows[0]["DataRiferimento"];
|
||||||
|
if (dataRif != null && dataRif != DBNull.Value)
|
||||||
|
{
|
||||||
|
DateTime data = Convert.ToDateTime(dataRif);
|
||||||
|
lblMeseRiferimento.Text = "Mese di riferimento: " + data.ToString("dd-MM-yyyy");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lblMeseRiferimento.Text = "Nessun limite violato trovato";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvLimitiViolati_DataBinding(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//var grid = sender as ASPxGridView;
|
||||||
|
//grid.DataSource = GetLimitiViolatiData();
|
||||||
|
gvLimitiViolati.DataSource = GetLimitiViolatiData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
71
OlympiaIntranet/LimitiViolati.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public partial class LimitiViolati
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxFormLayout1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxFormLayout ASPxFormLayout1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gridLookupGestore control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup gridLookupGestore;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblMeseRiferimento control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel lblMeseRiferimento;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvLimitiViolati control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvLimitiViolati;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSGestori control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSGestori;
|
||||||
|
}
|
||||||
|
}
|
||||||
81
OlympiaIntranet/Login.aspx
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="Main.Login1" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="icon" type="image/png" href="Images/icons/favicon.ico" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="fonts/Linearicons-Free-v1.0.0/icon-font.min.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="vendor/animate/animate.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="vendor/css-hamburgers/hamburgers.min.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="vendor/animsition/css/animsition.min.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="vendor/daterangepicker/daterangepicker.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/util.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/main.css" />
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="limiter">
|
||||||
|
<div class="col d-flex align-items-center justify-content-center">
|
||||||
|
<img src="Images/logo_sito.jpg" class="img-fluid" alt="Responsive image" />
|
||||||
|
</div>
|
||||||
|
<hr />
|
||||||
|
<div class="container-login100">
|
||||||
|
<div class="wrap-login100 p-t-0 p-b-600">
|
||||||
|
<form method="post" class="login100-form validate-form flex-sb flex-w">
|
||||||
|
<span class="login100-form-title p-b-51">OLYMPIA INTRANET LOGIN</span>
|
||||||
|
<div class="wrap-input100 validate-input m-b-16" data-validate="Username is required">
|
||||||
|
<input class="input100" type="text" name="username" placeholder="Username" />
|
||||||
|
<span class="focus-input100"></span>
|
||||||
|
</div>
|
||||||
|
<div class="wrap-input100 validate-input m-b-16" data-validate="Password is required">
|
||||||
|
<input class="input100" type="password" name="pass" placeholder="Password" />
|
||||||
|
<span class="focus-input100"></span>
|
||||||
|
</div>
|
||||||
|
<div class="container-login100-form-btn m-t-17">
|
||||||
|
<button class="login100-form-btn">
|
||||||
|
Login
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="dropDownSelect1"></div>
|
||||||
|
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="vendor/animsition/js/animsition.min.js"></script>
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="vendor/bootstrap/js/popper.js"></script>
|
||||||
|
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="vendor/select2/select2.min.js"></script>
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="vendor/daterangepicker/moment.min.js"></script>
|
||||||
|
<script src="vendor/daterangepicker/daterangepicker.js"></script>
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="vendor/countdowntime/countdowntime.js"></script>
|
||||||
|
<!--===============================================================================================-->
|
||||||
|
<script src="js/main.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
33
OlympiaIntranet/Login.aspx.cs
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.Security;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
|
||||||
|
namespace Main
|
||||||
|
{
|
||||||
|
public partial class Login1 : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Response.Redirect("SignIn.aspx"); // redirect a nuova pagina login basata su ASP.NET Identity
|
||||||
|
|
||||||
|
// vecchio metodo di login basato su asp.net membership login (non più usato)
|
||||||
|
//if (Request.Form["username"] != null && Request.Form["pass"] != null)
|
||||||
|
//{
|
||||||
|
// if (Membership.ValidateUser(Request.Form["username"].ToString(), Request.Form["pass"].ToString()))
|
||||||
|
// {
|
||||||
|
// //Response.Redirect("Default.aspx");
|
||||||
|
// FormsAuthentication.RedirectFromLoginPage(Request.Form["username"].ToString(), true);
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// Response.StatusCode = 401;
|
||||||
|
// Response.End();
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
15
OlympiaIntranet/Login.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Main {
|
||||||
|
|
||||||
|
|
||||||
|
public partial class Login1 {
|
||||||
|
}
|
||||||
|
}
|
||||||
140
OlympiaIntranet/MSReset.aspx
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MSReset.aspx.cs" Inherits="OlympiaIntranet.MSReset" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<div>
|
||||||
|
<dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server" ColCount="2" EnableTheming="True" Theme="Aqua" ColumnCount="2">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutGroup Caption="Upload Area" ColCount="1" ColSpan="1">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="Tipo file" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxRadioButtonList ID="radioButtonList" runat="server" EnableTheming="True" RepeatDirection="Horizontal" SelectedIndex="0" Theme="Aqua" Enabled="false">
|
||||||
|
<Items>
|
||||||
|
<dx:ListEditItem Selected="True" Text="Reset Posizioni" Value="0" />
|
||||||
|
<dx:ListEditItem Text="Trade normale" Value="1" />
|
||||||
|
</Items>
|
||||||
|
<CaptionSettings Position="Left" VerticalAlign="Middle" />
|
||||||
|
</dx:ASPxRadioButtonList>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
<CaptionSettings VerticalAlign="Middle" />
|
||||||
|
<TabImage IconID="miscellaneous_publish_16x16">
|
||||||
|
</TabImage>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Upload file" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxUploadControl ID="uploadControl" runat="server" Height="23px" ShowProgressPanel="True" ShowUploadButton="True" Theme="Aqua" UploadMode="Auto" Width="325px" AutoStartUpload="True" OnFileUploadComplete="uploadControl_FileUploadComplete">
|
||||||
|
<AdvancedModeSettings EnableDragAndDrop="True" EnableFileList="True" EnableMultiSelect="True">
|
||||||
|
</AdvancedModeSettings>
|
||||||
|
</dx:ASPxUploadControl>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="btnElaboraInput" runat="server" OnClick="btnElaboraInput_Click" Text="Elabora Dati Giornalieri/Mensili">
|
||||||
|
<Image IconID="programming_technology_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="btnOutputGuardian" runat="server" OnClick="btnOutputGuardian_Click" Text="Output per Guardian">
|
||||||
|
<Image IconID="export_exporttocsv_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxFormLayout>
|
||||||
|
</div>
|
||||||
|
<dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" HeaderText="Control Area" Theme="Aqua" View="GroupBox" Width="100%">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server">
|
||||||
|
<dx:ASPxPageControl ID="ASPxPageControl1" runat="server" ActiveTabIndex="0" EnableTheming="True" Theme="Aqua" Width="100%">
|
||||||
|
<TabPages>
|
||||||
|
<dx:TabPage Name="Input data" Text="Input data">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<dx:ASPxGridView ID="gvInputCsv" runat="server" OnDataBinding="gvInputCsv_DataBinding" Theme="Aqua" Width="100%">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1">
|
||||||
|
</AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<EditFormLayoutProperties ColCount="1">
|
||||||
|
</EditFormLayoutProperties>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>
|
||||||
|
<dx:TabPage Name="Output data" Text="Output data">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<dx:ASPxGridView ID="gvOutput" runat="server" OnDataBinding="gvInputCsv_DataBinding" Theme="Aqua" Width="100%">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1">
|
||||||
|
</AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<EditFormLayoutProperties ColCount="1">
|
||||||
|
</EditFormLayoutProperties>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>
|
||||||
|
</TabPages>
|
||||||
|
|
||||||
|
</dx:ASPxPageControl>
|
||||||
|
<dx:ASPxRoundPanel ID="ASPxRoundPanel2" runat="server" HeaderText="Input" Theme="Aqua" View="GroupBox" Width="100%" Visible="false">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server">
|
||||||
|
<%-- <dx:ASPxGridView ID="gvInputCsv" runat="server" OnDataBinding="gvInputCsv_DataBinding" Theme="Aqua" Width="100%">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1">
|
||||||
|
</AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<EditFormLayoutProperties ColCount="1">
|
||||||
|
</EditFormLayoutProperties>
|
||||||
|
</dx:ASPxGridView>--%>
|
||||||
|
</dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxRoundPanel>
|
||||||
|
<dx:ASPxRoundPanel ID="ASPxRoundPanel3" runat="server" HeaderText="Output" Theme="Aqua" View="GroupBox" Width="100%" Visible="false">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server">
|
||||||
|
<%-- <dx:ASPxGridView ID="gvOutput" runat="server" OnDataBinding="gvInputCsv_DataBinding" Theme="Aqua" Width="100%">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1">
|
||||||
|
</AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<EditFormLayoutProperties ColCount="1">
|
||||||
|
</EditFormLayoutProperties>
|
||||||
|
</dx:ASPxGridView>--%>
|
||||||
|
</dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxRoundPanel>
|
||||||
|
</dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxRoundPanel>
|
||||||
|
<dx:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="gvOutput">
|
||||||
|
</dx:ASPxGridViewExporter>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
531
OlympiaIntranet/MSReset.aspx.cs
Normal file
@@ -0,0 +1,531 @@
|
|||||||
|
using ClosedXML.Excel;
|
||||||
|
using DevExpress.Export;
|
||||||
|
using DevExpress.Web;
|
||||||
|
using DevExpress.XtraPrinting;
|
||||||
|
using MySqlConnector;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class MSReset : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
DataTable dtOutputTrades = new DataTable();
|
||||||
|
|
||||||
|
protected void Page_Init(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
CultureInfo ci = (CultureInfo)Thread.CurrentThread.CurrentCulture.Clone();
|
||||||
|
ci.NumberFormat.NumberDecimalSeparator = ",";
|
||||||
|
Thread.CurrentThread.CurrentCulture = ci;
|
||||||
|
}
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (HttpContext.Current.User.Identity.IsAuthenticated == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
|
||||||
|
//Bind the grid only once
|
||||||
|
if (!IsPostBack)
|
||||||
|
gvInputCsv.DataBind();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataTable ResetFileToDataTable(UploadedFile uploadedFile)
|
||||||
|
{
|
||||||
|
// ref link: https://www.c-sharpcorner.com/blogs/read-csv-file-into-data-table1
|
||||||
|
|
||||||
|
DataTable dtCsv = new DataTable();
|
||||||
|
string Fulltext;
|
||||||
|
if (uploadedFile.IsValid) //if (FileUpload.HasFile && IsPostBack)
|
||||||
|
{
|
||||||
|
using (StreamReader sr = new StreamReader(uploadedFile.FileContent))
|
||||||
|
{
|
||||||
|
while (!sr.EndOfStream)
|
||||||
|
{
|
||||||
|
Fulltext = sr.ReadToEnd().ToString(); //read full file text
|
||||||
|
string[] rows = Fulltext.Split('\n'); //split full file text into rows
|
||||||
|
for (int i = 1; i < rows.Count() - 2; i++) // la prima riga la ignora!
|
||||||
|
{
|
||||||
|
string[] rowValues = rows[i].Split(','); //split each row with , to get individual values
|
||||||
|
{
|
||||||
|
if (i == 1)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < rowValues.Count(); j++)
|
||||||
|
{
|
||||||
|
if (rowValues[j] == "Security Description") dtCsv.Columns.Add("Stock description"); // se il file è giornaliero differisce solo per il nome colonna Security Description che deve diventare Stock description
|
||||||
|
else dtCsv.Columns.Add(rowValues[j]); //add headers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DataRow dr = dtCsv.NewRow();
|
||||||
|
for (int k = 0; k < rowValues.Count(); k++)
|
||||||
|
{
|
||||||
|
dr[k] = rowValues[k].ToString().Replace(",", ".").Replace("\"",string.Empty);
|
||||||
|
}
|
||||||
|
dtCsv.Rows.Add(dr); //add other rows
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return dtCsv;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void uploadControl_FileUploadComplete(object sender, FileUploadCompleteEventArgs e)
|
||||||
|
{
|
||||||
|
if (radioButtonList.SelectedIndex == 0) // da fare caso radioButtonList.SelectedIndex == 1 !
|
||||||
|
{
|
||||||
|
Session["dtResetFile"] = ResetFileToDataTable(e.UploadedFile);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvInputCsv_DataBinding(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (Session["dtResetFile"] != null)
|
||||||
|
{
|
||||||
|
gvInputCsv.DataSource = (DataTable)Session["dtResetFile"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void btnElaboraInput_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Serve solo per effettuare il postback e bindare gvInputCsv al datatable contenuto in Session["dtResetFile"]
|
||||||
|
|
||||||
|
// Importa struttura colonne file excel in output per Guardian
|
||||||
|
dtOutputTrades = ElaboraTemplateGuardian(Server.MapPath("~/App_Data/TEMPLATE/sample_imp_tra.xlsx"), "Foglio1"); // Importa colonne file template in output per Guardian
|
||||||
|
|
||||||
|
//if (radioButtonList.SelectedIndex == 0) ElaboraMSResetFileDaily(); // Elabora reset file NON PIU' USATO IL DAILY dal 30/07/2021
|
||||||
|
|
||||||
|
if (radioButtonList.SelectedIndex == 0) ElaboraMSResetFileWeekly(); // Elabora reset file
|
||||||
|
}
|
||||||
|
private void ElaboraMSResetFileWeekly()
|
||||||
|
{
|
||||||
|
DataTable dtResetFile = (DataTable)Session["dtResetFile"];
|
||||||
|
if (dtResetFile.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
double tempDouble = 0;
|
||||||
|
double quantity = 0;
|
||||||
|
foreach (DataRow rigaReset in dtResetFile.Rows)
|
||||||
|
{
|
||||||
|
if (rigaReset["Event"].ToString() != "RESET"
|
||||||
|
&& rigaReset["Event"].ToString() != "C"
|
||||||
|
&& rigaReset["Event"].ToString() != "DIV"
|
||||||
|
) continue; // elabora la riga solo se Event=RESET o C o DIV altrimenti skippa, dr1,dr2 vengono create solo con EVENT=RESET, dr3 viene creata sia con RESET che C, dr4 viene creata solo se EVENT = DIV
|
||||||
|
|
||||||
|
// Crea due righe in output per ogni riga in input
|
||||||
|
DataRow dr1 = dtOutputTrades.NewRow();
|
||||||
|
DataRow dr2 = dtOutputTrades.NewRow();
|
||||||
|
DataRow dr3 = dtOutputTrades.NewRow();
|
||||||
|
DataRow dr4 = dtOutputTrades.NewRow();
|
||||||
|
|
||||||
|
// data_ope
|
||||||
|
dr1["data_ope"] = DateTime.ParseExact(rigaReset["End Date"].ToString(), "yyyy-MM-dd", CultureInfo.InvariantCulture).ToString("dd.MM.yyyy");
|
||||||
|
dr2["data_ope"] = dr1["data_ope"];
|
||||||
|
dr3["data_ope"] = dr1["data_ope"];
|
||||||
|
dr4["data_ope"] = dr1["data_ope"];
|
||||||
|
|
||||||
|
// data_ins
|
||||||
|
dr1["data_ins"] = DateTime.ParseExact(rigaReset["End Date"].ToString(), "yyyy-MM-dd", CultureInfo.InvariantCulture).ToString("dd.MM.yyyy");
|
||||||
|
dr2["data_ins"] = dr1["data_ins"];
|
||||||
|
dr3["data_ins"] = dr1["data_ins"];
|
||||||
|
dr4["data_ins"] = dr1["data_ins"];
|
||||||
|
|
||||||
|
// data_val
|
||||||
|
dr1["data_val"] = DateTime.ParseExact(rigaReset["Value Date"].ToString(), "yyyy-MM-dd", CultureInfo.InvariantCulture).ToString("dd.MM.yyyy");
|
||||||
|
dr2["data_val"] = dr1["data_val"];
|
||||||
|
dr3["data_val"] = dr1["data_val"];
|
||||||
|
dr4["data_val"] = dr1["data_val"];
|
||||||
|
|
||||||
|
// prezzo
|
||||||
|
if (Double.TryParse(rigaReset["Mark Price2"].ToString().Replace(".", ","), out tempDouble)) dr1["prezzo"] = tempDouble;
|
||||||
|
else dr1["prezzo"] = DBNull.Value;
|
||||||
|
dr2["prezzo"] = dr1["prezzo"];
|
||||||
|
|
||||||
|
// cod_div_tit
|
||||||
|
dr1["cod_div_tit"] = rigaReset["Listing Ccy"];
|
||||||
|
dr2["cod_div_tit"] = dr1["cod_div_tit"];
|
||||||
|
dr3["cod_div_tit"] = dr1["cod_div_tit"];
|
||||||
|
dr4["cod_div_tit"] = dr1["cod_div_tit"];
|
||||||
|
|
||||||
|
// qta e cod_ope (dr1 e dr2)
|
||||||
|
if (Double.TryParse(rigaReset["Quantity"].ToString().Replace(".", ","), out quantity)) { dr1["qta"] = quantity; dr2["qta"] = -quantity; }
|
||||||
|
else { dr1["qta"] = DBNull.Value; dr2["qta"] = DBNull.Value; }
|
||||||
|
if (quantity > 0) { dr1["cod_ope"] = "B"; dr2["cod_ope"] = "S"; }
|
||||||
|
else { dr1["cod_ope"] = "S"; dr2["cod_ope"] = "B"; }
|
||||||
|
|
||||||
|
// qta,cod_ope,ctv_tit_dn,ctv_tot_dn,ctv_tit_dr,ctv_tot_dr (dr3)
|
||||||
|
if (Double.TryParse(rigaReset["Total"].ToString().Replace(".", ","), out tempDouble))
|
||||||
|
{
|
||||||
|
dr3["qta"] = tempDouble;
|
||||||
|
if (tempDouble > 0) { dr3["cod_ope"] = "CREDMAR"; } else { dr3["cod_ope"] = "DEBTMAR"; }
|
||||||
|
dr3["ctv_tit_dn"] = tempDouble;
|
||||||
|
dr3["ctv_tot_dn"] = tempDouble;
|
||||||
|
dr3["ctv_tit_dr"] = tempDouble;
|
||||||
|
dr3["ctv_tot_dr"] = tempDouble;
|
||||||
|
|
||||||
|
dr4["qta"] = tempDouble;
|
||||||
|
if (tempDouble > 0) { dr4["cod_ope"] = "CREDMAR"; } else { dr4["cod_ope"] = "DEBTMAR"; }
|
||||||
|
dr4["ctv_tit_dn"] = tempDouble;
|
||||||
|
dr4["ctv_tot_dn"] = tempDouble;
|
||||||
|
dr4["ctv_tit_dr"] = tempDouble;
|
||||||
|
dr4["ctv_tot_dr"] = tempDouble;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dr3["qta"] = DBNull.Value;
|
||||||
|
dr3["ctv_tit_dn"] = DBNull.Value;
|
||||||
|
dr3["ctv_tot_dn"] = DBNull.Value;
|
||||||
|
dr3["ctv_tit_dr"] = DBNull.Value;
|
||||||
|
dr3["ctv_tot_dr"] = DBNull.Value;
|
||||||
|
|
||||||
|
dr4["qta"] = DBNull.Value;
|
||||||
|
dr4["ctv_tit_dn"] = DBNull.Value;
|
||||||
|
dr4["ctv_tot_dn"] = DBNull.Value;
|
||||||
|
dr4["ctv_tit_dr"] = DBNull.Value;
|
||||||
|
dr4["ctv_tot_dr"] = DBNull.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// cod_tit
|
||||||
|
string cod_tit = execSP_Scalar("SELECT t.cod_tit FROM tit t WHERE t.cod_isin_sot='" + rigaReset["ISIN"].ToString() + "' and t.cfd='S';");
|
||||||
|
dr1["cod_tit"] = cod_tit;
|
||||||
|
dr2["cod_tit"] = cod_tit;
|
||||||
|
dr3["cod_tit"] = cod_tit;
|
||||||
|
dr4["cod_tit"] = cod_tit;
|
||||||
|
|
||||||
|
// cod_rap
|
||||||
|
if (rigaReset["Account Number"].ToString() == "061787OC") { dr1["cod_rap"] = "DB6289"; dr2["cod_rap"] = "DB6289"; dr3["cod_rap"] = "DB6289"; dr4["cod_rap"] = "DB6289"; } // Fondo Plurima
|
||||||
|
if (rigaReset["Account Number"].ToString() == "061787VN") { dr1["cod_rap"] = "GP11950"; dr2["cod_rap"] = "GP11950"; dr3["cod_rap"] = "GP11950"; dr4["cod_rap"] = "GP11950"; } // Fondo Hector
|
||||||
|
|
||||||
|
// cod_dep_liq
|
||||||
|
dr1["cod_dep_liq"] = "LIQCFD" + rigaReset["Swap Settlement Currency"].ToString();
|
||||||
|
dr2["cod_dep_liq"] = dr1["cod_dep_liq"];
|
||||||
|
|
||||||
|
// cod_div_reg
|
||||||
|
dr1["cod_div_reg"] = rigaReset["Swap Settlement Currency"];
|
||||||
|
dr2["cod_div_reg"] = dr1["cod_div_reg"];
|
||||||
|
dr3["cod_div_reg"] = dr1["cod_div_reg"];
|
||||||
|
dr4["cod_div_reg"] = dr1["cod_div_reg"];
|
||||||
|
|
||||||
|
// cod_dep_tit
|
||||||
|
dr1["cod_dep_tit"] = "DEPTIT";
|
||||||
|
dr2["cod_dep_tit"] = "DEPTIT";
|
||||||
|
|
||||||
|
// cod_ctp
|
||||||
|
dr1["cod_ctp"] = "MSP";
|
||||||
|
dr2["cod_ctp"] = "MSP";
|
||||||
|
dr3["cod_ctp"] = "MSP";
|
||||||
|
dr4["cod_ctp"] = "MSP";
|
||||||
|
|
||||||
|
// des_mov
|
||||||
|
dr1["des_mov"] = string.Format("Reset open {0}", rigaReset["Stock description"]);
|
||||||
|
dr2["des_mov"] = string.Format("Reset close {0} ", rigaReset["Stock description"]);
|
||||||
|
dr3["des_mov"] = string.Format("Reset payment {0}", rigaReset["Stock description"]);
|
||||||
|
dr4["des_mov"] = string.Format("Dividend payment {0}", rigaReset["Stock description"]);
|
||||||
|
|
||||||
|
if (rigaReset["Event"].ToString() == "RESET") dtOutputTrades.Rows.Add(dr1); // creata solo se Event=RESET
|
||||||
|
if (rigaReset["Event"].ToString() == "RESET") dtOutputTrades.Rows.Add(dr2); // creata solo se Event=RESET
|
||||||
|
dtOutputTrades.Rows.Add(dr3); // creata sempre quindi Event=RESET o Event=C
|
||||||
|
if (rigaReset["Event"].ToString() == "DIV") dtOutputTrades.Rows.Add(dr4); // creata solo se Event=DIV
|
||||||
|
}
|
||||||
|
if (dtOutputTrades.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
DataView dv = dtOutputTrades.DefaultView;
|
||||||
|
dv.Sort = "des_mov";
|
||||||
|
DataTable sortedDT = dv.ToTable();
|
||||||
|
|
||||||
|
//Session["dtOutputTrades"] = (DataTable)dtOutputTrades;
|
||||||
|
Session["dtOutputTrades"] = (DataTable)sortedDT;
|
||||||
|
gvOutput.DataSource = Session["dtOutputTrades"];
|
||||||
|
gvOutput.DataBind();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ElaboraMSResetFileDaily()
|
||||||
|
{
|
||||||
|
DataTable dtResetFile = (DataTable)Session["dtResetFile"];
|
||||||
|
if (dtResetFile.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
double tempDouble = 0;
|
||||||
|
double quantity = 0;
|
||||||
|
foreach (DataRow rigaReset in dtResetFile.Rows)
|
||||||
|
{
|
||||||
|
if (rigaReset["Event"].ToString() != "RESET"
|
||||||
|
&& rigaReset["Event"].ToString() != "C"
|
||||||
|
&& rigaReset["Event"].ToString() != "DIV"
|
||||||
|
) continue; // elabora la riga solo se Event=RESET o C o DIV altrimenti skippa, dr1,dr2 vengono create solo con EVENT=RESET, dr3 viene creata sia con RESET che C, dr4 viene creata solo se EVENT = DIV
|
||||||
|
|
||||||
|
// Crea due righe in output per ogni riga in input
|
||||||
|
DataRow dr1 = dtOutputTrades.NewRow();
|
||||||
|
DataRow dr2 = dtOutputTrades.NewRow();
|
||||||
|
DataRow dr3 = dtOutputTrades.NewRow();
|
||||||
|
DataRow dr4 = dtOutputTrades.NewRow();
|
||||||
|
|
||||||
|
// data_ope
|
||||||
|
dr1["data_ope"] = DateTime.ParseExact(rigaReset["End Date"].ToString(), "yyyy-MM-dd", CultureInfo.InvariantCulture).ToString("dd.MM.yyyy");
|
||||||
|
dr2["data_ope"] = dr1["data_ope"];
|
||||||
|
dr3["data_ope"] = dr1["data_ope"];
|
||||||
|
dr4["data_ope"] = dr1["data_ope"];
|
||||||
|
|
||||||
|
// data_ins
|
||||||
|
dr1["data_ins"] = DateTime.ParseExact(rigaReset["End Date"].ToString(), "yyyy-MM-dd", CultureInfo.InvariantCulture).ToString("dd.MM.yyyy");
|
||||||
|
dr2["data_ins"] = dr1["data_ins"];
|
||||||
|
dr3["data_ins"] = dr1["data_ins"];
|
||||||
|
dr4["data_ins"] = dr1["data_ins"];
|
||||||
|
|
||||||
|
// data_val
|
||||||
|
dr1["data_val"] = DateTime.ParseExact(rigaReset["Value Date"].ToString(), "yyyy-MM-dd", CultureInfo.InvariantCulture).ToString("dd.MM.yyyy");
|
||||||
|
dr2["data_val"] = dr1["data_val"];
|
||||||
|
dr3["data_val"] = dr1["data_val"];
|
||||||
|
dr4["data_val"] = dr1["data_val"];
|
||||||
|
|
||||||
|
// prezzo
|
||||||
|
if (Double.TryParse(rigaReset["Mark Price2"].ToString().Replace(".", ","), out tempDouble)) dr1["prezzo"] = tempDouble;
|
||||||
|
else dr1["prezzo"] = DBNull.Value;
|
||||||
|
dr2["prezzo"] = dr1["prezzo"];
|
||||||
|
|
||||||
|
// cod_div_tit
|
||||||
|
dr1["cod_div_tit"] = rigaReset["Listing Ccy"];
|
||||||
|
dr2["cod_div_tit"] = dr1["cod_div_tit"];
|
||||||
|
dr3["cod_div_tit"] = dr1["cod_div_tit"];
|
||||||
|
dr4["cod_div_tit"] = dr1["cod_div_tit"];
|
||||||
|
|
||||||
|
// qta e cod_ope (dr1 e dr2)
|
||||||
|
if (Double.TryParse(rigaReset["Quantity"].ToString().Replace(".", ","), out quantity)) { dr1["qta"] = quantity; dr2["qta"] = -quantity; }
|
||||||
|
else { dr1["qta"] = DBNull.Value; dr2["qta"] = DBNull.Value; }
|
||||||
|
if (quantity > 0) { dr1["cod_ope"] = "B"; dr2["cod_ope"] = "S"; }
|
||||||
|
else { dr1["cod_ope"] = "S"; dr2["cod_ope"] = "B"; }
|
||||||
|
|
||||||
|
// qta,cod_ope,ctv_tit_dn,ctv_tot_dn,ctv_tit_dr,ctv_tot_dr (dr3)
|
||||||
|
if (Double.TryParse(rigaReset["Total"].ToString().Replace(".", ","), out tempDouble))
|
||||||
|
{
|
||||||
|
dr3["qta"] = tempDouble;
|
||||||
|
if (tempDouble > 0) { dr3["cod_ope"] = "CREDMAR"; } else { dr3["cod_ope"] = "DEBTMAR"; }
|
||||||
|
dr3["ctv_tit_dn"] = tempDouble;
|
||||||
|
dr3["ctv_tot_dn"] = tempDouble;
|
||||||
|
dr3["ctv_tit_dr"] = tempDouble;
|
||||||
|
dr3["ctv_tot_dr"] = tempDouble;
|
||||||
|
|
||||||
|
dr4["qta"] = tempDouble;
|
||||||
|
if (tempDouble > 0) { dr4["cod_ope"] = "CREDMAR"; } else { dr4["cod_ope"] = "DEBTMAR"; }
|
||||||
|
dr4["ctv_tit_dn"] = tempDouble;
|
||||||
|
dr4["ctv_tot_dn"] = tempDouble;
|
||||||
|
dr4["ctv_tit_dr"] = tempDouble;
|
||||||
|
dr4["ctv_tot_dr"] = tempDouble;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dr3["qta"] = DBNull.Value;
|
||||||
|
dr3["ctv_tit_dn"] = DBNull.Value;
|
||||||
|
dr3["ctv_tot_dn"] = DBNull.Value;
|
||||||
|
dr3["ctv_tit_dr"] = DBNull.Value;
|
||||||
|
dr3["ctv_tot_dr"] = DBNull.Value;
|
||||||
|
|
||||||
|
dr4["qta"] = DBNull.Value;
|
||||||
|
dr4["ctv_tit_dn"] = DBNull.Value;
|
||||||
|
dr4["ctv_tot_dn"] = DBNull.Value;
|
||||||
|
dr4["ctv_tit_dr"] = DBNull.Value;
|
||||||
|
dr4["ctv_tot_dr"] = DBNull.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// cod_tit
|
||||||
|
string cod_tit = execSP_Scalar("SELECT t.cod_tit FROM tit t WHERE t.cod_isin_sot='" + rigaReset["ISIN"].ToString() + "' and t.cfd='S';");
|
||||||
|
dr1["cod_tit"] = cod_tit;
|
||||||
|
dr2["cod_tit"] = cod_tit;
|
||||||
|
dr3["cod_tit"] = cod_tit;
|
||||||
|
dr4["cod_tit"] = cod_tit;
|
||||||
|
|
||||||
|
// cod_rap
|
||||||
|
if (rigaReset["Account Number"].ToString() == "061787OC") { dr1["cod_rap"] = "DB6289"; dr2["cod_rap"] = "DB6289"; dr3["cod_rap"] = "DB6289"; dr4["cod_rap"] = "DB6289"; } // Fondo Plurima
|
||||||
|
if (rigaReset["Account Number"].ToString() == "061787VN") { dr1["cod_rap"] = "GP11950"; dr2["cod_rap"] = "GP11950"; dr3["cod_rap"] = "GP11950"; dr4["cod_rap"] = "GP11950"; } // Fondo Hector
|
||||||
|
|
||||||
|
// cod_dep_liq
|
||||||
|
dr1["cod_dep_liq"] = "LIQCFD" + rigaReset["Swap Settlement Currency"].ToString();
|
||||||
|
dr2["cod_dep_liq"] = dr1["cod_dep_liq"];
|
||||||
|
|
||||||
|
// cod_div_reg
|
||||||
|
dr1["cod_div_reg"] = rigaReset["Swap Settlement Currency"];
|
||||||
|
dr2["cod_div_reg"] = dr1["cod_div_reg"];
|
||||||
|
dr3["cod_div_reg"] = dr1["cod_div_reg"];
|
||||||
|
dr4["cod_div_reg"] = dr1["cod_div_reg"];
|
||||||
|
|
||||||
|
// cod_dep_tit
|
||||||
|
dr1["cod_dep_tit"] = "DEPTIT";
|
||||||
|
dr2["cod_dep_tit"] = "DEPTIT";
|
||||||
|
|
||||||
|
// cod_ctp
|
||||||
|
dr1["cod_ctp"] = "MSP";
|
||||||
|
dr2["cod_ctp"] = "MSP";
|
||||||
|
dr3["cod_ctp"] = "MSP";
|
||||||
|
dr4["cod_ctp"] = "MSP";
|
||||||
|
|
||||||
|
// des_mov
|
||||||
|
dr1["des_mov"] = string.Format("Reset open {0}", rigaReset["Security Description"]);
|
||||||
|
dr2["des_mov"] = string.Format("Reset close {0} ", rigaReset["Security Description"]);
|
||||||
|
dr3["des_mov"] = string.Format("Reset payment {0}", rigaReset["Security Description"]);
|
||||||
|
dr4["des_mov"] = string.Format("Dividend payment {0}", rigaReset["Security Description"]);
|
||||||
|
|
||||||
|
if (rigaReset["Event"].ToString() == "RESET") dtOutputTrades.Rows.Add(dr1); // creata solo se Event=RESET
|
||||||
|
if (rigaReset["Event"].ToString() == "RESET") dtOutputTrades.Rows.Add(dr2); // creata solo se Event=RESET
|
||||||
|
dtOutputTrades.Rows.Add(dr3); // creata sempre quindi Event=RESET o Event=C
|
||||||
|
if (rigaReset["Event"].ToString() == "DIV") dtOutputTrades.Rows.Add(dr4); // creata solo se Event=DIV
|
||||||
|
}
|
||||||
|
if (dtOutputTrades.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
DataView dv = dtOutputTrades.DefaultView;
|
||||||
|
dv.Sort = "des_mov";
|
||||||
|
DataTable sortedDT = dv.ToTable();
|
||||||
|
|
||||||
|
//Session["dtOutputTrades"] = (DataTable)dtOutputTrades;
|
||||||
|
Session["dtOutputTrades"] = (DataTable)sortedDT;
|
||||||
|
gvOutput.DataSource = Session["dtOutputTrades"];
|
||||||
|
gvOutput.DataBind();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string execSP_Scalar(string query)
|
||||||
|
{
|
||||||
|
object objResult;
|
||||||
|
string result = String.Empty;
|
||||||
|
using (var con = new MySqlConnection(Properties.Settings.Default.mySqlConnection))
|
||||||
|
{
|
||||||
|
var cmd = new MySqlCommand
|
||||||
|
{
|
||||||
|
CommandText = query,
|
||||||
|
CommandType = CommandType.Text,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
cmd.CommandTimeout = 0;
|
||||||
|
con.Open(); // Open the SqlConnection.
|
||||||
|
objResult = cmd.ExecuteScalar();
|
||||||
|
|
||||||
|
if (objResult != null) result = objResult.ToString();
|
||||||
|
}
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DataTable ElaboraTemplateGuardian(string file, string sheetName)
|
||||||
|
{
|
||||||
|
// Open the Excel file using ClosedXML.
|
||||||
|
// Keep in mind the Excel file cannot be open when trying to read it
|
||||||
|
using (XLWorkbook workBook = new XLWorkbook(file))
|
||||||
|
{
|
||||||
|
//Read the first Sheet from Excel file.
|
||||||
|
IXLWorksheet workSheet = workBook.Worksheet(1);
|
||||||
|
|
||||||
|
//Create a new DataTable.
|
||||||
|
DataTable dt = new DataTable();
|
||||||
|
|
||||||
|
//Loop through the Worksheet rows.
|
||||||
|
bool firstRow = true;
|
||||||
|
foreach (IXLRow row in workSheet.Rows())
|
||||||
|
{
|
||||||
|
//Use the first row to add columns to DataTable.
|
||||||
|
if (firstRow)
|
||||||
|
{
|
||||||
|
foreach (IXLCell cell in row.Cells())
|
||||||
|
{
|
||||||
|
// Definisco tipo di colonna in tabella dt a seconda delle colonne di partenza del template
|
||||||
|
switch (cell.Value.ToString())
|
||||||
|
{
|
||||||
|
//case "qta":
|
||||||
|
// dt.Columns.Add(cell.Value.ToString(),typeof(Int64));
|
||||||
|
// break;
|
||||||
|
|
||||||
|
case "qta":
|
||||||
|
case "prezzo":
|
||||||
|
case "cambiom":
|
||||||
|
case "ctv_tit_dr":
|
||||||
|
case "coma_dep_dr":
|
||||||
|
case "spese_dr":
|
||||||
|
case "ctv_tot_dr":
|
||||||
|
case "imposte_dr":
|
||||||
|
case "ctv_tit_dn":
|
||||||
|
case "imposte_dn":
|
||||||
|
case "ctv_tot_dn":
|
||||||
|
dt.Columns.Add(cell.Value.ToString(), typeof(double));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
dt.Columns.Add(cell.Value.ToString());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// dt.Columns.Add(cell.Value.ToString());
|
||||||
|
}
|
||||||
|
firstRow = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Add rows to DataTable.
|
||||||
|
dt.Rows.Add();
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
foreach (IXLCell cell in row.Cells(row.FirstCellUsed().Address.ColumnNumber, row.LastCellUsed().Address.ColumnNumber))
|
||||||
|
{
|
||||||
|
dt.Rows[dt.Rows.Count - 1][i] = cell.Value.ToString();
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return dt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void btnOutputGuardian_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Metodo 1) - Crea file di output in formato .xlsx per guardian relativo a MS Trades
|
||||||
|
// Prepare the response
|
||||||
|
string fileType = string.Empty;
|
||||||
|
if (radioButtonList.SelectedIndex == 0) fileType = "msreset";
|
||||||
|
else fileType = "normaltrade";
|
||||||
|
string excelTrades = string.Format("{0}_trades_{1:yyyyMMdd}.xlsx", fileType, DateTime.Today.Date);
|
||||||
|
HttpResponse httpResponse = Response;
|
||||||
|
httpResponse.Clear();
|
||||||
|
httpResponse.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
||||||
|
httpResponse.AddHeader("content-disposition", string.Format("attachment;filename={0}", excelTrades));
|
||||||
|
|
||||||
|
// Flush the workbook to the Response.OutputStream
|
||||||
|
DataTable dt = (DataTable)Session["dtOutputTrades"];
|
||||||
|
using (var workbook = new XLWorkbook())
|
||||||
|
{
|
||||||
|
using (MemoryStream memoryStream = new MemoryStream())
|
||||||
|
{
|
||||||
|
workbook.Worksheets.Add(dt, "Foglio1");
|
||||||
|
workbook.SaveAs(memoryStream);
|
||||||
|
memoryStream.WriteTo(httpResponse.OutputStream);
|
||||||
|
memoryStream.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
httpResponse.End();
|
||||||
|
|
||||||
|
// Metodo 2) Utilizzo AspxGridviewExporter per salvare xlsx in ouutput
|
||||||
|
//if (Session["dtOutputTrades"] != null)
|
||||||
|
//{
|
||||||
|
// gvOutput.DataSource = (DataTable)Session["dtOutputTrades"];
|
||||||
|
// gvOutput.DataBind();
|
||||||
|
|
||||||
|
// string fileType = string.Empty;
|
||||||
|
// if (radioButtonList.SelectedIndex == 0) fileType = "msreset";
|
||||||
|
// else fileType = "normaltrade";
|
||||||
|
// ASPxGridViewExporter1.FileName = String.Format("{0}_trades_{1:yyyyMMdd}.xlsx", fileType, DateTime.Today.Date);
|
||||||
|
// XlsxExportOptionsEx option = new XlsxExportOptionsEx { ExportType = ExportType.DataAware, TextExportMode = TextExportMode.Value };
|
||||||
|
// ASPxGridViewExporter1.WriteXlsxToResponse(option);
|
||||||
|
//}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
132
OlympiaIntranet/MSReset.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet {
|
||||||
|
|
||||||
|
|
||||||
|
public partial class MSReset {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxFormLayout1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxFormLayout ASPxFormLayout1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// radioButtonList control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxRadioButtonList radioButtonList;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// uploadControl control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxUploadControl uploadControl;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnElaboraInput control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton btnElaboraInput;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnOutputGuardian control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton btnOutputGuardian;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxRoundPanel1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxRoundPanel ASPxRoundPanel1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPageControl1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPageControl ASPxPageControl1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvInputCsv control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvInputCsv;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvOutput control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvOutput;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxRoundPanel2 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxRoundPanel ASPxRoundPanel2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxRoundPanel3 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxRoundPanel ASPxRoundPanel3;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxGridViewExporter1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridViewExporter ASPxGridViewExporter1;
|
||||||
|
}
|
||||||
|
}
|
||||||
131
OlympiaIntranet/Margini.aspx
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Margini.aspx.cs" Inherits="OlympiaIntranet.Margini" UICulture="it" Culture="it-IT" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<div>
|
||||||
|
<dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server" ColCount="2" EnableTheming="True" Theme="Aqua" ColumnCount="2">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutGroup Caption="Upload Area" ColCount="1" ColSpan="1">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="Upload file" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxUploadControl ID="uploadControl" runat="server" Height="23px" ShowProgressPanel="True" ShowUploadButton="True" Theme="Aqua" UploadMode="Auto" Width="325px" AutoStartUpload="True" OnFileUploadComplete="uploadControl_FileUploadComplete">
|
||||||
|
<AdvancedModeSettings EnableDragAndDrop="True" EnableFileList="True" EnableMultiSelect="True">
|
||||||
|
</AdvancedModeSettings>
|
||||||
|
</dx:ASPxUploadControl>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="btnElaboraInput" runat="server" OnClick="btnElaboraInput_Click" Text="Elabora Input">
|
||||||
|
<Image IconID="programming_technology_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="btnOutputGuardian" runat="server" OnClick="btnOutputGuardian_Click" Text="Output per Guardian">
|
||||||
|
<Image IconID="export_exporttocsv_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxFormLayout>
|
||||||
|
</div>
|
||||||
|
<dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" HeaderText="Control Area" Theme="Aqua" View="GroupBox" Width="100%">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server">
|
||||||
|
<dx:ASPxRoundPanel ID="ASPxRoundPanel4" runat="server" HeaderText="Margini" Theme="Aqua" View="GroupBox" Width="100%">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server">
|
||||||
|
<dx:ASPxPageControl ID="ASPxPageControl1" runat="server" ActiveTabIndex="0" EnableTheming="True" Theme="Aqua">
|
||||||
|
|
||||||
|
<TabPages>
|
||||||
|
<dx:TabPage Name="Plurima 10" Text="Plurima 10">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<dx:ASPxGridView ID="gvPlurima10" runat="server" OnDataBinding="gvPlurima10_DataBinding" Theme="Aqua" Width="100%">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1">
|
||||||
|
</AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<EditFormLayoutProperties ColCount="1">
|
||||||
|
</EditFormLayoutProperties>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>
|
||||||
|
<dx:TabPage Name="Plurima VB" Text="Plurima VB">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<dx:ASPxGridView ID="gvPlurimaVB" runat="server" OnDataBinding="gvPlurimaVB_DataBinding" Theme="Aqua" Width="100%">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1">
|
||||||
|
</AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<EditFormLayoutProperties ColCount="1">
|
||||||
|
</EditFormLayoutProperties>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>
|
||||||
|
</TabPages>
|
||||||
|
|
||||||
|
</dx:ASPxPageControl>
|
||||||
|
</dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxRoundPanel>
|
||||||
|
<dx:ASPxRoundPanel ID="ASPxRoundPanel2" runat="server" HeaderText="Input" Theme="Aqua" View="GroupBox" Width="100%">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server">
|
||||||
|
<dx:ASPxGridView ID="gvInputCsv" runat="server" OnDataBinding="gvInputCsv_DataBinding" Theme="Aqua" Width="100%" OnHtmlRowPrepared="gvInputCsv_HtmlRowPrepared">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1">
|
||||||
|
</AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<EditFormLayoutProperties ColCount="1">
|
||||||
|
</EditFormLayoutProperties>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxRoundPanel>
|
||||||
|
<dx:ASPxRoundPanel ID="ASPxRoundPanel3" runat="server" HeaderText="Output" Theme="Aqua" View="GroupBox" Width="100%">
|
||||||
|
<PanelCollection>
|
||||||
|
<dx:PanelContent runat="server">
|
||||||
|
<dx:ASPxGridView ID="gvOutput" runat="server" OnDataBinding="gvOutput_DataBinding" Theme="Aqua" Width="100%">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1">
|
||||||
|
</AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<EditFormLayoutProperties ColCount="1">
|
||||||
|
</EditFormLayoutProperties>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxRoundPanel>
|
||||||
|
</dx:PanelContent>
|
||||||
|
</PanelCollection>
|
||||||
|
</dx:ASPxRoundPanel>
|
||||||
|
<dx:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="gvOutput">
|
||||||
|
</dx:ASPxGridViewExporter>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
433
OlympiaIntranet/Margini.aspx.cs
Normal file
@@ -0,0 +1,433 @@
|
|||||||
|
using ClosedXML.Excel;
|
||||||
|
using DevExpress.Export;
|
||||||
|
using DevExpress.Web;
|
||||||
|
using DevExpress.XtraPrinting;
|
||||||
|
using MySqlConnector;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class Margini : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
DataTable dtOutputTrades = new DataTable();
|
||||||
|
protected override void InitializeCulture() // Aggiunto altrimenti in produzione prendeva settaggi USA per i decimali con il punto invece che con la virgola
|
||||||
|
{
|
||||||
|
Culture = "it-IT";
|
||||||
|
UICulture = "it";
|
||||||
|
|
||||||
|
}
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (HttpContext.Current.User.Identity.IsAuthenticated == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
|
||||||
|
//Bind the grid only once
|
||||||
|
if (!IsPostBack)
|
||||||
|
{
|
||||||
|
gvInputCsv.DataBind();
|
||||||
|
gvOutput.DataBind();
|
||||||
|
gvPlurima10.DataBind();
|
||||||
|
gvPlurimaVB.DataBind();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void uploadControl_FileUploadComplete(object sender, FileUploadCompleteEventArgs e)
|
||||||
|
{
|
||||||
|
Session["dtInputFile"] = ProcessInputFile(e.UploadedFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataTable ProcessInputFile(UploadedFile uploadedFile)
|
||||||
|
{
|
||||||
|
// ref link: https://www.c-sharpcorner.com/blogs/read-csv-file-into-data-table1
|
||||||
|
DataTable dtCsv = new DataTable();
|
||||||
|
string Fulltext;
|
||||||
|
if (uploadedFile.IsValid) //if (FileUpload.HasFile && IsPostBack)
|
||||||
|
{
|
||||||
|
using (StreamReader sr = new StreamReader(uploadedFile.FileContent))
|
||||||
|
{
|
||||||
|
while (!sr.EndOfStream)
|
||||||
|
{
|
||||||
|
Fulltext = sr.ReadToEnd().ToString(); //read full file text
|
||||||
|
string[] rows = Fulltext.Split('\n'); //split full file text into rows
|
||||||
|
for (int i = 0; i < rows.Count() - 1; i++)
|
||||||
|
{
|
||||||
|
string[] rowValues = rows[i].Split(','); //split each row with , to get individual values
|
||||||
|
{
|
||||||
|
if (i == 0)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < rowValues.Count(); j++)
|
||||||
|
{
|
||||||
|
if (j == 0 || j == 1 || j == 3 || j == 10 || j == 13 || j == 15) dtCsv.Columns.Add(rowValues[j]); //add headers 0 - Business Date, 1 - Account ID,3 - Currency,10 - Open Trade Equity,13 - Initial Margin,15 - Margin Excess Deficit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DataRow dr = dtCsv.NewRow();
|
||||||
|
int cont = 0;
|
||||||
|
for (int k = 0; k < rowValues.Count(); k++)
|
||||||
|
{
|
||||||
|
if (k == 0 || k == 1 || k == 3 || k == 10 || k == 13 || k == 15)
|
||||||
|
{
|
||||||
|
if (k == 13) // Se è colonna InitialMargin aggiungo un - davanti
|
||||||
|
{
|
||||||
|
if (rowValues[k].ToString() != "0" && rowValues[k].ToString().IndexOf("-")==-1) // se il valore non è 0 e non è negativo allora aggiunge il meno
|
||||||
|
{
|
||||||
|
dr[cont] = "-" + rowValues[k].ToString().Replace("\"", string.Empty);
|
||||||
|
}
|
||||||
|
if (rowValues[k].ToString() != "0" && rowValues[k].ToString().IndexOf("-") != -1) // se il valore non è 0 ed è negativo allora toglie il meno
|
||||||
|
{
|
||||||
|
dr[cont] = rowValues[k].ToString().Replace("\"", string.Empty).Replace("-",string.Empty);
|
||||||
|
}
|
||||||
|
if (rowValues[k].ToString() == "0") // se il valore e 0 non modifica niente
|
||||||
|
{
|
||||||
|
dr[cont] = "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else dr[cont] = rowValues[k].ToString().Replace("\"", string.Empty);
|
||||||
|
cont++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dtCsv.Rows.Add(dr); //add other rows
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return dtCsv;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvInputCsv_DataBinding(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (Session["dtInputFile"] != null)
|
||||||
|
{
|
||||||
|
gvInputCsv.DataSource = (DataTable)Session["dtInputFile"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void btnElaboraInput_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Serve solo per effettuare il postback e bindare gvInputCsv al datatable contenuto in Session["dtResetFile"]
|
||||||
|
|
||||||
|
// Importa struttura colonne file excel in output per Guardian
|
||||||
|
dtOutputTrades = ElaboraTemplateGuardian(Server.MapPath("~/App_Data/TEMPLATE/sample_imp_tra.xlsx"), "Foglio1"); // Importa colonne file template in output per Guardian
|
||||||
|
|
||||||
|
//if (radioButtonList.SelectedIndex == 0) ElaboraMSResetFile(); // Elabora reset file
|
||||||
|
ElaboraOutputFile();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ElaboraOutputFile()
|
||||||
|
{
|
||||||
|
DataTable dt = (DataTable)Session["dtInputFile"];
|
||||||
|
DataTable dtPlurima10 = new DataTable();
|
||||||
|
dtPlurima10.Columns.Add("Conto", typeof(string));
|
||||||
|
dtPlurima10.Columns.Add("Descrizione", typeof(string));
|
||||||
|
dtPlurima10.Columns.Add("Currency", typeof(string));
|
||||||
|
dtPlurima10.Columns.Add("RBC", typeof(double));
|
||||||
|
dtPlurima10.Columns.Add("Guardian", typeof(double));
|
||||||
|
DataTable dtPlurimaVB = new DataTable();
|
||||||
|
dtPlurimaVB.Columns.Add("Conto", typeof(string));
|
||||||
|
dtPlurimaVB.Columns.Add("Descrizione", typeof(string));
|
||||||
|
dtPlurimaVB.Columns.Add("Currency", typeof(string));
|
||||||
|
dtPlurimaVB.Columns.Add("RBC", typeof(double));
|
||||||
|
dtPlurimaVB.Columns.Add("Guardian", typeof(double));
|
||||||
|
if (dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
string currency = string.Empty;
|
||||||
|
string cod_rap = string.Empty;
|
||||||
|
foreach (DataRow rigaInput in dt.Rows)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
RBC Guardian
|
||||||
|
InitialMargin ETD Initial Marg
|
||||||
|
MarginExcessDeficit ETD Cash
|
||||||
|
OpenTradeEquity ETD Open Trade
|
||||||
|
*/
|
||||||
|
// Rileva valori da cui poi creare le righe se sono > 0
|
||||||
|
if (rigaInput["AccountID"].ToString() == "C77261") cod_rap = "10CONV";
|
||||||
|
if (rigaInput["AccountID"].ToString() == "C77260") cod_rap = "DB6289";
|
||||||
|
currency = rigaInput["Currency"].ToString();
|
||||||
|
double initialMargin, marginExcessDeficit, openTradeEquity, initialMarginGDN, marginExcessDeficitGDN, openTradeEquityGDN = 0;
|
||||||
|
double diffInitialMargin, diffMarginExcessDeficit, diffOpenTradeEquity = 0;
|
||||||
|
string temp = string.Empty;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Elabora InitialMargin (ETD Initial Marg)
|
||||||
|
///
|
||||||
|
Double.TryParse(rigaInput["InitialMargin"].ToString().Replace(".", ","), out initialMargin); // Nota: E' stato necessario settare in aspx nella direttiva <%@ Page: UICulture="it" Culture="it-IT" e fare override InitializeCulture altrimenti in produzione prendeva il settaggio USA per i decimali con il punto come decimale invece della virgola !
|
||||||
|
string cod_dep_liq_initialMarginGDN = String.Empty;
|
||||||
|
string descrInitialMarginGDN = String.Empty;
|
||||||
|
|
||||||
|
temp = execSP_Scalar("SELECT tmp2.qta FROM tmppostit2 tmp2 LEFT JOIN tit t ON(t.cod_tit = tmp2.cod_tit) LEFT JOIN rap r ON(r.cod_rap = tmp2.cod_rap) WHERE r.cod_rap = '" + cod_rap + "' and t.cod_div = '" + currency + "' and t.des_tit like '%ETD Initial Marg%' AND r.cod_sta in ('ATTIVO', 'PENDING') LIMIT 1; ");
|
||||||
|
if (!String.IsNullOrEmpty(temp)) initialMarginGDN = Convert.ToDouble(temp);
|
||||||
|
else initialMarginGDN = 0;
|
||||||
|
cod_dep_liq_initialMarginGDN = execSP_Scalar("SELECT d.cod_dep_liq from depliq d where d.cod_rap = '" + cod_rap + "' and d.cod_div = '" + currency + "' and d.des_dep_liq like '%ETD Initial Marg%';");
|
||||||
|
descrInitialMarginGDN = execSP_Scalar("SELECT t.des_tit FROM depliq d LEFT JOIN tit t ON (t.cod_tit = d.cod_dep_liq) WHERE d.cod_rap = '" + cod_rap + "' and d.cod_div = '" + currency + "' and d.des_dep_liq like '%ETD Initial Marg%';");
|
||||||
|
|
||||||
|
diffInitialMargin = Math.Round(initialMargin - initialMarginGDN, 2);
|
||||||
|
if (diffInitialMargin != 0) CreaRiga(currency, cod_rap, rigaInput, cod_dep_liq_initialMarginGDN, diffInitialMargin);
|
||||||
|
|
||||||
|
if (cod_rap == "10CONV") CreaRigaPlurima(cod_dep_liq_initialMarginGDN, descrInitialMarginGDN, currency, initialMargin, initialMarginGDN, dtPlurima10);
|
||||||
|
if (cod_rap == "DB6289") CreaRigaPlurima(cod_dep_liq_initialMarginGDN, descrInitialMarginGDN, currency, initialMargin, initialMarginGDN, dtPlurimaVB);
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Elabora MarginExcessDeficit (ETD Cash)
|
||||||
|
///
|
||||||
|
Double.TryParse(rigaInput["MarginExcessDeficit"].ToString().Replace(".", ","), out marginExcessDeficit);
|
||||||
|
string cod_dep_liq_marginExcessDeficitGDN = String.Empty;
|
||||||
|
string descrMarginExcessDeficitGDN = string.Empty;
|
||||||
|
temp = execSP_Scalar("SELECT tmp2.qta FROM tmppostit2 tmp2 LEFT JOIN tit t ON (t.cod_tit = tmp2.cod_tit) LEFT JOIN rap r ON (r.cod_rap = tmp2.cod_rap) WHERE r.cod_rap = '" + cod_rap + "' and t.cod_div = '" + currency + "' and t.des_tit like '%ETD Cash%' AND r.cod_sta in ('ATTIVO', 'PENDING') LIMIT 1;");
|
||||||
|
if (!String.IsNullOrEmpty(temp)) marginExcessDeficitGDN = Convert.ToDouble(temp);
|
||||||
|
else marginExcessDeficitGDN = 0;
|
||||||
|
cod_dep_liq_marginExcessDeficitGDN = execSP_Scalar("SELECT d.cod_dep_liq from depliq d where d.cod_rap = '" + cod_rap + "' and d.cod_div = '" + currency + "' and d.des_dep_liq like '%ETD Cash%';");
|
||||||
|
descrMarginExcessDeficitGDN = execSP_Scalar("SELECT t.des_tit FROM depliq d LEFT JOIN tit t ON (t.cod_tit = d.cod_dep_liq) WHERE d.cod_rap = '" + cod_rap + "' and d.cod_div = '" + currency + "' and d.des_dep_liq like '%ETD Cash%';");
|
||||||
|
|
||||||
|
diffMarginExcessDeficit = Math.Round(marginExcessDeficit - marginExcessDeficitGDN, 2);
|
||||||
|
if (diffMarginExcessDeficit != 0) CreaRiga(currency, cod_rap, rigaInput, cod_dep_liq_marginExcessDeficitGDN, diffMarginExcessDeficit);
|
||||||
|
|
||||||
|
if (cod_rap == "10CONV") CreaRigaPlurima(cod_dep_liq_marginExcessDeficitGDN, descrMarginExcessDeficitGDN, currency, marginExcessDeficit, marginExcessDeficitGDN, dtPlurima10);
|
||||||
|
if (cod_rap == "DB6289") CreaRigaPlurima(cod_dep_liq_marginExcessDeficitGDN, descrMarginExcessDeficitGDN, currency, marginExcessDeficit, marginExcessDeficitGDN, dtPlurimaVB);
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Elabora OpenTradeEquity (ETD Open Trade)
|
||||||
|
///
|
||||||
|
Double.TryParse(rigaInput["OpenTradeEquity"].ToString().Replace(".", ","), out openTradeEquity);
|
||||||
|
string cod_dep_liq_openTradeEquityGDN = String.Empty;
|
||||||
|
string descrOpenTradeEquityGDN = String.Empty;
|
||||||
|
|
||||||
|
temp = execSP_Scalar("SELECT tmp2.qta FROM tmppostit2 tmp2 LEFT JOIN tit t ON (t.cod_tit = tmp2.cod_tit) LEFT JOIN rap r ON (r.cod_rap = tmp2.cod_rap) WHERE r.cod_rap = '" + cod_rap + "' and t.cod_div = '" + currency + "' and t.des_tit like '%ETD Open Trade%' AND r.cod_sta in ('ATTIVO', 'PENDING') LIMIT 1;");
|
||||||
|
if (!String.IsNullOrEmpty(temp)) openTradeEquityGDN = Convert.ToDouble(temp);
|
||||||
|
else openTradeEquityGDN = 0;
|
||||||
|
cod_dep_liq_openTradeEquityGDN = execSP_Scalar("SELECT d.cod_dep_liq from depliq d where d.cod_rap = '" + cod_rap + "' and d.cod_div = '" + currency + "' and d.des_dep_liq like '%ETD Open Trade%';");
|
||||||
|
descrOpenTradeEquityGDN = execSP_Scalar("SELECT t.des_tit FROM depliq d LEFT JOIN tit t ON (t.cod_tit = d.cod_dep_liq) WHERE d.cod_rap = '" + cod_rap + "' and d.cod_div = '" + currency + "' and d.des_dep_liq like '%ETD Open Trade%';");
|
||||||
|
|
||||||
|
diffOpenTradeEquity = Math.Round(openTradeEquity - openTradeEquityGDN, 2);
|
||||||
|
if (diffOpenTradeEquity != 0) CreaRiga(currency, cod_rap, rigaInput, cod_dep_liq_openTradeEquityGDN, diffOpenTradeEquity);
|
||||||
|
|
||||||
|
if (cod_rap == "10CONV") CreaRigaPlurima(cod_dep_liq_openTradeEquityGDN, descrOpenTradeEquityGDN, currency, openTradeEquity, openTradeEquityGDN, dtPlurima10);
|
||||||
|
if (cod_rap == "DB6289") CreaRigaPlurima(cod_dep_liq_openTradeEquityGDN, descrOpenTradeEquityGDN, currency, openTradeEquity, openTradeEquityGDN, dtPlurimaVB);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
if (dtOutputTrades.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
Session["dtOutputTrades"] = (DataTable)dtOutputTrades;
|
||||||
|
gvOutput.DataSource = Session["dtOutputTrades"];
|
||||||
|
gvOutput.DataBind();
|
||||||
|
|
||||||
|
Session["dtPlurima10"] = (DataTable)dtPlurima10;
|
||||||
|
gvPlurima10.DataSource = Session["dtPlurima10"];
|
||||||
|
gvPlurima10.DataBind();
|
||||||
|
|
||||||
|
Session["dtPlurimaVB"] = (DataTable)dtPlurimaVB;
|
||||||
|
gvPlurimaVB.DataSource = Session["dtPlurimaVB"];
|
||||||
|
gvPlurimaVB.DataBind();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CreaRigaPlurima(string Conto, string DescrizioneConto, string Currency, double RBCValue, double GuardianValue, DataTable dtPlurima)
|
||||||
|
{
|
||||||
|
if (!String.IsNullOrEmpty(Conto))
|
||||||
|
{
|
||||||
|
DataRow drPlurima = dtPlurima.NewRow();
|
||||||
|
drPlurima["Conto"] = Conto;
|
||||||
|
drPlurima["Descrizione"] = DescrizioneConto;
|
||||||
|
drPlurima["Currency"] = Currency;
|
||||||
|
drPlurima["RBC"] = RBCValue;
|
||||||
|
drPlurima["Guardian"] = GuardianValue;
|
||||||
|
dtPlurima.Rows.Add(drPlurima);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CreaRiga(string currency, string cod_rap, DataRow rigaInput, string cod_dep_liq, double diffValori)
|
||||||
|
{
|
||||||
|
DataRow dr1 = dtOutputTrades.NewRow();
|
||||||
|
|
||||||
|
dr1["spuntato"] = "S";
|
||||||
|
dr1["data_ope"] = DateTime.ParseExact(rigaInput["BusinessDate"].ToString(), "yyyyMMdd", CultureInfo.InvariantCulture).ToString("dd.MM.yyyy");
|
||||||
|
dr1["data_ins"] = DateTime.ParseExact(rigaInput["BusinessDate"].ToString(), "yyyyMMdd", CultureInfo.InvariantCulture).ToString("dd.MM.yyyy");
|
||||||
|
dr1["data_val"] = DateTime.ParseExact(rigaInput["BusinessDate"].ToString(), "yyyyMMdd", CultureInfo.InvariantCulture).ToString("dd.MM.yyyy");
|
||||||
|
if (diffValori <= 0) dr1["cod_ope"] = "DEBTMAR";
|
||||||
|
else dr1["cod_ope"] = "CREDMAR";
|
||||||
|
dr1["cod_rap"] = cod_rap;
|
||||||
|
//string cod_tit = execSP_Scalar("SELECT t.cod_tit FROM tmppostit2 tmp2 LEFT JOIN tit t ON (t.cod_tit = tmp2.cod_tit) LEFT JOIN rap r ON (r.cod_rap = tmp2.cod_rap) WHERE r.cod_rap = '" + cod_rap + "' and t.cod_div = '" + currency + "' and(t.options = 'S' or t.cod_tiptit like 'O1%') AND r.cod_sta in ('ATTIVO', 'PENDING') LIMIT 1;");
|
||||||
|
string cod_tit = execSP_Scalar("SELECT t.cod_tit FROM tra LEFT JOIN tit t ON (t.cod_tit = tra.cod_tit) LEFT JOIN rap r ON (r.cod_rap = tra.cod_rap) WHERE r.cod_rap = '" + cod_rap + "' and t.cod_div = '" + currency + "' and (t.options = 'S' or t.cod_tiptit like 'O1%') AND r.cod_sta in ('ATTIVO', 'PENDING') ORDER BY t.data_ins desc LIMIT 1;");
|
||||||
|
dr1["cod_tit"] = cod_tit;
|
||||||
|
dr1["cod_div_tit"] = currency;
|
||||||
|
dr1["cod_ctp"] = "RBEF";
|
||||||
|
dr1["cod_dep_liq"] = cod_dep_liq;
|
||||||
|
dr1["qta"] = diffValori;
|
||||||
|
dr1["ctv_tit_dn"] = diffValori;
|
||||||
|
dr1["ctv_tot_dn"] = diffValori;
|
||||||
|
dr1["ctv_tit_dr"] = diffValori;
|
||||||
|
dr1["ctv_tot_dr"] = diffValori;
|
||||||
|
|
||||||
|
dtOutputTrades.Rows.Add(dr1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string execSP_Scalar(string query)
|
||||||
|
{
|
||||||
|
object objResult;
|
||||||
|
string result = String.Empty;
|
||||||
|
using (var con = new MySqlConnection(Properties.Settings.Default.mySqlConnection))
|
||||||
|
{
|
||||||
|
var cmd = new MySqlCommand
|
||||||
|
{
|
||||||
|
CommandText = query,
|
||||||
|
CommandType = CommandType.Text,
|
||||||
|
Connection = con
|
||||||
|
};
|
||||||
|
cmd.CommandTimeout = 0;
|
||||||
|
con.Open(); // Open the SqlConnection.
|
||||||
|
objResult = cmd.ExecuteScalar();
|
||||||
|
|
||||||
|
if (objResult != null) result = objResult.ToString();
|
||||||
|
}
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DataTable ElaboraTemplateGuardian(string file, string sheetName)
|
||||||
|
{
|
||||||
|
// Open the Excel file using ClosedXML.
|
||||||
|
// Keep in mind the Excel file cannot be open when trying to read it
|
||||||
|
using (XLWorkbook workBook = new XLWorkbook(file))
|
||||||
|
{
|
||||||
|
//Read the first Sheet from Excel file.
|
||||||
|
IXLWorksheet workSheet = workBook.Worksheet(1);
|
||||||
|
|
||||||
|
//Create a new DataTable.
|
||||||
|
DataTable dt = new DataTable();
|
||||||
|
|
||||||
|
//Loop through the Worksheet rows.
|
||||||
|
bool firstRow = true;
|
||||||
|
foreach (IXLRow row in workSheet.Rows())
|
||||||
|
{
|
||||||
|
//Use the first row to add columns to DataTable.
|
||||||
|
if (firstRow)
|
||||||
|
{
|
||||||
|
foreach (IXLCell cell in row.Cells())
|
||||||
|
{
|
||||||
|
// Definisco tipo di colonna in tabella dt a seconda delle colonne di partenza del template
|
||||||
|
switch (cell.Value.ToString())
|
||||||
|
{
|
||||||
|
//case "qta":
|
||||||
|
// dt.Columns.Add(cell.Value.ToString(),typeof(Int64));
|
||||||
|
// break;
|
||||||
|
|
||||||
|
case "qta":
|
||||||
|
case "prezzo":
|
||||||
|
case "cambiom":
|
||||||
|
case "ctv_tit_dr":
|
||||||
|
case "coma_dep_dr":
|
||||||
|
case "spese_dr":
|
||||||
|
case "ctv_tot_dr":
|
||||||
|
case "imposte_dr":
|
||||||
|
case "ctv_tit_dn":
|
||||||
|
case "imposte_dn":
|
||||||
|
case "ctv_tot_dn":
|
||||||
|
dt.Columns.Add(cell.Value.ToString(), typeof(double));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
dt.Columns.Add(cell.Value.ToString());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// dt.Columns.Add(cell.Value.ToString());
|
||||||
|
}
|
||||||
|
firstRow = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Add rows to DataTable.
|
||||||
|
dt.Rows.Add();
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
foreach (IXLCell cell in row.Cells(row.FirstCellUsed().Address.ColumnNumber, row.LastCellUsed().Address.ColumnNumber))
|
||||||
|
{
|
||||||
|
dt.Rows[dt.Rows.Count - 1][i] = cell.Value.ToString();
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return dt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void btnOutputGuardian_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Metodo 1) - Crea file di output in formato .xlsx per guardian relativo a MS Trades
|
||||||
|
// Prepare the response
|
||||||
|
string fileType = string.Empty;
|
||||||
|
string excelTrades = string.Format("rbccm_margins_{0:yyyyMMdd}.xlsx", DateTime.Today.Date);
|
||||||
|
HttpResponse httpResponse = Response;
|
||||||
|
httpResponse.Clear();
|
||||||
|
httpResponse.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
||||||
|
httpResponse.AddHeader("content-disposition", string.Format("attachment;filename={0}", excelTrades));
|
||||||
|
|
||||||
|
// Flush the workbook to the Response.OutputStream
|
||||||
|
DataTable dt = (DataTable)Session["dtOutputTrades"];
|
||||||
|
using (var workbook = new XLWorkbook())
|
||||||
|
{
|
||||||
|
using (MemoryStream memoryStream = new MemoryStream())
|
||||||
|
{
|
||||||
|
workbook.Worksheets.Add(dt, "Foglio1");
|
||||||
|
workbook.SaveAs(memoryStream);
|
||||||
|
memoryStream.WriteTo(httpResponse.OutputStream);
|
||||||
|
memoryStream.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
httpResponse.End();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvInputCsv_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.RowType != GridViewRowType.Data) return;
|
||||||
|
|
||||||
|
// Colora in modo differente le righe relative ai due fondi C77261 (10CONV) e C77260 (DB6289)
|
||||||
|
if ((string)e.GetValue("AccountID") == "C77261") e.Row.BackColor = Color.LightGray;
|
||||||
|
if ((string)e.GetValue("AccountID") == "C77260") e.Row.BackColor = Color.LightSteelBlue;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvOutput_DataBinding(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (Session["dtOutputTrades"] != null)
|
||||||
|
{
|
||||||
|
gvOutput.DataSource = (DataTable)Session["dtOutputTrades"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvPlurima10_DataBinding(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (Session["dtPlurima10"] != null)
|
||||||
|
{
|
||||||
|
gvPlurima10.DataSource = (DataTable)Session["dtPlurima10"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvPlurimaVB_DataBinding(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (Session["dtPlurimaVB"] != null)
|
||||||
|
{
|
||||||
|
gvPlurimaVB.DataSource = (DataTable)Session["dtPlurimaVB"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
150
OlympiaIntranet/Margini.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet {
|
||||||
|
|
||||||
|
|
||||||
|
public partial class Margini {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxFormLayout1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxFormLayout ASPxFormLayout1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// uploadControl control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxUploadControl uploadControl;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnElaboraInput control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton btnElaboraInput;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnOutputGuardian control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton btnOutputGuardian;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxRoundPanel1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxRoundPanel ASPxRoundPanel1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxRoundPanel4 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxRoundPanel ASPxRoundPanel4;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxPageControl1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPageControl ASPxPageControl1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvPlurima10 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvPlurima10;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvPlurimaVB control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvPlurimaVB;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxRoundPanel2 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxRoundPanel ASPxRoundPanel2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvInputCsv control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvInputCsv;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxRoundPanel3 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxRoundPanel ASPxRoundPanel3;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvOutput control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvOutput;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxGridViewExporter1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridViewExporter ASPxGridViewExporter1;
|
||||||
|
}
|
||||||
|
}
|
||||||
114
OlympiaIntranet/Mifir.aspx
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Mifir.aspx.cs" Inherits="OlympiaIntranet.Mifir" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<div>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxUploadControl ID="ASPxUploadControl1" runat="server" UploadMode="Auto" Width="280px" AutoStartUpload="True" OnFileUploadComplete="ASPxUploadControl1_FileUploadComplete" Theme="Aqua">
|
||||||
|
<AdvancedModeSettings EnableDragAndDrop="True">
|
||||||
|
</AdvancedModeSettings>
|
||||||
|
</dx:ASPxUploadControl>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxButton ID="btnProcessaDatiUBS" runat="server" OnClick="btnProcessaDatiUBS_Click" Style="margin-bottom: 0px" Text="Processa dati UBS" Theme="Aqua">
|
||||||
|
<Image IconID="actions_additem_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Data Banca Sella
|
||||||
|
<dx:ASPxDateEdit ID="dateeditBancaSella" runat="server" Theme="Aqua" EditFormat="Custom" EditFormatString="dd/MM/yyyy">
|
||||||
|
</dx:ASPxDateEdit>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxButton ID="btnProcessaDatiBancaSella" runat="server" OnClick="btnProcessaDatiBancaSella_Click" Style="margin-bottom: 0px" Text="Processa dati Banca Sella" Theme="Aqua">
|
||||||
|
<Image IconID="programming_technology_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxButton ID="btnCreaOutput" runat="server" OnClick="btnCreaOutput_Click" Style="margin-bottom: 0px" Text="Genera Csv per MiFIR" Theme="Aqua" AutoPostBack="False">
|
||||||
|
<Image IconID="export_exporttocsv_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<dx:ASPxPageControl ID="pageControl" runat="server" ActiveTabIndex="0" Theme="Aqua">
|
||||||
|
<TabPages>
|
||||||
|
<dx:TabPage Name="tpDatiUBS" Text="Dati UBS">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<dx:ASPxGridView ID="gvDatiUBS" runat="server" Theme="Aqua" OnHtmlRowPrepared="gvDatiUBS_HtmlRowPrepared" OnRowUpdating="gvDatiUBS_RowUpdating">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
|
||||||
|
<SettingsEditing Mode="Inline">
|
||||||
|
</SettingsEditing>
|
||||||
|
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>
|
||||||
|
<dx:TabPage Name="tpOutputXLS" Text="Output Csv">
|
||||||
|
<ContentCollection>
|
||||||
|
<dx:ContentControl runat="server">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="lblDatiUBS" runat="server" ForeColor="LightGreen" Text=" " Font-Bold="True"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxLabel ID="lblDatiBancaSella" runat="server" ForeColor="LightBlue" Text=" " Font-Bold="True"></dx:ASPxLabel>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<dx:ASPxGridView ID="gvOuputExcel" runat="server" Theme="Aqua" EnableCallBacks="False" OnHtmlRowPrepared="gvOuputExcel_HtmlRowPrepared">
|
||||||
|
<SettingsAdaptivity>
|
||||||
|
<AdaptiveDetailLayoutProperties ColCount="1"></AdaptiveDetailLayoutProperties>
|
||||||
|
</SettingsAdaptivity>
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
<EditFormLayoutProperties ColCount="1"></EditFormLayoutProperties>
|
||||||
|
</dx:ASPxGridView>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</dx:ContentControl>
|
||||||
|
</ContentCollection>
|
||||||
|
</dx:TabPage>
|
||||||
|
</TabPages>
|
||||||
|
</dx:ASPxPageControl>
|
||||||
|
<dx:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="gvOuputExcel"></dx:ASPxGridViewExporter>
|
||||||
|
<dx:ASPxLabel ID="lblError" runat="server" Text="" ForeColor="Red" Font-Bold="true"></dx:ASPxLabel>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
632
OlympiaIntranet/Mifir.aspx.cs
Normal file
@@ -0,0 +1,632 @@
|
|||||||
|
using DevExpress.Export;
|
||||||
|
using DevExpress.XtraPrinting;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
using DevExpress.Web;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Text;
|
||||||
|
using MySqlConnector;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class Mifir : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
DataTable dtOutputExcel;
|
||||||
|
DataTable dtDatiUBS;
|
||||||
|
//DataTable dtProcessedCSV;
|
||||||
|
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (HttpContext.Current.User.Identity.IsAuthenticated == false)
|
||||||
|
{
|
||||||
|
Response.Redirect("~/SignIn.aspx");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Session["DatiUBS"] != null)
|
||||||
|
{
|
||||||
|
gvDatiUBS.DataSource = (DataTable)Session["DatiUBS"];
|
||||||
|
gvDatiUBS.DataBind();
|
||||||
|
}
|
||||||
|
if (Session["outputTable"] != null)
|
||||||
|
{
|
||||||
|
gvOuputExcel.DataSource = (DataTable)Session["outputTable"];
|
||||||
|
gvOuputExcel.DataBind();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IsPostBack) dateeditBancaSella.Date = DateTime.Now.Date; // setta la data odierna solo la prima volta, se è un postback no altrimenti se viene cambiata la data poi la risetta a oggi
|
||||||
|
}
|
||||||
|
|
||||||
|
// ref link: https://github.com/DevExpress-Examples/bind-a-grid-to-a-datatable-via-code-e168
|
||||||
|
private DataTable ProcessaInputDatiUBS()
|
||||||
|
{
|
||||||
|
lblError.Text = "";
|
||||||
|
|
||||||
|
// dtDatiUBS è popolata in evento ASPxUploadControl1_FileUploadComplete in Session["DatiUBS"]
|
||||||
|
DataTable dtDatiUBS = new DataTable();
|
||||||
|
dtDatiUBS = (DataTable)Session["DatiUBS"];
|
||||||
|
if (dtDatiUBS.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
// Aggiunge colonna a dt
|
||||||
|
DataTable dt = new DataTable();
|
||||||
|
foreach (DataColumn column in dtDatiUBS.Columns)
|
||||||
|
{
|
||||||
|
dt.Columns.Add(column.ColumnName);
|
||||||
|
}
|
||||||
|
dt.Columns.Add("PROC1"); // Colonna che conterrà elaborazione procedura1
|
||||||
|
dt.Columns.Add("KeyID"); // Colonna che conterrà primary key
|
||||||
|
dt.PrimaryKey = new DataColumn[] { dt.Columns["KeyID"] }; // setta primary key per datatable dt
|
||||||
|
|
||||||
|
// Aggiunge righe a dt e per ogni riga esegue una select
|
||||||
|
int keyID = 1; // chiave primaria per dt
|
||||||
|
foreach (DataRow row in dtDatiUBS.Rows)
|
||||||
|
{
|
||||||
|
DataRow dr = dt.NewRow();
|
||||||
|
using (var con = new SqlConnection(Properties.Settings.Default.SqlConnection))
|
||||||
|
{
|
||||||
|
SqlCommand cmd = con.CreateCommand();
|
||||||
|
//string query = string.Format("SELECT distinct tra.cod_ope from tra LEFT JOIN tit ON tra.cod_tit=tit.cod_tit WHERE tit.cod_isin ='{0}' AND ABS(tra.qta)={1} AND tra.data_ope > date_sub(CURDATE(), INTERVAL 10 DAY) and tra.cod_ope in ('B','S')", row["TAG_41"], row["TAG_30"]);
|
||||||
|
cmd.CommandType = CommandType.StoredProcedure;
|
||||||
|
cmd.CommandText = "mifir_UBS_codope";
|
||||||
|
cmd.Parameters.Add("@ISIN", SqlDbType.VarChar).Value = row["TAG_41"];
|
||||||
|
cmd.Parameters.Add("@Qta", SqlDbType.Int).Value = row["TAG_30"];
|
||||||
|
con.Open(); // Open the SqlConnection.
|
||||||
|
SqlDataReader dataReader = cmd.ExecuteReader();
|
||||||
|
var dtResult = new DataTable();
|
||||||
|
dtResult.Load(dataReader);
|
||||||
|
if (dtResult.Rows.Count == 1) dr["PROC1"] = dtResult.Rows[0][0].ToString(); // 'S' o 'B'
|
||||||
|
else dr["PROC1"] = "";
|
||||||
|
}
|
||||||
|
int col = 0;
|
||||||
|
foreach (var item in row.ItemArray)
|
||||||
|
{
|
||||||
|
dr[col] = item;
|
||||||
|
col++;
|
||||||
|
}
|
||||||
|
dr["KeyID"] = keyID;
|
||||||
|
dt.Rows.Add(dr);
|
||||||
|
keyID++;
|
||||||
|
}
|
||||||
|
if (dt != null)
|
||||||
|
{
|
||||||
|
Session["DatiUBS"] = dt;
|
||||||
|
gvDatiUBS.DataSource = dt;
|
||||||
|
|
||||||
|
// Aggiunge colonne a gvInputCSV
|
||||||
|
gvDatiUBS.Columns.Clear();
|
||||||
|
foreach (DataColumn column in dtDatiUBS.Columns)
|
||||||
|
{
|
||||||
|
GridViewDataColumn c = new GridViewDataColumn();
|
||||||
|
c.FieldName = column.ColumnName;
|
||||||
|
gvDatiUBS.Columns.Add(c);
|
||||||
|
}
|
||||||
|
GridViewDataColumn d = new GridViewDataColumn();
|
||||||
|
d.FieldName = "PROC1";
|
||||||
|
gvDatiUBS.Columns.Add(d);
|
||||||
|
GridViewDataColumn e = new GridViewDataColumn();
|
||||||
|
e.FieldName = "KeyID";
|
||||||
|
gvDatiUBS.Columns.Add(d);
|
||||||
|
gvDatiUBS.KeyFieldName = "KeyID";
|
||||||
|
GridViewCommandColumn cc = new GridViewCommandColumn();
|
||||||
|
gvDatiUBS.Columns.Add(cc);
|
||||||
|
cc.ShowEditButton = true;
|
||||||
|
cc.ShowNewButton = false;
|
||||||
|
cc.ShowDeleteButton = false;
|
||||||
|
cc.ShowCancelButton = true;
|
||||||
|
cc.ShowUpdateButton = true;
|
||||||
|
|
||||||
|
gvDatiUBS.DataBind();
|
||||||
|
}
|
||||||
|
return (dt);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lblError.Text = "CSV non rilevato!";
|
||||||
|
return (null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private DataTable CreateOutputDataTable()
|
||||||
|
{
|
||||||
|
// Crea struttura datatable per output file
|
||||||
|
DataTable dtOutput = new DataTable();
|
||||||
|
dtOutput.Columns.Add("Report Status");
|
||||||
|
dtOutput.Columns.Add("Transaction Reference Number");
|
||||||
|
dtOutput.Columns.Add("Venue Transaction ID");
|
||||||
|
dtOutput.Columns.Add("Submitting Entity ID");
|
||||||
|
dtOutput.Columns.Add("Executing Entity ID");
|
||||||
|
dtOutput.Columns.Add("Investment Firm Indicator");
|
||||||
|
dtOutput.Columns.Add("Buyer ID Type");
|
||||||
|
dtOutput.Columns.Add("Buyer ID Sub Type");
|
||||||
|
dtOutput.Columns.Add("Buyer ID");
|
||||||
|
dtOutput.Columns.Add("Buyer Country of Branch");
|
||||||
|
dtOutput.Columns.Add("Buyer First Name");
|
||||||
|
dtOutput.Columns.Add("Buyer Surname");
|
||||||
|
dtOutput.Columns.Add("Buyer DOB");
|
||||||
|
dtOutput.Columns.Add("Buyer Decision Maker ID Type");
|
||||||
|
dtOutput.Columns.Add("Buyer Decision Maker ID Sub Type");
|
||||||
|
dtOutput.Columns.Add("Buyer Decision Maker ID");
|
||||||
|
dtOutput.Columns.Add("Buyer Decision Maker First Name");
|
||||||
|
dtOutput.Columns.Add("Buyer Decision Maker Surname");
|
||||||
|
dtOutput.Columns.Add("Buyer Decision Maker DOB");
|
||||||
|
dtOutput.Columns.Add("Seller ID Type");
|
||||||
|
dtOutput.Columns.Add("Seller ID Sub Type");
|
||||||
|
dtOutput.Columns.Add("Seller ID");
|
||||||
|
dtOutput.Columns.Add("Seller Country of Branch");
|
||||||
|
dtOutput.Columns.Add("Seller First Name");
|
||||||
|
dtOutput.Columns.Add("Seller Surname");
|
||||||
|
dtOutput.Columns.Add("Seller DOB");
|
||||||
|
dtOutput.Columns.Add("Seller Decision Maker ID Type");
|
||||||
|
dtOutput.Columns.Add("Seller Decision Maker ID Sub Type");
|
||||||
|
dtOutput.Columns.Add("Seller Decision Maker ID");
|
||||||
|
dtOutput.Columns.Add("Seller Decision Maker First Name");
|
||||||
|
dtOutput.Columns.Add("Seller Decision Maker Surname");
|
||||||
|
dtOutput.Columns.Add("Seller Decision Maker DOB");
|
||||||
|
dtOutput.Columns.Add("Order Transmission Indicator");
|
||||||
|
dtOutput.Columns.Add("Buyer Transmitter ID");
|
||||||
|
dtOutput.Columns.Add("Seller Transmitter ID");
|
||||||
|
dtOutput.Columns.Add("Trading Date Time");
|
||||||
|
dtOutput.Columns.Add("Trading Capacity");
|
||||||
|
dtOutput.Columns.Add("Quantity");
|
||||||
|
dtOutput.Columns.Add("Quantity Type");
|
||||||
|
dtOutput.Columns.Add("Quantity Currency");
|
||||||
|
dtOutput.Columns.Add("Derivative Notional Change");
|
||||||
|
dtOutput.Columns.Add("Price");
|
||||||
|
dtOutput.Columns.Add("Price Type");
|
||||||
|
dtOutput.Columns.Add("Price Currency");
|
||||||
|
dtOutput.Columns.Add("Net Amount");
|
||||||
|
dtOutput.Columns.Add("Venue");
|
||||||
|
dtOutput.Columns.Add("Country of Branch");
|
||||||
|
dtOutput.Columns.Add("Up-Front Payment");
|
||||||
|
dtOutput.Columns.Add("Up-Front Payment Currency");
|
||||||
|
dtOutput.Columns.Add("Complex Trade Component ID");
|
||||||
|
dtOutput.Columns.Add("Instrument ID");
|
||||||
|
dtOutput.Columns.Add("Instrument ID Type");
|
||||||
|
dtOutput.Columns.Add("Instrument Name");
|
||||||
|
dtOutput.Columns.Add("Instrument Classification");
|
||||||
|
dtOutput.Columns.Add("Notional Currency 1");
|
||||||
|
dtOutput.Columns.Add("Notional Currency 2");
|
||||||
|
dtOutput.Columns.Add("Notional Currency 2 Type");
|
||||||
|
dtOutput.Columns.Add("Price Multiplier");
|
||||||
|
dtOutput.Columns.Add("UV Instrument Classification");
|
||||||
|
dtOutput.Columns.Add("Underlying Instrument ID");
|
||||||
|
dtOutput.Columns.Add("UV Index Classification");
|
||||||
|
dtOutput.Columns.Add("Underlying Index ID");
|
||||||
|
dtOutput.Columns.Add("Underlying Index Name");
|
||||||
|
dtOutput.Columns.Add("Underlying Index Term");
|
||||||
|
dtOutput.Columns.Add("Option Type");
|
||||||
|
dtOutput.Columns.Add("Strike Price");
|
||||||
|
dtOutput.Columns.Add("Strike Price Type");
|
||||||
|
dtOutput.Columns.Add("Strike Price Currency");
|
||||||
|
dtOutput.Columns.Add("Option Style");
|
||||||
|
dtOutput.Columns.Add("Maturity Date");
|
||||||
|
dtOutput.Columns.Add("Expiry Date");
|
||||||
|
dtOutput.Columns.Add("Delivery Type");
|
||||||
|
dtOutput.Columns.Add("Investment Decision ID Type");
|
||||||
|
dtOutput.Columns.Add("Investment Decision ID Sub Type");
|
||||||
|
dtOutput.Columns.Add("Investment Decision ID");
|
||||||
|
dtOutput.Columns.Add("Investment Decision Country of Branch");
|
||||||
|
dtOutput.Columns.Add("Firm Execution ID Type");
|
||||||
|
dtOutput.Columns.Add("Firm Execution ID Sub Type");
|
||||||
|
dtOutput.Columns.Add("Firm Execution ID");
|
||||||
|
dtOutput.Columns.Add("Firm Execution Country of Branch");
|
||||||
|
dtOutput.Columns.Add("Waiver Indicator");
|
||||||
|
dtOutput.Columns.Add("Short Selling Indicator");
|
||||||
|
dtOutput.Columns.Add("OTC Post Trade Indicator");
|
||||||
|
dtOutput.Columns.Add("Commodity Derivative Indicator");
|
||||||
|
dtOutput.Columns.Add("SFT Indicator");
|
||||||
|
dtOutput.Columns.Add("Internal Client Identification");
|
||||||
|
dtOutput.Columns.Add("Data Category");
|
||||||
|
|
||||||
|
return (dtOutput);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void btnCreaOutput_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Salva csv in db tabella MifirReport
|
||||||
|
SqlBulkCopyTable((DataTable)Session["outputTable"], "MifirReport");
|
||||||
|
|
||||||
|
// ref link: https://stackoverflow.com/questions/1746701/export-datatable-to-excel-file
|
||||||
|
lblError.Text = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ASPxGridViewExporter1.ExportSelectedRowsOnly = false;
|
||||||
|
ASPxGridViewExporter1.FileName = "Olympia_Wealth_Management_Ltd_MiFIR_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".csv";
|
||||||
|
CsvExportOptionsEx op = new CsvExportOptionsEx() { ExportType = ExportType.DataAware }; // in DataAware mode l'evento ASPxGridViewExporter_RenderBrick non viene eseguito!!
|
||||||
|
ASPxGridViewExporter1.WriteCsvToResponse(op);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
lblError.Text = ex.Message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SqlBulkCopyTable(DataTable dt, string sqlTable)
|
||||||
|
{
|
||||||
|
//var table = "Events";
|
||||||
|
using (var conn = new SqlConnection(Properties.Settings.Default.SqlConnection))
|
||||||
|
{
|
||||||
|
var bulkCopy = new SqlBulkCopy(conn) { DestinationTableName = sqlTable };
|
||||||
|
bulkCopy.BulkCopyTimeout = 6000;
|
||||||
|
conn.Open();
|
||||||
|
var schema = conn.GetSchema("Columns", new[] { null, null, sqlTable, null });
|
||||||
|
foreach (DataColumn schemaColumn in dt.Columns)
|
||||||
|
{
|
||||||
|
foreach (DataRow row in schema.Rows)
|
||||||
|
{
|
||||||
|
if (string.Equals(schemaColumn.ColumnName, (string)row["COLUMN_NAME"], StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
bulkCopy.ColumnMappings.Add(schemaColumn.ColumnName, (string)row["COLUMN_NAME"]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
bulkCopy.WriteToServer(dt);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
lblError.Text = ex.Message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void Flusso_BancaSella()
|
||||||
|
{
|
||||||
|
// Definizione datatable Input e Output
|
||||||
|
DataTable dtInput = new DataTable();
|
||||||
|
DataTable dtOutput = new DataTable();
|
||||||
|
string dataBancaSella = dateeditBancaSella.Date.Year+"-"+ dateeditBancaSella.Date.Month+"-"+dateeditBancaSella.Date.Day;
|
||||||
|
dtOutput = (DataTable)Session["outputTable"];
|
||||||
|
|
||||||
|
// Carica dati banca sella da Guardian in dtInput
|
||||||
|
string query = string.Empty;
|
||||||
|
//SqlConnection connSql = new SqlConnection(Properties.Settings.Default.DBSettings);
|
||||||
|
//SqlCommand cmdSql = connSql.CreateCommand();
|
||||||
|
//cmdSql.Parameters.Add("@date", SqlDbType.VarChar).Value = dataBancaSella;
|
||||||
|
//cmdSql.CommandText = "mifir_SELLA1";
|
||||||
|
//connSql.Open();
|
||||||
|
//query = cmdSql.ExecuteScalar().ToString();
|
||||||
|
//connSql.Close();
|
||||||
|
using (var connSql = new SqlConnection(Properties.Settings.Default.SqlConnection))
|
||||||
|
{
|
||||||
|
var cmdSql = new SqlCommand
|
||||||
|
{
|
||||||
|
CommandText = "mifir_SELLA1",
|
||||||
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
Connection = connSql
|
||||||
|
};
|
||||||
|
cmdSql.Parameters.Add("@date", SqlDbType.VarChar).Value = dataBancaSella;
|
||||||
|
connSql.Open();
|
||||||
|
query = cmdSql.ExecuteScalar().ToString();
|
||||||
|
connSql.Close();
|
||||||
|
}
|
||||||
|
// Scarica dati da Guardian
|
||||||
|
MySqlConnection conn = new MySqlConnection(Properties.Settings.Default.mySqlConnection);
|
||||||
|
MySqlCommand cmd = conn.CreateCommand();
|
||||||
|
cmd.CommandText = query;
|
||||||
|
conn.Open();
|
||||||
|
|
||||||
|
MySqlDataReader dataReader = cmd.ExecuteReader();
|
||||||
|
dtInput.Load(dataReader); // id,progr,sending_time,Dayofexec,OrdStatus,ISIN,cod_ope,ExecTime,QtyFilled,Price,CCY,netamount,divisore
|
||||||
|
conn.Close();
|
||||||
|
|
||||||
|
if (dtInput.Rows.Count == 0) return; // Esce se non ci sono record da guardian
|
||||||
|
|
||||||
|
lblDatiBancaSella.Text = String.Format("Record Banca Sella processati: {0}", dtInput.Rows.Count);
|
||||||
|
|
||||||
|
foreach (DataRow inputRow in dtInput.Rows)
|
||||||
|
{
|
||||||
|
DataRow dr = dtOutput.NewRow();
|
||||||
|
|
||||||
|
// Mappatura campi dtInput in dtOutput
|
||||||
|
dr["Report Status"] = "NEWT"; // col 1
|
||||||
|
dr["Transaction Reference Number"] = "A"+inputRow["id"].ToString() + inputRow["progr"].ToString(); // col 2
|
||||||
|
dr["Submitting Entity ID"] = "213800Y8S6ABNF5NCQ84"; // col 4
|
||||||
|
dr["Executing Entity ID"] = "213800Y8S6ABNF5NCQ84"; // col 5
|
||||||
|
dr["Investment Firm Indicator"] = "TRUE"; // col 6
|
||||||
|
dr["Buyer ID Type"] = "L"; // col 7
|
||||||
|
dr["Buyer ID"] = "549300I7OIUB41P86L19"; // col 9
|
||||||
|
if (inputRow["cod_ope"].ToString() == "B")
|
||||||
|
{
|
||||||
|
dr["Buyer Decision Maker ID Type"] = "L"; // col 14
|
||||||
|
dr["Buyer Decision Maker ID"] = "549300I7OIUB41P86L19"; // col 16
|
||||||
|
}
|
||||||
|
dr["Seller ID Type"] = "L"; // col 20
|
||||||
|
dr["Seller ID"] = "549300I7OIUB41P86L19"; // col 22
|
||||||
|
if (inputRow["cod_ope"].ToString() == "S")
|
||||||
|
{
|
||||||
|
dr["Seller Decision Maker ID Type"] = "L"; // col 27
|
||||||
|
dr["Seller Decision Maker ID"] = "549300I7OIUB41P86L19"; // col 29
|
||||||
|
}
|
||||||
|
dr["Order Transmission Indicator"] = "FALSE"; // col 33
|
||||||
|
dr["Trading Date Time"] = inputRow["ExecTime"]; // col 36
|
||||||
|
dr["Trading Capacity"] = "AOTC"; // col 37
|
||||||
|
dr["Quantity"] = inputRow["QtyFilled"].ToString().Replace(",", "."); // col 38
|
||||||
|
dr["Quantity Type"] = "UNIT"; // col 39
|
||||||
|
dr["Quantity Currency"] = inputRow["CCY"]; // col 40
|
||||||
|
dr["Price"] = inputRow["Price"].ToString().Replace(",", "."); // col 42
|
||||||
|
dr["Price Type"] = "MntryValAmt"; // col 43
|
||||||
|
dr["Price Currency"] = inputRow["CCY"]; // col 44
|
||||||
|
dr["Net Amount"] = inputRow["netamount"].ToString().Replace(",","."); // col 45
|
||||||
|
dr["Venue"] = "XOFF"; // col 46
|
||||||
|
dr["Instrument ID Type"] = "FinInstrm.Id"; // col 51
|
||||||
|
dr["Instrument ID"] = inputRow["ISIN"]; // col 52
|
||||||
|
dr["Price Multiplier"] = inputRow["divisore"].ToString().Replace(",", "."); // col 58
|
||||||
|
dr["Firm Execution ID Type"] = "N"; // col 77
|
||||||
|
dr["Firm Execution ID Sub Type"] = "NIDN"; // col 78
|
||||||
|
dr["Firm Execution ID"] = "CRNFNC90L60C532V"; // col 79
|
||||||
|
dr["Firm Execution Country of Branch"] = "IT"; // col 80
|
||||||
|
dr["SFT Indicator"] = "FALSE"; // col 85
|
||||||
|
|
||||||
|
dtOutput.Rows.Add(dr);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dtOutput != null)
|
||||||
|
{
|
||||||
|
Session["outputTable"] = dtOutput;
|
||||||
|
gvOuputExcel.DataSource = Session["outputTable"];
|
||||||
|
gvOuputExcel.DataBind();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SalvaInCSV(DataTable dt) // non più usata
|
||||||
|
{
|
||||||
|
//string excelFileName = "Olympia_Wealth_Management_Ltd_MiFIR_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".csv";
|
||||||
|
//string attachment = String.Format("attachment; filename={0}", excelFileName);
|
||||||
|
//Response.ClearContent();
|
||||||
|
//Response.AddHeader("content-disposition", attachment);
|
||||||
|
//Response.ContentType = "text/csv";
|
||||||
|
|
||||||
|
//string[] columnNames = dt.Columns.Cast<DataColumn>().
|
||||||
|
// Select(column => column.ColumnName).
|
||||||
|
// ToArray();
|
||||||
|
//Response.Write(string.Join(",", columnNames));
|
||||||
|
//Response.Write("\n");
|
||||||
|
//foreach (DataRow row in dt.Rows)
|
||||||
|
//{
|
||||||
|
// string[] fields = row.ItemArray.Select(field => field.ToString()).
|
||||||
|
// ToArray();
|
||||||
|
// for (int i = 0; i < fields.Length; i++)
|
||||||
|
// {
|
||||||
|
|
||||||
|
// if (fields[i].IndexOf(",") != -1) fields[i] = fields[i].Replace(",","."); // nei decimali sostituisce la , con il .
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Response.Write(string.Join(",", fields));
|
||||||
|
// Response.Write("\n");
|
||||||
|
//}
|
||||||
|
//Response.End();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SalvaInExcel(DataTable dt) // non usato, sembra che MiFir non accetti il formato excel
|
||||||
|
{
|
||||||
|
//string excelFileName = "Olympia_Wealth_Management_Ltd_MiFIR_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
|
||||||
|
//string attachment = String.Format("attachment; filename={0}", excelFileName);
|
||||||
|
//Response.ClearContent();
|
||||||
|
//Response.AddHeader("content-disposition", attachment);
|
||||||
|
//Response.ContentType = "application/vnd.ms-excel";
|
||||||
|
//string tab = "";
|
||||||
|
//foreach (DataColumn dc in dt.Columns)
|
||||||
|
//{
|
||||||
|
// Response.Write(tab + dc.ColumnName);
|
||||||
|
// tab = "\t";
|
||||||
|
//}
|
||||||
|
//Response.Write("\n");
|
||||||
|
//int i;
|
||||||
|
//foreach (DataRow dr in dt.Rows)
|
||||||
|
//{
|
||||||
|
// tab = "";
|
||||||
|
// for (i = 0; i < dt.Columns.Count; i++)
|
||||||
|
// {
|
||||||
|
// Response.Write(tab + dr[i].ToString());
|
||||||
|
// tab = "\t";
|
||||||
|
// }
|
||||||
|
// Response.Write("\n");
|
||||||
|
//}
|
||||||
|
//Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvDatiUBS_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.RowType != GridViewRowType.Data) return;
|
||||||
|
|
||||||
|
// Evidenzia righe con PROC1 vuoto (sono da editare e assegnare B o S manualmente
|
||||||
|
if (String.IsNullOrEmpty((string)e.GetValue("PROC1"))) e.Row.BackColor = Color.LightSalmon;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void btnProcessaDatiBancaSella_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Processa output csv , elaborando i dati di UBS e di Banca Sella
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Processa dati UBS
|
||||||
|
|
||||||
|
lblError.Text = "";
|
||||||
|
pageControl.ActiveTabIndex = 1;
|
||||||
|
if (Session["DatiUBS"] == null)
|
||||||
|
{
|
||||||
|
lblError.Text = "CSV non rilevato!";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Crea colonne per Datatable di output dtOutputExcel
|
||||||
|
dtOutputExcel = new DataTable();
|
||||||
|
dtOutputExcel = CreateOutputDataTable(); // crea colonne
|
||||||
|
|
||||||
|
// Popola righe Datatable di ouput
|
||||||
|
dtDatiUBS = (DataTable)Session["DatiUBS"];
|
||||||
|
int incrKey = 1;
|
||||||
|
foreach (DataRow inputRow in dtDatiUBS.Rows)
|
||||||
|
{
|
||||||
|
DataRow dr = dtOutputExcel.NewRow();
|
||||||
|
|
||||||
|
// Mappatura campi dtInputCSV in dtOutputExcel
|
||||||
|
dr["Report Status"] = inputRow["TAG_01"]; // col 1
|
||||||
|
dr["Transaction Reference Number"] = Convert.ToString(incrKey) + inputRow["TAG_02"]; // col 2
|
||||||
|
dr["Submitting Entity ID"] = "213800Y8S6ABNF5NCQ84"; // col 4
|
||||||
|
dr["Executing Entity ID"] = "213800Y8S6ABNF5NCQ84"; // col 5
|
||||||
|
dr["Investment Firm Indicator"] = "TRUE"; // col 6
|
||||||
|
dr["Buyer ID Type"] = "L"; // col 7
|
||||||
|
dr["Buyer ID"] = inputRow["UBSLEI"]; // col 9
|
||||||
|
dr["Seller ID Type"] = "L"; // col 20
|
||||||
|
dr["Seller ID"] = inputRow["UBSLEI"]; // col 22
|
||||||
|
dr["Order Transmission Indicator"] = "FALSE"; // col 33
|
||||||
|
dr["Trading Date Time"] = inputRow["TAG_28"]; // col 36
|
||||||
|
dr["Trading Capacity"] = "AOTC"; // col 37
|
||||||
|
dr["Quantity"] = inputRow["TAG_30"]; // col 38
|
||||||
|
dr["Quantity Type"] = "UNIT"; // col 39
|
||||||
|
dr["Quantity Currency"] = inputRow["TAG_31"]; // col 40
|
||||||
|
dr["Price"] = inputRow["TAG_33"]; // col 42
|
||||||
|
dr["Price Type"] = "MntryValAmt"; // col 43
|
||||||
|
dr["Price Currency"] = inputRow["TAG_34"]; // col 44
|
||||||
|
dr["Net Amount"] = inputRow["TAG_35"]; // col 45
|
||||||
|
dr["Venue"] = "XOFF"; // col 46
|
||||||
|
dr["Instrument ID Type"] = "FinInstrm.Id"; // col 51
|
||||||
|
dr["Instrument ID"] = inputRow["TAG_41"]; // col 52
|
||||||
|
dr["Instrument Name"] = inputRow["TAG_42"]; // col 53
|
||||||
|
dr["Instrument Classification"] = inputRow["TAG_43"]; // col 54
|
||||||
|
dr["Notional Currency 1"] = inputRow["TAG_44"]; // col 55
|
||||||
|
dr["Notional Currency 2"] = inputRow["TAG_45"]; // col 56
|
||||||
|
dr["Price Multiplier"] = inputRow["TAG_46"]; // col 58
|
||||||
|
dr["Firm Execution ID Type"] = "N"; // col 77
|
||||||
|
dr["Firm Execution ID Sub Type"] = "NIDN"; // col 78
|
||||||
|
dr["Firm Execution ID"] = "CRNFNC90L60C532V"; // col 79
|
||||||
|
dr["Firm Execution Country of Branch"] = "IT"; // col 80
|
||||||
|
dr["SFT Indicator"] = "FALSE"; // col 85
|
||||||
|
|
||||||
|
if (inputRow["PROC1"].ToString()=="B")
|
||||||
|
{
|
||||||
|
dr["Buyer Decision Maker ID Type"] = "L"; // col 14
|
||||||
|
dr["Buyer Decision Maker ID"] = "213800Y8S6ABNF5NCQ84"; // col 16
|
||||||
|
}
|
||||||
|
if (inputRow["PROC1"].ToString() == "S")
|
||||||
|
{
|
||||||
|
dr["Seller Decision Maker ID Type"] = "L"; // col 27
|
||||||
|
dr["Seller Decision Maker ID"] = "213800Y8S6ABNF5NCQ84"; // col 29
|
||||||
|
}
|
||||||
|
if (inputRow["TAG_01"].ToString() == "NEWT" && !String.IsNullOrEmpty(inputRow["PFLID"].ToString())) // aggiunge la riga se tag_01 = NEWT e PFLID è valorizzato
|
||||||
|
{
|
||||||
|
dtOutputExcel.Rows.Add(dr);
|
||||||
|
incrKey++;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dtOutputExcel != null) Session["outputTable"] = dtOutputExcel;
|
||||||
|
|
||||||
|
lblDatiUBS.Text = String.Format("Record UBS processati: {0}", dtOutputExcel.Rows.Count);
|
||||||
|
|
||||||
|
// Processa Dati Banca Sella
|
||||||
|
Flusso_BancaSella(); // aggiunge al Session["outputTable"] flusso dati da Banca Sella prima di salvare tutto in formato .csv
|
||||||
|
gvOuputExcel.DataSource = Session["outputTable"];
|
||||||
|
gvOuputExcel.DataBind();
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
lblError.Text = ex.Message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ASPxUploadControl1_FileUploadComplete(object sender, FileUploadCompleteEventArgs e)
|
||||||
|
{
|
||||||
|
Session["DatiUBS"] = CaricaDatiUBSCsv(e.UploadedFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataTable CaricaDatiUBSCsv(UploadedFile uploadedFile)
|
||||||
|
{
|
||||||
|
// ref link: https://www.c-sharpcorner.com/blogs/read-csv-file-into-data-table1
|
||||||
|
|
||||||
|
DataTable dtCsv = new DataTable();
|
||||||
|
string Fulltext;
|
||||||
|
if (uploadedFile.IsValid && IsPostBack) //if (FileUpload.HasFile && IsPostBack)
|
||||||
|
{
|
||||||
|
using (StreamReader sr = new StreamReader(uploadedFile.FileContent))
|
||||||
|
{
|
||||||
|
while (!sr.EndOfStream)
|
||||||
|
{
|
||||||
|
Fulltext = sr.ReadToEnd().ToString(); //read full file text
|
||||||
|
string[] rows = Fulltext.Split('\n'); //split full file text into rows
|
||||||
|
for (int i = 0; i < rows.Count() - 1; i++)
|
||||||
|
{
|
||||||
|
string[] rowValues = rows[i].Split('|'); //split each row with | to get individual values
|
||||||
|
{
|
||||||
|
if (i == 0)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < rowValues.Count(); j++)
|
||||||
|
{
|
||||||
|
dtCsv.Columns.Add(rowValues[j]); //add headers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DataRow dr = dtCsv.NewRow();
|
||||||
|
for (int k = 0; k < rowValues.Count(); k++)
|
||||||
|
{
|
||||||
|
dr[k] = rowValues[k].ToString().Replace(",",".");
|
||||||
|
}
|
||||||
|
dtCsv.Rows.Add(dr); //add other rows
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return dtCsv;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvDatiUBS_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
|
||||||
|
{
|
||||||
|
ASPxGridView gridView = (ASPxGridView)sender;
|
||||||
|
DataTable dataTable = (DataTable)Session["DatiUBS"];
|
||||||
|
DataRow row = dataTable.Rows.Find(e.Keys[0]);
|
||||||
|
row["PROC1"] = e.NewValues["PROC1"];
|
||||||
|
gridView.CancelEdit();
|
||||||
|
e.Cancel = true;
|
||||||
|
Session["DatiUBS"] = dataTable;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void btnProcessaDatiUBS_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Carica Dati UBS
|
||||||
|
try
|
||||||
|
{
|
||||||
|
lblError.Text = "";
|
||||||
|
|
||||||
|
// Carica csv UBS in Datatable e lo processa
|
||||||
|
dtDatiUBS = ProcessaInputDatiUBS();
|
||||||
|
pageControl.ActiveTabIndex = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
lblError.Text = ex.Message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvOuputExcel_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.RowType != GridViewRowType.Data) return;
|
||||||
|
|
||||||
|
// Rileva campo Buyer Decision Maker ID, per colorare le righe di Banca Sella
|
||||||
|
object objBuyerMakerID = e.GetValue("Buyer ID");
|
||||||
|
if (!String.IsNullOrEmpty(objBuyerMakerID.ToString()))
|
||||||
|
{
|
||||||
|
if (objBuyerMakerID.ToString() == "549300I7OIUB41P86L19") e.Row.BackColor = Color.LightBlue; // riga di BancaSella
|
||||||
|
if (objBuyerMakerID.ToString() == "5299007QVIQ7IO64NX37") e.Row.BackColor = Color.LightGreen; // riga di UBS
|
||||||
|
//else e.Row.BackColor = Color.LightGreen; // riga di UBS
|
||||||
|
}
|
||||||
|
//else e.Row.BackColor = Color.LightGreen; // riga di UBS
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
132
OlympiaIntranet/Mifir.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet {
|
||||||
|
|
||||||
|
|
||||||
|
public partial class Mifir {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxUploadControl1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxUploadControl ASPxUploadControl1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnProcessaDatiUBS control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton btnProcessaDatiUBS;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// dateeditBancaSella control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxDateEdit dateeditBancaSella;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnProcessaDatiBancaSella control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton btnProcessaDatiBancaSella;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnCreaOutput control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton btnCreaOutput;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// pageControl control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxPageControl pageControl;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvDatiUBS control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvDatiUBS;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblDatiUBS control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel lblDatiUBS;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblDatiBancaSella control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel lblDatiBancaSella;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvOuputExcel control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridView gvOuputExcel;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxGridViewExporter1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridViewExporter ASPxGridViewExporter1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblError control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxLabel lblError;
|
||||||
|
}
|
||||||
|
}
|
||||||
111
OlympiaIntranet/MonitorVaR.aspx
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MonitorVaR.aspx.cs" Inherits="OlympiaIntranet.MonitorVaR" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.Bootstrap.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.Bootstrap" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.XtraCharts.v23.2.Web, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.XtraCharts.Web" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.XtraCharts.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.XtraCharts" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
<style>
|
||||||
|
html {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
<dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server" ColCount="1" EnableTheming="True" Theme="DevEx">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutGroup Caption="" ColCount="7" ColSpan="1" ColumnCount="7" RowSpan="2">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="Gestore" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="glGestore" runat="server" Theme="DevEx" AutoPostBack="true" DataSourceID="" ValueType="System.String" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Gestore" TextFormatString="{0}" OnValueChanged="glGestore_ValueChanged">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
|
||||||
|
<SettingsPopup>
|
||||||
|
<FilterControl AutoUpdatePosition="False"></FilterControl>
|
||||||
|
</SettingsPopup>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Linea di Gestione" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="glLinea" ClientInstanceName="clientgridLookupLinea" runat="server" Theme="Aqua" DataSourceID="" DropDownStyle="DropDownList" EnableTheming="True" KeyFieldName="Linea" TextFormatString="{0}">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
|
||||||
|
<SettingsPopup>
|
||||||
|
<FilterControl AutoUpdatePosition="False"></FilterControl>
|
||||||
|
</SettingsPopup>
|
||||||
|
</GridViewProperties>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1" HorizontalAlign="Center">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="btnShowChart" runat="server" ToolTip="Genera grafico" OnClick="btnShowChart_Click">
|
||||||
|
<Image IconID="chart_spline_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1" HorizontalAlign="Center">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="btnEsportaPdf" runat="server" OnClick="btnEsportaPdf_Click">
|
||||||
|
<Image IconID="export_exporttopdf_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxFormLayout>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
<dx:WebChartControl ID="chartControl" runat="server" CrosshairEnabled="True" Height="800px" Width="1390px">
|
||||||
|
</dx:WebChartControl>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
251
OlympiaIntranet/MonitorVaR.aspx.cs
Normal file
@@ -0,0 +1,251 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
using DevExpress.CodeParser;
|
||||||
|
using DevExpress.Web;
|
||||||
|
using DevExpress.XtraCharts;
|
||||||
|
using DevExpress.XtraCharts.Native;
|
||||||
|
using DevExpress.XtraCharts.Web;
|
||||||
|
using DevExpress.XtraPrinting;
|
||||||
|
using DevExpress.XtraPrintingLinks;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class MonitorVaR : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Se è la prima volta che viene caricata la pagina allora carica glGestore e cancella tutto quello che c'è in glLinea
|
||||||
|
if (IsPostBack == false)
|
||||||
|
{
|
||||||
|
BindGestori();
|
||||||
|
glLinea.DataSource = null;
|
||||||
|
glLinea.DataBind();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BindGestori()
|
||||||
|
{
|
||||||
|
using (SqlConnection conn = new SqlConnection(OlympiaIntranet.Properties.Settings.Default.SqlConnection))
|
||||||
|
using (SqlCommand cmd = new SqlCommand("GDN_GetGestore", conn))
|
||||||
|
{
|
||||||
|
cmd.CommandType = CommandType.StoredProcedure;
|
||||||
|
conn.Open();
|
||||||
|
SqlDataReader dr = cmd.ExecuteReader();
|
||||||
|
DataTable dt = new DataTable();
|
||||||
|
dt.Load(dr);
|
||||||
|
glGestore.DataSource = dt;
|
||||||
|
glGestore.DataBind();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PlottaGrafico(DataTable dataTable)
|
||||||
|
{
|
||||||
|
// Cancella tutte le serie prima di plottare
|
||||||
|
chartControl.Series.Clear();
|
||||||
|
|
||||||
|
// Cancella tutti i titoli della serie prima di plottare
|
||||||
|
chartControl.Titles.Clear();
|
||||||
|
|
||||||
|
// Setta titolo del grafico
|
||||||
|
SettaTitoloGrafico();
|
||||||
|
|
||||||
|
// Setta posizione legenda
|
||||||
|
Legend legend = chartControl.Legend;
|
||||||
|
legend.AlignmentHorizontal = LegendAlignmentHorizontal.Center;
|
||||||
|
legend.AlignmentVertical = LegendAlignmentVertical.BottomOutside;
|
||||||
|
legend.Direction = LegendDirection.LeftToRight;
|
||||||
|
|
||||||
|
// Create a new bar series.
|
||||||
|
Series series = new Series("# pos. sconfinanti per VaR puntuale", ViewType.Line);
|
||||||
|
series.ArgumentScaleType = ScaleType.DateTime;
|
||||||
|
series.ArgumentDataMember = "Data";
|
||||||
|
series.ValueScaleType = ScaleType.Numerical;
|
||||||
|
series.ValueDataMembers.AddRange(new string[] { "NumDeltaPuntuale" });
|
||||||
|
chartControl.Series.Add(series);
|
||||||
|
|
||||||
|
Series series1 = new Series("# pos. sconfinanti per VaR medio", ViewType.Line);
|
||||||
|
series1.ArgumentScaleType = ScaleType.DateTime;
|
||||||
|
series1.ArgumentDataMember = "Data";
|
||||||
|
series1.ValueScaleType = ScaleType.Numerical;
|
||||||
|
series1.ValueDataMembers.AddRange(new string[] { "NumDeltaMedio" });
|
||||||
|
chartControl.Series.Add(series1);
|
||||||
|
|
||||||
|
// Specify the series data source.
|
||||||
|
series.DataSource = dataTable;
|
||||||
|
series1.DataSource = dataTable;
|
||||||
|
|
||||||
|
XYDiagramSeriesViewBase view = (XYDiagramSeriesViewBase)series.View;
|
||||||
|
LineSeriesView ssv = view as LineSeriesView;
|
||||||
|
ssv.MarkerVisibility = DevExpress.Utils.DefaultBoolean.False;
|
||||||
|
|
||||||
|
XYDiagramSeriesViewBase view1 = (XYDiagramSeriesViewBase)series1.View;
|
||||||
|
LineSeriesView ssv1 = view1 as LineSeriesView;
|
||||||
|
ssv1.MarkerVisibility = DevExpress.Utils.DefaultBoolean.False;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SettaTitoloGrafico()
|
||||||
|
{
|
||||||
|
// Create chart titles.
|
||||||
|
ChartTitle chartTitle1 = new ChartTitle();
|
||||||
|
ChartTitle chartTitle2 = new ChartTitle();
|
||||||
|
// Define the text for the titles.
|
||||||
|
chartTitle1.Text = "<b>Numero posizioni sconfinanti per VaR</b>";
|
||||||
|
|
||||||
|
chartTitle2.Text = TitoloFiltri();
|
||||||
|
|
||||||
|
chartTitle2.WordWrap = true;
|
||||||
|
chartTitle2.MaxLineCount = 2;
|
||||||
|
|
||||||
|
// Define the alignment of the titles.
|
||||||
|
chartTitle1.Alignment = StringAlignment.Near;
|
||||||
|
chartTitle2.Alignment = StringAlignment.Near;
|
||||||
|
|
||||||
|
// Place the titles where it's required.
|
||||||
|
chartTitle1.Dock = ChartTitleDockStyle.Top;
|
||||||
|
chartTitle2.Dock = ChartTitleDockStyle.Top;
|
||||||
|
|
||||||
|
// Customize a title's appearance.
|
||||||
|
chartTitle1.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
chartTitle1.Font = new Font("Tahoma", 14, FontStyle.Bold);
|
||||||
|
chartTitle1.TextColor = Color.Blue;
|
||||||
|
chartTitle1.Indent = 10;
|
||||||
|
|
||||||
|
// Customize a title's appearance.
|
||||||
|
chartTitle2.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
chartTitle2.Font = new Font("Arial", 10, FontStyle.Italic);
|
||||||
|
chartTitle2.TextColor = Color.Black;
|
||||||
|
chartTitle2.Indent = 10;
|
||||||
|
|
||||||
|
// Add the titles to the chart.
|
||||||
|
chartControl.Titles.AddRange(new ChartTitle[] {chartTitle1,chartTitle2});
|
||||||
|
}
|
||||||
|
|
||||||
|
private string TitoloFiltri()
|
||||||
|
{
|
||||||
|
string filtro = String.Empty;
|
||||||
|
if (String.IsNullOrEmpty(glGestore.Text) == true) { filtro += "Gestore: tutti "; } else { filtro += $"Gestore: {glGestore.Text} "; }
|
||||||
|
if (String.IsNullOrEmpty(glLinea.Text) == true) { filtro += "Linea: tutti "; } else { filtro += $"Linea: {glLinea.Text} "; }
|
||||||
|
return (filtro);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void btnEsportaPdf_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
// Esporta grafico in pdf
|
||||||
|
var ps = new PrintingSystem();
|
||||||
|
ps.PageSettings.Landscape = true;
|
||||||
|
var link1 = new PrintableComponentLink();
|
||||||
|
chartControl.DataBind();
|
||||||
|
link1.Component = ((IChartContainer)chartControl).Chart;
|
||||||
|
link1.Landscape = true;
|
||||||
|
link1.PrintingSystem = ps;
|
||||||
|
link1.CreateDocument();
|
||||||
|
ps.Document.AutoFitToPagesWidth = 1; // Fit to page
|
||||||
|
using (var stream = new MemoryStream())
|
||||||
|
{
|
||||||
|
link1.PrintingSystem.ExportToPdf(stream);
|
||||||
|
Response.Clear();
|
||||||
|
Response.Buffer = false;
|
||||||
|
Response.AppendHeader("Content-Type", "application/pdf");
|
||||||
|
Response.AppendHeader("Content-Transfer-Encoding", "binary");
|
||||||
|
Response.AppendHeader("Content-Disposition", "attachment; filename=HomePageCharts.pdf");
|
||||||
|
Response.BinaryWrite(stream.GetBuffer());
|
||||||
|
Response.End();
|
||||||
|
}
|
||||||
|
ps.Dispose();
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!(String.IsNullOrEmpty(glGestore.Text) || String.IsNullOrEmpty(glLinea.Text)))
|
||||||
|
{
|
||||||
|
string query = CommonClass.ExecSql("monitorVaR_LoadData1", glGestore.Text, glLinea.Text);
|
||||||
|
var dataTable = CommonClass.execQuery_Datatable_MySql(query, Properties.Settings.Default.mySqlConnection);
|
||||||
|
|
||||||
|
// Plotta il grafico in server-side, così da assicurarti che sia pronto per l'esportazione
|
||||||
|
PlottaGrafico(dataTable);
|
||||||
|
|
||||||
|
var ps = new PrintingSystem();
|
||||||
|
ps.PageSettings.Landscape = true;
|
||||||
|
|
||||||
|
var link = new PrintableComponentLink(ps)
|
||||||
|
{
|
||||||
|
Component = ((IChartContainer)chartControl).Chart,
|
||||||
|
Landscape = true
|
||||||
|
};
|
||||||
|
|
||||||
|
link.CreateDocument();
|
||||||
|
ps.Document.AutoFitToPagesWidth = 1;
|
||||||
|
|
||||||
|
using (var stream = new MemoryStream())
|
||||||
|
{
|
||||||
|
ps.ExportToPdf(stream);
|
||||||
|
Response.Clear();
|
||||||
|
Response.Buffer = false;
|
||||||
|
Response.AppendHeader("Content-Type", "application/pdf");
|
||||||
|
Response.AppendHeader("Content-Transfer-Encoding", "binary");
|
||||||
|
Response.AppendHeader("Content-Disposition", $"attachment; filename=monitorVar_{DateTime.Now:yyyyMMdd_HHmmss}.pdf");
|
||||||
|
Response.BinaryWrite(stream.ToArray());
|
||||||
|
Response.End();
|
||||||
|
}
|
||||||
|
|
||||||
|
ps.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void glGestore_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// ref: https://supportcenter.devexpress.com/ticket/details/q340370/aspxgridlookup-how-to-refresh-the-control-after-some-data-is-changed
|
||||||
|
// note: Per refreshare gridlookupLinea e gridlookupAdvisor sulla base del valore di gridLookupGestore, salvo il valore gestore in una variabile di sessione Session["cod_ges"]
|
||||||
|
// e poi il refresh/rebind di SqlDSLinee e SqlDSAdvisor verrà effettuato nell'evento lato client EndCallBack
|
||||||
|
|
||||||
|
if (glGestore.Value != null && String.IsNullOrEmpty(glGestore.Value.ToString()) == false)
|
||||||
|
{
|
||||||
|
BindLineeByGestore(glGestore.Text);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
glLinea.DataSource = null;
|
||||||
|
glLinea.DataBind();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void BindLineeByGestore(string Gestore)
|
||||||
|
{
|
||||||
|
using (SqlConnection conn = new SqlConnection(OlympiaIntranet.Properties.Settings.Default.SqlConnection))
|
||||||
|
using (SqlCommand cmd = new SqlCommand("GDN_GetLinee1", conn))
|
||||||
|
{
|
||||||
|
cmd.CommandType = CommandType.StoredProcedure;
|
||||||
|
cmd.Parameters.AddWithValue("@cod_ges", Gestore);
|
||||||
|
//cmd.Parameters.AddWithValue("@cod_adv", "-- TUTTI --");
|
||||||
|
conn.Open();
|
||||||
|
SqlDataReader dr = cmd.ExecuteReader();
|
||||||
|
DataTable dt = new DataTable();
|
||||||
|
dt.Load(dr);
|
||||||
|
glLinea.DataSource = dt;
|
||||||
|
glLinea.DataBind();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected void btnShowChart_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!(String.IsNullOrEmpty(glGestore.Text) == true || String.IsNullOrEmpty(glLinea.Text) == true))
|
||||||
|
{
|
||||||
|
string query = CommonClass.ExecSql("monitorVaR_LoadData1", glGestore.Text, glLinea.Text);
|
||||||
|
|
||||||
|
var dataTable = CommonClass.execQuery_Datatable_MySql(query, Properties.Settings.Default.mySqlConnection); // DataIns, NumDeltaPuntuale, NumDeltaMedio
|
||||||
|
|
||||||
|
PlottaGrafico(dataTable);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
80
OlympiaIntranet/MonitorVaR.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public partial class MonitorVaR
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxFormLayout1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxFormLayout ASPxFormLayout1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// glGestore control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup glGestore;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// glLinea control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup glLinea;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnShowChart control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton btnShowChart;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnEsportaPdf control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton btnEsportaPdf;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// chartControl control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.XtraCharts.Web.WebChartControl chartControl;
|
||||||
|
}
|
||||||
|
}
|
||||||
184
OlympiaIntranet/MonitorVaR_old.aspx
Normal file
@@ -0,0 +1,184 @@
|
|||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MonitorVaR_old.aspx.cs" Inherits="OlympiaIntranet.MonitorVaR_old" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.Bootstrap.v20.1, Version=20.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.Bootstrap" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.Web.v20.1, Version=20.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<%@ Register Assembly="DevExpress.XtraCharts.v20.1.Web, Version=20.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.XtraCharts.Web" TagPrefix="dx" %>
|
||||||
|
|
||||||
|
<%@ Register assembly="DevExpress.XtraCharts.v20.1, Version=20.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.XtraCharts" tagprefix="dx" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<title></title>
|
||||||
|
<style>
|
||||||
|
/*.center {
|
||||||
|
margin: auto;
|
||||||
|
width: 50%;
|
||||||
|
padding: 6px 5px;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
html {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="form1" runat="server">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
<dx:ASPxFormLayout ID="ASPxFormLayout1" runat="server" ColCount="1" EnableTheming="True" Theme="DevEx">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutGroup Caption="" ColCount="7" ColSpan="1" ColumnCount="7" RowSpan="2">
|
||||||
|
<Items>
|
||||||
|
<dx:LayoutItem Caption="Gestore" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="glGestore" runat="server" Theme="DevEx" AutoGenerateColumns="False" DataSourceID="SqlDSGestore" KeyFieldName="cod_ges">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<EditFormLayoutProperties ColCount="1">
|
||||||
|
</EditFormLayoutProperties>
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_ges" ShowInCustomizationForm="True" VisibleIndex="0">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Advisor" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="glAdvisor" runat="server" Theme="DevEx" AutoGenerateColumns="False" DataSourceID="SqlDSAdvisor" KeyFieldName="cod_adv">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<EditFormLayoutProperties ColCount="1">
|
||||||
|
</EditFormLayoutProperties>
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_adv" ShowInCustomizationForm="True" VisibleIndex="0">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Consulente" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="glConsulente" runat="server" Theme="DevEx" AutoGenerateColumns="False" DataSourceID="SqlDSConsulente" KeyFieldName="cod_pro">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<EditFormLayoutProperties ColCount="1">
|
||||||
|
</EditFormLayoutProperties>
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_pro" ShowInCustomizationForm="True" VisibleIndex="0">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Gruppo" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="glGruppo" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDSGruppo" KeyFieldName="cod_gru">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<EditFormLayoutProperties ColCount="1">
|
||||||
|
</EditFormLayoutProperties>
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_gru" ShowInCustomizationForm="True" VisibleIndex="0">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="Linea" ColSpan="1">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxGridLookup ID="glLinea" runat="server" DataSourceID="SqlDSLinea" EnableTheming="True" Theme="DevEx" AutoGenerateColumns="False" KeyFieldName="cod_lin">
|
||||||
|
<GridViewProperties>
|
||||||
|
<SettingsBehavior AllowFocusedRow="True" AllowSelectSingleRowOnly="True" EnableRowHotTrack="True" />
|
||||||
|
<EditFormLayoutProperties ColCount="1">
|
||||||
|
</EditFormLayoutProperties>
|
||||||
|
<SettingsPager Mode="ShowAllRecords">
|
||||||
|
</SettingsPager>
|
||||||
|
</GridViewProperties>
|
||||||
|
<Columns>
|
||||||
|
<dx:GridViewDataTextColumn FieldName="cod_lin" ShowInCustomizationForm="True" VisibleIndex="0">
|
||||||
|
</dx:GridViewDataTextColumn>
|
||||||
|
</Columns>
|
||||||
|
</dx:ASPxGridLookup>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1" HorizontalAlign="Center">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="btnShowChart" runat="server" ToolTip="Genera grafico">
|
||||||
|
<Image IconID="chart_spline_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
<dx:LayoutItem Caption="" ColSpan="1" HorizontalAlign="Center">
|
||||||
|
<LayoutItemNestedControlCollection>
|
||||||
|
<dx:LayoutItemNestedControlContainer runat="server">
|
||||||
|
<dx:ASPxButton ID="btnEsportaPdf" runat="server" OnClick="btnEsportaPdf_Click">
|
||||||
|
<Image IconID="export_exporttopdf_16x16">
|
||||||
|
</Image>
|
||||||
|
</dx:ASPxButton>
|
||||||
|
</dx:LayoutItemNestedControlContainer>
|
||||||
|
</LayoutItemNestedControlCollection>
|
||||||
|
</dx:LayoutItem>
|
||||||
|
</Items>
|
||||||
|
</dx:LayoutGroup>
|
||||||
|
</Items>
|
||||||
|
</dx:ASPxFormLayout>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
<dx:WebChartControl ID="chartControl" runat="server" CrosshairEnabled="True" Height="800px" Width="1390px">
|
||||||
|
</dx:WebChartControl>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<asp:SqlDataSource ID="SqlDSLinea" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="monitorVaR_LoadLinea1" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSGestore" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" ProviderName="<%$ ConnectionStrings:DefaultConnection.ProviderName %>" SelectCommand="dbo.monitorVaR_LoadGestore1" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSAdvisor" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="monitorVaR_LoadAdvisor1" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSConsulente" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="monitorVaR_LoadConsulente1" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
|
||||||
|
<asp:SqlDataSource ID="SqlDSGruppo" runat="server" ConnectionString="Data Source=26.69.45.60;Initial Catalog=FirstSolutionDB;Persist Security Info=True;User ID=sa;Password=Skyline72" SelectCommand="monitorVaR_LoadGruppo1" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
166
OlympiaIntranet/MonitorVaR_old.aspx.cs
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
using DevExpress.XtraCharts;
|
||||||
|
using DevExpress.XtraCharts.Native;
|
||||||
|
using DevExpress.XtraCharts.Web;
|
||||||
|
using DevExpress.XtraPrinting;
|
||||||
|
using DevExpress.XtraPrintingLinks;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public partial class MonitorVaR_old : System.Web.UI.Page
|
||||||
|
{
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//if (HttpContext.Current.User.Identity.IsAuthenticated == false)
|
||||||
|
//{
|
||||||
|
// Response.Redirect("~/SignIn.aspx");
|
||||||
|
//}
|
||||||
|
|
||||||
|
if (IsPostBack)
|
||||||
|
{
|
||||||
|
string query = CommonClass.ExecSql("monitorVaR_LoadData", glGruppo.Text, glLinea.Text, glGestore.Text, glAdvisor.Text, glConsulente.Text);
|
||||||
|
|
||||||
|
var dataTable = CommonClass.execQuery_Datatable_MySql(query, Properties.Settings.Default.mySqlConnection); // DataIns, NumDeltaPuntuale, NumDeltaMedio
|
||||||
|
|
||||||
|
PlottaGrafico(dataTable);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PlottaGrafico(DataTable dataTable)
|
||||||
|
{
|
||||||
|
// Cancella tutte le serie prima di plottare
|
||||||
|
chartControl.Series.Clear();
|
||||||
|
|
||||||
|
// Cancella tutti i titoli della serie prima di plottare
|
||||||
|
chartControl.Titles.Clear();
|
||||||
|
|
||||||
|
// Setta titolo del grafico
|
||||||
|
SettaTitoloGrafico();
|
||||||
|
|
||||||
|
// Setta posizione legenda
|
||||||
|
Legend legend = chartControl.Legend;
|
||||||
|
legend.AlignmentHorizontal = LegendAlignmentHorizontal.Center;
|
||||||
|
legend.AlignmentVertical = LegendAlignmentVertical.BottomOutside;
|
||||||
|
legend.Direction = LegendDirection.LeftToRight;
|
||||||
|
|
||||||
|
// Create a new bar series.
|
||||||
|
Series series = new Series("# pos. sconfinanti per VaR puntuale", ViewType.Line);
|
||||||
|
series.ArgumentScaleType = ScaleType.DateTime;
|
||||||
|
series.ArgumentDataMember = "Data";
|
||||||
|
series.ValueScaleType = ScaleType.Numerical;
|
||||||
|
series.ValueDataMembers.AddRange(new string[] { "NumDeltaPuntuale" });
|
||||||
|
chartControl.Series.Add(series);
|
||||||
|
|
||||||
|
Series series1 = new Series("# pos. sconfinanti per VaR medio", ViewType.Line);
|
||||||
|
series1.ArgumentScaleType = ScaleType.DateTime;
|
||||||
|
series1.ArgumentDataMember = "Data";
|
||||||
|
series1.ValueScaleType = ScaleType.Numerical;
|
||||||
|
series1.ValueDataMembers.AddRange(new string[] { "NumDeltaMedio" });
|
||||||
|
chartControl.Series.Add(series1);
|
||||||
|
|
||||||
|
// Specify the series data source.
|
||||||
|
series.DataSource = dataTable;
|
||||||
|
series1.DataSource = dataTable;
|
||||||
|
|
||||||
|
//XYDiagramSeriesViewBase view = (XYDiagramSeriesViewBase)series.View;
|
||||||
|
//SplineSeriesView ssv = view as SplineSeriesView;
|
||||||
|
//ssv.MarkerVisibility = DevExpress.Utils.DefaultBoolean.False;
|
||||||
|
|
||||||
|
//XYDiagramSeriesViewBase view1 = (XYDiagramSeriesViewBase)series1.View;
|
||||||
|
//SplineSeriesView ssv1 = view1 as SplineSeriesView;
|
||||||
|
//ssv1.MarkerVisibility = DevExpress.Utils.DefaultBoolean.False;
|
||||||
|
|
||||||
|
XYDiagramSeriesViewBase view = (XYDiagramSeriesViewBase)series.View;
|
||||||
|
LineSeriesView ssv = view as LineSeriesView;
|
||||||
|
ssv.MarkerVisibility = DevExpress.Utils.DefaultBoolean.False;
|
||||||
|
|
||||||
|
XYDiagramSeriesViewBase view1 = (XYDiagramSeriesViewBase)series1.View;
|
||||||
|
LineSeriesView ssv1 = view1 as LineSeriesView;
|
||||||
|
ssv1.MarkerVisibility = DevExpress.Utils.DefaultBoolean.False;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SettaTitoloGrafico()
|
||||||
|
{
|
||||||
|
// Create chart titles.
|
||||||
|
ChartTitle chartTitle1 = new ChartTitle();
|
||||||
|
ChartTitle chartTitle2 = new ChartTitle();
|
||||||
|
// Define the text for the titles.
|
||||||
|
chartTitle1.Text = "<b>Numero posizioni sconfinanti per VaR</b>";
|
||||||
|
|
||||||
|
chartTitle2.Text = TitoloFiltri();
|
||||||
|
|
||||||
|
chartTitle2.WordWrap = true;
|
||||||
|
chartTitle2.MaxLineCount = 2;
|
||||||
|
|
||||||
|
// Define the alignment of the titles.
|
||||||
|
chartTitle1.Alignment = StringAlignment.Near;
|
||||||
|
chartTitle2.Alignment = StringAlignment.Near;
|
||||||
|
|
||||||
|
// Place the titles where it's required.
|
||||||
|
chartTitle1.Dock = ChartTitleDockStyle.Top;
|
||||||
|
chartTitle2.Dock = ChartTitleDockStyle.Top;
|
||||||
|
|
||||||
|
// Customize a title's appearance.
|
||||||
|
chartTitle1.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
chartTitle1.Font = new Font("Tahoma", 14, FontStyle.Bold);
|
||||||
|
chartTitle1.TextColor = Color.Blue;
|
||||||
|
chartTitle1.Indent = 10;
|
||||||
|
|
||||||
|
// Customize a title's appearance.
|
||||||
|
chartTitle2.EnableAntialiasing = DevExpress.Utils.DefaultBoolean.True;
|
||||||
|
chartTitle2.Font = new Font("Arial", 10, FontStyle.Italic);
|
||||||
|
chartTitle2.TextColor = Color.Black;
|
||||||
|
chartTitle2.Indent = 10;
|
||||||
|
|
||||||
|
// Add the titles to the chart.
|
||||||
|
chartControl.Titles.AddRange(new ChartTitle[] {chartTitle1,chartTitle2});
|
||||||
|
}
|
||||||
|
|
||||||
|
private string TitoloFiltri()
|
||||||
|
{
|
||||||
|
string filtro = String.Empty;
|
||||||
|
if (String.IsNullOrEmpty(glGestore.Text) == true) { filtro += "Gestore: tutti "; } else { filtro += $"Gestore: {glGestore.Text} "; }
|
||||||
|
if (String.IsNullOrEmpty(glAdvisor.Text) == true) { filtro += "Advisor: tutti "; } else { filtro += $"Advisor: {glAdvisor.Text} "; }
|
||||||
|
if (String.IsNullOrEmpty(glConsulente.Text) == true) { filtro += "Consulente: tutti "; } else { filtro += $"Consulente: {glConsulente.Text} "; }
|
||||||
|
if (String.IsNullOrEmpty(glGruppo.Text) == true) { filtro += "Gruppo: tutti "; } else { filtro += $"Gruppo: {glGruppo.Text} "; }
|
||||||
|
if (String.IsNullOrEmpty(glLinea.Text) == true) { filtro += "Linea: tutti "; } else { filtro += $"Linea: {glLinea.Text} "; }
|
||||||
|
return (filtro);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void btnEsportaPdf_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Esporta grafico in pdf
|
||||||
|
var ps = new PrintingSystem();
|
||||||
|
ps.PageSettings.Landscape = true;
|
||||||
|
var link1 = new PrintableComponentLink();
|
||||||
|
chartControl.DataBind();
|
||||||
|
link1.Component = ((IChartContainer)chartControl).Chart;
|
||||||
|
link1.Landscape = true;
|
||||||
|
link1.PrintingSystem = ps;
|
||||||
|
link1.CreateDocument();
|
||||||
|
ps.Document.AutoFitToPagesWidth = 1; // Fit to page
|
||||||
|
using (var stream = new MemoryStream())
|
||||||
|
{
|
||||||
|
link1.PrintingSystem.ExportToPdf(stream);
|
||||||
|
Response.Clear();
|
||||||
|
Response.Buffer = false;
|
||||||
|
Response.AppendHeader("Content-Type", "application/pdf");
|
||||||
|
Response.AppendHeader("Content-Transfer-Encoding", "binary");
|
||||||
|
Response.AppendHeader("Content-Disposition", "attachment; filename=HomePageCharts.pdf");
|
||||||
|
Response.BinaryWrite(stream.GetBuffer());
|
||||||
|
Response.End();
|
||||||
|
}
|
||||||
|
ps.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
150
OlympiaIntranet/MonitorVaR_old.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OlympiaIntranet {
|
||||||
|
|
||||||
|
|
||||||
|
public partial class MonitorVaR_old {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// form1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ASPxFormLayout1 control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxFormLayout ASPxFormLayout1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// glGestore control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup glGestore;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// glAdvisor control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup glAdvisor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// glConsulente control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup glConsulente;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// glGruppo control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup glGruppo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// glLinea control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxGridLookup glLinea;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnShowChart control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton btnShowChart;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnEsportaPdf control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.Web.ASPxButton btnEsportaPdf;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// chartControl control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::DevExpress.XtraCharts.Web.WebChartControl chartControl;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSLinea control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSLinea;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSGestore control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSGestore;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSAdvisor control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSAdvisor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSConsulente control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSConsulente;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SqlDSGruppo control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.SqlDataSource SqlDSGruppo;
|
||||||
|
}
|
||||||
|
}
|
||||||
14
OlympiaIntranet/MyException.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
|
namespace OlympiaIntranet
|
||||||
|
{
|
||||||
|
public class MyException : Exception
|
||||||
|
{
|
||||||
|
public MyException(string message) : base(message)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||