<?xml version="1.0"?>
<configuration>
    <configSections>
        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="SUPPLYWATCH.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
        </sectionGroup>
        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="SUPPLYWATCH.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
        </sectionGroup>
    </configSections>
    <connectionStrings>
        <add name="SUPPLYWATCH.My.MySettings.MC_SUPPLYWATCHConnectionString"
            connectionString="Data Source=192.168.8.13;Initial Catalog=MC2_SUPPLYWATCH;User ID=sa;Password=dd"
            providerName="System.Data.SqlClient" />
    </connectionStrings>
    <system.diagnostics>
        <sources>
            <!-- Dieser Abschnitt definiert die Protokollierungskonfiguration für My.Application.Log -->
            <source name="DefaultSource" switchName="DefaultSwitch">
                <listeners>
                    <add name="FileLog"/>
                    <!-- Auskommentierung des nachfolgenden Abschnitts aufheben, um in das Anwendungsereignisprotokoll zu schreiben -->
                    <!--<add name="EventLog"/>-->
                </listeners>
            </source>
        </sources>
        <switches>
            <add name="DefaultSwitch" value="Information"/>
        </switches>
        <sharedListeners>
            <add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter"/>
            <!-- Auskommentierung des nachfolgenden Abschnitts aufheben und APPLICATION_NAME durch den Namen der Anwendung ersetzen, um in das Anwendungsereignisprotokoll zu schreiben -->
            <!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
        </sharedListeners>
    </system.diagnostics>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
    <userSettings>
        <SUPPLYWATCH.My.MySettings>
            <setting name="ConfigConnectionString" serializeAs="String">
                <value>Data Source=192.168.8.13;Initial Catalog=MC2_SUPPLYWATCH;User ID=sa;Password=dd</value>
            </setting>
            <setting name="SQL_DATENBANK" serializeAs="String">
                <value>MC_SUPPLYWATCH</value>
            </setting>
            <setting name="SQL_SERVERNAME" serializeAs="String">
                <value />
            </setting>
            <setting name="SQL_USER" serializeAs="String">
                <value>sa</value>
            </setting>
            <setting name="SQL_PW" serializeAs="String">
                <value />
            </setting>
            <setting name="TBSTATUSDataGridView" serializeAs="String">
                <value />
            </setting>
            <setting name="SpDGeraete" serializeAs="String">
                <value>308</value>
            </setting>
            <setting name="VWSUPPLIES_AKTUELLDataGridView" serializeAs="String">
                <value />
            </setting>
            <setting name="SPDOrderGeraet" serializeAs="String">
                <value>332</value>
            </setting>
            <setting name="VWSUPPLIES_TO_ORDERDataGridView" serializeAs="String">
                <value />
            </setting>
            <setting name="Setting" serializeAs="String">
                <value />
            </setting>
            <setting name="spltGeraeteUebersicht" serializeAs="String">
                <value>3, 28</value>
            </setting>
            <setting name="spltSupplies" serializeAs="String">
                <value>224, 28</value>
            </setting>
            <setting name="TBWH_STATUSFILTERDataGridView" serializeAs="String">
                <value />
            </setting>
            <setting name="TBWH_MARKTDataGridView" serializeAs="String">
                <value />
            </setting>
            <setting name="spltBestellungen" serializeAs="String">
                <value>0, 56</value>
            </setting>
            <setting name="TBSUPPLY_BESTELLUNGDataGridView" serializeAs="String">
                <value />
            </setting>
            <setting name="TBSUPPLY_BESTELLUNGViewDataGridView" serializeAs="String">
                <value />
            </setting>
            <setting name="DGTBWH_Markt_Bestellungen" serializeAs="String">
                <value />
            </setting>
            <setting name="spltVerfolgung" serializeAs="String">
                <value>111</value>
            </setting>
            <setting name="spltGeraet_Supply" serializeAs="String">
                <value>229</value>
            </setting>
            <setting name="splitterVerfolgung" serializeAs="String">
                <value>469, 25</value>
            </setting>
            <setting name="VWGERAETE_VERFOLGUNGDataGridView" serializeAs="String">
                <value />
            </setting>
            <setting name="VWSUPPLY_VERFOLGUNGDataGridView" serializeAs="String">
                <value />
            </setting>
            <setting name="spltProduktVertrag" serializeAs="String">
                <value>266</value>
            </setting>
            <setting name="TBVERTRAEGEDataGridView" serializeAs="String">
                <value />
            </setting>
            <setting name="TBPRODUKT_VERTRAGDataGridView" serializeAs="String">
                <value />
            </setting>
            <setting name="splitter_VertragProdukt" serializeAs="String">
                <value>510, 3</value>
            </setting>
            <setting name="TBSUPPLY_DEFINITIONDataGridView" serializeAs="String">
                <value />
            </setting>
            <setting name="VWNotInListDataGridView" serializeAs="String">
                <value />
            </setting>
            <setting name="TBVERTRAG_NOTEXISTDataGridView" serializeAs="String">
                <value />
            </setting>
            <setting name="frmImport_Report" serializeAs="String">
                <value>0, 0</value>
            </setting>
            <setting name="SheetnameBestellung" serializeAs="String">
                <value>RptOrder_Supplies</value>
            </setting>
            <setting name="conFile_Reporting" serializeAs="String">
                <value>modReporting.xml</value>
            </setting>
            <setting name="verf_id" serializeAs="String">
                <value>0</value>
            </setting>
            <setting name="Mandant_ID" serializeAs="String">
                <value />
            </setting>
            <setting name="SplitContainerSupplies_SD" serializeAs="String">
                <value>746</value>
            </setting>
            <setting name="SplitContainerSupplyBestellungenSD" serializeAs="String">
                <value>743</value>
            </setting>
        </SUPPLYWATCH.My.MySettings>
    </userSettings>
    <applicationSettings>
        <SUPPLYWATCH.My.MySettings>
            <setting name="FehlerEmail_to" serializeAs="String">
                <value>m.schreiber@didalog.de</value>
            </setting>
            <setting name="selectATR" serializeAs="String">
                <value>SELECT   
    '&gt;=2013' ABGRENZUNG,      
	T.GERAETE_ID,
	T.SERIENNR,
	T.BEZEICHNUNG AS DEVICE, 
	MIN(CONVERT(DATE, T.MELDEDATUM)) AS ERSTES_MELDEDATUM,
	MAX(CONVERT(DATE, T.MELDEDATUM)) AS LETZTES_MELDEDATUM,
	MIN(T.PAGE_COUNT) AS PAGECOUNT_MIN, 
	MAX(T.PAGE_COUNT) AS PAGECOUNT_MAX, 
	MAX(T.PAGE_COUNT) - MIN(T.PAGE_COUNT) AS PAGECOUNT_ALL, 
	--A4Mono
	(CASE WHEN MAX(T.A4MONOTotalImpressions) IS NULL OR MAX(T.A4MONOTotalImpressions) = 0 
		THEN 0 ELSE MAX(T.A4MONOTotalImpressions) 
		END) - 
		CASE WHEN MIN(T.A4MONOTotalImpressions) IS NULL OR MIN(T.A4MONOTotalImpressions) = 0 
		THEN 0 ELSE MIN(T.A4MONOTotalImpressions) 
		END
	AS PAGECOUNT_A4MONO,
	--A3Mono
	(CASE WHEN MAX(T.A3MONOTotalImpressions) IS NULL OR MAX(T.A3MONOTotalImpressions) = 0 
		THEN 0 ELSE MAX(T.A3MONOTotalImpressions) 
		END) - 
		CASE WHEN MIN(T.A3MONOTotalImpressions) IS NULL OR MIN(T.A3MONOTotalImpressions) = 0 
		THEN 0 ELSE MIN(T.A3MONOTotalImpressions) 
		END
	AS PAGECOUNT_A3MONO,
	(CASE WHEN MAX(T.A4MONOTotalImpressions) IS NULL OR MAX(T.A4MONOTotalImpressions) = 0 
		THEN 0 ELSE MAX(T.A4MONOTotalImpressions) 
		END) - (CASE WHEN MIN(T.A4MONOTotalImpressions) IS NULL OR MIN(T.A4MONOTotalImpressions) = 0 
				THEN 0 ELSE MIN(T.A4MONOTotalImpressions) 
				END) 
		+ 
		(CASE WHEN MAX(T.A3MONOTotalImpressions) IS NULL OR MAX(T.A3MONOTotalImpressions) = 0 
		THEN 0 ELSE MAX(T.A3MONOTotalImpressions) 
		END) - (CASE WHEN MIN(T.A3MONOTotalImpressions) IS NULL OR MIN(T.A3MONOTotalImpressions) = 0 
				THEN 0 ELSE MIN(T.A3MONOTotalImpressions) 
				END) 
	AS PAGECOUNT_MONO,
	--A4Color
	(CASE WHEN MAX(T.A4ColorTotalImpressions) IS NULL OR MAX(T.A4ColorTotalImpressions) = 0 
		THEN 0 ELSE MAX(T.A4ColorTotalImpressions) 
		END) - 	(CASE WHEN MIN(T.A4ColorTotalImpressions) IS NULL OR MIN(T.A4ColorTotalImpressions) = 0 
				THEN 0 ELSE MIN(T.A4ColorTotalImpressions) END)
	AS PAGECOUNT_A4COLOR,
	--A3COLOR
	(CASE WHEN MAX(T.A3COLORTotalImpressions) IS NULL OR MAX(T.A3COLORTotalImpressions) = 0 
		THEN 0 ELSE MAX(T.A3COLORTotalImpressions) 
		END) - (CASE WHEN MIN(T.A3COLORTotalImpressions) IS NULL OR MIN(T.A3COLORTotalImpressions) = 0 
				THEN 0 ELSE MIN(T.A3COLORTotalImpressions) END)
	AS PAGECOUNT_A3COLOR,
	--PAGECOUNT COLOR MIN
	CASE WHEN MIN(T.A4ColorTotalImpressions) IS NULL OR MIN(T.A4ColorTotalImpressions) = 0
	THEN MIN(T.A4ColorTotalImpressions) 
	ELSE
	(CASE WHEN MIN(T.A4ColorTotalImpressions) IS NULL OR MIN(T.A4ColorTotalImpressions) = 0 
	THEN 0 ELSE MIN(T.A4ColorTotalImpressions) END) +
	(CASE WHEN MIN(T.A3COLORTotalImpressions) IS NULL OR MIN(T.A3COLORTotalImpressions) = 0 
		THEN 0 ELSE MIN(T.A3COLORTotalImpressions) END)
	END
	AS PAGECOUNT_COLOR_MIN,
	--PAGECOUNT COLOR MAX
	(CASE WHEN MAX(T.A4ColorTotalImpressions) IS NULL OR MAX(T.A4ColorTotalImpressions) = 0 
		THEN 0 ELSE MAX(T.A4ColorTotalImpressions) END) +
	(CASE WHEN MAX(T.A3COLORTotalImpressions) IS NULL OR MAX(T.A3COLORTotalImpressions) = 0 
	THEN 0 ELSE MAX(T.A3COLORTotalImpressions) END)
	AS PAGECOUNT_COLOR_MAX,
	--PAGECOUNT COLOR ALL
	(CASE WHEN MAX(T.A4ColorTotalImpressions) IS NULL OR MAX(T.A4ColorTotalImpressions) = 0 
		THEN 0 ELSE MAX(T.A4ColorTotalImpressions) 
		END) - 
	CASE WHEN YEAR(CONVERT(DATE, '@DATE_VON')) = 2012 THEN 
		CASE WHEN MIN(T.A4ColorTotalImpressions) IS NULL OR MIN(T.A4ColorTotalImpressions) = 0 
		THEN 0 ELSE MIN(T.A4ColorTotalImpressions) 
		END
	ELSE 
		CASE WHEN MIN(T.A4ColorTotalImpressions) IS NULL OR MIN(T.A4ColorTotalImpressions) = 0 
		THEN 0 ELSE MIN(T.A4ColorTotalImpressions) 
		END
	END
	 + 
	(CASE WHEN MAX(T.A3COLORTotalImpressions) IS NULL OR MAX(T.A3COLORTotalImpressions) = 0 
	THEN 0 ELSE MAX(T.A3COLORTotalImpressions) 
	END) - 
	CASE WHEN YEAR(CONVERT(DATE,'@DATE_VON')) = 2012 THEN
	CASE WHEN MIN(T.A3COLORTotalImpressions) IS NULL OR MIN(T.A3COLORTotalImpressions) = 0 
		THEN 0 ELSE MIN(T.A3COLORTotalImpressions) END
	ELSE 
		CASE WHEN MIN(T.A3COLORTotalImpressions) IS NULL OR MIN(T.A3COLORTotalImpressions) = 0 
		THEN 0 ELSE MIN(T.A3COLORTotalImpressions) END
	END AS PAGECOUNT_COLOR_ALL
FROM
	MC2_SUPPLYWATCH_VERFOLGUNG.dbo.TBGERAETE_VERFOLGUNG AS T,
	MC2_SUPPLYWATCH.dbo.TBGERAET AS T1
WHERE 
	T.GERAETE_ID = T1.GUID AND 
	--NOT EXISTS (SELECT GERAETE_ID FROM MC2_SUPPLYWATCH_VERFOLGUNG.dbo.TBGERAETE_VERFOLGUNG_bis2012 WHERE GERAETE_ID = T.GERAETE_ID) AND
	T.PAGE_COUNT &gt; 0 AND T.GERAETE_ID IS NOT NULL AND
	REPLACE(T1.MARKT, ' ', '') = REPLACE('@MARKT', ' ', '') AND 
	(CONVERT(DATE, T.MELDEDATUM) BETWEEN CONVERT(DATE,'@DATE_VON') AND CONVERT(DATE,'@DATE_BIS'))
GROUP BY 
	T.GERAETE_ID, 
	T.SERIENNR,
	T.BEZEICHNUNG
ORDER BY ERSTES_MELDEDATUM</value>
            </setting>
        </SUPPLYWATCH.My.MySettings>
    </applicationSettings>
</configuration>
