Compare commits
177 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 49930062c9 | |||
| b47c8f9e49 | |||
| e92d288cc3 | |||
| e8ef38fc56 | |||
| a22667f505 | |||
| bfb2c4fc9c | |||
| e9c7bbbcdb | |||
| f0e51ba3a0 | |||
| f8dbf27447 | |||
| 06ed89bd75 | |||
| 823132cf07 | |||
| 092e39a89e | |||
| ff79b12420 | |||
| 3bbc14f11e | |||
| e11068cab3 | |||
| cc3b6b4a1b | |||
| 75fda50c94 | |||
| 0ed92b84d4 | |||
| 69c32c30e0 | |||
| 4f7f03cd1f | |||
| fba002dfdd | |||
| 8f9645e4e7 | |||
| b7337e7ae1 | |||
| de7bc44204 | |||
| befacf6da0 | |||
| 226540c7d2 | |||
| 756277e466 | |||
| e11f6d6a70 | |||
| 7cbc7d025e | |||
| b690b86aec | |||
| 492aa5496e | |||
| 4f9d701821 | |||
| 25b36f8941 | |||
| 2f52a12591 | |||
| 49a2a44c94 | |||
| d9d7bbcc41 | |||
| 228b022a01 | |||
| 51efaf5dd1 | |||
| 13249b2b74 | |||
| fb6c874ba4 | |||
| 9b1e597416 | |||
| 0d631bfd5d | |||
| 9d8b8f2a08 | |||
| ab477afcb1 | |||
| 0f04b63a29 | |||
| 161bd4522d | |||
| c574dcc396 | |||
| 4a231c9b77 | |||
| 9fd39a8f85 | |||
| b15c2876b3 | |||
| d6e2d586fe | |||
| 4ceb8aa01b | |||
| 30ed0f8fab | |||
| e9a5bd6839 | |||
| c4b83b1575 | |||
| ed60f662b6 | |||
| 7ad36062c4 | |||
| 40560b99f6 | |||
| 39da8e016c | |||
| b5731d46e9 | |||
| 5da9298045 | |||
| 0d9ad0c940 | |||
| 3914bc869a | |||
| 4b498595e6 | |||
| 1879d441c3 | |||
| 9accacf2ed | |||
| 60ae233ada | |||
| 3af82343d1 | |||
| 0371394885 | |||
| 4d2a1bcb10 | |||
| 062cb9986c | |||
| 010b5635b9 | |||
| 581aa79763 | |||
| 9e0326ffc2 | |||
| 5ef9137522 | |||
| 12ca01f984 | |||
| b947071896 | |||
| a217971636 | |||
| dbd8ea4f7e | |||
| 0a0b5d2b35 | |||
| 69a2c01fff | |||
| 41c0bf31a6 | |||
| 70604473a0 | |||
| 382916df7d | |||
| d5af76fb91 | |||
| 115c1870c6 | |||
| 1bb728ff86 | |||
| 639585c0d0 | |||
| 1861019ba5 | |||
| c0174161e9 | |||
| 0cc3acda52 | |||
| 4c4f72496c | |||
| d84e581b2c | |||
| 79ff9ca4ef | |||
| ff3578b911 | |||
| 896350733c | |||
| a7d4d1d5e4 | |||
| 9a498dbabd | |||
| c697093ad3 | |||
| 2fccbb28a7 | |||
| 9346810ec1 | |||
| 43a1680844 | |||
| a520000fb2 | |||
| 4ce03983c9 | |||
| 1fba7f5c4a | |||
| 4c7e8e8aca | |||
| 559fbc5393 | |||
| d34d484204 | |||
| 863c7b41f8 | |||
| 9d53de119b | |||
| 9e10b66d7a | |||
| e2bfe69c35 | |||
| 16559ae5d8 | |||
| 6620a5be2d | |||
| 21bd4d33f0 | |||
| 38e3d3cb44 | |||
| 43cc6693d2 | |||
| 05f36b2daf | |||
| 527d7cb50a | |||
| 134d04952c | |||
| 3dfa2c0316 | |||
| 82e2d7f786 | |||
| 8cb501d1e8 | |||
| 16018569b3 | |||
| b2e2d8c372 | |||
| 467b7c5305 | |||
| 667636240c | |||
| 91df1a4cf2 | |||
| cf5de74af9 | |||
| fe22d05444 | |||
| 320f75ab8c | |||
| 51d8cc96b8 | |||
| 2e496a0715 | |||
| 03012f0f6e | |||
| ec0a6e0772 | |||
| a4331594af | |||
| c2a8736842 | |||
| ba3323368c | |||
| 58de359260 | |||
| 233d82d013 | |||
| c5f84074a0 | |||
| d403512f06 | |||
| 9a278554a8 | |||
| 0f3eacda75 | |||
| 44fbf8362c | |||
| 8c956ebcac | |||
| 90481bcd36 | |||
| e7ca7aaa52 | |||
| cc89c24958 | |||
| 024102c7a7 | |||
| 39243e6714 | |||
| a3276ecbe3 | |||
| b695e25acf | |||
| 37ff8944bd | |||
| 5ad683b61e | |||
| e5de35e095 | |||
| 600886fb9d | |||
| c5059608b6 | |||
| 2d78c222c1 | |||
| 6f9abe01e9 | |||
| eb8f79c4a9 | |||
| 341c121626 | |||
| 6ed3dcafa5 | |||
| 3feb10cbcc | |||
| f4f0af64f4 | |||
| 29137439a1 | |||
| ef41183d77 | |||
| 744619fc54 | |||
| cb51d5acd1 | |||
| 3b7fda9752 | |||
| cd4aaea09c | |||
| 0c139e00c2 | |||
| 06f10df8ac | |||
| 7494d42b4e | |||
| 70a73828e8 | |||
| 0d622c0ba8 | |||
| ad906c827f |
@@ -0,0 +1,4 @@
|
||||
[*.cs]
|
||||
|
||||
# CA1303: Non passare valori letterali come parametri localizzati
|
||||
dotnet_diagnostic.CA1303.severity = none
|
||||
@@ -87,7 +87,9 @@
|
||||
<Reference Include="SteamWare, Version=3.5.2002.721, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SteamWare.3.5.2002.721\lib\net462\SteamWare.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System">
|
||||
<HintPath>..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\System.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -191,7 +193,6 @@
|
||||
<Content Include="App_Readme\README_SteamWare.txt" />
|
||||
<Content Include="App_Readme\SteamWare_demo\example-config-table.txt" />
|
||||
<Content Include="App_Readme\SteamWare_demo\example-favicon.ico" />
|
||||
<Content Include="mongocrypt.dll" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\packages\MongoDB.Libmongocrypt.1.0.0\build\MongoDB.Libmongocrypt.targets" Condition="Exists('..\packages\MongoDB.Libmongocrypt.1.0.0\build\MongoDB.Libmongocrypt.targets')" />
|
||||
|
||||
Generated
+1024
-3
File diff suppressed because it is too large
Load Diff
+80
-13
@@ -23,6 +23,7 @@
|
||||
<Mapping SourceColumn="CodGruppo" DataSetColumn="CodGruppo" />
|
||||
<Mapping SourceColumn="CodArt" DataSetColumn="CodArt" />
|
||||
<Mapping SourceColumn="QtaRic" DataSetColumn="QtaRic" />
|
||||
<Mapping SourceColumn="TimeEst" DataSetColumn="TimeEst" />
|
||||
<Mapping SourceColumn="QtaEv" DataSetColumn="QtaEv" />
|
||||
<Mapping SourceColumn="Prior" DataSetColumn="Prior" />
|
||||
<Mapping SourceColumn="Concluso" DataSetColumn="Concluso" />
|
||||
@@ -100,6 +101,7 @@
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@NumTask" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@CodArt" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@QtaRic" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="float" DbType="Double" Direction="Input" ParameterName="@TimeEst" Precision="53" ProviderType="Float" Scale="0" Size="8" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</SelectCommand>
|
||||
@@ -286,6 +288,7 @@ FROM v_TaskRec</CommandText>
|
||||
<Mapping SourceColumn="CodTag" DataSetColumn="CodTag" />
|
||||
<Mapping SourceColumn="CodArt" DataSetColumn="CodArt" />
|
||||
<Mapping SourceColumn="QtaRic" DataSetColumn="QtaRic" />
|
||||
<Mapping SourceColumn="TempoPrev" DataSetColumn="TempoPrev" />
|
||||
<Mapping SourceColumn="CodOpr" DataSetColumn="CodOpr" />
|
||||
<Mapping SourceColumn="NomeOpr" DataSetColumn="NomeOpr" />
|
||||
<Mapping SourceColumn="CodPost" DataSetColumn="CodPost" />
|
||||
@@ -1126,6 +1129,36 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
|
||||
</DbSource>
|
||||
</Sources>
|
||||
</TableAdapter>
|
||||
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="TaskRecAggTableAdapter" GeneratorDataComponentClassName="TaskRecAggTableAdapter" Name="TaskRecAgg" UserDataComponentName="TaskRecAggTableAdapter">
|
||||
<MainSource>
|
||||
<DbSource ConnectionRef="C_TRACKConnectionString (Settings)" DbObjectName="C_TRACK.dbo.stp_TRA_GetByFilt" DbObjectType="StoredProcedure" GenerateMethods="Get" GenerateShortCommands="false" GeneratorGetMethodName="getByFilt" GetMethodModifier="Public" GetMethodName="getByFilt" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="getByFilt" UserSourceName="getByFilt">
|
||||
<SelectCommand>
|
||||
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
|
||||
<CommandText>dbo.stp_TRA_GetByFilt</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@CodArt" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="datetime" DbType="DateTime" Direction="Input" ParameterName="@DtFrom" Precision="23" ProviderType="DateTime" Scale="3" Size="8" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="datetime" DbType="DateTime" Direction="Input" ParameterName="@DtTo" Precision="23" ProviderType="DateTime" Scale="3" Size="8" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</SelectCommand>
|
||||
</DbSource>
|
||||
</MainSource>
|
||||
<Mappings>
|
||||
<Mapping SourceColumn="NumTask" DataSetColumn="NumTask" />
|
||||
<Mapping SourceColumn="CodArt" DataSetColumn="CodArt" />
|
||||
<Mapping SourceColumn="QtaRic" DataSetColumn="QtaRic" />
|
||||
<Mapping SourceColumn="TempoPrev" DataSetColumn="TempoPrev" />
|
||||
<Mapping SourceColumn="IdxRec" DataSetColumn="IdxRec" />
|
||||
<Mapping SourceColumn="DtStart" DataSetColumn="DtStart" />
|
||||
<Mapping SourceColumn="DtEnd" DataSetColumn="DtEnd" />
|
||||
<Mapping SourceColumn="QtaEv" DataSetColumn="QtaEv" />
|
||||
<Mapping SourceColumn="DurataMin" DataSetColumn="DurataMin" />
|
||||
<Mapping SourceColumn="TCiclo" DataSetColumn="TCiclo" />
|
||||
</Mappings>
|
||||
<Sources />
|
||||
</TableAdapter>
|
||||
</Tables>
|
||||
<Sources />
|
||||
</DataSource>
|
||||
@@ -1134,7 +1167,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
|
||||
<xs:element name="DS_App" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="true" msprop:Generator_DataSetName="DS_App" msprop:Generator_UserDSName="DS_App">
|
||||
<xs:complexType>
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="TaskList" msprop:Generator_TableClassName="TaskListDataTable" msprop:Generator_TableVarName="tableTaskList" msprop:Generator_TablePropName="TaskList" msprop:Generator_RowDeletingName="TaskListRowDeleting" msprop:Generator_RowChangingName="TaskListRowChanging" msprop:Generator_RowEvHandlerName="TaskListRowChangeEventHandler" msprop:Generator_RowDeletedName="TaskListRowDeleted" msprop:Generator_UserTableName="TaskList" msprop:Generator_RowChangedName="TaskListRowChanged" msprop:Generator_RowEvArgName="TaskListRowChangeEvent" msprop:Generator_RowClassName="TaskListRow">
|
||||
<xs:element name="TaskList" msprop:Generator_TableClassName="TaskListDataTable" msprop:Generator_TableVarName="tableTaskList" msprop:Generator_RowChangedName="TaskListRowChanged" msprop:Generator_TablePropName="TaskList" msprop:Generator_RowDeletingName="TaskListRowDeleting" msprop:Generator_RowChangingName="TaskListRowChanging" msprop:Generator_RowEvHandlerName="TaskListRowChangeEventHandler" msprop:Generator_RowDeletedName="TaskListRowDeleted" msprop:Generator_RowClassName="TaskListRow" msprop:Generator_UserTableName="TaskList" msprop:Generator_RowEvArgName="TaskListRowChangeEvent">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="NumTask" msprop:Generator_ColumnVarNameInTable="columnNumTask" msprop:Generator_ColumnPropNameInRow="NumTask" msprop:Generator_ColumnPropNameInTable="NumTaskColumn" msprop:Generator_UserColumnName="NumTask">
|
||||
@@ -1159,6 +1192,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="QtaRic" msprop:Generator_ColumnVarNameInTable="columnQtaRic" msprop:Generator_ColumnPropNameInRow="QtaRic" msprop:Generator_ColumnPropNameInTable="QtaRicColumn" msprop:Generator_UserColumnName="QtaRic" type="xs:int" />
|
||||
<xs:element name="TimeEst" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnTimeEst" msprop:Generator_ColumnPropNameInRow="TimeEst" msprop:Generator_ColumnPropNameInTable="TimeEstColumn" msprop:Generator_UserColumnName="TimeEst" type="xs:decimal" minOccurs="0" />
|
||||
<xs:element name="QtaEv" msprop:Generator_ColumnVarNameInTable="columnQtaEv" msprop:Generator_ColumnPropNameInRow="QtaEv" msprop:Generator_ColumnPropNameInTable="QtaEvColumn" msprop:Generator_UserColumnName="QtaEv" type="xs:int" minOccurs="0" />
|
||||
<xs:element name="Prior" msprop:Generator_ColumnVarNameInTable="columnPrior" msprop:Generator_ColumnPropNameInRow="Prior" msprop:Generator_ColumnPropNameInTable="PriorColumn" msprop:Generator_UserColumnName="Prior" type="xs:int" />
|
||||
<xs:element name="Concluso" msprop:Generator_ColumnVarNameInTable="columnConcluso" msprop:Generator_ColumnPropNameInRow="Concluso" msprop:Generator_ColumnPropNameInTable="ConclusoColumn" msprop:Generator_UserColumnName="Concluso" type="xs:boolean" />
|
||||
@@ -1171,7 +1205,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="AnagFasi" msprop:Generator_TableClassName="AnagFasiDataTable" msprop:Generator_TableVarName="tableAnagFasi" msprop:Generator_TablePropName="AnagFasi" msprop:Generator_RowDeletingName="AnagFasiRowDeleting" msprop:Generator_RowChangingName="AnagFasiRowChanging" msprop:Generator_RowEvHandlerName="AnagFasiRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagFasiRowDeleted" msprop:Generator_UserTableName="AnagFasi" msprop:Generator_RowChangedName="AnagFasiRowChanged" msprop:Generator_RowEvArgName="AnagFasiRowChangeEvent" msprop:Generator_RowClassName="AnagFasiRow">
|
||||
<xs:element name="AnagFasi" msprop:Generator_TableClassName="AnagFasiDataTable" msprop:Generator_TableVarName="tableAnagFasi" msprop:Generator_RowChangedName="AnagFasiRowChanged" msprop:Generator_TablePropName="AnagFasi" msprop:Generator_RowDeletingName="AnagFasiRowDeleting" msprop:Generator_RowChangingName="AnagFasiRowChanging" msprop:Generator_RowEvHandlerName="AnagFasiRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagFasiRowDeleted" msprop:Generator_RowClassName="AnagFasiRow" msprop:Generator_UserTableName="AnagFasi" msprop:Generator_RowEvArgName="AnagFasiRowChangeEvent">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="CodFase" msprop:Generator_ColumnVarNameInTable="columnCodFase" msprop:Generator_ColumnPropNameInRow="CodFase" msprop:Generator_ColumnPropNameInTable="CodFaseColumn" msprop:Generator_UserColumnName="CodFase">
|
||||
@@ -1193,7 +1227,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="AnagOpr" msprop:Generator_TableClassName="AnagOprDataTable" msprop:Generator_TableVarName="tableAnagOpr" msprop:Generator_TablePropName="AnagOpr" msprop:Generator_RowDeletingName="AnagOprRowDeleting" msprop:Generator_RowChangingName="AnagOprRowChanging" msprop:Generator_RowEvHandlerName="AnagOprRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagOprRowDeleted" msprop:Generator_UserTableName="AnagOpr" msprop:Generator_RowChangedName="AnagOprRowChanged" msprop:Generator_RowEvArgName="AnagOprRowChangeEvent" msprop:Generator_RowClassName="AnagOprRow">
|
||||
<xs:element name="AnagOpr" msprop:Generator_TableClassName="AnagOprDataTable" msprop:Generator_TableVarName="tableAnagOpr" msprop:Generator_RowChangedName="AnagOprRowChanged" msprop:Generator_TablePropName="AnagOpr" msprop:Generator_RowDeletingName="AnagOprRowDeleting" msprop:Generator_RowChangingName="AnagOprRowChanging" msprop:Generator_RowEvHandlerName="AnagOprRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagOprRowDeleted" msprop:Generator_RowClassName="AnagOprRow" msprop:Generator_UserTableName="AnagOpr" msprop:Generator_RowEvArgName="AnagOprRowChangeEvent">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="CodOpr" msprop:Generator_ColumnVarNameInTable="columnCodOpr" msprop:Generator_ColumnPropNameInRow="CodOpr" msprop:Generator_ColumnPropNameInTable="CodOprColumn" msprop:Generator_UserColumnName="CodOpr">
|
||||
@@ -1220,7 +1254,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="TaskRec" msprop:Generator_TableClassName="TaskRecDataTable" msprop:Generator_TableVarName="tableTaskRec" msprop:Generator_TablePropName="TaskRec" msprop:Generator_RowDeletingName="TaskRecRowDeleting" msprop:Generator_RowChangingName="TaskRecRowChanging" msprop:Generator_RowEvHandlerName="TaskRecRowChangeEventHandler" msprop:Generator_RowDeletedName="TaskRecRowDeleted" msprop:Generator_UserTableName="TaskRec" msprop:Generator_RowChangedName="TaskRecRowChanged" msprop:Generator_RowEvArgName="TaskRecRowChangeEvent" msprop:Generator_RowClassName="TaskRecRow">
|
||||
<xs:element name="TaskRec" msprop:Generator_TableClassName="TaskRecDataTable" msprop:Generator_TableVarName="tableTaskRec" msprop:Generator_RowChangedName="TaskRecRowChanged" msprop:Generator_TablePropName="TaskRec" msprop:Generator_RowDeletingName="TaskRecRowDeleting" msprop:Generator_RowChangingName="TaskRecRowChanging" msprop:Generator_RowEvHandlerName="TaskRecRowChangeEventHandler" msprop:Generator_RowDeletedName="TaskRecRowDeleted" msprop:Generator_RowClassName="TaskRecRow" msprop:Generator_UserTableName="TaskRec" msprop:Generator_RowEvArgName="TaskRecRowChangeEvent">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="IdxRec" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnIdxRec" msprop:Generator_ColumnPropNameInRow="IdxRec" msprop:Generator_ColumnPropNameInTable="IdxRecColumn" msprop:Generator_UserColumnName="IdxRec" type="xs:int" />
|
||||
@@ -1246,6 +1280,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="QtaRic" msprop:Generator_ColumnVarNameInTable="columnQtaRic" msprop:Generator_ColumnPropNameInRow="QtaRic" msprop:Generator_ColumnPropNameInTable="QtaRicColumn" msprop:Generator_UserColumnName="QtaRic" type="xs:int" />
|
||||
<xs:element name="TempoPrev" msprop:Generator_ColumnVarNameInTable="columnTempoPrev" msprop:Generator_ColumnPropNameInRow="TempoPrev" msprop:Generator_ColumnPropNameInTable="TempoPrevColumn" msprop:Generator_UserColumnName="TempoPrev" type="xs:decimal" />
|
||||
<xs:element name="CodOpr" msprop:Generator_ColumnVarNameInTable="columnCodOpr" msprop:Generator_ColumnPropNameInRow="CodOpr" msprop:Generator_ColumnPropNameInTable="CodOprColumn" msprop:Generator_UserColumnName="CodOpr">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
@@ -1296,7 +1331,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="AnagPost" msprop:Generator_TableClassName="AnagPostDataTable" msprop:Generator_TableVarName="tableAnagPost" msprop:Generator_TablePropName="AnagPost" msprop:Generator_RowDeletingName="AnagPostRowDeleting" msprop:Generator_RowChangingName="AnagPostRowChanging" msprop:Generator_RowEvHandlerName="AnagPostRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagPostRowDeleted" msprop:Generator_UserTableName="AnagPost" msprop:Generator_RowChangedName="AnagPostRowChanged" msprop:Generator_RowEvArgName="AnagPostRowChangeEvent" msprop:Generator_RowClassName="AnagPostRow">
|
||||
<xs:element name="AnagPost" msprop:Generator_TableClassName="AnagPostDataTable" msprop:Generator_TableVarName="tableAnagPost" msprop:Generator_RowChangedName="AnagPostRowChanged" msprop:Generator_TablePropName="AnagPost" msprop:Generator_RowDeletingName="AnagPostRowDeleting" msprop:Generator_RowChangingName="AnagPostRowChanging" msprop:Generator_RowEvHandlerName="AnagPostRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagPostRowDeleted" msprop:Generator_RowClassName="AnagPostRow" msprop:Generator_UserTableName="AnagPost" msprop:Generator_RowEvArgName="AnagPostRowChangeEvent">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="CodPost" msprop:Generator_ColumnVarNameInTable="columnCodPost" msprop:Generator_ColumnPropNameInRow="CodPost" msprop:Generator_ColumnPropNameInTable="CodPostColumn" msprop:Generator_UserColumnName="CodPost">
|
||||
@@ -1338,7 +1373,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="TraEv2Stati" msprop:Generator_TableClassName="TraEv2StatiDataTable" msprop:Generator_TableVarName="tableTraEv2Stati" msprop:Generator_TablePropName="TraEv2Stati" msprop:Generator_RowDeletingName="TraEv2StatiRowDeleting" msprop:Generator_RowChangingName="TraEv2StatiRowChanging" msprop:Generator_RowEvHandlerName="TraEv2StatiRowChangeEventHandler" msprop:Generator_RowDeletedName="TraEv2StatiRowDeleted" msprop:Generator_UserTableName="TraEv2Stati" msprop:Generator_RowChangedName="TraEv2StatiRowChanged" msprop:Generator_RowEvArgName="TraEv2StatiRowChangeEvent" msprop:Generator_RowClassName="TraEv2StatiRow">
|
||||
<xs:element name="TraEv2Stati" msprop:Generator_TableClassName="TraEv2StatiDataTable" msprop:Generator_TableVarName="tableTraEv2Stati" msprop:Generator_RowChangedName="TraEv2StatiRowChanged" msprop:Generator_TablePropName="TraEv2Stati" msprop:Generator_RowDeletingName="TraEv2StatiRowDeleting" msprop:Generator_RowChangingName="TraEv2StatiRowChanging" msprop:Generator_RowEvHandlerName="TraEv2StatiRowChangeEventHandler" msprop:Generator_RowDeletedName="TraEv2StatiRowDeleted" msprop:Generator_RowClassName="TraEv2StatiRow" msprop:Generator_UserTableName="TraEv2Stati" msprop:Generator_RowEvArgName="TraEv2StatiRowChangeEvent">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="CodMappa" msprop:Generator_ColumnVarNameInTable="columnCodMappa" msprop:Generator_ColumnPropNameInRow="CodMappa" msprop:Generator_ColumnPropNameInTable="CodMappaColumn" msprop:Generator_UserColumnName="CodMappa">
|
||||
@@ -1400,7 +1435,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="AnagEventi" msprop:Generator_TableClassName="AnagEventiDataTable" msprop:Generator_TableVarName="tableAnagEventi" msprop:Generator_TablePropName="AnagEventi" msprop:Generator_RowDeletingName="AnagEventiRowDeleting" msprop:Generator_RowChangingName="AnagEventiRowChanging" msprop:Generator_RowEvHandlerName="AnagEventiRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagEventiRowDeleted" msprop:Generator_UserTableName="AnagEventi" msprop:Generator_RowChangedName="AnagEventiRowChanged" msprop:Generator_RowEvArgName="AnagEventiRowChangeEvent" msprop:Generator_RowClassName="AnagEventiRow">
|
||||
<xs:element name="AnagEventi" msprop:Generator_TableClassName="AnagEventiDataTable" msprop:Generator_TableVarName="tableAnagEventi" msprop:Generator_RowChangedName="AnagEventiRowChanged" msprop:Generator_TablePropName="AnagEventi" msprop:Generator_RowDeletingName="AnagEventiRowDeleting" msprop:Generator_RowChangingName="AnagEventiRowChanging" msprop:Generator_RowEvHandlerName="AnagEventiRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagEventiRowDeleted" msprop:Generator_RowClassName="AnagEventiRow" msprop:Generator_UserTableName="AnagEventi" msprop:Generator_RowEvArgName="AnagEventiRowChangeEvent">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="CodEvento" msprop:Generator_ColumnVarNameInTable="columnCodEvento" msprop:Generator_ColumnPropNameInRow="CodEvento" msprop:Generator_ColumnPropNameInTable="CodEventoColumn" msprop:Generator_UserColumnName="CodEvento">
|
||||
@@ -1434,7 +1469,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="PODL" msprop:Generator_TableClassName="PODLDataTable" msprop:Generator_TableVarName="tablePODL" msprop:Generator_RowChangedName="PODLRowChanged" msprop:Generator_TablePropName="PODL" msprop:Generator_RowDeletingName="PODLRowDeleting" msprop:Generator_RowChangingName="PODLRowChanging" msprop:Generator_RowEvHandlerName="PODLRowChangeEventHandler" msprop:Generator_RowDeletedName="PODLRowDeleted" msprop:Generator_RowClassName="PODLRow" msprop:Generator_UserTableName="PODL" msprop:Generator_RowEvArgName="PODLRowChangeEvent">
|
||||
<xs:element name="PODL" msprop:Generator_TableClassName="PODLDataTable" msprop:Generator_TableVarName="tablePODL" msprop:Generator_TablePropName="PODL" msprop:Generator_RowDeletingName="PODLRowDeleting" msprop:Generator_RowChangingName="PODLRowChanging" msprop:Generator_RowEvHandlerName="PODLRowChangeEventHandler" msprop:Generator_RowDeletedName="PODLRowDeleted" msprop:Generator_UserTableName="PODL" msprop:Generator_RowChangedName="PODLRowChanged" msprop:Generator_RowEvArgName="PODLRowChangeEvent" msprop:Generator_RowClassName="PODLRow">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="idxPromessa" msprop:Generator_ColumnVarNameInTable="columnidxPromessa" msprop:Generator_ColumnPropNameInRow="idxPromessa" msprop:Generator_ColumnPropNameInTable="idxPromessaColumn" msprop:Generator_UserColumnName="idxPromessa" type="xs:int" />
|
||||
@@ -1526,7 +1561,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="AnagArticoli" msprop:Generator_TableClassName="AnagArticoliDataTable" msprop:Generator_TableVarName="tableAnagArticoli" msprop:Generator_RowChangedName="AnagArticoliRowChanged" msprop:Generator_TablePropName="AnagArticoli" msprop:Generator_RowDeletingName="AnagArticoliRowDeleting" msprop:Generator_RowChangingName="AnagArticoliRowChanging" msprop:Generator_RowEvHandlerName="AnagArticoliRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagArticoliRowDeleted" msprop:Generator_RowClassName="AnagArticoliRow" msprop:Generator_UserTableName="AnagArticoli" msprop:Generator_RowEvArgName="AnagArticoliRowChangeEvent">
|
||||
<xs:element name="AnagArticoli" msprop:Generator_TableClassName="AnagArticoliDataTable" msprop:Generator_TableVarName="tableAnagArticoli" msprop:Generator_TablePropName="AnagArticoli" msprop:Generator_RowDeletingName="AnagArticoliRowDeleting" msprop:Generator_RowChangingName="AnagArticoliRowChanging" msprop:Generator_RowEvHandlerName="AnagArticoliRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagArticoliRowDeleted" msprop:Generator_UserTableName="AnagArticoli" msprop:Generator_RowChangedName="AnagArticoliRowChanged" msprop:Generator_RowEvArgName="AnagArticoliRowChangeEvent" msprop:Generator_RowClassName="AnagArticoliRow">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="CodArt" msprop:Generator_ColumnVarNameInTable="columnCodArt" msprop:Generator_ColumnPropNameInRow="CodArt" msprop:Generator_ColumnPropNameInTable="CodArtColumn" msprop:Generator_UserColumnName="CodArt">
|
||||
@@ -1575,7 +1610,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="TaskList2Post" msprop:Generator_TableClassName="TaskList2PostDataTable" msprop:Generator_TableVarName="tableTaskList2Post" msprop:Generator_TablePropName="TaskList2Post" msprop:Generator_RowDeletingName="TaskList2PostRowDeleting" msprop:Generator_RowChangingName="TaskList2PostRowChanging" msprop:Generator_RowEvHandlerName="TaskList2PostRowChangeEventHandler" msprop:Generator_RowDeletedName="TaskList2PostRowDeleted" msprop:Generator_UserTableName="TaskList2Post" msprop:Generator_RowChangedName="TaskList2PostRowChanged" msprop:Generator_RowEvArgName="TaskList2PostRowChangeEvent" msprop:Generator_RowClassName="TaskList2PostRow">
|
||||
<xs:element name="TaskList2Post" msprop:Generator_TableClassName="TaskList2PostDataTable" msprop:Generator_TableVarName="tableTaskList2Post" msprop:Generator_RowChangedName="TaskList2PostRowChanged" msprop:Generator_TablePropName="TaskList2Post" msprop:Generator_RowDeletingName="TaskList2PostRowDeleting" msprop:Generator_RowChangingName="TaskList2PostRowChanging" msprop:Generator_RowEvHandlerName="TaskList2PostRowChangeEventHandler" msprop:Generator_RowDeletedName="TaskList2PostRowDeleted" msprop:Generator_RowClassName="TaskList2PostRow" msprop:Generator_UserTableName="TaskList2Post" msprop:Generator_RowEvArgName="TaskList2PostRowChangeEvent">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="NumTask" msprop:Generator_ColumnVarNameInTable="columnNumTask" msprop:Generator_ColumnPropNameInRow="NumTask" msprop:Generator_ColumnPropNameInTable="NumTaskColumn" msprop:Generator_UserColumnName="NumTask">
|
||||
@@ -1635,7 +1670,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="AnagStati" msprop:Generator_TableClassName="AnagStatiDataTable" msprop:Generator_TableVarName="tableAnagStati" msprop:Generator_TablePropName="AnagStati" msprop:Generator_RowDeletingName="AnagStatiRowDeleting" msprop:Generator_RowChangingName="AnagStatiRowChanging" msprop:Generator_RowEvHandlerName="AnagStatiRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagStatiRowDeleted" msprop:Generator_UserTableName="AnagStati" msprop:Generator_RowChangedName="AnagStatiRowChanged" msprop:Generator_RowEvArgName="AnagStatiRowChangeEvent" msprop:Generator_RowClassName="AnagStatiRow">
|
||||
<xs:element name="AnagStati" msprop:Generator_TableClassName="AnagStatiDataTable" msprop:Generator_TableVarName="tableAnagStati" msprop:Generator_RowChangedName="AnagStatiRowChanged" msprop:Generator_TablePropName="AnagStati" msprop:Generator_RowDeletingName="AnagStatiRowDeleting" msprop:Generator_RowChangingName="AnagStatiRowChanging" msprop:Generator_RowEvHandlerName="AnagStatiRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagStatiRowDeleted" msprop:Generator_RowClassName="AnagStatiRow" msprop:Generator_UserTableName="AnagStati" msprop:Generator_RowEvArgName="AnagStatiRowChangeEvent">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="CodStato" msprop:Generator_ColumnVarNameInTable="columnCodStato" msprop:Generator_ColumnPropNameInRow="CodStato" msprop:Generator_ColumnPropNameInTable="CodStatoColumn" msprop:Generator_UserColumnName="CodStato">
|
||||
@@ -1663,7 +1698,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Opr2Post" msprop:Generator_TableClassName="Opr2PostDataTable" msprop:Generator_TableVarName="tableOpr2Post" msprop:Generator_TablePropName="Opr2Post" msprop:Generator_RowDeletingName="Opr2PostRowDeleting" msprop:Generator_RowChangingName="Opr2PostRowChanging" msprop:Generator_RowEvHandlerName="Opr2PostRowChangeEventHandler" msprop:Generator_RowDeletedName="Opr2PostRowDeleted" msprop:Generator_UserTableName="Opr2Post" msprop:Generator_RowChangedName="Opr2PostRowChanged" msprop:Generator_RowEvArgName="Opr2PostRowChangeEvent" msprop:Generator_RowClassName="Opr2PostRow">
|
||||
<xs:element name="Opr2Post" msprop:Generator_TableClassName="Opr2PostDataTable" msprop:Generator_TableVarName="tableOpr2Post" msprop:Generator_RowChangedName="Opr2PostRowChanged" msprop:Generator_TablePropName="Opr2Post" msprop:Generator_RowDeletingName="Opr2PostRowDeleting" msprop:Generator_RowChangingName="Opr2PostRowChanging" msprop:Generator_RowEvHandlerName="Opr2PostRowChangeEventHandler" msprop:Generator_RowDeletedName="Opr2PostRowDeleted" msprop:Generator_RowClassName="Opr2PostRow" msprop:Generator_UserTableName="Opr2Post" msprop:Generator_RowEvArgName="Opr2PostRowChangeEvent">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="CodOpr" msprop:Generator_ColumnVarNameInTable="columnCodOpr" msprop:Generator_ColumnPropNameInRow="CodOpr" msprop:Generator_ColumnPropNameInTable="CodOprColumn" msprop:Generator_UserColumnName="CodOpr">
|
||||
@@ -1698,7 +1733,7 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="AnagTag" msprop:Generator_TableClassName="AnagTagDataTable" msprop:Generator_TableVarName="tableAnagTag" msprop:Generator_TablePropName="AnagTag" msprop:Generator_RowDeletingName="AnagTagRowDeleting" msprop:Generator_RowChangingName="AnagTagRowChanging" msprop:Generator_RowEvHandlerName="AnagTagRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagTagRowDeleted" msprop:Generator_UserTableName="AnagTag" msprop:Generator_RowChangedName="AnagTagRowChanged" msprop:Generator_RowEvArgName="AnagTagRowChangeEvent" msprop:Generator_RowClassName="AnagTagRow">
|
||||
<xs:element name="AnagTag" msprop:Generator_TableClassName="AnagTagDataTable" msprop:Generator_TableVarName="tableAnagTag" msprop:Generator_RowChangedName="AnagTagRowChanged" msprop:Generator_TablePropName="AnagTag" msprop:Generator_RowDeletingName="AnagTagRowDeleting" msprop:Generator_RowChangingName="AnagTagRowChanging" msprop:Generator_RowEvHandlerName="AnagTagRowChangeEventHandler" msprop:Generator_RowDeletedName="AnagTagRowDeleted" msprop:Generator_RowClassName="AnagTagRow" msprop:Generator_UserTableName="AnagTag" msprop:Generator_RowEvArgName="AnagTagRowChangeEvent">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="CodTag" msprop:Generator_ColumnVarNameInTable="columnCodTag" msprop:Generator_ColumnPropNameInRow="CodTag" msprop:Generator_ColumnPropNameInTable="CodTagColumn" msprop:Generator_UserColumnName="CodTag">
|
||||
@@ -1725,6 +1760,34 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="TaskRecAgg" msprop:Generator_TableClassName="TaskRecAggDataTable" msprop:Generator_TableVarName="tableTaskRecAgg" msprop:Generator_TablePropName="TaskRecAgg" msprop:Generator_RowDeletingName="TaskRecAggRowDeleting" msprop:Generator_RowChangingName="TaskRecAggRowChanging" msprop:Generator_RowEvHandlerName="TaskRecAggRowChangeEventHandler" msprop:Generator_RowDeletedName="TaskRecAggRowDeleted" msprop:Generator_UserTableName="TaskRecAgg" msprop:Generator_RowChangedName="TaskRecAggRowChanged" msprop:Generator_RowEvArgName="TaskRecAggRowChangeEvent" msprop:Generator_RowClassName="TaskRecAggRow">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="NumTask" msprop:Generator_ColumnVarNameInTable="columnNumTask" msprop:Generator_ColumnPropNameInRow="NumTask" msprop:Generator_ColumnPropNameInTable="NumTaskColumn" msprop:Generator_UserColumnName="NumTask">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="50" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="CodArt" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnCodArt" msprop:Generator_ColumnPropNameInRow="CodArt" msprop:Generator_ColumnPropNameInTable="CodArtColumn" msprop:Generator_UserColumnName="CodArt" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="50" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="QtaRic" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnQtaRic" msprop:Generator_ColumnPropNameInRow="QtaRic" msprop:Generator_ColumnPropNameInTable="QtaRicColumn" msprop:Generator_UserColumnName="QtaRic" type="xs:int" minOccurs="0" />
|
||||
<xs:element name="TempoPrev" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnTempoPrev" msprop:Generator_ColumnPropNameInRow="TempoPrev" msprop:Generator_ColumnPropNameInTable="TempoPrevColumn" msprop:Generator_UserColumnName="TempoPrev" type="xs:decimal" minOccurs="0" />
|
||||
<xs:element name="IdxRec" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnIdxRec" msprop:Generator_ColumnPropNameInRow="IdxRec" msprop:Generator_ColumnPropNameInTable="IdxRecColumn" msprop:Generator_UserColumnName="IdxRec" type="xs:int" minOccurs="0" />
|
||||
<xs:element name="DtStart" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDtStart" msprop:Generator_ColumnPropNameInRow="DtStart" msprop:Generator_ColumnPropNameInTable="DtStartColumn" msprop:Generator_UserColumnName="DtStart" type="xs:dateTime" minOccurs="0" />
|
||||
<xs:element name="DtEnd" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDtEnd" msprop:Generator_ColumnPropNameInRow="DtEnd" msprop:Generator_ColumnPropNameInTable="DtEndColumn" msprop:Generator_UserColumnName="DtEnd" type="xs:dateTime" minOccurs="0" />
|
||||
<xs:element name="QtaEv" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnQtaEv" msprop:Generator_ColumnPropNameInRow="QtaEv" msprop:Generator_ColumnPropNameInTable="QtaEvColumn" msprop:Generator_UserColumnName="QtaEv" type="xs:int" minOccurs="0" />
|
||||
<xs:element name="DurataMin" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnDurataMin" msprop:Generator_ColumnPropNameInRow="DurataMin" msprop:Generator_ColumnPropNameInTable="DurataMinColumn" msprop:Generator_UserColumnName="DurataMin" type="xs:decimal" minOccurs="0" />
|
||||
<xs:element name="TCiclo" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnTCiclo" msprop:Generator_ColumnPropNameInRow="TCiclo" msprop:Generator_ColumnPropNameInTable="TCicloColumn" msprop:Generator_UserColumnName="TCiclo" type="xs:decimal" minOccurs="0" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
<xs:unique name="Constraint1" msdata:PrimaryKey="true">
|
||||
@@ -1774,5 +1837,9 @@ SELECT CodTag, TipoTag, DescrTag FROM AnagTag WHERE (CodTag = @CodTag)</CommandT
|
||||
<xs:selector xpath=".//mstns:AnagTag" />
|
||||
<xs:field xpath="mstns:CodTag" />
|
||||
</xs:unique>
|
||||
<xs:unique name="TaskRecAgg_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
|
||||
<xs:selector xpath=".//mstns:TaskRecAgg" />
|
||||
<xs:field xpath="mstns:NumTask" />
|
||||
</xs:unique>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
+15
-14
@@ -4,21 +4,22 @@
|
||||
Changes to this file may cause incorrect behavior and will be lost if
|
||||
the code is regenerated.
|
||||
</autogenerated>-->
|
||||
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="-10" ViewPortY="-10" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
|
||||
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="-10" ViewPortY="304" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
|
||||
<Shapes>
|
||||
<Shape ID="DesignTable:TaskList" ZOrder="7" X="91" Y="386" Height="381" Width="289" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
|
||||
<Shape ID="DesignTable:AnagFasi" ZOrder="10" X="887" Y="474" Height="191" Width="197" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
|
||||
<Shape ID="DesignTable:AnagOpr" ZOrder="13" X="910" Y="728" Height="153" Width="197" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="83" />
|
||||
<Shape ID="DesignTable:TaskRec" ZOrder="3" X="519" Y="541" Height="457" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="306" />
|
||||
<Shape ID="DesignTable:AnagPost" ZOrder="9" X="519" Y="209" Height="267" Width="200" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="140" />
|
||||
<Shape ID="DesignTable:TraEv2Stati" ZOrder="12" X="195" Y="1020" Height="248" Width="210" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="178" />
|
||||
<Shape ID="DesignTable:AnagEventi" ZOrder="11" X="903" Y="966" Height="172" Width="211" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
|
||||
<Shape ID="DesignTable:PODL" ZOrder="8" X="560" Y="1047" Height="343" Width="199" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
|
||||
<Shape ID="DesignTable:AnagArticoli" ZOrder="6" X="258" Y="1475" Height="229" Width="217" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="159" />
|
||||
<Shape ID="DesignTable:TaskList2Post" ZOrder="1" X="809" Y="16" Height="400" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
|
||||
<Shape ID="DesignTable:AnagStati" ZOrder="5" X="220" Y="54" Height="191" Width="201" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
|
||||
<Shape ID="DesignTable:Opr2Post" ZOrder="4" X="175" Y="774" Height="229" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="121" />
|
||||
<Shape ID="DesignTable:AnagTag" ZOrder="2" X="563" Y="18" Height="153" Width="196" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="83" />
|
||||
<Shape ID="DesignTable:TaskList" ZOrder="2" X="85" Y="299" Height="381" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
|
||||
<Shape ID="DesignTable:AnagFasi" ZOrder="11" X="887" Y="474" Height="191" Width="197" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
|
||||
<Shape ID="DesignTable:AnagOpr" ZOrder="14" X="910" Y="728" Height="153" Width="197" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="83" />
|
||||
<Shape ID="DesignTable:TaskRec" ZOrder="5" X="519" Y="541" Height="381" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
|
||||
<Shape ID="DesignTable:AnagPost" ZOrder="10" X="519" Y="209" Height="267" Width="200" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="140" />
|
||||
<Shape ID="DesignTable:TraEv2Stati" ZOrder="13" X="195" Y="1020" Height="248" Width="210" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="178" />
|
||||
<Shape ID="DesignTable:AnagEventi" ZOrder="12" X="903" Y="966" Height="172" Width="211" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
|
||||
<Shape ID="DesignTable:PODL" ZOrder="9" X="560" Y="1047" Height="343" Width="199" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
|
||||
<Shape ID="DesignTable:AnagArticoli" ZOrder="8" X="152" Y="1317" Height="229" Width="217" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="159" />
|
||||
<Shape ID="DesignTable:TaskList2Post" ZOrder="3" X="809" Y="16" Height="381" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
|
||||
<Shape ID="DesignTable:AnagStati" ZOrder="7" X="220" Y="54" Height="191" Width="201" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
|
||||
<Shape ID="DesignTable:Opr2Post" ZOrder="6" X="175" Y="774" Height="229" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="121" />
|
||||
<Shape ID="DesignTable:AnagTag" ZOrder="4" X="563" Y="18" Height="153" Width="196" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="83" />
|
||||
<Shape ID="DesignTable:TaskRecAgg" ZOrder="1" X="833" Y="1202" Height="267" Width="232" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="216" />
|
||||
</Shapes>
|
||||
<Connectors />
|
||||
</DiagramLayout>
|
||||
+141
-110
@@ -2,115 +2,146 @@
|
||||
|
||||
namespace AppData
|
||||
{
|
||||
public class dataLayer
|
||||
{
|
||||
/// <summary>
|
||||
/// avvio classe
|
||||
/// </summary>
|
||||
protected dataLayer()
|
||||
public class dataLayer
|
||||
{
|
||||
avvioTA();
|
||||
setupConnectionStringBase();
|
||||
#region Public Fields
|
||||
|
||||
/// <summary>
|
||||
/// singleton classe
|
||||
/// </summary>
|
||||
public static dataLayer man = new dataLayer();
|
||||
|
||||
/// <summary>
|
||||
/// Elenco POSTAZIONI
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.AnagFasiTableAdapter taAF;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco TASK
|
||||
/// </summary>
|
||||
public DS_UtilityTableAdapters.AnagKeyValueTableAdapter taAKV;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ARTICOLI
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.AnagArticoliTableAdapter taAnArt;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco OPERATORI
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.AnagOprTableAdapter taAO;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco POSTAZIONI
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.AnagPostTableAdapter taAP;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco TAG
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.AnagTagTableAdapter taAT;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco PROMESSE ODL
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.Opr2PostTableAdapter taO2P;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco PROMESSE ODL
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.PODLTableAdapter taPODL;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco TASK
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.TraEv2StatiTableAdapter taTE2S;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco TASK
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.TaskListTableAdapter taTL;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco TASK
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.TaskList2PostTableAdapter taTL2Post;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco TASK
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.TaskRecTableAdapter taTR;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco TASK Aggregati
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.TaskRecAggTableAdapter taTRA;
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Protected Constructors
|
||||
|
||||
/// <summary>
|
||||
/// avvio classe
|
||||
/// </summary>
|
||||
public dataLayer()
|
||||
{
|
||||
avvioTA();
|
||||
setupConnectionStringBase();
|
||||
}
|
||||
|
||||
#endregion Protected Constructors
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// avvia table adapters
|
||||
/// </summary>
|
||||
private void avvioTA()
|
||||
{
|
||||
// avvio i table adapters...
|
||||
taAnArt = new DS_AppTableAdapters.AnagArticoliTableAdapter();
|
||||
taAF = new DS_AppTableAdapters.AnagFasiTableAdapter();
|
||||
taAO = new DS_AppTableAdapters.AnagOprTableAdapter();
|
||||
taAP = new DS_AppTableAdapters.AnagPostTableAdapter();
|
||||
taAT = new DS_AppTableAdapters.AnagTagTableAdapter();
|
||||
taO2P = new DS_AppTableAdapters.Opr2PostTableAdapter();
|
||||
taPODL = new DS_AppTableAdapters.PODLTableAdapter();
|
||||
taTL = new DS_AppTableAdapters.TaskListTableAdapter();
|
||||
taTL2Post = new DS_AppTableAdapters.TaskList2PostTableAdapter();
|
||||
taTR = new DS_AppTableAdapters.TaskRecTableAdapter();
|
||||
taTRA = new DS_AppTableAdapters.TaskRecAggTableAdapter();
|
||||
taTE2S = new DS_AppTableAdapters.TraEv2StatiTableAdapter();
|
||||
|
||||
taAKV = new DS_UtilityTableAdapters.AnagKeyValueTableAdapter();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// effettua setup dei connection strings da web.config delal singola applicazione
|
||||
/// </summary>
|
||||
protected virtual void setupConnectionStringBase()
|
||||
{
|
||||
string connString = memLayer.ML.confReadString("CTrackConnectionString");
|
||||
// connections strings del db
|
||||
taAnArt.Connection.ConnectionString = connString;
|
||||
taAF.Connection.ConnectionString = connString;
|
||||
taAO.Connection.ConnectionString = connString;
|
||||
taAP.Connection.ConnectionString = connString;
|
||||
taAT.Connection.ConnectionString = connString;
|
||||
taO2P.Connection.ConnectionString = connString;
|
||||
taPODL.Connection.ConnectionString = connString;
|
||||
taTL.Connection.ConnectionString = connString;
|
||||
taTL2Post.Connection.ConnectionString = connString;
|
||||
taTR.Connection.ConnectionString = connString;
|
||||
taTRA.Connection.ConnectionString = connString;
|
||||
taTE2S.Connection.ConnectionString = connString;
|
||||
|
||||
taAKV.Connection.ConnectionString = connString;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
/// <summary>
|
||||
/// avvia table adapters
|
||||
/// </summary>
|
||||
private void avvioTA()
|
||||
{
|
||||
// avvio i table adapters...
|
||||
taAnArt = new DS_AppTableAdapters.AnagArticoliTableAdapter();
|
||||
taAF = new DS_AppTableAdapters.AnagFasiTableAdapter();
|
||||
taAO = new DS_AppTableAdapters.AnagOprTableAdapter();
|
||||
taAP = new DS_AppTableAdapters.AnagPostTableAdapter();
|
||||
taAT = new DS_AppTableAdapters.AnagTagTableAdapter();
|
||||
taO2P = new DS_AppTableAdapters.Opr2PostTableAdapter();
|
||||
taPODL = new DS_AppTableAdapters.PODLTableAdapter();
|
||||
taTL = new DS_AppTableAdapters.TaskListTableAdapter();
|
||||
taTL2Post = new DS_AppTableAdapters.TaskList2PostTableAdapter();
|
||||
taTR = new DS_AppTableAdapters.TaskRecTableAdapter();
|
||||
taTE2S = new DS_AppTableAdapters.TraEv2StatiTableAdapter();
|
||||
|
||||
taAKV = new DS_UtilityTableAdapters.AnagKeyValueTableAdapter();
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua setup dei connection strings da web.config delal singola applicazione
|
||||
/// </summary>
|
||||
protected virtual void setupConnectionStringBase()
|
||||
{
|
||||
string connString = memLayer.ML.confReadString("CTrackConnectionString");
|
||||
// connections strings del db
|
||||
taAnArt.Connection.ConnectionString = connString;
|
||||
taAF.Connection.ConnectionString = connString;
|
||||
taAO.Connection.ConnectionString = connString;
|
||||
taAP.Connection.ConnectionString = connString;
|
||||
taAT.Connection.ConnectionString = connString;
|
||||
taO2P.Connection.ConnectionString = connString;
|
||||
taPODL.Connection.ConnectionString = connString;
|
||||
taTL.Connection.ConnectionString = connString;
|
||||
taTL2Post.Connection.ConnectionString = connString;
|
||||
taTR.Connection.ConnectionString = connString;
|
||||
taTE2S.Connection.ConnectionString = connString;
|
||||
|
||||
taAKV.Connection.ConnectionString = connString;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco ARTICOLI
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.AnagArticoliTableAdapter taAnArt;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco POSTAZIONI
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.AnagFasiTableAdapter taAF;
|
||||
/// <summary>
|
||||
/// Elenco OPERATORI
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.AnagOprTableAdapter taAO;
|
||||
/// <summary>
|
||||
/// Elenco POSTAZIONI
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.AnagPostTableAdapter taAP;
|
||||
/// <summary>
|
||||
/// Elenco TAG
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.AnagTagTableAdapter taAT;
|
||||
/// <summary>
|
||||
/// Elenco PROMESSE ODL
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.Opr2PostTableAdapter taO2P;
|
||||
/// <summary>
|
||||
/// Elenco PROMESSE ODL
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.PODLTableAdapter taPODL;
|
||||
/// <summary>
|
||||
/// Elenco TASK
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.TaskListTableAdapter taTL;
|
||||
/// <summary>
|
||||
/// Elenco TASK
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.TaskList2PostTableAdapter taTL2Post;
|
||||
/// <summary>
|
||||
/// Elenco TASK
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.TaskRecTableAdapter taTR;
|
||||
/// <summary>
|
||||
/// Elenco TASK
|
||||
/// </summary>
|
||||
public DS_AppTableAdapters.TraEv2StatiTableAdapter taTE2S;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Elenco TASK
|
||||
/// </summary>
|
||||
public DS_UtilityTableAdapters.AnagKeyValueTableAdapter taAKV;
|
||||
|
||||
/// <summary>
|
||||
/// singleton classe
|
||||
/// </summary>
|
||||
public static dataLayer man = new dataLayer();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+212
-178
@@ -2,188 +2,222 @@
|
||||
|
||||
namespace AppData
|
||||
{
|
||||
public class mUtils
|
||||
{
|
||||
|
||||
#region definizione Regexp
|
||||
/// <summary>
|
||||
/// RegExp x Cod ARTICOLO
|
||||
/// </summary>
|
||||
public static string reCodArt = memLayer.ML.cdv("regExp_CodArt");
|
||||
/// <summary>
|
||||
/// RegExp x Cod OPERATORE
|
||||
/// </summary>
|
||||
public static string reCodOper = memLayer.ML.cdv("regExp_CodOper");
|
||||
/// <summary>
|
||||
/// RegExp x Cod POSTAZIONE
|
||||
/// </summary>
|
||||
public static string reCodPost = memLayer.ML.cdv("regExp_CodPost");
|
||||
/// <summary>
|
||||
/// RegExp x Cod COMMESSA (NumTask)
|
||||
/// </summary>
|
||||
public static string reNumTask = memLayer.ML.cdv("regExp_NumTask");
|
||||
/// <summary>
|
||||
/// RegExp x QTA
|
||||
/// </summary>
|
||||
public static string reQta = memLayer.ML.cdv("regExp_QtaRic");
|
||||
/// <summary>
|
||||
/// RegExp x RESET / CANCEL
|
||||
/// </summary>
|
||||
public static string reReset = memLayer.ML.cdv("regExp_KO");
|
||||
/// <summary>
|
||||
/// RegExp x CONFERMA ADD
|
||||
/// </summary>
|
||||
public static string reAddNew = memLayer.ML.cdv("regExp_AddNew");
|
||||
/// <summary>
|
||||
/// RegExp x CONFERMA DELETE
|
||||
/// </summary>
|
||||
public static string reDelete = memLayer.ML.cdv("regExp_DEL");
|
||||
/// <summary>
|
||||
/// Comando x RESET OPERATORE
|
||||
/// </summary>
|
||||
public static string reCmdResetOper = memLayer.ML.cdv("regExp_CmdResetOper");
|
||||
/// <summary>
|
||||
/// Comando x RESET COMMESSA (NumTask)
|
||||
/// </summary>
|
||||
public static string reCmdResetNumTask = memLayer.ML.cdv("regExp_CmdResetNumTask");
|
||||
/// <summary>
|
||||
/// Comando x PAUSA (es COMMESSA/NumTask)
|
||||
/// </summary>
|
||||
public static string reCmdPause = memLayer.ML.cdv("regExp_CmdPause");
|
||||
/// <summary>
|
||||
/// Comando x CHIUSURA COMMESSA (NumTask)
|
||||
/// </summary>
|
||||
public static string reCmdClose = memLayer.ML.cdv("regExp_CmdClose");
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// OPZIONE: indica che è abilitato BCode
|
||||
/// </summary>
|
||||
public static bool OptUseBCode = memLayer.ML.CRB("OptUseBCode");
|
||||
/// <summary>
|
||||
/// OPZIONE: indica che è abilitata selezione TASK/COMMESSA
|
||||
/// </summary>
|
||||
public static bool OptUseSelTask = memLayer.ML.CRB("OptUseSelTask");
|
||||
/// <summary>
|
||||
/// OPZIONE: indica che è abilitata selezione TAG
|
||||
/// </summary>
|
||||
public static bool OptUseSelTag = memLayer.ML.CRB("OptUseSelTag");
|
||||
|
||||
/// <summary>
|
||||
/// OPZIONE: indica che è da eseguire il preprocessing
|
||||
/// </summary>
|
||||
public static bool OptBCodePrepDo = memLayer.ML.CRB("OptBCodePrepDo");
|
||||
/// <summary>
|
||||
/// RegExp x Cod dati raw x preprocessare
|
||||
/// </summary>
|
||||
public static string rePreproc = memLayer.ML.cdv("regExp_Preproc");
|
||||
/// <summary>
|
||||
/// RegExp x Cod dati da TENERE post preprocessing
|
||||
/// </summary>
|
||||
public static string rePreprocKeep = memLayer.ML.cdv("regExp_PreprocKeep");
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Codice Operatore
|
||||
/// </summary>
|
||||
public static string CodOpr
|
||||
public class mUtils
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
answ = memLayer.ML.StringSessionObj("CodOpr");
|
||||
// se vuoto cerco anche nei cookies...
|
||||
if (answ == "")
|
||||
{
|
||||
answ = memLayer.ML.getCookieVal("CTrack_CodOpr");
|
||||
// se non vuoto salvo...
|
||||
memLayer.ML.setSessionVal("CodOpr", answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("CodOpr", value);
|
||||
memLayer.ML.setCookieVal("CTrack_CodOpr", value);
|
||||
memLayer.ML.emptySessionVal("NomeOpr");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Codice postazione di lavoro
|
||||
/// </summary>
|
||||
public static string CodPost
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
answ = memLayer.ML.StringSessionObj("CodPost");
|
||||
if (string.IsNullOrEmpty(answ))
|
||||
{
|
||||
answ = memLayer.ML.getCookieVal("CTrack_CodPost");
|
||||
// se non vuoto salvo...
|
||||
memLayer.ML.setSessionVal("CodPost", answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("CodPost", value);
|
||||
memLayer.ML.setCookieVal("CTrack_CodPost", value);
|
||||
memLayer.ML.emptySessionVal("DescPost");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Restituisce boolean se post corrente sia multi operatore
|
||||
/// </summary>
|
||||
public static bool postIsMulti
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
if (memLayer.ML.isInSessionObject("postIsMulti"))
|
||||
{
|
||||
answ = memLayer.ML.BoolSessionObj("postIsMulti");
|
||||
}
|
||||
else
|
||||
{
|
||||
string rawAnsw = memLayer.ML.getCookieVal("CTrack_postIsMulti");
|
||||
bool.TryParse(rawAnsw, out answ);
|
||||
// se non vuoto salvo...
|
||||
memLayer.ML.setSessionVal("postIsMulti", answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("postIsMulti", value);
|
||||
memLayer.ML.setCookieVal("CTrack_postIsMulti", value.ToString());
|
||||
}
|
||||
}
|
||||
#region Public Fields
|
||||
|
||||
/// <summary>
|
||||
/// oggetto valore opzionale letto 8e scorporato da barcode), es TAG in commessa + tag
|
||||
/// </summary>
|
||||
public static string optValueBC
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ;
|
||||
if (memLayer.ML.isInSessionObject("optValueBC"))
|
||||
/// <summary>
|
||||
/// Array di regole di sostituzione per valori Time
|
||||
/// </summary>
|
||||
public static string[] lRepCleanTime = memLayer.ML.CRS("confAddTaskCleanTime").Split('#');
|
||||
|
||||
/// <summary>
|
||||
/// OPZIONE: indica che è da eseguire il preprocessing
|
||||
/// </summary>
|
||||
public static bool OptBCodePrepDo = memLayer.ML.CRB("OptBCodePrepDo");
|
||||
|
||||
/// <summary>
|
||||
/// OPZIONE: indica che è abilitato BCode
|
||||
/// </summary>
|
||||
public static bool OptUseBCode = memLayer.ML.CRB("OptUseBCode");
|
||||
|
||||
/// <summary>
|
||||
/// OPZIONE: indica che è abilitata selezione TAG
|
||||
/// </summary>
|
||||
public static bool OptUseSelTag = memLayer.ML.CRB("OptUseSelTag");
|
||||
|
||||
/// <summary>
|
||||
/// OPZIONE: indica che è abilitata selezione TASK/COMMESSA
|
||||
/// </summary>
|
||||
public static bool OptUseSelTask = memLayer.ML.CRB("OptUseSelTask");
|
||||
|
||||
/// <summary>
|
||||
/// RegExp x CONFERMA ADD
|
||||
/// </summary>
|
||||
public static string reAddNew = memLayer.ML.cdv("regExp_AddNew");
|
||||
|
||||
/// <summary>
|
||||
/// Comando x CHIUSURA COMMESSA (NumTask)
|
||||
/// </summary>
|
||||
public static string reCmdClose = memLayer.ML.cdv("regExp_CmdClose");
|
||||
|
||||
/// <summary>
|
||||
/// Comando x PAUSA (es COMMESSA/NumTask)
|
||||
/// </summary>
|
||||
public static string reCmdPause = memLayer.ML.cdv("regExp_CmdPause");
|
||||
|
||||
/// <summary>
|
||||
/// Comando x RESET COMMESSA (NumTask)
|
||||
/// </summary>
|
||||
public static string reCmdResetNumTask = memLayer.ML.cdv("regExp_CmdResetNumTask");
|
||||
|
||||
/// <summary>
|
||||
/// Comando x RESET OPERATORE
|
||||
/// </summary>
|
||||
public static string reCmdResetOper = memLayer.ML.cdv("regExp_CmdResetOper");
|
||||
|
||||
/// <summary>
|
||||
/// RegExp x Cod ARTICOLO
|
||||
/// </summary>
|
||||
public static string reCodArt = memLayer.ML.cdv("regExp_CodArt");
|
||||
|
||||
/// <summary>
|
||||
/// RegExp x Cod OPERATORE
|
||||
/// </summary>
|
||||
public static string reCodOper = memLayer.ML.cdv("regExp_CodOper");
|
||||
|
||||
/// <summary>
|
||||
/// RegExp x Cod POSTAZIONE
|
||||
/// </summary>
|
||||
public static string reCodPost = memLayer.ML.cdv("regExp_CodPost");
|
||||
|
||||
/// <summary>
|
||||
/// RegExp x CONFERMA DELETE
|
||||
/// </summary>
|
||||
public static string reDelete = memLayer.ML.cdv("regExp_DEL");
|
||||
|
||||
/// <summary>
|
||||
/// RegExp x Cod COMMESSA (NumTask)
|
||||
/// </summary>
|
||||
public static string reNumTask = memLayer.ML.cdv("regExp_NumTask");
|
||||
|
||||
/// <summary>
|
||||
/// RegExp x Cod dati raw x preprocessare
|
||||
/// </summary>
|
||||
public static string rePreproc = memLayer.ML.cdv("regExp_Preproc");
|
||||
|
||||
/// <summary>
|
||||
/// RegExp x Cod dati da TENERE post preprocessing
|
||||
/// </summary>
|
||||
public static string rePreprocKeep = memLayer.ML.cdv("regExp_PreprocKeep");
|
||||
|
||||
/// <summary>
|
||||
/// RegExp x QTA
|
||||
/// </summary>
|
||||
public static string reQta = memLayer.ML.cdv("regExp_QtaRic");
|
||||
|
||||
/// <summary>
|
||||
/// RegExp x RESET / CANCEL
|
||||
/// </summary>
|
||||
public static string reReset = memLayer.ML.cdv("regExp_KO");
|
||||
|
||||
/// <summary>
|
||||
/// RegExp x TempoPrevisto
|
||||
/// </summary>
|
||||
public static string reTempoPrev = memLayer.ML.cdv("regExp_TimePrev");
|
||||
|
||||
/// <summary>
|
||||
/// Fattore conversione tempo stimato letto da BCode (def 1 = NO conversione, 10=da dividere per 10)
|
||||
/// </summary>
|
||||
public static int TimeEstFactor = memLayer.ML.cdvi("confAddTaskTimeFactor");
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Codice Operatore
|
||||
/// </summary>
|
||||
public static string CodOpr
|
||||
{
|
||||
answ = memLayer.ML.StringSessionObj("optValueBC");
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
answ = memLayer.ML.StringSessionObj("CodOpr");
|
||||
// se vuoto cerco anche nei cookies...
|
||||
if (answ == "")
|
||||
{
|
||||
answ = memLayer.ML.getCookieVal("CTrack_CodOpr");
|
||||
// se non vuoto salvo...
|
||||
memLayer.ML.setSessionVal("CodOpr", answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("CodOpr", value);
|
||||
memLayer.ML.setCookieVal("CTrack_CodOpr", value);
|
||||
memLayer.ML.emptySessionVal("NomeOpr");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
/// <summary>
|
||||
/// Codice postazione di lavoro
|
||||
/// </summary>
|
||||
public static string CodPost
|
||||
{
|
||||
answ = "";
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
answ = memLayer.ML.StringSessionObj("CodPost");
|
||||
if (string.IsNullOrEmpty(answ))
|
||||
{
|
||||
answ = memLayer.ML.getCookieVal("CTrack_CodPost");
|
||||
// se non vuoto salvo...
|
||||
memLayer.ML.setSessionVal("CodPost", answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("CodPost", value);
|
||||
memLayer.ML.setCookieVal("CTrack_CodPost", value);
|
||||
memLayer.ML.emptySessionVal("DescPost");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("optValueBC", value, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// oggetto valore opzionale letto 8e scorporato da barcode), es TAG in commessa + tag
|
||||
/// </summary>
|
||||
public static string optValueBC
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ;
|
||||
if (memLayer.ML.isInSessionObject("optValueBC"))
|
||||
{
|
||||
answ = memLayer.ML.StringSessionObj("optValueBC");
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("optValueBC", value, false);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce boolean se post corrente sia multi operatore
|
||||
/// </summary>
|
||||
public static bool postIsMulti
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
if (memLayer.ML.isInSessionObject("postIsMulti"))
|
||||
{
|
||||
answ = memLayer.ML.BoolSessionObj("postIsMulti");
|
||||
}
|
||||
else
|
||||
{
|
||||
string rawAnsw = memLayer.ML.getCookieVal("CTrack_postIsMulti");
|
||||
bool.TryParse(rawAnsw, out answ);
|
||||
// se non vuoto salvo...
|
||||
memLayer.ML.setSessionVal("postIsMulti", answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("postIsMulti", value);
|
||||
memLayer.ML.setCookieVal("CTrack_postIsMulti", value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+96
-96
@@ -3,107 +3,107 @@ using System.Text.RegularExpressions;
|
||||
|
||||
namespace AppData
|
||||
{
|
||||
/// <summary>
|
||||
/// macchina di gestione degli stati
|
||||
/// </summary>
|
||||
public class stateMachine
|
||||
{
|
||||
/// <summary>
|
||||
/// macchina di gestione degli stati
|
||||
/// </summary>
|
||||
public class stateMachine
|
||||
{
|
||||
|
||||
protected DS_AppTableAdapters.AnagEventiTableAdapter taEv;
|
||||
protected DS_AppTableAdapters.TraEv2StatiTableAdapter taEv2St;
|
||||
//protected DS_applicazioneTableAdapters.IstObjTableAdapter taIstObj;
|
||||
protected stateMachine()
|
||||
{
|
||||
avvioTA();
|
||||
setupConnectionStringBase();
|
||||
}
|
||||
/// <summary>
|
||||
/// avvia table adapters
|
||||
/// </summary>
|
||||
private void avvioTA()
|
||||
{
|
||||
taEv = new DS_AppTableAdapters.AnagEventiTableAdapter();
|
||||
taEv2St = new DS_AppTableAdapters.TraEv2StatiTableAdapter();
|
||||
//taIstObj = new DS_applicazioneTableAdapters.IstObjTableAdapter();
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua setup dei connection strings da web.config della singola applicazione
|
||||
/// </summary>
|
||||
protected virtual void setupConnectionStringBase()
|
||||
{
|
||||
string connString = memLayer.ML.confReadString("CTrackConnectionString");
|
||||
// connections strings del db
|
||||
taEv.Connection.ConnectionString = connString;
|
||||
taEv2St.Connection.ConnectionString = connString;
|
||||
//taIstObj.Connection.ConnectionString = connString;
|
||||
}
|
||||
public static stateMachine st = new stateMachine();
|
||||
/// <summary>
|
||||
/// restituisce il tipo di comando associato...
|
||||
/// </summary>
|
||||
/// <param name="comando"></param>
|
||||
/// <returns></returns>
|
||||
public tipoAzione azioneComando(inputComando comando)
|
||||
{
|
||||
Match testNumTask = Regex.Match(comando.valore, mUtils.reNumTask);
|
||||
Match testOper = Regex.Match(comando.valore, mUtils.reCodOper);
|
||||
Match testPost = Regex.Match(comando.valore, mUtils.reCodPost);
|
||||
tipoAzione _azione = tipoAzione.noAct;
|
||||
// se è un SET OPR o POST è un azione IMPLICITA...
|
||||
if (testOper.Success || testPost.Success)
|
||||
{
|
||||
_azione = tipoAzione.esegui;
|
||||
}
|
||||
else if (testNumTask.Success)
|
||||
{
|
||||
_azione = tipoAzione.esegui;
|
||||
}
|
||||
else if (dataLayer.man.taAF.getByKey(comando.currCmdIn).Rows.Count > 0)
|
||||
{
|
||||
_azione = tipoAzione.esegui;
|
||||
}
|
||||
else
|
||||
{
|
||||
// altrimenti controllo azione
|
||||
string toDo = "";
|
||||
try
|
||||
protected DS_AppTableAdapters.AnagEventiTableAdapter taEv;
|
||||
protected DS_AppTableAdapters.TraEv2StatiTableAdapter taEv2St;
|
||||
//protected DS_applicazioneTableAdapters.IstObjTableAdapter taIstObj;
|
||||
protected stateMachine()
|
||||
{
|
||||
toDo = taEv.getByKey(comando.currCmdIn)[0].Action;
|
||||
avvioTA();
|
||||
setupConnectionStringBase();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
switch (toDo)
|
||||
/// <summary>
|
||||
/// avvia table adapters
|
||||
/// </summary>
|
||||
private void avvioTA()
|
||||
{
|
||||
case "ok":
|
||||
_azione = tipoAzione.conferma;
|
||||
break;
|
||||
case "ko":
|
||||
_azione = tipoAzione.annulla;
|
||||
break;
|
||||
case "act":
|
||||
_azione = tipoAzione.esegui;
|
||||
break;
|
||||
default:
|
||||
_azione = tipoAzione.noAct;
|
||||
break;
|
||||
taEv = new DS_AppTableAdapters.AnagEventiTableAdapter();
|
||||
taEv2St = new DS_AppTableAdapters.TraEv2StatiTableAdapter();
|
||||
//taIstObj = new DS_applicazioneTableAdapters.IstObjTableAdapter();
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua setup dei connection strings da web.config della singola applicazione
|
||||
/// </summary>
|
||||
protected virtual void setupConnectionStringBase()
|
||||
{
|
||||
string connString = memLayer.ML.confReadString("CTrackConnectionString");
|
||||
// connections strings del db
|
||||
taEv.Connection.ConnectionString = connString;
|
||||
taEv2St.Connection.ConnectionString = connString;
|
||||
//taIstObj.Connection.ConnectionString = connString;
|
||||
}
|
||||
public static stateMachine st = new stateMachine();
|
||||
/// <summary>
|
||||
/// restituisce il tipo di comando associato...
|
||||
/// </summary>
|
||||
/// <param name="comando"></param>
|
||||
/// <returns></returns>
|
||||
public tipoAzione azioneComando(inputComando comando)
|
||||
{
|
||||
Match testNumTask = Regex.Match(comando.valore, mUtils.reNumTask);
|
||||
Match testOper = Regex.Match(comando.valore, mUtils.reCodOper);
|
||||
Match testPost = Regex.Match(comando.valore, mUtils.reCodPost);
|
||||
tipoAzione _azione = tipoAzione.noAct;
|
||||
// se è un SET OPR o POST è un azione IMPLICITA...
|
||||
if (testOper.Success || testPost.Success)
|
||||
{
|
||||
_azione = tipoAzione.esegui;
|
||||
}
|
||||
else if (testNumTask.Success)
|
||||
{
|
||||
_azione = tipoAzione.esegui;
|
||||
}
|
||||
else if (dataLayer.man.taAF.getByKey(comando.currCmdIn).Rows.Count > 0)
|
||||
{
|
||||
_azione = tipoAzione.esegui;
|
||||
}
|
||||
else
|
||||
{
|
||||
// altrimenti controllo azione
|
||||
string toDo = "";
|
||||
try
|
||||
{
|
||||
toDo = taEv.getByKey(comando.currCmdIn)[0].Action;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
switch (toDo)
|
||||
{
|
||||
case "ok":
|
||||
_azione = tipoAzione.conferma;
|
||||
break;
|
||||
case "ko":
|
||||
_azione = tipoAzione.annulla;
|
||||
break;
|
||||
case "act":
|
||||
_azione = tipoAzione.esegui;
|
||||
break;
|
||||
default:
|
||||
_azione = tipoAzione.noAct;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return _azione;
|
||||
}
|
||||
}
|
||||
return _azione;
|
||||
}
|
||||
}
|
||||
|
||||
public enum tipoAzione
|
||||
{
|
||||
annulla,
|
||||
conferma,
|
||||
esegui,
|
||||
noAct,
|
||||
setup
|
||||
}
|
||||
public enum tipoEsito
|
||||
{
|
||||
error,
|
||||
ok,
|
||||
undef
|
||||
}
|
||||
public enum tipoAzione
|
||||
{
|
||||
annulla,
|
||||
conferma,
|
||||
esegui,
|
||||
noAct,
|
||||
setup
|
||||
}
|
||||
public enum tipoEsito
|
||||
{
|
||||
error,
|
||||
ok,
|
||||
undef
|
||||
}
|
||||
}
|
||||
+4
-23
@@ -9,9 +9,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VersGen", "VersGen\VersGen.
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppData", "AppData\AppData.csproj", "{85BD343D-4246-48DF-BE81-F34321896F88}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MP-MAG", "MP-MAG\MP-MAG.csproj", "{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MagData", "MagData\MagData.csproj", "{973245E4-02C0-4ED1-A81B-1727C5F4CA59}"
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E9EAA61B-E4E0-4051-8836-6F9A89E27930}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -52,26 +53,6 @@ Global
|
||||
{85BD343D-4246-48DF-BE81-F34321896F88}.OVH-EletScal|Any CPU.Build.0 = Release|Any CPU
|
||||
{85BD343D-4246-48DF-BE81-F34321896F88}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{85BD343D-4246-48DF-BE81-F34321896F88}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.IIS01|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.IIS01|Any CPU.Build.0 = Release|Any CPU
|
||||
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.IIS02|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.IIS02|Any CPU.Build.0 = Release|Any CPU
|
||||
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.OVH-EletScal|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.OVH-EletScal|Any CPU.Build.0 = Release|Any CPU
|
||||
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{ECFD70CB-FE89-418C-82ED-6D0ACFDE6C07}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.IIS01|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.IIS01|Any CPU.Build.0 = Release|Any CPU
|
||||
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.IIS02|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.IIS02|Any CPU.Build.0 = Release|Any CPU
|
||||
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.OVH-EletScal|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.OVH-EletScal|Any CPU.Build.0 = Release|Any CPU
|
||||
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{973245E4-02C0-4ED1-A81B-1727C5F4CA59}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
using AppData;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace C_TRACK
|
||||
{
|
||||
public class BasePage : System.Web.UI.Page
|
||||
{
|
||||
protected dataLayer DLMan = new dataLayer();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
using AppData;
|
||||
using Newtonsoft.Json;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace C_TRACK
|
||||
{
|
||||
public class BaseUserControl : System.Web.UI.UserControl
|
||||
{
|
||||
#region Public Events
|
||||
|
||||
protected dataLayer DLMan = new dataLayer();
|
||||
|
||||
/// <summary>
|
||||
/// Generico evento di richiesta refresh a aprent
|
||||
/// </summary>
|
||||
public event EventHandler eh_doRefresh;
|
||||
|
||||
/// <summary>
|
||||
/// Generico evento di richiesta refresh a aprent
|
||||
/// </summary>
|
||||
public event EventHandler eh_doReset;
|
||||
|
||||
#endregion Public Events
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Codice operatore salvato in cookie
|
||||
/// </summary>
|
||||
protected string cookieCodOpr
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.getCookieVal("CTrack_CodOpr");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Codice post salvato in cookie
|
||||
/// </summary>
|
||||
protected string cookieCodPost
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.getCookieVal("CTrack_CodPost");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Chiamata evento
|
||||
/// </summary>
|
||||
public void raiseEvent()
|
||||
{
|
||||
// se qualcuno ascolta sollevo evento nuovo valore...
|
||||
if (eh_doRefresh != null)
|
||||
{
|
||||
eh_doRefresh(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiamata evento
|
||||
/// </summary>
|
||||
public void raiseReset()
|
||||
{
|
||||
// se qualcuno ascolta sollevo evento nuovo valore...
|
||||
if (eh_doReset != null)
|
||||
{
|
||||
eh_doReset(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper traduzione termini
|
||||
/// </summary>
|
||||
/// <param name="lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(string lemma)
|
||||
{
|
||||
return SteamWare.user_std.UtSn.Traduci(lemma);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -300,7 +300,6 @@
|
||||
<Content Include="images\logo_sw.png" />
|
||||
<Content Include="jumper.aspx" />
|
||||
<Content Include="login.aspx" />
|
||||
<Content Include="mongocrypt.dll" />
|
||||
<Content Include="postazioni.aspx" />
|
||||
<Content Include="Properties\PublishProfiles\IIS01.pubxml.user" />
|
||||
<Content Include="Properties\PublishProfiles\IIS02.pubxml.user" />
|
||||
@@ -551,6 +550,12 @@
|
||||
<Compile Include="barcode.aspx.designer.cs">
|
||||
<DependentUpon>barcode.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BasePage.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BaseUserControl.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="closeAllRec.aspx.cs">
|
||||
<DependentUpon>closeAllRec.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
||||
+364
-363
@@ -4,376 +4,377 @@
|
||||
https://go.microsoft.com/fwlink/?LinkId=169433
|
||||
-->
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="elmah">
|
||||
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
|
||||
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
|
||||
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
|
||||
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.6.2" />
|
||||
<httpRuntime targetFramework="4.6.2" />
|
||||
<pages>
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Optimization" />
|
||||
</namespaces>
|
||||
<controls>
|
||||
<add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />
|
||||
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" /></controls>
|
||||
</pages>
|
||||
<httpModules>
|
||||
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
|
||||
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
|
||||
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
|
||||
</httpModules>
|
||||
<sessionState timeout="600" mode="Custom" customProvider="MySessionStateStore">
|
||||
<providers>
|
||||
<add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" host="localhost" accessKey="localhost" ssl="false" applicationName="C.TRACK" databaseId="2" />
|
||||
</providers>
|
||||
</sessionState>
|
||||
<customErrors mode="RemoteOnly" defaultRedirect="error.html" />
|
||||
</system.web>
|
||||
<!--<system.web.extensions>
|
||||
<configSections>
|
||||
<sectionGroup name="elmah">
|
||||
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
|
||||
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
|
||||
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
|
||||
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.6.2" />
|
||||
<httpRuntime targetFramework="4.6.2" />
|
||||
<pages>
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Optimization" />
|
||||
</namespaces>
|
||||
<controls>
|
||||
<add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />
|
||||
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
|
||||
</controls>
|
||||
</pages>
|
||||
<httpModules>
|
||||
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
|
||||
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
|
||||
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
|
||||
</httpModules>
|
||||
<sessionState timeout="600" mode="Custom" customProvider="MySessionStateStore">
|
||||
<providers>
|
||||
<add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" host="localhost" accessKey="localhost" ssl="false" applicationName="C.TRACK" databaseId="2" />
|
||||
</providers>
|
||||
</sessionState>
|
||||
<customErrors mode="RemoteOnly" defaultRedirect="error.html" />
|
||||
</system.web>
|
||||
<!--<system.web.extensions>
|
||||
<scripting>
|
||||
<scriptResourceHandler enableCompression="true" enableCaching="true" />
|
||||
</scripting>
|
||||
</system.web.extensions>-->
|
||||
<appSettings>
|
||||
<add key="CodModulo" value="C.TRACK" />
|
||||
<add key="cacheOnRedis" value="true" />
|
||||
<add key="maxAgeAppConf_min" value="15" />
|
||||
<add key="_logDir" value="~/logs/" />
|
||||
<add key="logMitigSec" value="1" />
|
||||
<!--Conf generale-->
|
||||
<add key="appVers" value="stable" />
|
||||
<add key="downloadPath" value="c:\Steamware\installers\CTRACK\" />
|
||||
<!--Redis conn-->
|
||||
<add key="RedisConn" value="localhost,abortConnect=false,ssl=false" />
|
||||
<add key="RedisConnAdmin" value="localhost,abortConnect=false,ssl=false" />
|
||||
<add key="redisDb" value="2" />
|
||||
<add key="_safePages" value="chLang#jumper#unauthorized#forceUser#login#test#UserAdmin#UpdMan#about#contact" />
|
||||
<!--area DB-->
|
||||
<add key="CTrackConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
|
||||
<add key="DbConfConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
|
||||
<add key="DevicesAuthConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
|
||||
<add key="PermessiConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
|
||||
<add key="UtenteCdcConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
|
||||
<add key="VocabolarioConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
|
||||
</appSettings>
|
||||
<connectionStrings>
|
||||
<add name="AppData.Properties.Settings.C_TRACKConnectionString" connectionString="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
|
||||
</connectionStrings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Xml.XmlSerializer" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Xml.XDocument" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Xml.ReaderWriter" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="CC7B13FFCD2DDD51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Timer" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Parallel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Overlapped" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.RegularExpressions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Encoding.Extensions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Encoding" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Security.SecureString" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Security.Principal" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.Serialization.Xml" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.3.0" newVersion="4.1.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.Serialization.Primitives" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.Serialization.Json" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.Numerics" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.InteropServices" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.Extensions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Resources.ResourceManager" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Reflection.Primitives" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Reflection.Extensions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Reflection" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ObjectModel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Sockets" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Requests" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Primitives" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.NetworkInformation" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Http" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Linq.Queryable" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Linq.Parallel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Linq.Expressions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Linq" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Compression" publicKeyToken="B77A5C561934E089" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Globalization.Extensions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Globalization" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Dynamic.Runtime" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.Tracing" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.Tools" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.Debug" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.Contracts" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Data.Common" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ComponentModel.EventBasedAsync" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ComponentModel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Collections" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Collections.Concurrent" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.1" newVersion="4.0.2.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Channels" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="SharpCompress" publicKeyToken="afb0a02973931d96" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-0.24.0.0" newVersion="0.24.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.webServer>
|
||||
<validation validateIntegratedModeConfiguration="false" />
|
||||
<modules>
|
||||
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
|
||||
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
|
||||
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
|
||||
<remove name="Session" />
|
||||
<add name="Session" type="Microsoft.AspNet.SessionState.SessionStateModuleAsync, Microsoft.AspNet.SessionState.SessionStateModule, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode" />
|
||||
</modules>
|
||||
<handlers>
|
||||
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
|
||||
<remove name="OPTIONSVerbHandler" />
|
||||
<remove name="TRACEVerbHandler" />
|
||||
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
</handlers></system.webServer>
|
||||
<elmah>
|
||||
<!--
|
||||
See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for
|
||||
more information on remote access and securing ELMAH.
|
||||
-->
|
||||
<security allowRemoteAccess="false" />
|
||||
</elmah>
|
||||
<location path="elmah.axd" inheritInChildApplications="false">
|
||||
<system.web>
|
||||
<httpHandlers>
|
||||
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
|
||||
</httpHandlers>
|
||||
<!--
|
||||
See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for
|
||||
<appSettings>
|
||||
<add key="CodModulo" value="C.TRACK" />
|
||||
<add key="cacheOnRedis" value="true" />
|
||||
<add key="maxAgeAppConf_min" value="15" />
|
||||
<add key="_logDir" value="~/logs/" />
|
||||
<add key="logMitigSec" value="1" />
|
||||
<!--Conf generale-->
|
||||
<add key="appVers" value="stable" />
|
||||
<add key="downloadPath" value="c:\Steamware\installers\CTRACK\" />
|
||||
<!--Redis conn-->
|
||||
<add key="RedisConn" value="localhost,abortConnect=false,ssl=false" />
|
||||
<add key="RedisConnAdmin" value="localhost,abortConnect=false,ssl=false" />
|
||||
<add key="redisDb" value="2" />
|
||||
<add key="_safePages" value="chLang#jumper#unauthorized#forceUser#login#test#UserAdmin#UpdMan#about#contact" />
|
||||
<!--area DB-->
|
||||
<add key="CTrackConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
|
||||
<add key="DbConfConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
|
||||
<add key="DevicesAuthConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
|
||||
<add key="PermessiConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
|
||||
<add key="UtenteCdcConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
|
||||
<add key="VocabolarioConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
|
||||
</appSettings>
|
||||
<connectionStrings>
|
||||
<add name="AppData.Properties.Settings.C_TRACKConnectionString" connectionString="Data Source=SQL2016DEV;Initial Catalog=C_TRACK;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
|
||||
<add name="ErrorLog" connectionString="Data Source=SQL2016DEV;Initial Catalog=Elmah;Persist Security Info=True;User ID=sa;Password=keyhammer16;"
|
||||
providerName="System.Data.SqlClient" />
|
||||
</connectionStrings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Xml.XmlSerializer" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Xml.XDocument" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Xml.ReaderWriter" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="CC7B13FFCD2DDD51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Timer" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Parallel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Overlapped" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.RegularExpressions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Encoding.Extensions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Encoding" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Security.SecureString" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Security.Principal" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.Serialization.Xml" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.3.0" newVersion="4.1.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.Serialization.Primitives" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.Serialization.Json" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.Numerics" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.InteropServices" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.Extensions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Resources.ResourceManager" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Reflection.Primitives" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Reflection.Extensions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Reflection" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ObjectModel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Sockets" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Requests" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Primitives" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.NetworkInformation" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Http" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Linq.Queryable" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Linq.Parallel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Linq.Expressions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Linq" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Compression" publicKeyToken="B77A5C561934E089" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Globalization.Extensions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Globalization" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Dynamic.Runtime" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.Tracing" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.Tools" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.Debug" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.Contracts" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Data.Common" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ComponentModel.EventBasedAsync" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ComponentModel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Collections" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Collections.Concurrent" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.1" newVersion="4.0.2.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Channels" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="SharpCompress" publicKeyToken="afb0a02973931d96" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-0.24.0.0" newVersion="0.24.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.webServer>
|
||||
<validation validateIntegratedModeConfiguration="false" />
|
||||
<modules>
|
||||
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
|
||||
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
|
||||
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
|
||||
<remove name="Session" />
|
||||
<add name="Session" type="Microsoft.AspNet.SessionState.SessionStateModuleAsync, Microsoft.AspNet.SessionState.SessionStateModule, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode" />
|
||||
</modules>
|
||||
<handlers>
|
||||
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
|
||||
<remove name="OPTIONSVerbHandler" />
|
||||
<remove name="TRACEVerbHandler" />
|
||||
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
<elmah>
|
||||
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ErrorLog" />
|
||||
<security allowRemoteAccess="false" />
|
||||
</elmah>
|
||||
<location path="elmah.axd" inheritInChildApplications="false">
|
||||
<system.web>
|
||||
<httpHandlers>
|
||||
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
|
||||
</httpHandlers>
|
||||
<!--
|
||||
See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for
|
||||
more information on using ASP.NET authorization securing ELMAH.
|
||||
|
||||
<authorization>
|
||||
<allow roles="admin" />
|
||||
<deny users="*" />
|
||||
<deny users="*" />
|
||||
</authorization>
|
||||
-->
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</location>
|
||||
</configuration>
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</location>
|
||||
</configuration>
|
||||
@@ -1,20 +1,29 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_addTask.ascx.cs" Inherits="C_TRACK.WebUserControls.mod_addTask" %>
|
||||
<div runat="server" id="divAddNew">
|
||||
<div class="row font-weight-bold py-2">
|
||||
<div class="col-3 text-center" runat="server" id="divArticolo">
|
||||
<asp:Label runat="server" ID="lblCodArt" CssClass="text-secondary">Cod.ARTICOLO</asp:Label>
|
||||
<div><%: CodArticolo %></div>
|
||||
<%@ Register Src="~/WebUserControls/mod_periodo.ascx" TagPrefix="uc1" TagName="mod_periodo" %>
|
||||
|
||||
<div runat="server" id="divAddNew">
|
||||
<div class="row font-weight-bold py-2">
|
||||
<div class="col text-center" runat="server" id="divExport">
|
||||
<asp:HyperLink runat="server" ID="hlExport" CssClass="btn btn-warning btn-block" NavigateUrl="~/export.aspx" Target="_blank"><i class="fas fa-download"></i> Data Export</asp:HyperLink>
|
||||
</div>
|
||||
<div class="col text-center" runat="server" id="divArticolo">
|
||||
<asp:Label runat="server" ID="lblCodArt" CssClass="text-secondary">Cod.ARTICOLO</asp:Label>
|
||||
<div><%: CodArticolo %></div>
|
||||
</div>
|
||||
<div class="col text-center" runat="server" id="divCommessa">
|
||||
<asp:Label runat="server" ID="lblNumTask" CssClass="text-secondary">COMMESSA</asp:Label>
|
||||
<div><%: NumTask %></div>
|
||||
</div>
|
||||
<div class="col text-center" runat="server" id="divQta">
|
||||
<asp:Label runat="server" ID="lblQta" CssClass="text-secondary">QUANTITA</asp:Label>
|
||||
<div><%: Quantita %></div>
|
||||
</div>
|
||||
<div class="col text-center" runat="server" id="divTime">
|
||||
<asp:Label runat="server" ID="Label1" CssClass="text-secondary">TEMPO <sub>prev</sub></asp:Label>
|
||||
<div><%: TimeEst %></div>
|
||||
</div>
|
||||
<div class="col text-center" runat="server" id="divReset">
|
||||
<asp:LinkButton runat="server" ID="lbtReset" CssClass="btn btn-info btn-block" OnClick="lbtReset_Click"><i class="fas fa-sync-alt"></i> RESET</asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3 text-center" runat="server" id="divCommessa">
|
||||
<asp:Label runat="server" ID="lblNumTask" CssClass="text-secondary">COMMESSA</asp:Label>
|
||||
<div><%: NumTask %></div>
|
||||
</div>
|
||||
<div class="col-3 text-center" runat="server" id="divQta">
|
||||
<asp:Label runat="server" ID="lblQta" CssClass="text-secondary">QUANTITA</asp:Label>
|
||||
<div><%: Quantita %></div>
|
||||
</div>
|
||||
<div class="col-3 text-center" runat="server" id="divReset">
|
||||
<asp:LinkButton runat="server" ID="lbtReset" CssClass="btn btn-info btn-block" OnClick="lbtReset_Click"><i class="fas fa-sync-alt"></i> RESET</asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,182 +1,255 @@
|
||||
using AppData;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace C_TRACK.WebUserControls
|
||||
{
|
||||
public partial class mod_addTask : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// evento aggiunta record
|
||||
/// </summary>
|
||||
public event EventHandler eh_created;
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
public partial class mod_addTask : BaseUserControl
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
CodArticolo = "";
|
||||
NumTask = "";
|
||||
Quantita = 0;
|
||||
}
|
||||
checkValori();
|
||||
}
|
||||
#region Public Events
|
||||
|
||||
private void checkValori()
|
||||
{
|
||||
// verifica quali valori siano disponibili e di conseguenza visualizza COLORE...
|
||||
divArticolo.Attributes.Remove("class");
|
||||
divCommessa.Attributes.Remove("class");
|
||||
divQta.Attributes.Remove("class");
|
||||
divArticolo.Attributes.Add("class", CodArticolo != "" ? "col-3 text-center table-success text-success" : "col-3 text-center text-secondary");
|
||||
divCommessa.Attributes.Add("class", NumTask != "" ? "col-3 text-center table-success text-success" : "col-3 text-center text-secondary");
|
||||
divQta.Attributes.Add("class", Quantita > 0 ? "col-3 text-center table-success text-success" : "col-3 text-center text-secondary");
|
||||
}
|
||||
/// <summary>
|
||||
/// Input da processare...
|
||||
/// </summary>
|
||||
public string newInput
|
||||
{
|
||||
set
|
||||
{
|
||||
processInput(value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Effettua riconoscimento input e determina valori commessa / articolo / qta
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
private void processInput(string value)
|
||||
{
|
||||
// verifico se sia un articolo...
|
||||
Match testReset = Regex.Match(value, mUtils.reReset);
|
||||
Match testDelete = Regex.Match(value, mUtils.reDelete);
|
||||
Match testAddNew = Regex.Match(value, mUtils.reAddNew);
|
||||
Match testCodArt = Regex.Match(value, mUtils.reCodArt);
|
||||
Match testNumTask = Regex.Match(value, mUtils.reNumTask);
|
||||
Match testQta = Regex.Match(value, mUtils.reQta);
|
||||
/// <summary>
|
||||
/// evento aggiunta record
|
||||
/// </summary>
|
||||
public event EventHandler eh_created;
|
||||
|
||||
#endregion Public Events
|
||||
|
||||
if (testReset.Success)
|
||||
{
|
||||
CodArticolo = "";
|
||||
NumTask = "";
|
||||
Quantita = 0;
|
||||
}
|
||||
else if (testDelete.Success)
|
||||
{
|
||||
// creo...
|
||||
dataLayer.man.taTL.deleteQuery(NumTask);
|
||||
// resetto!
|
||||
CodArticolo = "";
|
||||
NumTask = "";
|
||||
Quantita = 0;
|
||||
// invoco update...
|
||||
if (eh_created != null)
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Cod ARTICOLO corrente
|
||||
/// </summary>
|
||||
public string CodArticolo
|
||||
{
|
||||
eh_created(this, new EventArgs());
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("currCodArt");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("currCodArt", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (testAddNew.Success)
|
||||
{
|
||||
// se qta > 0 ed ho articolo e commessa...
|
||||
if (Quantita > 0 && CodArticolo != "" && NumTask != "")
|
||||
|
||||
/// <summary>
|
||||
/// Input da processare...
|
||||
/// </summary>
|
||||
public string newInput
|
||||
{
|
||||
// creo...
|
||||
dataLayer.man.taTL.insertQuery(NumTask, CodArticolo, Quantita);
|
||||
// resetto!
|
||||
CodArticolo = "";
|
||||
NumTask = "";
|
||||
Quantita = 0;
|
||||
// invoco update...
|
||||
if (eh_created != null)
|
||||
{
|
||||
eh_created(this, new EventArgs());
|
||||
}
|
||||
set
|
||||
{
|
||||
processInput(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (testCodArt.Success)
|
||||
{
|
||||
CodArticolo = value;
|
||||
}
|
||||
else if (testNumTask.Success)
|
||||
{
|
||||
NumTask = value;
|
||||
}
|
||||
else if (testQta.Success)
|
||||
{
|
||||
int qta = 0;
|
||||
int.TryParse(value, out qta);
|
||||
Quantita = qta;
|
||||
}
|
||||
|
||||
// non match con RegExp --> ricerca ESPLICITA, se abilitato ricerca estesa
|
||||
if (memLayer.ML.CRB("OptEnableMapoIn") && !(testCodArt.Success || testNumTask.Success))
|
||||
{
|
||||
var tabArt = dataLayer.man.taAnArt.getByKey(value);
|
||||
if (tabArt.Rows.Count > 0)
|
||||
/// <summary>
|
||||
/// Cod COMMESSA corrente
|
||||
/// </summary>
|
||||
public string NumTask
|
||||
{
|
||||
CodArticolo = value;
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("currNumTask");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("currNumTask", value);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
/// <summary>
|
||||
/// QTA da produrre
|
||||
/// </summary>
|
||||
public int Quantita
|
||||
{
|
||||
var tabTask = dataLayer.man.taTL.getByKey(value);
|
||||
if (tabTask.Rows.Count > 0)
|
||||
{
|
||||
NumTask = value;
|
||||
}
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("currQta");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("currQta", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
checkValori();
|
||||
}
|
||||
/// <summary>
|
||||
/// Tempo stimato x produzione
|
||||
/// </summary>
|
||||
public float TimeEst
|
||||
{
|
||||
get
|
||||
{
|
||||
float answ = -1;
|
||||
string rawVal = memLayer.ML.StringSessionObj("currTimeEst");
|
||||
float.TryParse(rawVal, out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("currTimeEst", value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cod ARTICOLO corrente
|
||||
/// </summary>
|
||||
public string CodArticolo
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("currCodArt");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("currCodArt", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Cod COMMESSA corrente
|
||||
/// </summary>
|
||||
public string NumTask
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("currNumTask");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("currNumTask", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// QTA da produrre
|
||||
/// </summary>
|
||||
public int Quantita
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("currQta");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("currQta", value);
|
||||
}
|
||||
}
|
||||
#endregion Public Properties
|
||||
|
||||
protected void lbtReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
processInput(memLayer.ML.CRS("regExp_KO"));
|
||||
#region Private Methods
|
||||
|
||||
private void checkValori()
|
||||
{
|
||||
// verifica quali valori siano disponibili e di conseguenza visualizza COLORE...
|
||||
divArticolo.Attributes.Remove("class");
|
||||
divCommessa.Attributes.Remove("class");
|
||||
divQta.Attributes.Remove("class");
|
||||
divTime.Attributes.Remove("class");
|
||||
divArticolo.Attributes.Add("class", CodArticolo != "" ? "col text-center table-success text-success" : "col text-center text-secondary");
|
||||
divCommessa.Attributes.Add("class", NumTask != "" ? "col text-center table-success text-success" : "col text-center text-secondary");
|
||||
divQta.Attributes.Add("class", Quantita > 0 ? "col text-center table-success text-success" : "col text-center text-secondary");
|
||||
divTime.Attributes.Add("class", TimeEst > 0 ? "col text-center table-success text-success" : "col text-center text-secondary");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua riconoscimento input e determina valori commessa / articolo / qta
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
private void processInput(string value)
|
||||
{
|
||||
// verifico se sia un articolo...
|
||||
Match testReset = Regex.Match(value, mUtils.reReset);
|
||||
Match testDelete = Regex.Match(value, mUtils.reDelete);
|
||||
Match testAddNew = Regex.Match(value, mUtils.reAddNew);
|
||||
Match testCodArt = Regex.Match(value, mUtils.reCodArt);
|
||||
Match testNumTask = Regex.Match(value, mUtils.reNumTask);
|
||||
Match testQta = Regex.Match(value, mUtils.reQta);
|
||||
Match testTempo = Regex.Match(value, mUtils.reTempoPrev);
|
||||
|
||||
if (testReset.Success)
|
||||
{
|
||||
CodArticolo = "";
|
||||
NumTask = "";
|
||||
Quantita = 0;
|
||||
TimeEst = 0;
|
||||
}
|
||||
else if (testDelete.Success)
|
||||
{
|
||||
// creo...
|
||||
DLMan.taTL.deleteQuery(NumTask);
|
||||
// resetto!
|
||||
CodArticolo = "";
|
||||
NumTask = "";
|
||||
Quantita = 0;
|
||||
// invoco update...
|
||||
if (eh_created != null)
|
||||
{
|
||||
eh_created(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
else if (testAddNew.Success)
|
||||
{
|
||||
// controllo condizione richiesta tempo x setup Task
|
||||
bool confAddTaskReqTime = memLayer.ML.CRB("confAddTaskReqTime");
|
||||
// se NON richiesto --> Time=0
|
||||
if (!confAddTaskReqTime)
|
||||
{
|
||||
TimeEst = 0;
|
||||
}
|
||||
|
||||
// se qta > 0 ed ho articolo e commessa...
|
||||
if (Quantita > 0 && !string.IsNullOrEmpty(CodArticolo) && !string.IsNullOrEmpty(NumTask) && (!confAddTaskReqTime || TimeEst > 0))
|
||||
{
|
||||
// creo...
|
||||
DLMan.taTL.insertQuery(NumTask, CodArticolo, Quantita, TimeEst);
|
||||
// resetto!
|
||||
CodArticolo = "";
|
||||
NumTask = "";
|
||||
Quantita = 0;
|
||||
// invoco update...
|
||||
if (eh_created != null)
|
||||
{
|
||||
eh_created(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (testTempo.Success)
|
||||
{
|
||||
string newVal = value;
|
||||
// effettuo pulizia variabile da conf...
|
||||
foreach (var item in mUtils.lRepCleanTime)
|
||||
{
|
||||
string[] repVal = item.Split('|');
|
||||
if (repVal.Length > 1)
|
||||
{
|
||||
newVal = newVal.Replace(repVal[0], repVal[1]);
|
||||
}
|
||||
}
|
||||
float tPrev = 0;
|
||||
float.TryParse(newVal, out tPrev);
|
||||
// se configurata conversione procedo
|
||||
if (mUtils.TimeEstFactor != 1)
|
||||
{
|
||||
tPrev = tPrev / mUtils.TimeEstFactor;
|
||||
}
|
||||
// assegno!
|
||||
TimeEst = tPrev;
|
||||
}
|
||||
else if (testCodArt.Success)
|
||||
{
|
||||
CodArticolo = value;
|
||||
}
|
||||
else if (testNumTask.Success)
|
||||
{
|
||||
NumTask = value;
|
||||
}
|
||||
else if (testQta.Success)
|
||||
{
|
||||
int qta = 0;
|
||||
int.TryParse(value, out qta);
|
||||
Quantita = qta;
|
||||
}
|
||||
|
||||
// non match con RegExp --> ricerca ESPLICITA, se abilitato ricerca estesa
|
||||
if (memLayer.ML.CRB("OptEnableMapoIn") && !(testCodArt.Success || testNumTask.Success))
|
||||
{
|
||||
var tabArt = DLMan.taAnArt.getByKey(value);
|
||||
if (tabArt.Rows.Count > 0)
|
||||
{
|
||||
CodArticolo = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
var tabTask = DLMan.taTL.getByKey(value);
|
||||
if (tabTask.Rows.Count > 0)
|
||||
{
|
||||
NumTask = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
checkValori();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void lbtReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
processInput(memLayer.ML.CRS("regExp_KO"));
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
CodArticolo = "";
|
||||
NumTask = "";
|
||||
Quantita = 0;
|
||||
}
|
||||
checkValori();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
}
|
||||
+51
-13
@@ -7,11 +7,13 @@
|
||||
// </generato automaticamente>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace C_TRACK.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_addTask {
|
||||
|
||||
namespace C_TRACK.WebUserControls
|
||||
{
|
||||
|
||||
|
||||
public partial class mod_addTask
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Controllo divAddNew.
|
||||
/// </summary>
|
||||
@@ -20,7 +22,25 @@ namespace C_TRACK.WebUserControls {
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divAddNew;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Controllo divExport.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divExport;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo hlExport.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink hlExport;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo divArticolo.
|
||||
/// </summary>
|
||||
@@ -29,7 +49,7 @@ namespace C_TRACK.WebUserControls {
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divArticolo;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblCodArt.
|
||||
/// </summary>
|
||||
@@ -38,7 +58,7 @@ namespace C_TRACK.WebUserControls {
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblCodArt;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Controllo divCommessa.
|
||||
/// </summary>
|
||||
@@ -47,7 +67,7 @@ namespace C_TRACK.WebUserControls {
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divCommessa;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblNumTask.
|
||||
/// </summary>
|
||||
@@ -56,7 +76,7 @@ namespace C_TRACK.WebUserControls {
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNumTask;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Controllo divQta.
|
||||
/// </summary>
|
||||
@@ -65,7 +85,7 @@ namespace C_TRACK.WebUserControls {
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divQta;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblQta.
|
||||
/// </summary>
|
||||
@@ -74,7 +94,25 @@ namespace C_TRACK.WebUserControls {
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblQta;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Controllo divTime.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divTime;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo Label1.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label1;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo divReset.
|
||||
/// </summary>
|
||||
@@ -83,7 +121,7 @@ namespace C_TRACK.WebUserControls {
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divReset;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lbtReset.
|
||||
/// </summary>
|
||||
|
||||
@@ -5,143 +5,143 @@ using System.Web.UI.WebControls;
|
||||
|
||||
namespace C_TRACK.WebUserControls
|
||||
{
|
||||
public partial class mod_btnComandi : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Codice TASK corrente
|
||||
/// </summary>
|
||||
public string CurrNumTask
|
||||
public partial class mod_btnComandi : BaseUserControl
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("CurrNumTask");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("CurrNumTask", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// evento comando clicked
|
||||
/// </summary>
|
||||
public event EventHandler eh_clickComando;
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
updateBtn();
|
||||
}
|
||||
/// <summary>
|
||||
/// segnala click su button comando
|
||||
/// </summary>
|
||||
public void segnalaClick()
|
||||
{
|
||||
eh_clickComando?.Invoke(this, new EventArgs());
|
||||
}
|
||||
|
||||
protected void lbtCmd_Click(object sender, EventArgs e)
|
||||
{
|
||||
// PROCEDO SOLO SE non ho veto...
|
||||
if (!hasVeto)
|
||||
{
|
||||
LinkButton lb = (LinkButton)sender;
|
||||
memLayer.ML.setSessionVal("btnCmdPress", lb.CommandArgument, false);
|
||||
segnalaClick();
|
||||
}
|
||||
else
|
||||
{
|
||||
updateBtn();
|
||||
}
|
||||
}
|
||||
|
||||
public void updateBtn()
|
||||
{
|
||||
// verifico se ho comandi PREVALENTI (es: ho UNA FASE APERTA)
|
||||
if (mUtils.CodOpr != "")
|
||||
{
|
||||
var tabTR = dataLayer.man.taTR.getAttiveByOpr(mUtils.CodOpr);
|
||||
if (tabTR.Rows.Count > 0)
|
||||
/// <summary>
|
||||
/// Codice TASK corrente
|
||||
/// </summary>
|
||||
public string CurrNumTask
|
||||
{
|
||||
// se NON HO una commessa attiva, SELEZIONO la PRIMA commessa aperta...
|
||||
if (CurrNumTask == "")
|
||||
{
|
||||
CurrNumTask = tabTR[0].NumTask;
|
||||
}
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("CurrNumTask");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("CurrNumTask", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// evento comando clicked
|
||||
/// </summary>
|
||||
public event EventHandler eh_clickComando;
|
||||
|
||||
// controllo se HO una fase corrente...
|
||||
repComandi.Visible = !hasVeto;
|
||||
if (!hasVeto)
|
||||
{
|
||||
// altrimenti imposto fasi da postazione...
|
||||
repComandi.DataBind();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica btn siano abilitati e nel caso x css aggiunge DISABLED
|
||||
/// - ho una commessa
|
||||
/// - la commessa NON E' chiusa...
|
||||
/// </summary>
|
||||
public string datiCommessa
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
// controllos e ho in sessione numTask altrimenti NON E' abilitato...
|
||||
if (CurrNumTask == "")
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// se NON E' multi
|
||||
if (mUtils.postIsMulti)
|
||||
{
|
||||
answ = "<-- Gestione commesse";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "Manca Commessa";
|
||||
}
|
||||
updateBtn();
|
||||
}
|
||||
else
|
||||
/// <summary>
|
||||
/// segnala click su button comando
|
||||
/// </summary>
|
||||
public void segnalaClick()
|
||||
{
|
||||
answ = hasVeto ? "Commessa Chiusa: " + CurrNumTask.ToString() : "";
|
||||
eh_clickComando?.Invoke(this, new EventArgs());
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica se la commessa sia assente/chiusa
|
||||
/// </summary>
|
||||
public bool hasVeto
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
bool noTask = CurrNumTask == "";
|
||||
bool isChiuso = false;
|
||||
try
|
||||
|
||||
protected void lbtCmd_Click(object sender, EventArgs e)
|
||||
{
|
||||
isChiuso = dataLayer.man.taTL.getByKey(CurrNumTask)[0].Concluso;
|
||||
// PROCEDO SOLO SE non ho veto...
|
||||
if (!hasVeto)
|
||||
{
|
||||
LinkButton lb = (LinkButton)sender;
|
||||
memLayer.ML.setSessionVal("btnCmdPress", lb.CommandArgument, false);
|
||||
segnalaClick();
|
||||
}
|
||||
else
|
||||
{
|
||||
updateBtn();
|
||||
}
|
||||
}
|
||||
|
||||
public void updateBtn()
|
||||
{
|
||||
// verifico se ho comandi PREVALENTI (es: ho UNA FASE APERTA)
|
||||
if (mUtils.CodOpr != "")
|
||||
{
|
||||
var tabTR = DLMan.taTR.getAttiveByOpr(mUtils.CodOpr);
|
||||
if (tabTR.Rows.Count > 0)
|
||||
{
|
||||
// se NON HO una commessa attiva, SELEZIONO la PRIMA commessa aperta...
|
||||
if (CurrNumTask == "")
|
||||
{
|
||||
CurrNumTask = tabTR[0].NumTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// controllo se HO una fase corrente...
|
||||
repComandi.Visible = !hasVeto;
|
||||
if (!hasVeto)
|
||||
{
|
||||
// altrimenti imposto fasi da postazione...
|
||||
repComandi.DataBind();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica btn siano abilitati e nel caso x css aggiunge DISABLED
|
||||
/// - ho una commessa
|
||||
/// - la commessa NON E' chiusa...
|
||||
/// </summary>
|
||||
public string datiCommessa
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
// controllos e ho in sessione numTask altrimenti NON E' abilitato...
|
||||
if (CurrNumTask == "")
|
||||
{
|
||||
// se NON E' multi
|
||||
if (mUtils.postIsMulti)
|
||||
{
|
||||
answ = "<-- Gestione commesse";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "Manca Commessa";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = hasVeto ? "Commessa Chiusa: " + CurrNumTask.ToString() : "";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica se la commessa sia assente/chiusa
|
||||
/// </summary>
|
||||
public bool hasVeto
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
bool noTask = CurrNumTask == "";
|
||||
bool isChiuso = false;
|
||||
try
|
||||
{
|
||||
isChiuso = DLMan.taTL.getByKey(CurrNumTask)[0].Concluso;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// controllos e ho in sessione numTask altrimenti NON E' abilitato...
|
||||
answ = noTask || isChiuso;
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica btn siano abilitati e nel caso x css aggiunge DISABLED
|
||||
/// - ho una commessa
|
||||
/// - la commessa NON E' chiusa...
|
||||
/// </summary>
|
||||
public string cssEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
// controllos e ho in sessione numTask altrimenti NON E' abilitato...
|
||||
answ = hasVeto ? "disabled" : "";
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// controllos e ho in sessione numTask altrimenti NON E' abilitato...
|
||||
answ = noTask || isChiuso;
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica btn siano abilitati e nel caso x css aggiunge DISABLED
|
||||
/// - ho una commessa
|
||||
/// - la commessa NON E' chiusa...
|
||||
/// </summary>
|
||||
public string cssEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
// controllos e ho in sessione numTask altrimenti NON E' abilitato...
|
||||
answ = hasVeto ? "disabled" : "";
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,35 +4,35 @@ using System;
|
||||
|
||||
namespace C_TRACK.WebUserControls
|
||||
{
|
||||
public partial class mod_checkPost : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
public partial class mod_checkPost : BaseUserControl
|
||||
{
|
||||
// se ho operatore in sessione ma NON HO postazione... cerco di recuperare postazione
|
||||
if (mUtils.CodOpr != "" && mUtils.CodPost == "")
|
||||
{
|
||||
// cerco da tab se ha una postazione (prendo la prima...)
|
||||
var righeOpr = dataLayer.man.taAP.getByOpr(mUtils.CodOpr);
|
||||
if (righeOpr.Rows.Count > 0)
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
mUtils.CodPost = righeOpr[0].CodPost;
|
||||
// se ho operatore in sessione ma NON HO postazione... cerco di recuperare postazione
|
||||
if (mUtils.CodOpr != "" && mUtils.CodPost == "")
|
||||
{
|
||||
// cerco da tab se ha una postazione (prendo la prima...)
|
||||
var righeOpr = DLMan.taAP.getByOpr(mUtils.CodOpr);
|
||||
if (righeOpr.Rows.Count > 0)
|
||||
{
|
||||
mUtils.CodPost = righeOpr[0].CodPost;
|
||||
}
|
||||
}
|
||||
// verifico di avere CodOpr in sessione...
|
||||
if (mUtils.CodPost == "")
|
||||
{
|
||||
// mostro warning..
|
||||
divWarning.Visible = true;
|
||||
// se NON sono in pagina bcode --> rimando a richiesta dichiarazione POSTAZIONE (con BARCODE)
|
||||
if (devicesAuthProxy.pagCorrente != "barcode")
|
||||
{
|
||||
Response.Redirect("~/barcode");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
divWarning.Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// verifico di avere CodOpr in sessione...
|
||||
if (mUtils.CodPost == "")
|
||||
{
|
||||
// mostro warning..
|
||||
divWarning.Visible = true;
|
||||
// se NON sono in pagina bcode --> rimando a richiesta dichiarazione POSTAZIONE (con BARCODE)
|
||||
if (devicesAuthProxy.pagCorrente != "barcode")
|
||||
{
|
||||
Response.Redirect("~/barcode");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
divWarning.Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,172 +4,173 @@ using System;
|
||||
|
||||
namespace C_TRACK.WebUserControls
|
||||
{
|
||||
public partial class mod_faseCurr : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
public partial class mod_faseCurr : BaseUserControl
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
mod_numKeyb.Visible = false;
|
||||
setupValori();
|
||||
}
|
||||
mod_numKeyb.eh_comandoRegistrato += Mod_numKeyb_eh_comandoRegistrato;
|
||||
mod_numKeyb.eh_reset += Mod_numKeyb_eh_reset;
|
||||
}
|
||||
|
||||
private void Mod_numKeyb_eh_reset(object sender, EventArgs e)
|
||||
{
|
||||
// nascondo keyb...
|
||||
mod_numKeyb.Visible = false;
|
||||
}
|
||||
|
||||
private void Mod_numKeyb_eh_comandoRegistrato(object sender, EventArgs e)
|
||||
{
|
||||
// recupero valore
|
||||
if (mod_numKeyb.numSelected >= 0)
|
||||
{
|
||||
txtQta.Text = mod_numKeyb.numSelected.ToString();
|
||||
refreshQtaSel();
|
||||
// nascondo keyb...
|
||||
mod_numKeyb.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void setupValori()
|
||||
{
|
||||
// recupero riga TR e popolo valori visualizzati
|
||||
var tabTR = dataLayer.man.taTR.getByPost(mUtils.CodPost, false);
|
||||
bool showDiv = false;
|
||||
if (tabTR.Rows.Count > 0)
|
||||
{
|
||||
DescFaseCurr = tabTR[0].DescrFase;
|
||||
QtaFaseCurr = tabTR[0].QtaEv;
|
||||
txtQta.Text = QtaFaseCurr.ToString();
|
||||
idxRecCurr = tabTR[0].IdxRec;
|
||||
showDiv = true;
|
||||
}
|
||||
divFaseCurr.Visible = showDiv;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Descrizione fase attiva
|
||||
/// </summary>
|
||||
public string DescFaseCurr
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("DescFaseCurr");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("DescFaseCurr", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Qta della fase attiva
|
||||
/// </summary>
|
||||
public int QtaFaseCurr
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("QtaFaseCurr");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("QtaFaseCurr", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// idxRec della fase attiva
|
||||
/// </summary>
|
||||
public int idxRecCurr
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("idxRecCurr");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxRecCurr", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Codice postazione di lavoro
|
||||
/// </summary>
|
||||
public string DescPost
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if (memLayer.ML.isInSessionObject("DescPost"))
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
answ = memLayer.ML.StringSessionObj("DescPost");
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
mod_numKeyb.Visible = false;
|
||||
setupValori();
|
||||
}
|
||||
mod_numKeyb.eh_comandoRegistrato += Mod_numKeyb_eh_comandoRegistrato;
|
||||
mod_numKeyb.eh_reset += Mod_numKeyb_eh_reset;
|
||||
}
|
||||
if (answ == "")
|
||||
|
||||
private void Mod_numKeyb_eh_reset(object sender, EventArgs e)
|
||||
{
|
||||
var tabPost = dataLayer.man.taAP.getByKey(mUtils.CodPost);
|
||||
if (tabPost.Rows.Count > 0)
|
||||
{
|
||||
answ = tabPost[0].Descrizione;
|
||||
}
|
||||
memLayer.ML.setSessionVal("DescPost", answ);
|
||||
// nascondo keyb...
|
||||
mod_numKeyb.Visible = false;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Codice Operatore
|
||||
/// </summary>
|
||||
public string NomeOpr
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if (memLayer.ML.isInSessionObject("NomeOpr"))
|
||||
|
||||
private void Mod_numKeyb_eh_comandoRegistrato(object sender, EventArgs e)
|
||||
{
|
||||
answ = memLayer.ML.StringSessionObj("NomeOpr");
|
||||
// recupero valore
|
||||
if (mod_numKeyb.numSelected >= 0)
|
||||
{
|
||||
txtQta.Text = mod_numKeyb.numSelected.ToString();
|
||||
refreshQtaSel();
|
||||
// nascondo keyb...
|
||||
mod_numKeyb.Visible = false;
|
||||
}
|
||||
}
|
||||
if (answ == "")
|
||||
|
||||
private void setupValori()
|
||||
{
|
||||
var tabOpr = dataLayer.man.taAO.getByKey(mUtils.CodOpr);
|
||||
if (tabOpr.Rows.Count > 0)
|
||||
{
|
||||
answ = string.Format("{0} {1}", tabOpr[0].Cognome, tabOpr[0].Nome);
|
||||
}
|
||||
memLayer.ML.setSessionVal("NomeOpr", answ);
|
||||
// recupero riga TR e popolo valori visualizzati
|
||||
var tabTR = DLMan.taTR.getByPost(mUtils.CodPost, false);
|
||||
bool showDiv = false;
|
||||
if (tabTR.Rows.Count > 0)
|
||||
{
|
||||
DescFaseCurr = tabTR[0].DescrFase;
|
||||
QtaFaseCurr = tabTR[0].QtaEv;
|
||||
txtQta.Text = QtaFaseCurr.ToString();
|
||||
idxRecCurr = tabTR[0].IdxRec;
|
||||
showDiv = true;
|
||||
}
|
||||
divFaseCurr.Visible = showDiv;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
protected void txtQta_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
refreshQtaSel();
|
||||
}
|
||||
/// <summary>
|
||||
/// Descrizione fase attiva
|
||||
/// </summary>
|
||||
public string DescFaseCurr
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("DescFaseCurr");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("DescFaseCurr", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Qta della fase attiva
|
||||
/// </summary>
|
||||
public int QtaFaseCurr
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("QtaFaseCurr");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("QtaFaseCurr", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// idxRec della fase attiva
|
||||
/// </summary>
|
||||
public int idxRecCurr
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("idxRecCurr");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxRecCurr", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Codice postazione di lavoro
|
||||
/// </summary>
|
||||
public string DescPost
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if (memLayer.ML.isInSessionObject("DescPost"))
|
||||
{
|
||||
answ = memLayer.ML.StringSessionObj("DescPost");
|
||||
}
|
||||
if (answ == "")
|
||||
{
|
||||
var tabPost = DLMan.taAP.getByKey(mUtils.CodPost);
|
||||
if (tabPost.Rows.Count > 0)
|
||||
{
|
||||
answ = tabPost[0].Descrizione;
|
||||
}
|
||||
memLayer.ML.setSessionVal("DescPost", answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Codice Operatore
|
||||
/// </summary>
|
||||
public string NomeOpr
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if (memLayer.ML.isInSessionObject("NomeOpr"))
|
||||
{
|
||||
answ = memLayer.ML.StringSessionObj("NomeOpr");
|
||||
}
|
||||
if (answ == "")
|
||||
{
|
||||
var tabOpr = DLMan.taAO.getByKey(mUtils.CodOpr);
|
||||
if (tabOpr.Rows.Count > 0)
|
||||
{
|
||||
answ = string.Format("{0} {1}", tabOpr[0].Cognome, tabOpr[0].Nome);
|
||||
}
|
||||
memLayer.ML.setSessionVal("NomeOpr", answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshQtaSel()
|
||||
{
|
||||
int newQta = QtaFaseCurr;
|
||||
int.TryParse(txtQta.Text, out newQta);
|
||||
// salvo nuova qta...
|
||||
QtaFaseCurr = newQta;
|
||||
}
|
||||
protected void txtQta_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
refreshQtaSel();
|
||||
}
|
||||
|
||||
protected void lbtKeyb_Click(object sender, EventArgs e)
|
||||
{
|
||||
toggleNumKeyb();
|
||||
}
|
||||
/// <summary>
|
||||
/// Toggle visibilità numKeyb
|
||||
/// </summary>
|
||||
private void toggleNumKeyb()
|
||||
{
|
||||
mod_numKeyb.Visible = !mod_numKeyb.Visible;
|
||||
}
|
||||
private void refreshQtaSel()
|
||||
{
|
||||
int newQta = QtaFaseCurr;
|
||||
int.TryParse(txtQta.Text, out newQta);
|
||||
// salvo nuova qta...
|
||||
QtaFaseCurr = newQta;
|
||||
}
|
||||
|
||||
protected void lbtReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
Response.Redirect("~/barcode");
|
||||
protected void lbtKeyb_Click(object sender, EventArgs e)
|
||||
{
|
||||
toggleNumKeyb();
|
||||
}
|
||||
/// <summary>
|
||||
/// Toggle visibilità numKeyb
|
||||
/// </summary>
|
||||
private void toggleNumKeyb()
|
||||
{
|
||||
mod_numKeyb.Visible = !mod_numKeyb.Visible;
|
||||
}
|
||||
|
||||
protected void lbtReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
Response.Redirect("~/barcode");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,18 +3,18 @@ using System;
|
||||
|
||||
namespace C_TRACK.WebUserControls
|
||||
{
|
||||
public partial class mod_fasiAttive : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
public partial class mod_fasiAttive : BaseUserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected void lbtCloseAll_Click(object sender, EventArgs e)
|
||||
{
|
||||
// chiama la procedura che chiude tutte la fasi rimaste attive...
|
||||
dataLayer.man.taTR.closePending();
|
||||
Response.Redirect("~/task");
|
||||
protected void lbtCloseAll_Click(object sender, EventArgs e)
|
||||
{
|
||||
// chiama la procedura che chiude tutte la fasi rimaste attive...
|
||||
DLMan.taTR.closePending();
|
||||
Response.Redirect("~/task");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,132 +6,132 @@ using System.Web.UI;
|
||||
|
||||
namespace C_TRACK.WebUserControls
|
||||
{
|
||||
public partial class mod_menuTopCompact : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
public partial class mod_menuTopCompact : BaseUserControl
|
||||
{
|
||||
string lastPage = Request.Url.LocalPath.Split('/').Last();
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
// fix visibilità TASK
|
||||
hlTask.Visible = devicesAuthProxy.stObj.userHasRight("CT_userStart");
|
||||
hlReset.Visible = false;
|
||||
// se l'utente NON c'è torno a login...
|
||||
if (!devicesAuthProxy.stObj.isAuth)
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (lastPage != "" && lastPage != "login")
|
||||
{
|
||||
Session["nextPage"] = lastPage;
|
||||
}
|
||||
// SE non sono in "safe page"
|
||||
if (memLayer.ML.CRS("_loginPages").ToLower().IndexOf(lastPage.ToLower()) < 0)
|
||||
{
|
||||
Response.Redirect("~/login");
|
||||
}
|
||||
string lastPage = Request.Url.LocalPath.Split('/').Last();
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
// fix visibilità TASK
|
||||
hlTask.Visible = devicesAuthProxy.stObj.userHasRight("CT_userStart");
|
||||
hlReset.Visible = false;
|
||||
// se l'utente NON c'è torno a login...
|
||||
if (!devicesAuthProxy.stObj.isAuth)
|
||||
{
|
||||
if (lastPage != "" && lastPage != "login")
|
||||
{
|
||||
Session["nextPage"] = lastPage;
|
||||
}
|
||||
// SE non sono in "safe page"
|
||||
if (memLayer.ML.CRS("_loginPages").ToLower().IndexOf(lastPage.ToLower()) < 0)
|
||||
{
|
||||
Response.Redirect("~/login");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PagCorrente();
|
||||
// leggo da conf SE mostrare logout...
|
||||
hlReset.Visible = memLayer.ML.CRB("enableLogOut");
|
||||
}
|
||||
}
|
||||
// controllo pagina...
|
||||
bool pageAuth = devicesAuthProxy.stObj.isPageEnabled(lastPage);
|
||||
// controllo pag auth...
|
||||
if (!pageAuth && memLayer.ML.confReadString("_safePages").ToLower().IndexOf(lastPage.ToLower()) < 0)
|
||||
{
|
||||
Response.Redirect("~/login");
|
||||
}
|
||||
lblTitolo.Text = memLayer.ML.CRS("appName");
|
||||
}
|
||||
else
|
||||
/// <summary>
|
||||
/// salva in variabile pagina il nome della pagina corrente
|
||||
/// </summary>
|
||||
protected void PagCorrente()
|
||||
{
|
||||
PagCorrente();
|
||||
// leggo da conf SE mostrare logout...
|
||||
hlReset.Visible = memLayer.ML.CRB("enableLogOut");
|
||||
string[] uri = Request.Url.LocalPath.Split('/');
|
||||
// salvo pagina corrente
|
||||
devicesAuthProxy.pagCorrente = uri.Last();
|
||||
if (devicesAuthProxy.pagPrecedente == "")
|
||||
{
|
||||
devicesAuthProxy.pagPrecedente = devicesAuthProxy.pagCorrente;
|
||||
}
|
||||
}
|
||||
}
|
||||
// controllo pagina...
|
||||
bool pageAuth = devicesAuthProxy.stObj.isPageEnabled(lastPage);
|
||||
// controllo pag auth...
|
||||
if (!pageAuth && memLayer.ML.confReadString("_safePages").ToLower().IndexOf(lastPage.ToLower()) < 0)
|
||||
{
|
||||
Response.Redirect("~/login");
|
||||
}
|
||||
lblTitolo.Text = memLayer.ML.CRS("appName");
|
||||
}
|
||||
/// <summary>
|
||||
/// salva in variabile pagina il nome della pagina corrente
|
||||
/// </summary>
|
||||
protected void PagCorrente()
|
||||
{
|
||||
string[] uri = Request.Url.LocalPath.Split('/');
|
||||
// salvo pagina corrente
|
||||
devicesAuthProxy.pagCorrente = uri.Last();
|
||||
if (devicesAuthProxy.pagPrecedente == "")
|
||||
{
|
||||
devicesAuthProxy.pagPrecedente = devicesAuthProxy.pagCorrente;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Codice TASK corrente
|
||||
/// </summary>
|
||||
public string CurrNumTask
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("CurrNumTask");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Codice ART corrente
|
||||
/// </summary>
|
||||
public string CurrCodArt
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("CurrCodArt");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Codice postazione di lavoro
|
||||
/// </summary>
|
||||
public string DescPost
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if (memLayer.ML.isInSessionObject("DescPost"))
|
||||
/// <summary>
|
||||
/// Codice TASK corrente
|
||||
/// </summary>
|
||||
public string CurrNumTask
|
||||
{
|
||||
answ = memLayer.ML.StringSessionObj("DescPost");
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("CurrNumTask");
|
||||
}
|
||||
}
|
||||
if (answ == "")
|
||||
/// <summary>
|
||||
/// Codice ART corrente
|
||||
/// </summary>
|
||||
public string CurrCodArt
|
||||
{
|
||||
var tabPost = dataLayer.man.taAP.getByKey(mUtils.CodPost);
|
||||
if (tabPost.Rows.Count > 0)
|
||||
{
|
||||
answ = tabPost[0].Descrizione;
|
||||
}
|
||||
memLayer.ML.setSessionVal("DescPost", answ);
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("CurrCodArt");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Codice Operatore
|
||||
/// </summary>
|
||||
public string NomeOpr
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if (memLayer.ML.isInSessionObject("NomeOpr"))
|
||||
/// <summary>
|
||||
/// Codice postazione di lavoro
|
||||
/// </summary>
|
||||
public string DescPost
|
||||
{
|
||||
answ = memLayer.ML.StringSessionObj("NomeOpr");
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if (memLayer.ML.isInSessionObject("DescPost"))
|
||||
{
|
||||
answ = memLayer.ML.StringSessionObj("DescPost");
|
||||
}
|
||||
if (answ == "")
|
||||
{
|
||||
var tabPost = DLMan.taAP.getByKey(mUtils.CodPost);
|
||||
if (tabPost.Rows.Count > 0)
|
||||
{
|
||||
answ = tabPost[0].Descrizione;
|
||||
}
|
||||
memLayer.ML.setSessionVal("DescPost", answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
if (answ == "")
|
||||
/// <summary>
|
||||
/// Codice Operatore
|
||||
/// </summary>
|
||||
public string NomeOpr
|
||||
{
|
||||
var tabOpr = dataLayer.man.taAO.getByKey(mUtils.CodOpr);
|
||||
if (tabOpr.Rows.Count > 0)
|
||||
{
|
||||
answ = string.Format("{0} {1}", tabOpr[0].Cognome, tabOpr[0].Nome);
|
||||
}
|
||||
memLayer.ML.setSessionVal("NomeOpr", answ);
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if (memLayer.ML.isInSessionObject("NomeOpr"))
|
||||
{
|
||||
answ = memLayer.ML.StringSessionObj("NomeOpr");
|
||||
}
|
||||
if (answ == "")
|
||||
{
|
||||
var tabOpr = DLMan.taAO.getByKey(mUtils.CodOpr);
|
||||
if (tabOpr.Rows.Count > 0)
|
||||
{
|
||||
answ = string.Format("{0} {1}", tabOpr[0].Cognome, tabOpr[0].Nome);
|
||||
}
|
||||
memLayer.ML.setSessionVal("NomeOpr", answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Forzo refresh pannello superiore
|
||||
/// </summary>
|
||||
public void doUpdate()
|
||||
{
|
||||
divCurr.DataBind();
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Forzo refresh pannello superiore
|
||||
/// </summary>
|
||||
public void doUpdate()
|
||||
{
|
||||
divCurr.DataBind();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,106 +10,106 @@ using System.Web.UI.WebControls;
|
||||
|
||||
namespace C_TRACK.WebUserControls
|
||||
{
|
||||
public partial class mod_opr2post : System.Web.UI.UserControl
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// evento aggiunta record
|
||||
/// </summary>
|
||||
public event EventHandler eh_reqUpdate;
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
public partial class mod_opr2post : BaseUserControl
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
if (mUtils.postIsMulti)
|
||||
|
||||
/// <summary>
|
||||
/// evento aggiunta record
|
||||
/// </summary>
|
||||
public event EventHandler eh_reqUpdate;
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
lbtClosePeriod.DataBind();
|
||||
doUpdate();
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
if (mUtils.postIsMulti)
|
||||
{
|
||||
lbtClosePeriod.DataBind();
|
||||
doUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void doUpdate()
|
||||
{
|
||||
grView.DataBind();
|
||||
}
|
||||
public void doUpdate()
|
||||
{
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// CodPost selezionato in sessione
|
||||
/// </summary>
|
||||
protected string codPost
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("CodPost");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// CodPost selezionato in sessione
|
||||
/// </summary>
|
||||
protected string codPost
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("CodPost");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void lbtClosePeriod_Click(object sender, EventArgs e)
|
||||
{
|
||||
// chiude il turno andando a ripartire tutte le ore operatore sulle commesse attive e senza riportare attivi gli operatori
|
||||
dataLayer.man.taTR.checkAlloc(codPost, false);
|
||||
grView.DataBind();
|
||||
reportUpdate();
|
||||
}
|
||||
protected void lbtClosePeriod_Click(object sender, EventArgs e)
|
||||
{
|
||||
// chiude il turno andando a ripartire tutte le ore operatore sulle commesse attive e senza riportare attivi gli operatori
|
||||
DLMan.taTR.checkAlloc(codPost, false);
|
||||
grView.DataBind();
|
||||
reportUpdate();
|
||||
}
|
||||
|
||||
protected void grView_RowDeleted(object sender, GridViewDeletedEventArgs e)
|
||||
{
|
||||
reportUpdate();
|
||||
}
|
||||
protected void grView_RowDeleted(object sender, GridViewDeletedEventArgs e)
|
||||
{
|
||||
reportUpdate();
|
||||
}
|
||||
|
||||
private void reportUpdate()
|
||||
{
|
||||
// invoco update...
|
||||
if (eh_reqUpdate != null)
|
||||
{
|
||||
eh_reqUpdate(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
private void reportUpdate()
|
||||
{
|
||||
// invoco update...
|
||||
if (eh_reqUpdate != null)
|
||||
{
|
||||
eh_reqUpdate(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Input da processare (tipo codOperatore...)...
|
||||
/// </summary>
|
||||
public string newInput
|
||||
{
|
||||
set
|
||||
{
|
||||
processInput(value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Input da processare (tipo codOperatore...)...
|
||||
/// </summary>
|
||||
public string newInput
|
||||
{
|
||||
set
|
||||
{
|
||||
processInput(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cod OPERATORE corrente
|
||||
/// </summary>
|
||||
public string codOper
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("currCodOperMulti");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("currCodOperMulti", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Effettua riconoscimento input e determina valori commessa / articolo / qta
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
private void processInput(string value)
|
||||
{
|
||||
// verifico se sia un operatore...
|
||||
Match testOper = Regex.Match(value, mUtils.reCodOper);
|
||||
/// <summary>
|
||||
/// Cod OPERATORE corrente
|
||||
/// </summary>
|
||||
public string codOper
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("currCodOperMulti");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("currCodOperMulti", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Effettua riconoscimento input e determina valori commessa / articolo / qta
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
private void processInput(string value)
|
||||
{
|
||||
// verifico se sia un operatore...
|
||||
Match testOper = Regex.Match(value, mUtils.reCodOper);
|
||||
|
||||
if (testOper.Success)
|
||||
{
|
||||
// salvo nuovo operatore SE non ci fosse...
|
||||
codOper = value;
|
||||
dataLayer.man.taO2P.InsertQuery(codPost, codOper, DateTime.Now);
|
||||
reportUpdate();
|
||||
}
|
||||
doUpdate();
|
||||
if (testOper.Success)
|
||||
{
|
||||
// salvo nuovo operatore SE non ci fosse...
|
||||
codOper = value;
|
||||
DLMan.taO2P.InsertQuery(codPost, codOper, DateTime.Now);
|
||||
reportUpdate();
|
||||
}
|
||||
doUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,10 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_periodo.ascx.cs" Inherits="C_TRACK.WebUserControls.mod_periodo" %>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<asp:TextBox runat="server" ID="txtFrom" CssClass="form-control" TextMode="Date" AutoPostBack="True" OnTextChanged="txtFrom_TextChanged"></asp:TextBox>
|
||||
</div>
|
||||
<div class="col"></div>
|
||||
<div class="col">
|
||||
<asp:TextBox runat="server" ID="txtTo" CssClass="form-control" TextMode="Date" AutoPostBack="True" OnTextChanged="txtTo_TextChanged"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col"></div>
|
||||
<div class="col">
|
||||
<asp:HyperLink runat="server" ID="hlExport" Target="_blank" CssClass="btn btn-success btn-block">EXPORT</asp:HyperLink>
|
||||
</div>
|
||||
<div class="col"></div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<asp:TextBox runat="server" ID="txtFrom" CssClass="form-control" TextMode="Date" AutoPostBack="True" OnTextChanged="txtFrom_TextChanged"></asp:TextBox>
|
||||
</div>
|
||||
<div class="col">
|
||||
<asp:TextBox runat="server" ID="txtTo" CssClass="form-control" TextMode="Date" AutoPostBack="True" OnTextChanged="txtTo_TextChanged"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3,59 +3,61 @@ using System.Web.UI;
|
||||
|
||||
namespace C_TRACK.WebUserControls
|
||||
{
|
||||
public partial class mod_periodo : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
public partial class mod_periodo : BaseUserControl
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
dataFrom = DateTime.Today.AddMonths(-1);
|
||||
dataTo = DateTime.Today.AddDays(1);
|
||||
updateUrl();
|
||||
}
|
||||
}
|
||||
#region Public Properties
|
||||
|
||||
protected DateTime dataFrom
|
||||
{
|
||||
get
|
||||
{
|
||||
DateTime answ = DateTime.Today;
|
||||
DateTime.TryParse(txtFrom.Text.Trim(), out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
txtFrom.Text = value.ToString("yyyy-MM-dd");
|
||||
}
|
||||
}
|
||||
public DateTime dataFrom
|
||||
{
|
||||
get
|
||||
{
|
||||
DateTime answ = DateTime.Today;
|
||||
DateTime.TryParse(txtFrom.Text.Trim(), out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
txtFrom.Text = value.ToString("yyyy-MM-dd");
|
||||
}
|
||||
}
|
||||
|
||||
protected DateTime dataTo
|
||||
{
|
||||
get
|
||||
{
|
||||
DateTime answ = DateTime.Today;
|
||||
DateTime.TryParse(txtTo.Text.Trim(), out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
txtTo.Text = value.ToString("yyyy-MM-dd");
|
||||
}
|
||||
}
|
||||
public DateTime dataTo
|
||||
{
|
||||
get
|
||||
{
|
||||
DateTime answ = DateTime.Today;
|
||||
DateTime.TryParse(txtTo.Text.Trim(), out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
txtTo.Text = value.ToString("yyyy-MM-dd");
|
||||
}
|
||||
}
|
||||
|
||||
protected void txtFrom_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
updateUrl();
|
||||
}
|
||||
#endregion Public Properties
|
||||
|
||||
protected void txtTo_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
updateUrl();
|
||||
}
|
||||
#region Protected Methods
|
||||
|
||||
private void updateUrl()
|
||||
{
|
||||
hlExport.NavigateUrl = string.Format("~/doExport?from={0:yyyy-MM-dd}&to={1:yyyy-MM-dd}", dataFrom, dataTo);
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
dataFrom = DateTime.Today.AddMonths(-1);
|
||||
dataTo = DateTime.Today.AddDays(1);
|
||||
}
|
||||
}
|
||||
|
||||
protected void txtFrom_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
raiseEvent();
|
||||
}
|
||||
|
||||
protected void txtTo_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
raiseEvent();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
-15
@@ -7,11 +7,13 @@
|
||||
// </generato automaticamente>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace C_TRACK.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_periodo {
|
||||
|
||||
namespace C_TRACK.WebUserControls
|
||||
{
|
||||
|
||||
|
||||
public partial class mod_periodo
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Controllo txtFrom.
|
||||
/// </summary>
|
||||
@@ -20,7 +22,7 @@ namespace C_TRACK.WebUserControls {
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtFrom;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Controllo txtTo.
|
||||
/// </summary>
|
||||
@@ -29,14 +31,5 @@ namespace C_TRACK.WebUserControls {
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtTo;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo hlExport.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink hlExport;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,113 +5,113 @@ using System.Web.UI;
|
||||
|
||||
namespace C_TRACK.WebUserControls
|
||||
{
|
||||
public partial class mod_postazioni : System.Web.UI.UserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
public partial class mod_postazioni : BaseUserControl
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
memLayer.ML.emptySessionVal("DescPost");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// selezione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// salvo la postazione selezionata
|
||||
string newCodPost = grView.SelectedValue.ToString();
|
||||
mUtils.CodPost = newCodPost;
|
||||
// vedo di recuperare dati postazione...
|
||||
try
|
||||
{
|
||||
DS_App.AnagPostRow datiPost = dataLayer.man.taAP.getByKey(newCodPost)[0];
|
||||
// salvo!
|
||||
mUtils.postIsMulti = datiPost.IsMultiOpr;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
string nextPage = "";
|
||||
if (memLayer.ML.StringSessionObj("nextObjCommand") == "setOpr")
|
||||
{
|
||||
// salvo su DB...
|
||||
dataLayer.man.taAP.setOpr(mUtils.CodPost, mUtils.CodOpr);
|
||||
// set rimando a BCode con settato Postazione
|
||||
nextPage = "~/barcode";
|
||||
}
|
||||
else if (memLayer.ML.StringSessionObj("nextObjCommand") == "freePost")
|
||||
{
|
||||
// salvo su DB...
|
||||
dataLayer.man.taAP.setOpr(mUtils.CodPost, "");
|
||||
mUtils.CodPost = "";
|
||||
// set rimando a postazioni
|
||||
nextPage = "~/postazioni";
|
||||
}
|
||||
else if (memLayer.ML.StringSessionObj("nextObjCommand") == "selPost")
|
||||
{
|
||||
// set rimando a BCode con settato Postazione
|
||||
nextPage = "~/barcode";
|
||||
}
|
||||
memLayer.ML.setSessionVal("nextObjCommand", "");
|
||||
// reload pagina!
|
||||
Response.Redirect(nextPage);
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
memLayer.ML.emptySessionVal("DescPost");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// selezione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// salvo la postazione selezionata
|
||||
string newCodPost = grView.SelectedValue.ToString();
|
||||
mUtils.CodPost = newCodPost;
|
||||
// vedo di recuperare dati postazione...
|
||||
try
|
||||
{
|
||||
DS_App.AnagPostRow datiPost = DLMan.taAP.getByKey(newCodPost)[0];
|
||||
// salvo!
|
||||
mUtils.postIsMulti = datiPost.IsMultiOpr;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
string nextPage = "";
|
||||
if (memLayer.ML.StringSessionObj("nextObjCommand") == "setOpr")
|
||||
{
|
||||
// salvo su DB...
|
||||
DLMan.taAP.setOpr(mUtils.CodPost, mUtils.CodOpr);
|
||||
// set rimando a BCode con settato Postazione
|
||||
nextPage = "~/barcode";
|
||||
}
|
||||
else if (memLayer.ML.StringSessionObj("nextObjCommand") == "freePost")
|
||||
{
|
||||
// salvo su DB...
|
||||
DLMan.taAP.setOpr(mUtils.CodPost, "");
|
||||
mUtils.CodPost = "";
|
||||
// set rimando a postazioni
|
||||
nextPage = "~/postazioni";
|
||||
}
|
||||
else if (memLayer.ML.StringSessionObj("nextObjCommand") == "selPost")
|
||||
{
|
||||
// set rimando a BCode con settato Postazione
|
||||
nextPage = "~/barcode";
|
||||
}
|
||||
memLayer.ML.setSessionVal("nextObjCommand", "");
|
||||
// reload pagina!
|
||||
Response.Redirect(nextPage);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// salvo in session che il prox comando è liberare postazione...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtFreePost_Click(object sender, EventArgs e)
|
||||
{
|
||||
memLayer.ML.setSessionVal("nextObjCommand", "freePost");
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo in session che il prox comando è impostare operatore...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtSetOpr_Click(object sender, EventArgs e)
|
||||
{
|
||||
memLayer.ML.setSessionVal("nextObjCommand", "setOpr");
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo in session che il prox comando è impostare postazione...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtSelPost_Click(object sender, EventArgs e)
|
||||
{
|
||||
memLayer.ML.setSessionVal("nextObjCommand", "selPost");
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica se sia possibile sbloccare la postazione (togliere Opr corrente:
|
||||
/// - è un user "power"
|
||||
/// - è LUI STESSO l'utente da levare
|
||||
/// </summary>
|
||||
public bool canUnlock(string thisCodOpr)
|
||||
{
|
||||
bool hasLock = thisCodOpr != "";
|
||||
bool isAdmin = devicesAuthProxy.stObj.userHasRight("CT_admin");
|
||||
bool isStart = devicesAuthProxy.stObj.userHasRight("CT_userStart");
|
||||
bool isPower = devicesAuthProxy.stObj.userHasRight("CT_powerUser");
|
||||
bool isHimself = (mUtils.CodOpr == thisCodOpr);
|
||||
return hasLock && (isPower || isAdmin || isStart || isHimself);
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo in session che il prox comando è liberare postazione...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtFreePost_Click(object sender, EventArgs e)
|
||||
{
|
||||
memLayer.ML.setSessionVal("nextObjCommand", "freePost");
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo in session che il prox comando è impostare operatore...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtSetOpr_Click(object sender, EventArgs e)
|
||||
{
|
||||
memLayer.ML.setSessionVal("nextObjCommand", "setOpr");
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo in session che il prox comando è impostare postazione...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtSelPost_Click(object sender, EventArgs e)
|
||||
{
|
||||
memLayer.ML.setSessionVal("nextObjCommand", "selPost");
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica se sia possibile sbloccare la postazione (togliere Opr corrente:
|
||||
/// - è un user "power"
|
||||
/// - è LUI STESSO l'utente da levare
|
||||
/// </summary>
|
||||
public bool canUnlock(string thisCodOpr)
|
||||
{
|
||||
bool hasLock = thisCodOpr != "";
|
||||
bool isAdmin = devicesAuthProxy.stObj.userHasRight("CT_admin");
|
||||
bool isStart = devicesAuthProxy.stObj.userHasRight("CT_userStart");
|
||||
bool isPower = devicesAuthProxy.stObj.userHasRight("CT_powerUser");
|
||||
bool isHimself = (mUtils.CodOpr == thisCodOpr);
|
||||
return hasLock && (isPower || isAdmin || isStart || isHimself);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se sia possibile sbloccare la postazione (togliere Opr corrente:
|
||||
/// - è un user "power"
|
||||
/// - è LUI STESSO l'utente da levare
|
||||
/// </summary>
|
||||
public bool canSelPost(string thisCodOpr)
|
||||
{
|
||||
bool hasLock = thisCodOpr != "";
|
||||
bool isHimself = (mUtils.CodOpr == thisCodOpr);
|
||||
return hasLock && isHimself;
|
||||
/// <summary>
|
||||
/// Verifica se sia possibile sbloccare la postazione (togliere Opr corrente:
|
||||
/// - è un user "power"
|
||||
/// - è LUI STESSO l'utente da levare
|
||||
/// </summary>
|
||||
public bool canSelPost(string thisCodOpr)
|
||||
{
|
||||
bool hasLock = thisCodOpr != "";
|
||||
bool isHimself = (mUtils.CodOpr == thisCodOpr);
|
||||
return hasLock && isHimself;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,91 +1,106 @@
|
||||
using AppData;
|
||||
using SteamWare;
|
||||
using SteamWare;
|
||||
using System;
|
||||
|
||||
namespace C_TRACK.WebUserControls
|
||||
{
|
||||
public partial class mod_selTask : System.Web.UI.UserControl
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// evento selezione dati
|
||||
/// </summary>
|
||||
public event EventHandler eh_dataSel;
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
public partial class mod_selTask : BaseUserControl
|
||||
{
|
||||
#region Public Events
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// evento selezione dati
|
||||
/// </summary>
|
||||
public event EventHandler eh_dataSel;
|
||||
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// selezionata una richiesta
|
||||
int idxProm = 0;
|
||||
int.TryParse(grView.SelectedValue.ToString(), out idxProm);
|
||||
if (idxProm > 0)
|
||||
{
|
||||
// --> ho IdxPromessa --> recupero KeyRichiesta = CurrNumTask
|
||||
var tab = dataLayer.man.taPODL.getByKey(idxProm);
|
||||
string _numTask = "";
|
||||
if (tab.Rows.Count > 0)
|
||||
#endregion Public Events
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Codice ART corrente
|
||||
/// </summary>
|
||||
public string CurrCodArt
|
||||
{
|
||||
// recupero NumTask
|
||||
_numTask = tab[0].KeyRichiesta;
|
||||
if (_numTask != "")
|
||||
{
|
||||
// verifica preliminare se vada creato Task...
|
||||
checkTask(idxProm);
|
||||
// salvo commessa
|
||||
CurrNumTask = _numTask;
|
||||
// salvo articolo...
|
||||
CurrCodArt = tab[0].CodArticolo;
|
||||
// segnalo update
|
||||
if (eh_dataSel != null)
|
||||
get
|
||||
{
|
||||
eh_dataSel(this, new EventArgs());
|
||||
return memLayer.ML.StringSessionObj("CurrCodArt");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("CurrCodArt", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica se il task vada importato
|
||||
/// </summary>
|
||||
/// <param name="idxPromessa"></param>
|
||||
private void checkTask(int idxPromessa)
|
||||
{
|
||||
dataLayer.man.taTL.ImportNew(idxPromessa);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Codice TASK corrente
|
||||
/// </summary>
|
||||
public string CurrNumTask
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("CurrNumTask");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("CurrNumTask", value);
|
||||
// salvo anche come btn pressed...
|
||||
memLayer.ML.setSessionVal("btnCmdPress", value);
|
||||
}
|
||||
/// <summary>
|
||||
/// Codice TASK corrente
|
||||
/// </summary>
|
||||
public string CurrNumTask
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("CurrNumTask");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("CurrNumTask", value);
|
||||
// salvo anche come btn pressed...
|
||||
memLayer.ML.setSessionVal("btnCmdPress", value);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se il task vada importato
|
||||
/// </summary>
|
||||
/// <param name="idxPromessa"></param>
|
||||
private void checkTask(int idxPromessa)
|
||||
{
|
||||
DLMan.taTL.ImportNew(idxPromessa);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// selezionata una richiesta
|
||||
int idxProm = 0;
|
||||
int.TryParse(grView.SelectedValue.ToString(), out idxProm);
|
||||
if (idxProm > 0)
|
||||
{
|
||||
// --> ho IdxPromessa --> recupero KeyRichiesta = CurrNumTask
|
||||
var tab = DLMan.taPODL.getByKey(idxProm);
|
||||
string _numTask = "";
|
||||
if (tab.Rows.Count > 0)
|
||||
{
|
||||
// recupero NumTask
|
||||
_numTask = tab[0].KeyRichiesta;
|
||||
if (_numTask != "")
|
||||
{
|
||||
// verifica preliminare se vada creato Task...
|
||||
checkTask(idxProm);
|
||||
// salvo commessa
|
||||
CurrNumTask = _numTask;
|
||||
// salvo articolo...
|
||||
CurrCodArt = tab[0].CodArticolo;
|
||||
// segnalo update
|
||||
if (eh_dataSel != null)
|
||||
{
|
||||
eh_dataSel(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
/// <summary>
|
||||
/// Codice ART corrente
|
||||
/// </summary>
|
||||
public string CurrCodArt
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("CurrCodArt");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("CurrCodArt", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,142 +7,148 @@ using System.Web.UI.WebControls;
|
||||
|
||||
namespace C_TRACK.WebUserControls
|
||||
{
|
||||
public partial class mod_task2post : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// evento aggiunta record
|
||||
/// </summary>
|
||||
public event EventHandler eh_reqUpdate;
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
public partial class mod_task2post : BaseUserControl
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
if (mUtils.postIsMulti)
|
||||
/// <summary>
|
||||
/// evento aggiunta record
|
||||
/// </summary>
|
||||
public event EventHandler eh_reqUpdate;
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
doUpdate();
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
if (mUtils.postIsMulti)
|
||||
{
|
||||
doUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
public void doUpdate()
|
||||
{
|
||||
try
|
||||
{
|
||||
grView.DataBind();
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog($"Eccezione in render gridView: CodPost = {memLayer.ML.StringSessionObj("CodPost")}");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Stato TASK da mostrare
|
||||
/// </summary>
|
||||
public bool taskIsActive
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
bool.TryParse(hfIsActive.Value, out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfIsActive.Value = value.ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica se lo stato sia ATTIVO
|
||||
/// </summary>
|
||||
/// <param name="_IsActive"></param>
|
||||
/// <returns></returns>
|
||||
public bool checkActive(object _IsActive)
|
||||
{
|
||||
bool answ = false;
|
||||
bool.TryParse(_IsActive.ToString(), out answ);
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// CodPost selezionato in sessione
|
||||
/// </summary>
|
||||
protected string codPost
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("CodPost");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public void doUpdate()
|
||||
{
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stato TASK da mostrare
|
||||
/// </summary>
|
||||
public bool taskIsActive
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
bool.TryParse(hfIsActive.Value, out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfIsActive.Value = value.ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica se lo stato sia ATTIVO
|
||||
/// </summary>
|
||||
/// <param name="_IsActive"></param>
|
||||
/// <returns></returns>
|
||||
public bool checkActive(object _IsActive)
|
||||
{
|
||||
bool answ = false;
|
||||
bool.TryParse(_IsActive.ToString(), out answ);
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// CodPost selezionato in sessione
|
||||
/// </summary>
|
||||
protected string codPost
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("CodPost");
|
||||
}
|
||||
}
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
string numTask = grView.SelectedValue.ToString();
|
||||
// chiamo toggle status, segnalo update!
|
||||
DLMan.taTL2Post.ToggleActive(codPost, numTask);
|
||||
reportUpdate();
|
||||
}
|
||||
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
string numTask = grView.SelectedValue.ToString();
|
||||
// chiamo toggle status, segnalo update!
|
||||
dataLayer.man.taTL2Post.ToggleActive(codPost, numTask);
|
||||
reportUpdate();
|
||||
}
|
||||
protected void grView_RowDeleted(object sender, GridViewDeletedEventArgs e)
|
||||
{
|
||||
reportUpdate();
|
||||
}
|
||||
|
||||
protected void grView_RowDeleted(object sender, GridViewDeletedEventArgs e)
|
||||
{
|
||||
reportUpdate();
|
||||
}
|
||||
private void reportUpdate()
|
||||
{
|
||||
// invoco update...
|
||||
if (eh_reqUpdate != null)
|
||||
{
|
||||
eh_reqUpdate(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
private void reportUpdate()
|
||||
{
|
||||
// invoco update...
|
||||
if (eh_reqUpdate != null)
|
||||
{
|
||||
eh_reqUpdate(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Input da processare (tipo codOperatore...)...
|
||||
/// </summary>
|
||||
public string newInput
|
||||
{
|
||||
set
|
||||
{
|
||||
processInput(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Input da processare (tipo codOperatore...)...
|
||||
/// </summary>
|
||||
public string newInput
|
||||
{
|
||||
set
|
||||
{
|
||||
processInput(value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Cod OPERATORE corrente
|
||||
/// </summary>
|
||||
public string NumTask
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("currNumTaskMulti");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("currNumTaskMulti", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Effettua riconoscimento input e determina valori commessa / articolo / qta
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
private void processInput(string value)
|
||||
{
|
||||
// verifico se sia un operatore...
|
||||
Match testNumTask = Regex.Match(value, mUtils.reNumTask);
|
||||
|
||||
/// <summary>
|
||||
/// Cod OPERATORE corrente
|
||||
/// </summary>
|
||||
public string NumTask
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("currNumTaskMulti");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("currNumTaskMulti", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Effettua riconoscimento input e determina valori commessa / articolo / qta
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
private void processInput(string value)
|
||||
{
|
||||
// verifico se sia un operatore...
|
||||
Match testNumTask = Regex.Match(value, mUtils.reNumTask);
|
||||
if (testNumTask.Success)
|
||||
{
|
||||
NumTask = value;
|
||||
string codTag = mUtils.optValueBC != "" ? mUtils.optValueBC : "";
|
||||
DLMan.taTL2Post.InsertQuery(codPost, NumTask, codTag);
|
||||
reportUpdate();
|
||||
}
|
||||
doUpdate();
|
||||
}
|
||||
|
||||
if (testNumTask.Success)
|
||||
{
|
||||
NumTask = value;
|
||||
string codTag = mUtils.optValueBC != "" ? mUtils.optValueBC : "";
|
||||
dataLayer.man.taTL2Post.InsertQuery(codPost, NumTask, codTag);
|
||||
reportUpdate();
|
||||
}
|
||||
doUpdate();
|
||||
}
|
||||
protected void grView_RowUpdated(object sender, GridViewUpdatedEventArgs e)
|
||||
{
|
||||
reportUpdate();
|
||||
}
|
||||
|
||||
protected void grView_RowUpdated(object sender, GridViewUpdatedEventArgs e)
|
||||
{
|
||||
reportUpdate();
|
||||
public bool showTag
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.CRB("OptUseSelTag");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool showTag
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.CRB("OptUseSelTag");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,90 +3,91 @@
|
||||
<%@ Register Src="~/WebUserControls/mod_fasiAttive.ascx" TagPrefix="uc1" TagName="mod_fasiAttive" %>
|
||||
|
||||
<div class="row text-uppercase mb-2">
|
||||
<div class="col">
|
||||
<asp:LinkButton runat="server" ID="lbCaricati" CssClass="btn btn-sm btn-success btn-block" OnClick="lbCaricati_Click" AccessKey="1">[1] Caricate</asp:LinkButton>
|
||||
</div>
|
||||
<div class="col">
|
||||
<asp:LinkButton runat="server" ID="lbInCorso" CssClass="btn btn-sm btn-warning btn-block" OnClick="lbInCorso_Click" AccessKey="2">[2] In Corso</asp:LinkButton>
|
||||
</div>
|
||||
<div class="col">
|
||||
<asp:LinkButton runat="server" ID="lbConclusi" CssClass="btn btn-sm btn-secondary btn-block" OnClick="lbConclusi_Click" AccessKey="3">[3] Concluse</asp:LinkButton>
|
||||
</div>
|
||||
<div class="col">
|
||||
<asp:LinkButton runat="server" ID="lbTutti" CssClass="btn btn-sm btn-dark btn-block" OnClick="lbTutti_Click" AccessKey="0">[0] Tutte Comm</asp:LinkButton>
|
||||
</div>
|
||||
<div class="col">
|
||||
<asp:LinkButton runat="server" ID="lbFasiAttive" CssClass="btn btn-sm btn-outline-primary btn-block" AccessKey="4" OnClick="lbFasiAttive_Click">[4] Fasi Attive</asp:LinkButton>
|
||||
</div>
|
||||
<div class="col">
|
||||
<asp:LinkButton runat="server" ID="lbCaricati" CssClass="btn btn-sm btn-success btn-block" OnClick="lbCaricati_Click" AccessKey="1">[1] Caricate</asp:LinkButton>
|
||||
</div>
|
||||
<div class="col">
|
||||
<asp:LinkButton runat="server" ID="lbInCorso" CssClass="btn btn-sm btn-warning btn-block" OnClick="lbInCorso_Click" AccessKey="2">[2] In Corso</asp:LinkButton>
|
||||
</div>
|
||||
<div class="col">
|
||||
<asp:LinkButton runat="server" ID="lbConclusi" CssClass="btn btn-sm btn-secondary btn-block" OnClick="lbConclusi_Click" AccessKey="3">[3] Concluse</asp:LinkButton>
|
||||
</div>
|
||||
<div class="col">
|
||||
<asp:LinkButton runat="server" ID="lbTutti" CssClass="btn btn-sm btn-dark btn-block" OnClick="lbTutti_Click" AccessKey="0">[0] Tutte Comm</asp:LinkButton>
|
||||
</div>
|
||||
<div class="col">
|
||||
<asp:LinkButton runat="server" ID="lbFasiAttive" CssClass="btn btn-sm btn-outline-primary btn-block" AccessKey="4" OnClick="lbFasiAttive_Click">[4] Fasi Attive</asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<uc1:mod_fasiAttive runat="server" ID="mod_fasiAttive" Visible="false" />
|
||||
<uc1:mod_taskRec runat="server" ID="mod_taskRec" tipoSelezione="byTask" />
|
||||
<i>NB: tempi espressi in minuti.centesimi</i>
|
||||
<asp:GridView ID="grView" runat="server" AutoGenerateColumns="False" DataKeyNames="NumTask" DataSourceID="ods" CssClass="table table-striped table-condensed table-sm small" AllowPaging="True" AllowSorting="True" OnSelectedIndexChanged="grView_SelectedIndexChanged">
|
||||
<HeaderStyle CssClass="default" />
|
||||
<PagerStyle CssClass="active GridPager" />
|
||||
<PagerSettings Mode="NumericFirstLast" />
|
||||
<SelectedRowStyle CssClass="table-info" />
|
||||
<EmptyDataTemplate>
|
||||
Nessun Risultato
|
||||
</EmptyDataTemplate>
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Width="2em">
|
||||
<HeaderTemplate>
|
||||
<asp:LinkButton ID="lbtReset" runat="server" OnClick="lbtReset_Click" CssClass="btn btn-sm btn-primary" Visible="true"><i class="fas fa-sync-alt"></i></asp:LinkButton>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lbSelect" runat="server" CausesValidation="False" CommandName="Select" CssClass="btn btn-sm btn-info"><i class="fas fa-search"></i></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
<div class="col-12">
|
||||
<uc1:mod_fasiAttive runat="server" ID="mod_fasiAttive" Visible="false" />
|
||||
<uc1:mod_taskRec runat="server" ID="mod_taskRec" tipoSelezione="byTask" />
|
||||
<i>NB: tempi espressi in minuti.centesimi</i>
|
||||
<asp:GridView ID="grView" runat="server" AutoGenerateColumns="False" DataKeyNames="NumTask" DataSourceID="ods" CssClass="table table-striped table-condensed table-sm small" AllowPaging="True" AllowSorting="True" OnSelectedIndexChanged="grView_SelectedIndexChanged">
|
||||
<HeaderStyle CssClass="default" />
|
||||
<PagerStyle CssClass="active GridPager" />
|
||||
<PagerSettings Mode="NumericFirstLast" />
|
||||
<SelectedRowStyle CssClass="table-info" />
|
||||
<EmptyDataTemplate>
|
||||
Nessun Risultato
|
||||
</EmptyDataTemplate>
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Width="2em">
|
||||
<HeaderTemplate>
|
||||
<asp:LinkButton ID="lbtReset" runat="server" OnClick="lbtReset_Click" CssClass="btn btn-sm btn-primary" Visible="true"><i class="fas fa-sync-alt"></i></asp:LinkButton>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lbSelect" runat="server" CausesValidation="False" CommandName="Select" CssClass="btn btn-sm btn-info"><i class="fas fa-search"></i></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
|
||||
<ItemStyle Width="2em"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="NumTask" HeaderText="Commessa" ReadOnly="True" SortExpression="NumTask" />
|
||||
<asp:BoundField DataField="CodGruppo" HeaderText="Gruppo" SortExpression="CodGruppo" />
|
||||
<asp:BoundField DataField="CodArt" HeaderText="Articolo" SortExpression="CodArt" />
|
||||
<asp:BoundField DataField="QtaRic" HeaderText="Qta Ord" SortExpression="QtaRic" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="QtaEv" HeaderText="Qta Ev" SortExpression="QtaEv" ItemStyle-HorizontalAlign="Center" ItemStyle-CssClass="text-success" />
|
||||
<asp:BoundField DataField="MinTotWrk" HeaderText="Tot Lav." SortExpression="MinTotWrk" DataFormatString="{0:N3}" />
|
||||
<asp:BoundField DataField="TCMedio" HeaderText="T.Ciclo" SortExpression="TCMedio" DataFormatString="{0:N2}"/>
|
||||
<asp:BoundField DataField="MinTotFix" HeaderText="Tot Rip." SortExpression="MinTotFix" DataFormatString="{0:N3}"/>
|
||||
<asp:BoundField DataField="DataIns" HeaderText="Inserita" SortExpression="DataIns" />
|
||||
<asp:TemplateField HeaderText="St" SortExpression="CurrStatus" ItemStyle-Width="4em">
|
||||
<ItemTemplate>
|
||||
<div class="text-center">
|
||||
<b>
|
||||
<asp:Label ID="Label1" runat="server" Font-Size="1.3em" Text='<%# Eval("CurrStatus") %>' /></b><br />
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# tradStatus(Eval("CurrStatus")) %>' />
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="2em"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="NumTask" HeaderText="Commessa" ReadOnly="True" SortExpression="NumTask" />
|
||||
<asp:BoundField DataField="CodGruppo" HeaderText="Gruppo" SortExpression="CodGruppo" />
|
||||
<asp:BoundField DataField="CodArt" HeaderText="Articolo" SortExpression="CodArt" />
|
||||
<asp:BoundField DataField="QtaRic" HeaderText="Qta Ord" SortExpression="QtaRic" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="QtaEv" HeaderText="Qta Ev" SortExpression="QtaEv" ItemStyle-HorizontalAlign="Center" ItemStyle-CssClass="text-success" />
|
||||
<asp:BoundField DataField="MinTotWrk" HeaderText="Tot Lav." SortExpression="MinTotWrk" DataFormatString="{0:N3}" />
|
||||
<asp:BoundField DataField="TCMedio" HeaderText="T.Ciclo" SortExpression="TCMedio" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="MinTotFix" HeaderText="Tot Rip." SortExpression="MinTotFix" DataFormatString="{0:N3}" />
|
||||
<asp:BoundField DataField="TimeEst" HeaderText="T.Prev" SortExpression="TimeEst" DataFormatString="{0:N3}" />
|
||||
<asp:BoundField DataField="DataIns" HeaderText="Inserita" SortExpression="DataIns" />
|
||||
<asp:TemplateField HeaderText="St" SortExpression="CurrStatus" ItemStyle-Width="4em">
|
||||
<ItemTemplate>
|
||||
<div class="text-center">
|
||||
<b>
|
||||
<asp:Label ID="Label1" runat="server" Font-Size="1.3em" Text='<%# Eval("CurrStatus") %>' /></b><br />
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# tradStatus(Eval("CurrStatus")) %>' />
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
|
||||
<ItemStyle Width="4em"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ShowHeader="False" ItemStyle-Width="2em">
|
||||
<ItemTemplate>
|
||||
<div class="row">
|
||||
<div class="col text-right">
|
||||
<asp:LinkButton ID="lbDelete" runat="server" CausesValidation="False" CommandName="Delete" CssClass="btn btn-sm btn-danger" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaDel") %>' Visible='<%# Eval("NumRec").ToString()=="0" %>'><i class="fas fa-trash"></i></asp:LinkButton>
|
||||
<asp:LinkButton ID="lbtReopen" runat="server" CausesValidation="False" CommandName="Select" CommandArgument="reopenTask" CssClass="btn btn-block btn-warning" Visible='<%# Convert.ToBoolean(Eval("Concluso")) %>' ToolTip="Riapertura Commessa" OnClick="lbtReopen_Click" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaReopenTask") %>'><i class="fas fa-angle-double-up"></i></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="4em"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ShowHeader="False" ItemStyle-Width="2em">
|
||||
<ItemTemplate>
|
||||
<div class="row">
|
||||
<div class="col text-right">
|
||||
<asp:LinkButton ID="lbDelete" runat="server" CausesValidation="False" CommandName="Delete" CssClass="btn btn-sm btn-danger" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaDel") %>' Visible='<%# Eval("NumRec").ToString()=="0" %>'><i class="fas fa-trash"></i></asp:LinkButton>
|
||||
<asp:LinkButton ID="lbtReopen" runat="server" CausesValidation="False" CommandName="Select" CommandArgument="reopenTask" CssClass="btn btn-block btn-warning" Visible='<%# Convert.ToBoolean(Eval("Concluso")) %>' ToolTip="Riapertura Commessa" OnClick="lbtReopen_Click" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaReopenTask") %>'><i class="fas fa-angle-double-up"></i></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
|
||||
<ItemStyle Width="2em"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:HiddenField runat="server" ID="hfCurrStatus" />
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByFilt" TypeName="AppData.DS_AppTableAdapters.TaskListTableAdapter" DeleteMethod="deleteQuery" OnDeleted="ods_Deleted">
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_NumTask" Type="String" />
|
||||
</DeleteParameters>
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="hfCurrStatus" DefaultValue="0" Name="CurrStatus" PropertyName="Value" Type="Int32" />
|
||||
<asp:SessionParameter Name="CodArt" SessionField="currCodArt" Type="String" />
|
||||
<asp:SessionParameter Name="NumTask" SessionField="currNumTask" Type="String" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
</div>
|
||||
<ItemStyle Width="2em"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:HiddenField runat="server" ID="hfCurrStatus" />
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByFilt" TypeName="AppData.DS_AppTableAdapters.TaskListTableAdapter" DeleteMethod="deleteQuery" OnDeleted="ods_Deleted">
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_NumTask" Type="String" />
|
||||
</DeleteParameters>
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="hfCurrStatus" DefaultValue="0" Name="CurrStatus" PropertyName="Value" Type="Int32" />
|
||||
<asp:SessionParameter Name="CodArt" SessionField="currCodArt" Type="String" />
|
||||
<asp:SessionParameter Name="NumTask" SessionField="currNumTask" Type="String" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
</div>
|
||||
@@ -5,7 +5,7 @@ using System.Web.UI;
|
||||
|
||||
namespace C_TRACK.WebUserControls
|
||||
{
|
||||
public partial class mod_taskList : System.Web.UI.UserControl
|
||||
public partial class mod_taskList : BaseUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Gestione load pagina
|
||||
@@ -153,7 +153,7 @@ namespace C_TRACK.WebUserControls
|
||||
if (memLayer.ML.StringSessionObj("nextObjCommand") == "reopenTask")
|
||||
{
|
||||
// salvo su DB...
|
||||
dataLayer.man.taTL.updateClose(NumTask, false);
|
||||
DLMan.taTL.updateClose(NumTask, false);
|
||||
// tolgo comando reopen...
|
||||
memLayer.ML.emptySessionVal("nextObjCommand");
|
||||
// set rimando a BCode con settato Postazione
|
||||
|
||||
+676
-671
File diff suppressed because it is too large
Load Diff
@@ -8,12 +8,12 @@ using System.Web.UI.WebControls;
|
||||
|
||||
namespace C_TRACK
|
||||
{
|
||||
public partial class closeAllRec : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
public partial class closeAllRec : BasePage
|
||||
{
|
||||
// chiama la procedura che chiude tutte la fasi rimaste attive...
|
||||
dataLayer.man.taTR.closePending();
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// chiama la procedura che chiude tutte la fasi rimaste attive...
|
||||
DLMan.taTR.closePending();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+117
-69
@@ -5,84 +5,132 @@ using System.Text;
|
||||
|
||||
namespace C_TRACK
|
||||
{
|
||||
public partial class doExport : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
public partial class doExport : BasePage
|
||||
{
|
||||
string delimiter = ",";
|
||||
#region Protected Properties
|
||||
|
||||
//prepare the output stream
|
||||
Response.Clear();
|
||||
Response.ContentType = "text/csv";
|
||||
Response.AppendHeader("Content-Disposition", "attachment; filename=ctrack_report.csv");
|
||||
|
||||
string value = "";
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
// recupero oggetti parametrici...
|
||||
string from = Request.QueryString["from"];
|
||||
string to = Request.QueryString["to"];
|
||||
DateTime dateFrom = DateTime.Today.AddYears(-1);
|
||||
DateTime dateTo = DateTime.Today.AddDays(1);
|
||||
// se è diverso da vuoto faccio parse...
|
||||
if (from != "" && from !=null)
|
||||
{
|
||||
DateTime.TryParse(from, out dateFrom);
|
||||
}
|
||||
if (to != "" && to != null)
|
||||
{
|
||||
DateTime.TryParse(to, out dateTo);
|
||||
}
|
||||
|
||||
// leggo tabella
|
||||
var dt = dataLayer.man.taTR.getByFilt("", dateFrom, dateTo);
|
||||
|
||||
//write the csv column headers
|
||||
for (int i = 0; i < dt.Columns.Count; i++)
|
||||
{
|
||||
|
||||
value = dt.Columns[i].ColumnName;
|
||||
// Implement special handling for values that contain comma or quote
|
||||
// Enclose in quotes and double up any double quotes
|
||||
if (value.IndexOfAny(new char[] { '"', ',' }) != -1)
|
||||
builder.AppendFormat("\"{0}\"", value.Replace("\"", "\"\""));
|
||||
else
|
||||
protected DateTime dateFrom
|
||||
{
|
||||
builder.Append(value);
|
||||
|
||||
get
|
||||
{
|
||||
DateTime answ = DateTime.Today.AddYears(-1);
|
||||
// se è diverso da vuoto faccio parse...
|
||||
if (!string.IsNullOrEmpty(from))
|
||||
{
|
||||
DateTime.TryParse(from, out answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
Response.Write(value);
|
||||
Response.Write((i < dt.Columns.Count - 1) ? delimiter : Environment.NewLine);
|
||||
builder.Clear();
|
||||
}
|
||||
|
||||
//write the data
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
for (int i = 0; i < dt.Columns.Count; i++)
|
||||
protected DateTime dateTo
|
||||
{
|
||||
value = row[i].ToString();
|
||||
// Implement special handling for values that contain comma or quote
|
||||
// Enclose in quotes and double up any double quotes
|
||||
|
||||
if (value.IndexOfAny(new char[] { '"', ',' }) != -1)
|
||||
builder.AppendFormat("\"{0}\"", value.Replace("\"", "\"\""));
|
||||
else
|
||||
{
|
||||
builder.Append(value);
|
||||
|
||||
}
|
||||
|
||||
Response.Write(builder.ToString());
|
||||
Response.Write((i < dt.Columns.Count - 1) ? delimiter : Environment.NewLine);
|
||||
builder.Clear();
|
||||
get
|
||||
{
|
||||
DateTime answ = DateTime.Today.AddDays(1);
|
||||
// se è diverso da vuoto faccio parse...
|
||||
if (!string.IsNullOrEmpty(to))
|
||||
{
|
||||
DateTime.TryParse(to, out answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Response.End();
|
||||
protected string from
|
||||
{
|
||||
get
|
||||
{
|
||||
return Request.QueryString["from"];
|
||||
}
|
||||
}
|
||||
|
||||
protected string mode
|
||||
{
|
||||
get
|
||||
{
|
||||
return Request.QueryString["mode"];
|
||||
}
|
||||
}
|
||||
|
||||
protected string to
|
||||
{
|
||||
get
|
||||
{
|
||||
return Request.QueryString["to"];
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
string delimiter = ",";
|
||||
|
||||
//prepare the output stream
|
||||
Response.Clear();
|
||||
Response.ContentType = "text/csv";
|
||||
Response.AppendHeader("Content-Disposition", "attachment; filename=ctrack_report.csv");
|
||||
|
||||
string value = "";
|
||||
StringBuilder builder = new StringBuilder();
|
||||
DataTable dt = new DataTable();
|
||||
|
||||
// leggo tabella secondo il MODO
|
||||
if (mode == "aggr")
|
||||
{
|
||||
dt = (DataTable)DLMan.taTRA.getByFilt("", dateFrom, dateTo);
|
||||
}
|
||||
else
|
||||
{
|
||||
dt = (DataTable)DLMan.taTR.getByFilt("", dateFrom, dateTo);
|
||||
}
|
||||
|
||||
// write the csv column headers
|
||||
for (int i = 0; i < dt.Columns.Count; i++)
|
||||
{
|
||||
value = dt.Columns[i].ColumnName;
|
||||
// Implement special handling for values that contain comma or quote
|
||||
// Enclose in quotes and double up any double quotes
|
||||
if (value.IndexOfAny(new char[] { '"', ',' }) != -1)
|
||||
builder.AppendFormat("\"{0}\"", value.Replace("\"", "\"\""));
|
||||
else
|
||||
{
|
||||
builder.Append(value);
|
||||
}
|
||||
|
||||
Response.Write(value);
|
||||
Response.Write((i < dt.Columns.Count - 1) ? delimiter : Environment.NewLine);
|
||||
builder.Clear();
|
||||
}
|
||||
|
||||
//write the data
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
for (int i = 0; i < dt.Columns.Count; i++)
|
||||
{
|
||||
value = row[i].ToString();
|
||||
// Implement special handling for values that contain comma or quote
|
||||
// Enclose in quotes and double up any double quotes
|
||||
|
||||
if (value.IndexOfAny(new char[] { '"', ',' }) != -1)
|
||||
builder.AppendFormat("\"{0}\"", value.Replace("\"", "\"\""));
|
||||
else
|
||||
{
|
||||
builder.Append(value);
|
||||
}
|
||||
|
||||
Response.Write(builder.ToString());
|
||||
Response.Write((i < dt.Columns.Count - 1) ? delimiter : Environment.NewLine);
|
||||
builder.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
Response.End();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
-10
@@ -3,17 +3,26 @@
|
||||
<%@ Register Src="~/WebUserControls/mod_checkOpr.ascx" TagPrefix="uc1" TagName="mod_checkOpr" %>
|
||||
<%@ Register Src="~/WebUserControls/mod_periodo.ascx" TagPrefix="uc1" TagName="mod_periodo" %>
|
||||
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
|
||||
<div class="card">
|
||||
<div class="card-header text-center text-primary text-uppercase py-1">
|
||||
<b>Gestione Commesse</b>
|
||||
<div class="card">
|
||||
<div class="card-header text-center text-primary text-uppercase py-1">
|
||||
<b>Gestione Commesse</b>
|
||||
</div>
|
||||
<div class="card-body p-1">
|
||||
<uc1:mod_checkOpr runat="server" ID="mod_checkOpr" />
|
||||
<div class="row my-2">
|
||||
<div class="col-6">
|
||||
<uc1:mod_periodo runat="server" ID="mod_periodo" />
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<asp:HyperLink runat="server" ID="hlExportFull" Target="_blank" CssClass="btn btn-success text-light btn-block"><i class="fas fa-download"></i> Export FULL</asp:HyperLink>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<asp:HyperLink runat="server" ID="hlExportComp" Target="_blank" CssClass="btn btn-success text-light btn-block"><i class="fas fa-download"></i> Export Compatto</asp:HyperLink>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-1">
|
||||
<uc1:mod_checkOpr runat="server" ID="mod_checkOpr" />
|
||||
<uc1:mod_periodo runat="server" id="mod_periodo" />
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
</asp:Content>
|
||||
+23
-4
@@ -7,11 +7,30 @@ using System.Web.UI.WebControls;
|
||||
|
||||
namespace C_TRACK
|
||||
{
|
||||
public partial class export : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
public partial class export : System.Web.UI.Page
|
||||
{
|
||||
#region Private Methods
|
||||
|
||||
private void mod_periodo_eh_doRefresh(object sender, EventArgs e)
|
||||
{
|
||||
updateUrl();
|
||||
}
|
||||
|
||||
private void updateUrl()
|
||||
{
|
||||
hlExportFull.NavigateUrl = string.Format("~/doExport?mode=full&from={0:yyyy-MM-dd}&to={1:yyyy-MM-dd}", mod_periodo.dataFrom, mod_periodo.dataTo);
|
||||
hlExportComp.NavigateUrl = string.Format("~/doExport?mode=aggr&from={0:yyyy-MM-dd}&to={1:yyyy-MM-dd}", mod_periodo.dataFrom, mod_periodo.dataTo);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
mod_periodo.eh_doRefresh += mod_periodo_eh_doRefresh;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+26
-6
@@ -7,11 +7,13 @@
|
||||
// </generato automaticamente>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace C_TRACK {
|
||||
|
||||
|
||||
public partial class export {
|
||||
|
||||
namespace C_TRACK
|
||||
{
|
||||
|
||||
|
||||
public partial class export
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Controllo mod_checkOpr.
|
||||
/// </summary>
|
||||
@@ -20,7 +22,7 @@ namespace C_TRACK {
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::C_TRACK.WebUserControls.mod_checkOpr mod_checkOpr;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Controllo mod_periodo.
|
||||
/// </summary>
|
||||
@@ -29,5 +31,23 @@ namespace C_TRACK {
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::C_TRACK.WebUserControls.mod_periodo mod_periodo;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo hlExportFull.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink hlExportFull;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo hlExportComp.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink hlExportComp;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="XPS.login" %>
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="C_TRACK.login" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
@@ -3,7 +3,7 @@ using System;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
|
||||
namespace XPS
|
||||
namespace C_TRACK
|
||||
{
|
||||
public partial class login : UserPage
|
||||
{
|
||||
@@ -11,8 +11,8 @@ namespace XPS
|
||||
{
|
||||
get
|
||||
{
|
||||
string pagina = SteamWare.memLayer.ML.StringSessionObj("nextPage");
|
||||
if (pagina == "")
|
||||
string pagina = memLayer.ML.StringSessionObj("nextPage");
|
||||
if (string.IsNullOrEmpty(pagina))
|
||||
{
|
||||
pagina = "barcode.aspx";
|
||||
}
|
||||
|
||||
Generated
+1
-1
@@ -7,7 +7,7 @@
|
||||
// </generato automaticamente>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace XPS {
|
||||
namespace C_TRACK {
|
||||
|
||||
|
||||
public partial class login {
|
||||
|
||||
Vendored
+4
-12
@@ -5,25 +5,17 @@ pipeline {
|
||||
EMAIL_RECIPIENTS = 'samuele@steamware.net'
|
||||
enableIIS01 = 'Y'
|
||||
enableIIS02 = 'Y'
|
||||
enableOVH = 'Y'
|
||||
enableOVH = 'N'
|
||||
}
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
agent any
|
||||
steps {
|
||||
/* build delle SteamWare libs! */
|
||||
/*build 'SteamWare/SteamWareLib'*/
|
||||
/* copio le libs...*/
|
||||
// step([$class: 'CopyArtifact', fingerprintArtifacts: true, projectName: 'Steamware/SteamWareLib', selector: [$class: 'WorkspaceSelector'], target: '../Steamware/SteamWareLib'])
|
||||
|
||||
// mirroring directory x SteamWare Libs
|
||||
// bat "robocopy /MIR ..\\..\\SteamWare\\SteamWareLib ..\\SteamWare\\SteamWareLib || EXIT /B 0"
|
||||
|
||||
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
|
||||
script {
|
||||
withEnv(['NEXT_BUILD_NUMBER=220']) {
|
||||
// env.versionNumber = VersionNumber(versionNumberString : '1.4.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2018-01-01', skipFailedBuilds: true)
|
||||
env.versionNumber = VersionNumber(versionNumberString : '1.4.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2018-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
withEnv(['NEXT_BUILD_NUMBER=229']) {
|
||||
// env.versionNumber = VersionNumber(versionNumberString : '1.5.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2018-01-01', skipFailedBuilds: true)
|
||||
env.versionNumber = VersionNumber(versionNumberString : '1.5.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILD_DATE_FORMATTED,"ddHH"}', projectStartDate : '2018-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
env.APP_NAME = 'C.TRACK'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
---------------------------------------------------------------
|
||||
------- SteamWareLib SDK -------
|
||||
---------------------------------------------------------------
|
||||
|
||||
Libreria di utility base di SteamWare.
|
||||
|
||||
Le dipendenze inserite sono necessarie al funzionamento dell'SDK.
|
||||
|
||||
Sono inclusi a titolo di esempio vari files di conf:
|
||||
* example-NLog.config
|
||||
|
||||
Attenzione a configurare correttamente il file NLog.xml includendo il rule per la classe, vedere ad esempio il file example-NLog.config allegato.
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 31 KiB |
@@ -1,27 +0,0 @@
|
||||
using System.Web;
|
||||
using System.Web.Optimization;
|
||||
|
||||
namespace MP_API
|
||||
{
|
||||
public class BundleConfig
|
||||
{
|
||||
// Per altre informazioni sulla creazione di bundle, vedere https://go.microsoft.com/fwlink/?LinkId=301862
|
||||
public static void RegisterBundles(BundleCollection bundles)
|
||||
{
|
||||
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
|
||||
"~/Scripts/jquery-{version}.js"));
|
||||
|
||||
// Utilizzare la versione di sviluppo di Modernizr per eseguire attività di sviluppo e formazione. Successivamente, quando si è
|
||||
// pronti per passare alla produzione, usare lo strumento di compilazione disponibile all'indirizzo https://modernizr.com per selezionare solo i test necessari.
|
||||
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
|
||||
"~/Scripts/modernizr-*"));
|
||||
|
||||
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
|
||||
"~/Scripts/bootstrap.js"));
|
||||
|
||||
bundles.Add(new StyleBundle("~/Content/css").Include(
|
||||
"~/Content/bootstrap.css",
|
||||
"~/Content/site.css"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace MP_API
|
||||
{
|
||||
public class FilterConfig
|
||||
{
|
||||
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
|
||||
{
|
||||
filters.Add(new HandleErrorAttribute());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
|
||||
namespace MP_API
|
||||
{
|
||||
public class RouteConfig
|
||||
{
|
||||
public static void RegisterRoutes(RouteCollection routes)
|
||||
{
|
||||
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
|
||||
|
||||
routes.MapRoute(
|
||||
name: "Default",
|
||||
url: "{controller}/{action}/{id}",
|
||||
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace MP_API
|
||||
{
|
||||
public static class WebApiConfig
|
||||
{
|
||||
public static void Register(HttpConfiguration config)
|
||||
{
|
||||
// Servizi e configurazione dell'API Web
|
||||
|
||||
// Route dell'API Web
|
||||
config.MapHttpAttributeRoutes();
|
||||
|
||||
config.Routes.MapHttpRoute(
|
||||
name: "DefaultApi",
|
||||
routeTemplate: "api/{controller}/{id}",
|
||||
defaults: new { id = RouteParameter.Optional }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Http.Description;
|
||||
|
||||
namespace MP_API.Areas.HelpPage
|
||||
{
|
||||
public static class ApiDescriptionExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Generates an URI-friendly ID for the <see cref="ApiDescription"/>. E.g. "Get-Values-id_name" instead of "GetValues/{id}?name={name}"
|
||||
/// </summary>
|
||||
/// <param name="description">The <see cref="ApiDescription"/>.</param>
|
||||
/// <returns>The ID as a string.</returns>
|
||||
public static string GetFriendlyId(this ApiDescription description)
|
||||
{
|
||||
string path = description.RelativePath;
|
||||
string[] urlParts = path.Split('?');
|
||||
string localPath = urlParts[0];
|
||||
string queryKeyString = null;
|
||||
if (urlParts.Length > 1)
|
||||
{
|
||||
string query = urlParts[1];
|
||||
string[] queryKeys = HttpUtility.ParseQueryString(query).AllKeys;
|
||||
queryKeyString = String.Join("_", queryKeys);
|
||||
}
|
||||
|
||||
StringBuilder friendlyPath = new StringBuilder();
|
||||
friendlyPath.AppendFormat("{0}-{1}",
|
||||
description.HttpMethod.Method,
|
||||
localPath.Replace("/", "-").Replace("{", String.Empty).Replace("}", String.Empty));
|
||||
if (queryKeyString != null)
|
||||
{
|
||||
friendlyPath.AppendFormat("_{0}", queryKeyString.Replace('.', '-'));
|
||||
}
|
||||
return friendlyPath.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
// Uncomment the following to provide samples for PageResult<T>. Must also add the Microsoft.AspNet.WebApi.OData
|
||||
// package to your project.
|
||||
////#define Handle_PageResultOfT
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Reflection;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
#if Handle_PageResultOfT
|
||||
using System.Web.Http.OData;
|
||||
#endif
|
||||
|
||||
namespace MP_API.Areas.HelpPage
|
||||
{
|
||||
/// <summary>
|
||||
/// Use this class to customize the Help Page.
|
||||
/// For example you can set a custom <see cref="System.Web.Http.Description.IDocumentationProvider"/> to supply the documentation
|
||||
/// or you can provide the samples for the requests/responses.
|
||||
/// </summary>
|
||||
public static class HelpPageConfig
|
||||
{
|
||||
[SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters",
|
||||
MessageId = "MP_API.Areas.HelpPage.TextSample.#ctor(System.String)",
|
||||
Justification = "End users may choose to merge this string with existing localized resources.")]
|
||||
[SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly",
|
||||
MessageId = "bsonspec",
|
||||
Justification = "Part of a URI.")]
|
||||
public static void Register(HttpConfiguration config)
|
||||
{
|
||||
//// Uncomment the following to use the documentation from XML documentation file.
|
||||
//config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));
|
||||
|
||||
//// Uncomment the following to use "sample string" as the sample for all actions that have string as the body parameter or return type.
|
||||
//// Also, the string arrays will be used for IEnumerable<string>. The sample objects will be serialized into different media type
|
||||
//// formats by the available formatters.
|
||||
//config.SetSampleObjects(new Dictionary<Type, object>
|
||||
//{
|
||||
// {typeof(string), "sample string"},
|
||||
// {typeof(IEnumerable<string>), new string[]{"sample 1", "sample 2"}}
|
||||
//});
|
||||
|
||||
// Extend the following to provide factories for types not handled automatically (those lacking parameterless
|
||||
// constructors) or for which you prefer to use non-default property values. Line below provides a fallback
|
||||
// since automatic handling will fail and GeneratePageResult handles only a single type.
|
||||
#if Handle_PageResultOfT
|
||||
config.GetHelpPageSampleGenerator().SampleObjectFactories.Add(GeneratePageResult);
|
||||
#endif
|
||||
|
||||
// Extend the following to use a preset object directly as the sample for all actions that support a media
|
||||
// type, regardless of the body parameter or return type. The lines below avoid display of binary content.
|
||||
// The BsonMediaTypeFormatter (if available) is not used to serialize the TextSample object.
|
||||
config.SetSampleForMediaType(
|
||||
new TextSample("Binary JSON content. See http://bsonspec.org for details."),
|
||||
new MediaTypeHeaderValue("application/bson"));
|
||||
|
||||
//// Uncomment the following to use "[0]=foo&[1]=bar" directly as the sample for all actions that support form URL encoded format
|
||||
//// and have IEnumerable<string> as the body parameter or return type.
|
||||
//config.SetSampleForType("[0]=foo&[1]=bar", new MediaTypeHeaderValue("application/x-www-form-urlencoded"), typeof(IEnumerable<string>));
|
||||
|
||||
//// Uncomment the following to use "1234" directly as the request sample for media type "text/plain" on the controller named "Values"
|
||||
//// and action named "Put".
|
||||
//config.SetSampleRequest("1234", new MediaTypeHeaderValue("text/plain"), "Values", "Put");
|
||||
|
||||
//// Uncomment the following to use the image on "../images/aspNetHome.png" directly as the response sample for media type "image/png"
|
||||
//// on the controller named "Values" and action named "Get" with parameter "id".
|
||||
//config.SetSampleResponse(new ImageSample("../images/aspNetHome.png"), new MediaTypeHeaderValue("image/png"), "Values", "Get", "id");
|
||||
|
||||
//// Uncomment the following to correct the sample request when the action expects an HttpRequestMessage with ObjectContent<string>.
|
||||
//// The sample will be generated as if the controller named "Values" and action named "Get" were having string as the body parameter.
|
||||
//config.SetActualRequestType(typeof(string), "Values", "Get");
|
||||
|
||||
//// Uncomment the following to correct the sample response when the action returns an HttpResponseMessage with ObjectContent<string>.
|
||||
//// The sample will be generated as if the controller named "Values" and action named "Post" were returning a string.
|
||||
//config.SetActualResponseType(typeof(string), "Values", "Post");
|
||||
}
|
||||
|
||||
#if Handle_PageResultOfT
|
||||
private static object GeneratePageResult(HelpPageSampleGenerator sampleGenerator, Type type)
|
||||
{
|
||||
if (type.IsGenericType)
|
||||
{
|
||||
Type openGenericType = type.GetGenericTypeDefinition();
|
||||
if (openGenericType == typeof(PageResult<>))
|
||||
{
|
||||
// Get the T in PageResult<T>
|
||||
Type[] typeParameters = type.GetGenericArguments();
|
||||
Debug.Assert(typeParameters.Length == 1);
|
||||
|
||||
// Create an enumeration to pass as the first parameter to the PageResult<T> constuctor
|
||||
Type itemsType = typeof(List<>).MakeGenericType(typeParameters);
|
||||
object items = sampleGenerator.GetSampleObject(itemsType);
|
||||
|
||||
// Fill in the other information needed to invoke the PageResult<T> constuctor
|
||||
Type[] parameterTypes = new Type[] { itemsType, typeof(Uri), typeof(long?), };
|
||||
object[] parameters = new object[] { items, null, (long)ObjectGenerator.DefaultCollectionSize, };
|
||||
|
||||
// Call PageResult(IEnumerable<T> items, Uri nextPageLink, long? count) constructor
|
||||
ConstructorInfo constructor = type.GetConstructor(parameterTypes);
|
||||
return constructor.Invoke(parameters);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
using System;
|
||||
using System.Web.Http;
|
||||
using System.Web.Mvc;
|
||||
using MP_API.Areas.HelpPage.ModelDescriptions;
|
||||
using MP_API.Areas.HelpPage.Models;
|
||||
|
||||
namespace MP_API.Areas.HelpPage.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// The controller that will handle requests for the help page.
|
||||
/// </summary>
|
||||
public class HelpController : Controller
|
||||
{
|
||||
private const string ErrorViewName = "Error";
|
||||
|
||||
public HelpController()
|
||||
: this(GlobalConfiguration.Configuration)
|
||||
{
|
||||
}
|
||||
|
||||
public HelpController(HttpConfiguration config)
|
||||
{
|
||||
Configuration = config;
|
||||
}
|
||||
|
||||
public HttpConfiguration Configuration { get; private set; }
|
||||
|
||||
public ActionResult Index()
|
||||
{
|
||||
ViewBag.DocumentationProvider = Configuration.Services.GetDocumentationProvider();
|
||||
return View(Configuration.Services.GetApiExplorer().ApiDescriptions);
|
||||
}
|
||||
|
||||
public ActionResult Api(string apiId)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(apiId))
|
||||
{
|
||||
HelpPageApiModel apiModel = Configuration.GetHelpPageApiModel(apiId);
|
||||
if (apiModel != null)
|
||||
{
|
||||
return View(apiModel);
|
||||
}
|
||||
}
|
||||
|
||||
return View(ErrorViewName);
|
||||
}
|
||||
|
||||
public ActionResult ResourceModel(string modelName)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(modelName))
|
||||
{
|
||||
ModelDescriptionGenerator modelDescriptionGenerator = Configuration.GetModelDescriptionGenerator();
|
||||
ModelDescription modelDescription;
|
||||
if (modelDescriptionGenerator.GeneratedModels.TryGetValue(modelName, out modelDescription))
|
||||
{
|
||||
return View(modelDescription);
|
||||
}
|
||||
}
|
||||
|
||||
return View(ErrorViewName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
.help-page h1,
|
||||
.help-page .h1,
|
||||
.help-page h2,
|
||||
.help-page .h2,
|
||||
.help-page h3,
|
||||
.help-page .h3,
|
||||
#body.help-page,
|
||||
.help-page-table th,
|
||||
.help-page-table pre,
|
||||
.help-page-table p {
|
||||
font-family: "Segoe UI Light", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif;
|
||||
}
|
||||
|
||||
.help-page pre.wrapped {
|
||||
white-space: -moz-pre-wrap;
|
||||
white-space: -pre-wrap;
|
||||
white-space: -o-pre-wrap;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.help-page .warning-message-container {
|
||||
margin-top: 20px;
|
||||
padding: 0 10px;
|
||||
color: #525252;
|
||||
background: #EFDCA9;
|
||||
border: 1px solid #CCCCCC;
|
||||
}
|
||||
|
||||
.help-page-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
text-align: left;
|
||||
margin: 0px 0px 20px 0px;
|
||||
border-top: 1px solid #D4D4D4;
|
||||
}
|
||||
|
||||
.help-page-table th {
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
border-bottom: 1px solid #D4D4D4;
|
||||
padding: 5px 6px 5px 6px;
|
||||
}
|
||||
|
||||
.help-page-table td {
|
||||
border-bottom: 1px solid #D4D4D4;
|
||||
padding: 10px 8px 10px 8px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.help-page-table pre,
|
||||
.help-page-table p {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
font-family: inherit;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
.help-page-table tbody tr:hover td {
|
||||
background-color: #F3F3F3;
|
||||
}
|
||||
|
||||
.help-page a:hover {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.help-page .sample-header {
|
||||
border: 2px solid #D4D4D4;
|
||||
background: #00497E;
|
||||
color: #FFFFFF;
|
||||
padding: 8px 15px;
|
||||
border-bottom: none;
|
||||
display: inline-block;
|
||||
margin: 10px 0px 0px 0px;
|
||||
}
|
||||
|
||||
.help-page .sample-content {
|
||||
display: block;
|
||||
border-width: 0;
|
||||
padding: 15px 20px;
|
||||
background: #FFFFFF;
|
||||
border: 2px solid #D4D4D4;
|
||||
margin: 0px 0px 10px 0px;
|
||||
}
|
||||
|
||||
.help-page .api-name {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.help-page .api-documentation {
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
.help-page .parameter-name {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.help-page .parameter-documentation {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.help-page .parameter-type {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.help-page .parameter-annotations {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.help-page h1,
|
||||
.help-page .h1 {
|
||||
font-size: 36px;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.help-page h2,
|
||||
.help-page .h2 {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.help-page h3,
|
||||
.help-page .h3 {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
#body.help-page {
|
||||
font-size: 14px;
|
||||
line-height: 143%;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.help-page a {
|
||||
color: #0000EE;
|
||||
text-decoration: none;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
using System.Web.Http;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace MP_API.Areas.HelpPage
|
||||
{
|
||||
public class HelpPageAreaRegistration : AreaRegistration
|
||||
{
|
||||
public override string AreaName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "HelpPage";
|
||||
}
|
||||
}
|
||||
|
||||
public override void RegisterArea(AreaRegistrationContext context)
|
||||
{
|
||||
context.MapRoute(
|
||||
"HelpPage_Default",
|
||||
"Help/{action}/{apiId}",
|
||||
new { controller = "Help", action = "Index", apiId = UrlParameter.Optional });
|
||||
|
||||
HelpPageConfig.Register(GlobalConfiguration.Configuration);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,467 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.Description;
|
||||
using MP_API.Areas.HelpPage.ModelDescriptions;
|
||||
using MP_API.Areas.HelpPage.Models;
|
||||
|
||||
namespace MP_API.Areas.HelpPage
|
||||
{
|
||||
public static class HelpPageConfigurationExtensions
|
||||
{
|
||||
private const string ApiModelPrefix = "MS_HelpPageApiModel_";
|
||||
|
||||
/// <summary>
|
||||
/// Sets the documentation provider for help page.
|
||||
/// </summary>
|
||||
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
|
||||
/// <param name="documentationProvider">The documentation provider.</param>
|
||||
public static void SetDocumentationProvider(this HttpConfiguration config, IDocumentationProvider documentationProvider)
|
||||
{
|
||||
config.Services.Replace(typeof(IDocumentationProvider), documentationProvider);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the objects that will be used by the formatters to produce sample requests/responses.
|
||||
/// </summary>
|
||||
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
|
||||
/// <param name="sampleObjects">The sample objects.</param>
|
||||
public static void SetSampleObjects(this HttpConfiguration config, IDictionary<Type, object> sampleObjects)
|
||||
{
|
||||
config.GetHelpPageSampleGenerator().SampleObjects = sampleObjects;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the sample request directly for the specified media type and action.
|
||||
/// </summary>
|
||||
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
|
||||
/// <param name="sample">The sample request.</param>
|
||||
/// <param name="mediaType">The media type.</param>
|
||||
/// <param name="controllerName">Name of the controller.</param>
|
||||
/// <param name="actionName">Name of the action.</param>
|
||||
public static void SetSampleRequest(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName)
|
||||
{
|
||||
config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Request, controllerName, actionName, new[] { "*" }), sample);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the sample request directly for the specified media type and action with parameters.
|
||||
/// </summary>
|
||||
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
|
||||
/// <param name="sample">The sample request.</param>
|
||||
/// <param name="mediaType">The media type.</param>
|
||||
/// <param name="controllerName">Name of the controller.</param>
|
||||
/// <param name="actionName">Name of the action.</param>
|
||||
/// <param name="parameterNames">The parameter names.</param>
|
||||
public static void SetSampleRequest(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName, params string[] parameterNames)
|
||||
{
|
||||
config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Request, controllerName, actionName, parameterNames), sample);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the sample request directly for the specified media type of the action.
|
||||
/// </summary>
|
||||
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
|
||||
/// <param name="sample">The sample response.</param>
|
||||
/// <param name="mediaType">The media type.</param>
|
||||
/// <param name="controllerName">Name of the controller.</param>
|
||||
/// <param name="actionName">Name of the action.</param>
|
||||
public static void SetSampleResponse(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName)
|
||||
{
|
||||
config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Response, controllerName, actionName, new[] { "*" }), sample);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the sample response directly for the specified media type of the action with specific parameters.
|
||||
/// </summary>
|
||||
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
|
||||
/// <param name="sample">The sample response.</param>
|
||||
/// <param name="mediaType">The media type.</param>
|
||||
/// <param name="controllerName">Name of the controller.</param>
|
||||
/// <param name="actionName">Name of the action.</param>
|
||||
/// <param name="parameterNames">The parameter names.</param>
|
||||
public static void SetSampleResponse(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName, params string[] parameterNames)
|
||||
{
|
||||
config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Response, controllerName, actionName, parameterNames), sample);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the sample directly for all actions with the specified media type.
|
||||
/// </summary>
|
||||
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
|
||||
/// <param name="sample">The sample.</param>
|
||||
/// <param name="mediaType">The media type.</param>
|
||||
public static void SetSampleForMediaType(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType)
|
||||
{
|
||||
config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType), sample);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the sample directly for all actions with the specified type and media type.
|
||||
/// </summary>
|
||||
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
|
||||
/// <param name="sample">The sample.</param>
|
||||
/// <param name="mediaType">The media type.</param>
|
||||
/// <param name="type">The parameter type or return type of an action.</param>
|
||||
public static void SetSampleForType(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, Type type)
|
||||
{
|
||||
config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, type), sample);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> passed to the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
|
||||
/// The help page will use this information to produce more accurate request samples.
|
||||
/// </summary>
|
||||
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="controllerName">Name of the controller.</param>
|
||||
/// <param name="actionName">Name of the action.</param>
|
||||
public static void SetActualRequestType(this HttpConfiguration config, Type type, string controllerName, string actionName)
|
||||
{
|
||||
config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Request, controllerName, actionName, new[] { "*" }), type);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> passed to the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
|
||||
/// The help page will use this information to produce more accurate request samples.
|
||||
/// </summary>
|
||||
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="controllerName">Name of the controller.</param>
|
||||
/// <param name="actionName">Name of the action.</param>
|
||||
/// <param name="parameterNames">The parameter names.</param>
|
||||
public static void SetActualRequestType(this HttpConfiguration config, Type type, string controllerName, string actionName, params string[] parameterNames)
|
||||
{
|
||||
config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Request, controllerName, actionName, parameterNames), type);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> returned as part of the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
|
||||
/// The help page will use this information to produce more accurate response samples.
|
||||
/// </summary>
|
||||
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="controllerName">Name of the controller.</param>
|
||||
/// <param name="actionName">Name of the action.</param>
|
||||
public static void SetActualResponseType(this HttpConfiguration config, Type type, string controllerName, string actionName)
|
||||
{
|
||||
config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Response, controllerName, actionName, new[] { "*" }), type);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> returned as part of the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
|
||||
/// The help page will use this information to produce more accurate response samples.
|
||||
/// </summary>
|
||||
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="controllerName">Name of the controller.</param>
|
||||
/// <param name="actionName">Name of the action.</param>
|
||||
/// <param name="parameterNames">The parameter names.</param>
|
||||
public static void SetActualResponseType(this HttpConfiguration config, Type type, string controllerName, string actionName, params string[] parameterNames)
|
||||
{
|
||||
config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Response, controllerName, actionName, parameterNames), type);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the help page sample generator.
|
||||
/// </summary>
|
||||
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
|
||||
/// <returns>The help page sample generator.</returns>
|
||||
public static HelpPageSampleGenerator GetHelpPageSampleGenerator(this HttpConfiguration config)
|
||||
{
|
||||
return (HelpPageSampleGenerator)config.Properties.GetOrAdd(
|
||||
typeof(HelpPageSampleGenerator),
|
||||
k => new HelpPageSampleGenerator());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the help page sample generator.
|
||||
/// </summary>
|
||||
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
|
||||
/// <param name="sampleGenerator">The help page sample generator.</param>
|
||||
public static void SetHelpPageSampleGenerator(this HttpConfiguration config, HelpPageSampleGenerator sampleGenerator)
|
||||
{
|
||||
config.Properties.AddOrUpdate(
|
||||
typeof(HelpPageSampleGenerator),
|
||||
k => sampleGenerator,
|
||||
(k, o) => sampleGenerator);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the model description generator.
|
||||
/// </summary>
|
||||
/// <param name="config">The configuration.</param>
|
||||
/// <returns>The <see cref="ModelDescriptionGenerator"/></returns>
|
||||
public static ModelDescriptionGenerator GetModelDescriptionGenerator(this HttpConfiguration config)
|
||||
{
|
||||
return (ModelDescriptionGenerator)config.Properties.GetOrAdd(
|
||||
typeof(ModelDescriptionGenerator),
|
||||
k => InitializeModelDescriptionGenerator(config));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the model that represents an API displayed on the help page. The model is initialized on the first call and cached for subsequent calls.
|
||||
/// </summary>
|
||||
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
|
||||
/// <param name="apiDescriptionId">The <see cref="ApiDescription"/> ID.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="HelpPageApiModel"/>
|
||||
/// </returns>
|
||||
public static HelpPageApiModel GetHelpPageApiModel(this HttpConfiguration config, string apiDescriptionId)
|
||||
{
|
||||
object model;
|
||||
string modelId = ApiModelPrefix + apiDescriptionId;
|
||||
if (!config.Properties.TryGetValue(modelId, out model))
|
||||
{
|
||||
Collection<ApiDescription> apiDescriptions = config.Services.GetApiExplorer().ApiDescriptions;
|
||||
ApiDescription apiDescription = apiDescriptions.FirstOrDefault(api => String.Equals(api.GetFriendlyId(), apiDescriptionId, StringComparison.OrdinalIgnoreCase));
|
||||
if (apiDescription != null)
|
||||
{
|
||||
model = GenerateApiModel(apiDescription, config);
|
||||
config.Properties.TryAdd(modelId, model);
|
||||
}
|
||||
}
|
||||
|
||||
return (HelpPageApiModel)model;
|
||||
}
|
||||
|
||||
private static HelpPageApiModel GenerateApiModel(ApiDescription apiDescription, HttpConfiguration config)
|
||||
{
|
||||
HelpPageApiModel apiModel = new HelpPageApiModel()
|
||||
{
|
||||
ApiDescription = apiDescription,
|
||||
};
|
||||
|
||||
ModelDescriptionGenerator modelGenerator = config.GetModelDescriptionGenerator();
|
||||
HelpPageSampleGenerator sampleGenerator = config.GetHelpPageSampleGenerator();
|
||||
GenerateUriParameters(apiModel, modelGenerator);
|
||||
GenerateRequestModelDescription(apiModel, modelGenerator, sampleGenerator);
|
||||
GenerateResourceDescription(apiModel, modelGenerator);
|
||||
GenerateSamples(apiModel, sampleGenerator);
|
||||
|
||||
return apiModel;
|
||||
}
|
||||
|
||||
private static void GenerateUriParameters(HelpPageApiModel apiModel, ModelDescriptionGenerator modelGenerator)
|
||||
{
|
||||
ApiDescription apiDescription = apiModel.ApiDescription;
|
||||
foreach (ApiParameterDescription apiParameter in apiDescription.ParameterDescriptions)
|
||||
{
|
||||
if (apiParameter.Source == ApiParameterSource.FromUri)
|
||||
{
|
||||
HttpParameterDescriptor parameterDescriptor = apiParameter.ParameterDescriptor;
|
||||
Type parameterType = null;
|
||||
ModelDescription typeDescription = null;
|
||||
ComplexTypeModelDescription complexTypeDescription = null;
|
||||
if (parameterDescriptor != null)
|
||||
{
|
||||
parameterType = parameterDescriptor.ParameterType;
|
||||
typeDescription = modelGenerator.GetOrCreateModelDescription(parameterType);
|
||||
complexTypeDescription = typeDescription as ComplexTypeModelDescription;
|
||||
}
|
||||
|
||||
// Example:
|
||||
// [TypeConverter(typeof(PointConverter))]
|
||||
// public class Point
|
||||
// {
|
||||
// public Point(int x, int y)
|
||||
// {
|
||||
// X = x;
|
||||
// Y = y;
|
||||
// }
|
||||
// public int X { get; set; }
|
||||
// public int Y { get; set; }
|
||||
// }
|
||||
// Class Point is bindable with a TypeConverter, so Point will be added to UriParameters collection.
|
||||
//
|
||||
// public class Point
|
||||
// {
|
||||
// public int X { get; set; }
|
||||
// public int Y { get; set; }
|
||||
// }
|
||||
// Regular complex class Point will have properties X and Y added to UriParameters collection.
|
||||
if (complexTypeDescription != null
|
||||
&& !IsBindableWithTypeConverter(parameterType))
|
||||
{
|
||||
foreach (ParameterDescription uriParameter in complexTypeDescription.Properties)
|
||||
{
|
||||
apiModel.UriParameters.Add(uriParameter);
|
||||
}
|
||||
}
|
||||
else if (parameterDescriptor != null)
|
||||
{
|
||||
ParameterDescription uriParameter =
|
||||
AddParameterDescription(apiModel, apiParameter, typeDescription);
|
||||
|
||||
if (!parameterDescriptor.IsOptional)
|
||||
{
|
||||
uriParameter.Annotations.Add(new ParameterAnnotation() { Documentation = "Required" });
|
||||
}
|
||||
|
||||
object defaultValue = parameterDescriptor.DefaultValue;
|
||||
if (defaultValue != null)
|
||||
{
|
||||
uriParameter.Annotations.Add(new ParameterAnnotation() { Documentation = "Default value is " + Convert.ToString(defaultValue, CultureInfo.InvariantCulture) });
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Assert(parameterDescriptor == null);
|
||||
|
||||
// If parameterDescriptor is null, this is an undeclared route parameter which only occurs
|
||||
// when source is FromUri. Ignored in request model and among resource parameters but listed
|
||||
// as a simple string here.
|
||||
ModelDescription modelDescription = modelGenerator.GetOrCreateModelDescription(typeof(string));
|
||||
AddParameterDescription(apiModel, apiParameter, modelDescription);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsBindableWithTypeConverter(Type parameterType)
|
||||
{
|
||||
if (parameterType == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return TypeDescriptor.GetConverter(parameterType).CanConvertFrom(typeof(string));
|
||||
}
|
||||
|
||||
private static ParameterDescription AddParameterDescription(HelpPageApiModel apiModel,
|
||||
ApiParameterDescription apiParameter, ModelDescription typeDescription)
|
||||
{
|
||||
ParameterDescription parameterDescription = new ParameterDescription
|
||||
{
|
||||
Name = apiParameter.Name,
|
||||
Documentation = apiParameter.Documentation,
|
||||
TypeDescription = typeDescription,
|
||||
};
|
||||
|
||||
apiModel.UriParameters.Add(parameterDescription);
|
||||
return parameterDescription;
|
||||
}
|
||||
|
||||
private static void GenerateRequestModelDescription(HelpPageApiModel apiModel, ModelDescriptionGenerator modelGenerator, HelpPageSampleGenerator sampleGenerator)
|
||||
{
|
||||
ApiDescription apiDescription = apiModel.ApiDescription;
|
||||
foreach (ApiParameterDescription apiParameter in apiDescription.ParameterDescriptions)
|
||||
{
|
||||
if (apiParameter.Source == ApiParameterSource.FromBody)
|
||||
{
|
||||
Type parameterType = apiParameter.ParameterDescriptor.ParameterType;
|
||||
apiModel.RequestModelDescription = modelGenerator.GetOrCreateModelDescription(parameterType);
|
||||
apiModel.RequestDocumentation = apiParameter.Documentation;
|
||||
}
|
||||
else if (apiParameter.ParameterDescriptor != null &&
|
||||
apiParameter.ParameterDescriptor.ParameterType == typeof(HttpRequestMessage))
|
||||
{
|
||||
Type parameterType = sampleGenerator.ResolveHttpRequestMessageType(apiDescription);
|
||||
|
||||
if (parameterType != null)
|
||||
{
|
||||
apiModel.RequestModelDescription = modelGenerator.GetOrCreateModelDescription(parameterType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void GenerateResourceDescription(HelpPageApiModel apiModel, ModelDescriptionGenerator modelGenerator)
|
||||
{
|
||||
ResponseDescription response = apiModel.ApiDescription.ResponseDescription;
|
||||
Type responseType = response.ResponseType ?? response.DeclaredType;
|
||||
if (responseType != null && responseType != typeof(void))
|
||||
{
|
||||
apiModel.ResourceDescription = modelGenerator.GetOrCreateModelDescription(responseType);
|
||||
}
|
||||
}
|
||||
|
||||
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is recorded as ErrorMessages.")]
|
||||
private static void GenerateSamples(HelpPageApiModel apiModel, HelpPageSampleGenerator sampleGenerator)
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (var item in sampleGenerator.GetSampleRequests(apiModel.ApiDescription))
|
||||
{
|
||||
apiModel.SampleRequests.Add(item.Key, item.Value);
|
||||
LogInvalidSampleAsError(apiModel, item.Value);
|
||||
}
|
||||
|
||||
foreach (var item in sampleGenerator.GetSampleResponses(apiModel.ApiDescription))
|
||||
{
|
||||
apiModel.SampleResponses.Add(item.Key, item.Value);
|
||||
LogInvalidSampleAsError(apiModel, item.Value);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
apiModel.ErrorMessages.Add(String.Format(CultureInfo.CurrentCulture,
|
||||
"An exception has occurred while generating the sample. Exception message: {0}",
|
||||
HelpPageSampleGenerator.UnwrapException(e).Message));
|
||||
}
|
||||
}
|
||||
|
||||
private static bool TryGetResourceParameter(ApiDescription apiDescription, HttpConfiguration config, out ApiParameterDescription parameterDescription, out Type resourceType)
|
||||
{
|
||||
parameterDescription = apiDescription.ParameterDescriptions.FirstOrDefault(
|
||||
p => p.Source == ApiParameterSource.FromBody ||
|
||||
(p.ParameterDescriptor != null && p.ParameterDescriptor.ParameterType == typeof(HttpRequestMessage)));
|
||||
|
||||
if (parameterDescription == null)
|
||||
{
|
||||
resourceType = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
resourceType = parameterDescription.ParameterDescriptor.ParameterType;
|
||||
|
||||
if (resourceType == typeof(HttpRequestMessage))
|
||||
{
|
||||
HelpPageSampleGenerator sampleGenerator = config.GetHelpPageSampleGenerator();
|
||||
resourceType = sampleGenerator.ResolveHttpRequestMessageType(apiDescription);
|
||||
}
|
||||
|
||||
if (resourceType == null)
|
||||
{
|
||||
parameterDescription = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static ModelDescriptionGenerator InitializeModelDescriptionGenerator(HttpConfiguration config)
|
||||
{
|
||||
ModelDescriptionGenerator modelGenerator = new ModelDescriptionGenerator(config);
|
||||
Collection<ApiDescription> apis = config.Services.GetApiExplorer().ApiDescriptions;
|
||||
foreach (ApiDescription api in apis)
|
||||
{
|
||||
ApiParameterDescription parameterDescription;
|
||||
Type parameterType;
|
||||
if (TryGetResourceParameter(api, config, out parameterDescription, out parameterType))
|
||||
{
|
||||
modelGenerator.GetOrCreateModelDescription(parameterType);
|
||||
}
|
||||
}
|
||||
return modelGenerator;
|
||||
}
|
||||
|
||||
private static void LogInvalidSampleAsError(HelpPageApiModel apiModel, object sample)
|
||||
{
|
||||
InvalidSample invalidSample = sample as InvalidSample;
|
||||
if (invalidSample != null)
|
||||
{
|
||||
apiModel.ErrorMessages.Add(invalidSample.ErrorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace MP_API.Areas.HelpPage.ModelDescriptions
|
||||
{
|
||||
public class CollectionModelDescription : ModelDescription
|
||||
{
|
||||
public ModelDescription ElementDescription { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace MP_API.Areas.HelpPage.ModelDescriptions
|
||||
{
|
||||
public class ComplexTypeModelDescription : ModelDescription
|
||||
{
|
||||
public ComplexTypeModelDescription()
|
||||
{
|
||||
Properties = new Collection<ParameterDescription>();
|
||||
}
|
||||
|
||||
public Collection<ParameterDescription> Properties { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace MP_API.Areas.HelpPage.ModelDescriptions
|
||||
{
|
||||
public class DictionaryModelDescription : KeyValuePairModelDescription
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace MP_API.Areas.HelpPage.ModelDescriptions
|
||||
{
|
||||
public class EnumTypeModelDescription : ModelDescription
|
||||
{
|
||||
public EnumTypeModelDescription()
|
||||
{
|
||||
Values = new Collection<EnumValueDescription>();
|
||||
}
|
||||
|
||||
public Collection<EnumValueDescription> Values { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
namespace MP_API.Areas.HelpPage.ModelDescriptions
|
||||
{
|
||||
public class EnumValueDescription
|
||||
{
|
||||
public string Documentation { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace MP_API.Areas.HelpPage.ModelDescriptions
|
||||
{
|
||||
public interface IModelDocumentationProvider
|
||||
{
|
||||
string GetDocumentation(MemberInfo member);
|
||||
|
||||
string GetDocumentation(Type type);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace MP_API.Areas.HelpPage.ModelDescriptions
|
||||
{
|
||||
public class KeyValuePairModelDescription : ModelDescription
|
||||
{
|
||||
public ModelDescription KeyModelDescription { get; set; }
|
||||
|
||||
public ModelDescription ValueModelDescription { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace MP_API.Areas.HelpPage.ModelDescriptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes a type model.
|
||||
/// </summary>
|
||||
public abstract class ModelDescription
|
||||
{
|
||||
public string Documentation { get; set; }
|
||||
|
||||
public Type ModelType { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,451 +0,0 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.Description;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace MP_API.Areas.HelpPage.ModelDescriptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Generates model descriptions for given types.
|
||||
/// </summary>
|
||||
public class ModelDescriptionGenerator
|
||||
{
|
||||
// Modify this to support more data annotation attributes.
|
||||
private readonly IDictionary<Type, Func<object, string>> AnnotationTextGenerator = new Dictionary<Type, Func<object, string>>
|
||||
{
|
||||
{ typeof(RequiredAttribute), a => "Required" },
|
||||
{ typeof(RangeAttribute), a =>
|
||||
{
|
||||
RangeAttribute range = (RangeAttribute)a;
|
||||
return String.Format(CultureInfo.CurrentCulture, "Range: inclusive between {0} and {1}", range.Minimum, range.Maximum);
|
||||
}
|
||||
},
|
||||
{ typeof(MaxLengthAttribute), a =>
|
||||
{
|
||||
MaxLengthAttribute maxLength = (MaxLengthAttribute)a;
|
||||
return String.Format(CultureInfo.CurrentCulture, "Max length: {0}", maxLength.Length);
|
||||
}
|
||||
},
|
||||
{ typeof(MinLengthAttribute), a =>
|
||||
{
|
||||
MinLengthAttribute minLength = (MinLengthAttribute)a;
|
||||
return String.Format(CultureInfo.CurrentCulture, "Min length: {0}", minLength.Length);
|
||||
}
|
||||
},
|
||||
{ typeof(StringLengthAttribute), a =>
|
||||
{
|
||||
StringLengthAttribute strLength = (StringLengthAttribute)a;
|
||||
return String.Format(CultureInfo.CurrentCulture, "String length: inclusive between {0} and {1}", strLength.MinimumLength, strLength.MaximumLength);
|
||||
}
|
||||
},
|
||||
{ typeof(DataTypeAttribute), a =>
|
||||
{
|
||||
DataTypeAttribute dataType = (DataTypeAttribute)a;
|
||||
return String.Format(CultureInfo.CurrentCulture, "Data type: {0}", dataType.CustomDataType ?? dataType.DataType.ToString());
|
||||
}
|
||||
},
|
||||
{ typeof(RegularExpressionAttribute), a =>
|
||||
{
|
||||
RegularExpressionAttribute regularExpression = (RegularExpressionAttribute)a;
|
||||
return String.Format(CultureInfo.CurrentCulture, "Matching regular expression pattern: {0}", regularExpression.Pattern);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
// Modify this to add more default documentations.
|
||||
private readonly IDictionary<Type, string> DefaultTypeDocumentation = new Dictionary<Type, string>
|
||||
{
|
||||
{ typeof(Int16), "integer" },
|
||||
{ typeof(Int32), "integer" },
|
||||
{ typeof(Int64), "integer" },
|
||||
{ typeof(UInt16), "unsigned integer" },
|
||||
{ typeof(UInt32), "unsigned integer" },
|
||||
{ typeof(UInt64), "unsigned integer" },
|
||||
{ typeof(Byte), "byte" },
|
||||
{ typeof(Char), "character" },
|
||||
{ typeof(SByte), "signed byte" },
|
||||
{ typeof(Uri), "URI" },
|
||||
{ typeof(Single), "decimal number" },
|
||||
{ typeof(Double), "decimal number" },
|
||||
{ typeof(Decimal), "decimal number" },
|
||||
{ typeof(String), "string" },
|
||||
{ typeof(Guid), "globally unique identifier" },
|
||||
{ typeof(TimeSpan), "time interval" },
|
||||
{ typeof(DateTime), "date" },
|
||||
{ typeof(DateTimeOffset), "date" },
|
||||
{ typeof(Boolean), "boolean" },
|
||||
};
|
||||
|
||||
private Lazy<IModelDocumentationProvider> _documentationProvider;
|
||||
|
||||
public ModelDescriptionGenerator(HttpConfiguration config)
|
||||
{
|
||||
if (config == null)
|
||||
{
|
||||
throw new ArgumentNullException("config");
|
||||
}
|
||||
|
||||
_documentationProvider = new Lazy<IModelDocumentationProvider>(() => config.Services.GetDocumentationProvider() as IModelDocumentationProvider);
|
||||
GeneratedModels = new Dictionary<string, ModelDescription>(StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public Dictionary<string, ModelDescription> GeneratedModels { get; private set; }
|
||||
|
||||
private IModelDocumentationProvider DocumentationProvider
|
||||
{
|
||||
get
|
||||
{
|
||||
return _documentationProvider.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public ModelDescription GetOrCreateModelDescription(Type modelType)
|
||||
{
|
||||
if (modelType == null)
|
||||
{
|
||||
throw new ArgumentNullException("modelType");
|
||||
}
|
||||
|
||||
Type underlyingType = Nullable.GetUnderlyingType(modelType);
|
||||
if (underlyingType != null)
|
||||
{
|
||||
modelType = underlyingType;
|
||||
}
|
||||
|
||||
ModelDescription modelDescription;
|
||||
string modelName = ModelNameHelper.GetModelName(modelType);
|
||||
if (GeneratedModels.TryGetValue(modelName, out modelDescription))
|
||||
{
|
||||
if (modelType != modelDescription.ModelType)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
String.Format(
|
||||
CultureInfo.CurrentCulture,
|
||||
"A model description could not be created. Duplicate model name '{0}' was found for types '{1}' and '{2}'. " +
|
||||
"Use the [ModelName] attribute to change the model name for at least one of the types so that it has a unique name.",
|
||||
modelName,
|
||||
modelDescription.ModelType.FullName,
|
||||
modelType.FullName));
|
||||
}
|
||||
|
||||
return modelDescription;
|
||||
}
|
||||
|
||||
if (DefaultTypeDocumentation.ContainsKey(modelType))
|
||||
{
|
||||
return GenerateSimpleTypeModelDescription(modelType);
|
||||
}
|
||||
|
||||
if (modelType.IsEnum)
|
||||
{
|
||||
return GenerateEnumTypeModelDescription(modelType);
|
||||
}
|
||||
|
||||
if (modelType.IsGenericType)
|
||||
{
|
||||
Type[] genericArguments = modelType.GetGenericArguments();
|
||||
|
||||
if (genericArguments.Length == 1)
|
||||
{
|
||||
Type enumerableType = typeof(IEnumerable<>).MakeGenericType(genericArguments);
|
||||
if (enumerableType.IsAssignableFrom(modelType))
|
||||
{
|
||||
return GenerateCollectionModelDescription(modelType, genericArguments[0]);
|
||||
}
|
||||
}
|
||||
if (genericArguments.Length == 2)
|
||||
{
|
||||
Type dictionaryType = typeof(IDictionary<,>).MakeGenericType(genericArguments);
|
||||
if (dictionaryType.IsAssignableFrom(modelType))
|
||||
{
|
||||
return GenerateDictionaryModelDescription(modelType, genericArguments[0], genericArguments[1]);
|
||||
}
|
||||
|
||||
Type keyValuePairType = typeof(KeyValuePair<,>).MakeGenericType(genericArguments);
|
||||
if (keyValuePairType.IsAssignableFrom(modelType))
|
||||
{
|
||||
return GenerateKeyValuePairModelDescription(modelType, genericArguments[0], genericArguments[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (modelType.IsArray)
|
||||
{
|
||||
Type elementType = modelType.GetElementType();
|
||||
return GenerateCollectionModelDescription(modelType, elementType);
|
||||
}
|
||||
|
||||
if (modelType == typeof(NameValueCollection))
|
||||
{
|
||||
return GenerateDictionaryModelDescription(modelType, typeof(string), typeof(string));
|
||||
}
|
||||
|
||||
if (typeof(IDictionary).IsAssignableFrom(modelType))
|
||||
{
|
||||
return GenerateDictionaryModelDescription(modelType, typeof(object), typeof(object));
|
||||
}
|
||||
|
||||
if (typeof(IEnumerable).IsAssignableFrom(modelType))
|
||||
{
|
||||
return GenerateCollectionModelDescription(modelType, typeof(object));
|
||||
}
|
||||
|
||||
return GenerateComplexTypeModelDescription(modelType);
|
||||
}
|
||||
|
||||
// Change this to provide different name for the member.
|
||||
private static string GetMemberName(MemberInfo member, bool hasDataContractAttribute)
|
||||
{
|
||||
JsonPropertyAttribute jsonProperty = member.GetCustomAttribute<JsonPropertyAttribute>();
|
||||
if (jsonProperty != null && !String.IsNullOrEmpty(jsonProperty.PropertyName))
|
||||
{
|
||||
return jsonProperty.PropertyName;
|
||||
}
|
||||
|
||||
if (hasDataContractAttribute)
|
||||
{
|
||||
DataMemberAttribute dataMember = member.GetCustomAttribute<DataMemberAttribute>();
|
||||
if (dataMember != null && !String.IsNullOrEmpty(dataMember.Name))
|
||||
{
|
||||
return dataMember.Name;
|
||||
}
|
||||
}
|
||||
|
||||
return member.Name;
|
||||
}
|
||||
|
||||
private static bool ShouldDisplayMember(MemberInfo member, bool hasDataContractAttribute)
|
||||
{
|
||||
JsonIgnoreAttribute jsonIgnore = member.GetCustomAttribute<JsonIgnoreAttribute>();
|
||||
XmlIgnoreAttribute xmlIgnore = member.GetCustomAttribute<XmlIgnoreAttribute>();
|
||||
IgnoreDataMemberAttribute ignoreDataMember = member.GetCustomAttribute<IgnoreDataMemberAttribute>();
|
||||
NonSerializedAttribute nonSerialized = member.GetCustomAttribute<NonSerializedAttribute>();
|
||||
ApiExplorerSettingsAttribute apiExplorerSetting = member.GetCustomAttribute<ApiExplorerSettingsAttribute>();
|
||||
|
||||
bool hasMemberAttribute = member.DeclaringType.IsEnum ?
|
||||
member.GetCustomAttribute<EnumMemberAttribute>() != null :
|
||||
member.GetCustomAttribute<DataMemberAttribute>() != null;
|
||||
|
||||
// Display member only if all the followings are true:
|
||||
// no JsonIgnoreAttribute
|
||||
// no XmlIgnoreAttribute
|
||||
// no IgnoreDataMemberAttribute
|
||||
// no NonSerializedAttribute
|
||||
// no ApiExplorerSettingsAttribute with IgnoreApi set to true
|
||||
// no DataContractAttribute without DataMemberAttribute or EnumMemberAttribute
|
||||
return jsonIgnore == null &&
|
||||
xmlIgnore == null &&
|
||||
ignoreDataMember == null &&
|
||||
nonSerialized == null &&
|
||||
(apiExplorerSetting == null || !apiExplorerSetting.IgnoreApi) &&
|
||||
(!hasDataContractAttribute || hasMemberAttribute);
|
||||
}
|
||||
|
||||
private string CreateDefaultDocumentation(Type type)
|
||||
{
|
||||
string documentation;
|
||||
if (DefaultTypeDocumentation.TryGetValue(type, out documentation))
|
||||
{
|
||||
return documentation;
|
||||
}
|
||||
if (DocumentationProvider != null)
|
||||
{
|
||||
documentation = DocumentationProvider.GetDocumentation(type);
|
||||
}
|
||||
|
||||
return documentation;
|
||||
}
|
||||
|
||||
private void GenerateAnnotations(MemberInfo property, ParameterDescription propertyModel)
|
||||
{
|
||||
List<ParameterAnnotation> annotations = new List<ParameterAnnotation>();
|
||||
|
||||
IEnumerable<Attribute> attributes = property.GetCustomAttributes();
|
||||
foreach (Attribute attribute in attributes)
|
||||
{
|
||||
Func<object, string> textGenerator;
|
||||
if (AnnotationTextGenerator.TryGetValue(attribute.GetType(), out textGenerator))
|
||||
{
|
||||
annotations.Add(
|
||||
new ParameterAnnotation
|
||||
{
|
||||
AnnotationAttribute = attribute,
|
||||
Documentation = textGenerator(attribute)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Rearrange the annotations
|
||||
annotations.Sort((x, y) =>
|
||||
{
|
||||
// Special-case RequiredAttribute so that it shows up on top
|
||||
if (x.AnnotationAttribute is RequiredAttribute)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (y.AnnotationAttribute is RequiredAttribute)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Sort the rest based on alphabetic order of the documentation
|
||||
return String.Compare(x.Documentation, y.Documentation, StringComparison.OrdinalIgnoreCase);
|
||||
});
|
||||
|
||||
foreach (ParameterAnnotation annotation in annotations)
|
||||
{
|
||||
propertyModel.Annotations.Add(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
private CollectionModelDescription GenerateCollectionModelDescription(Type modelType, Type elementType)
|
||||
{
|
||||
ModelDescription collectionModelDescription = GetOrCreateModelDescription(elementType);
|
||||
if (collectionModelDescription != null)
|
||||
{
|
||||
return new CollectionModelDescription
|
||||
{
|
||||
Name = ModelNameHelper.GetModelName(modelType),
|
||||
ModelType = modelType,
|
||||
ElementDescription = collectionModelDescription
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private ModelDescription GenerateComplexTypeModelDescription(Type modelType)
|
||||
{
|
||||
ComplexTypeModelDescription complexModelDescription = new ComplexTypeModelDescription
|
||||
{
|
||||
Name = ModelNameHelper.GetModelName(modelType),
|
||||
ModelType = modelType,
|
||||
Documentation = CreateDefaultDocumentation(modelType)
|
||||
};
|
||||
|
||||
GeneratedModels.Add(complexModelDescription.Name, complexModelDescription);
|
||||
bool hasDataContractAttribute = modelType.GetCustomAttribute<DataContractAttribute>() != null;
|
||||
PropertyInfo[] properties = modelType.GetProperties(BindingFlags.Public | BindingFlags.Instance);
|
||||
foreach (PropertyInfo property in properties)
|
||||
{
|
||||
if (ShouldDisplayMember(property, hasDataContractAttribute))
|
||||
{
|
||||
ParameterDescription propertyModel = new ParameterDescription
|
||||
{
|
||||
Name = GetMemberName(property, hasDataContractAttribute)
|
||||
};
|
||||
|
||||
if (DocumentationProvider != null)
|
||||
{
|
||||
propertyModel.Documentation = DocumentationProvider.GetDocumentation(property);
|
||||
}
|
||||
|
||||
GenerateAnnotations(property, propertyModel);
|
||||
complexModelDescription.Properties.Add(propertyModel);
|
||||
propertyModel.TypeDescription = GetOrCreateModelDescription(property.PropertyType);
|
||||
}
|
||||
}
|
||||
|
||||
FieldInfo[] fields = modelType.GetFields(BindingFlags.Public | BindingFlags.Instance);
|
||||
foreach (FieldInfo field in fields)
|
||||
{
|
||||
if (ShouldDisplayMember(field, hasDataContractAttribute))
|
||||
{
|
||||
ParameterDescription propertyModel = new ParameterDescription
|
||||
{
|
||||
Name = GetMemberName(field, hasDataContractAttribute)
|
||||
};
|
||||
|
||||
if (DocumentationProvider != null)
|
||||
{
|
||||
propertyModel.Documentation = DocumentationProvider.GetDocumentation(field);
|
||||
}
|
||||
|
||||
complexModelDescription.Properties.Add(propertyModel);
|
||||
propertyModel.TypeDescription = GetOrCreateModelDescription(field.FieldType);
|
||||
}
|
||||
}
|
||||
|
||||
return complexModelDescription;
|
||||
}
|
||||
|
||||
private DictionaryModelDescription GenerateDictionaryModelDescription(Type modelType, Type keyType, Type valueType)
|
||||
{
|
||||
ModelDescription keyModelDescription = GetOrCreateModelDescription(keyType);
|
||||
ModelDescription valueModelDescription = GetOrCreateModelDescription(valueType);
|
||||
|
||||
return new DictionaryModelDescription
|
||||
{
|
||||
Name = ModelNameHelper.GetModelName(modelType),
|
||||
ModelType = modelType,
|
||||
KeyModelDescription = keyModelDescription,
|
||||
ValueModelDescription = valueModelDescription
|
||||
};
|
||||
}
|
||||
|
||||
private EnumTypeModelDescription GenerateEnumTypeModelDescription(Type modelType)
|
||||
{
|
||||
EnumTypeModelDescription enumDescription = new EnumTypeModelDescription
|
||||
{
|
||||
Name = ModelNameHelper.GetModelName(modelType),
|
||||
ModelType = modelType,
|
||||
Documentation = CreateDefaultDocumentation(modelType)
|
||||
};
|
||||
bool hasDataContractAttribute = modelType.GetCustomAttribute<DataContractAttribute>() != null;
|
||||
foreach (FieldInfo field in modelType.GetFields(BindingFlags.Public | BindingFlags.Static))
|
||||
{
|
||||
if (ShouldDisplayMember(field, hasDataContractAttribute))
|
||||
{
|
||||
EnumValueDescription enumValue = new EnumValueDescription
|
||||
{
|
||||
Name = field.Name,
|
||||
Value = field.GetRawConstantValue().ToString()
|
||||
};
|
||||
if (DocumentationProvider != null)
|
||||
{
|
||||
enumValue.Documentation = DocumentationProvider.GetDocumentation(field);
|
||||
}
|
||||
enumDescription.Values.Add(enumValue);
|
||||
}
|
||||
}
|
||||
GeneratedModels.Add(enumDescription.Name, enumDescription);
|
||||
|
||||
return enumDescription;
|
||||
}
|
||||
|
||||
private KeyValuePairModelDescription GenerateKeyValuePairModelDescription(Type modelType, Type keyType, Type valueType)
|
||||
{
|
||||
ModelDescription keyModelDescription = GetOrCreateModelDescription(keyType);
|
||||
ModelDescription valueModelDescription = GetOrCreateModelDescription(valueType);
|
||||
|
||||
return new KeyValuePairModelDescription
|
||||
{
|
||||
Name = ModelNameHelper.GetModelName(modelType),
|
||||
ModelType = modelType,
|
||||
KeyModelDescription = keyModelDescription,
|
||||
ValueModelDescription = valueModelDescription
|
||||
};
|
||||
}
|
||||
|
||||
private ModelDescription GenerateSimpleTypeModelDescription(Type modelType)
|
||||
{
|
||||
SimpleTypeModelDescription simpleModelDescription = new SimpleTypeModelDescription
|
||||
{
|
||||
Name = ModelNameHelper.GetModelName(modelType),
|
||||
ModelType = modelType,
|
||||
Documentation = CreateDefaultDocumentation(modelType)
|
||||
};
|
||||
GeneratedModels.Add(simpleModelDescription.Name, simpleModelDescription);
|
||||
|
||||
return simpleModelDescription;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace MP_API.Areas.HelpPage.ModelDescriptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Use this attribute to change the name of the <see cref="ModelDescription"/> generated for a type.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum, AllowMultiple = false, Inherited = false)]
|
||||
public sealed class ModelNameAttribute : Attribute
|
||||
{
|
||||
public ModelNameAttribute(string name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public string Name { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace MP_API.Areas.HelpPage.ModelDescriptions
|
||||
{
|
||||
internal static class ModelNameHelper
|
||||
{
|
||||
// Modify this to provide custom model name mapping.
|
||||
public static string GetModelName(Type type)
|
||||
{
|
||||
ModelNameAttribute modelNameAttribute = type.GetCustomAttribute<ModelNameAttribute>();
|
||||
if (modelNameAttribute != null && !String.IsNullOrEmpty(modelNameAttribute.Name))
|
||||
{
|
||||
return modelNameAttribute.Name;
|
||||
}
|
||||
|
||||
string modelName = type.Name;
|
||||
if (type.IsGenericType)
|
||||
{
|
||||
// Format the generic type name to something like: GenericOfAgurment1AndArgument2
|
||||
Type genericType = type.GetGenericTypeDefinition();
|
||||
Type[] genericArguments = type.GetGenericArguments();
|
||||
string genericTypeName = genericType.Name;
|
||||
|
||||
// Trim the generic parameter counts from the name
|
||||
genericTypeName = genericTypeName.Substring(0, genericTypeName.IndexOf('`'));
|
||||
string[] argumentTypeNames = genericArguments.Select(t => GetModelName(t)).ToArray();
|
||||
modelName = String.Format(CultureInfo.InvariantCulture, "{0}Of{1}", genericTypeName, String.Join("And", argumentTypeNames));
|
||||
}
|
||||
|
||||
return modelName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace MP_API.Areas.HelpPage.ModelDescriptions
|
||||
{
|
||||
public class ParameterAnnotation
|
||||
{
|
||||
public Attribute AnnotationAttribute { get; set; }
|
||||
|
||||
public string Documentation { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace MP_API.Areas.HelpPage.ModelDescriptions
|
||||
{
|
||||
public class ParameterDescription
|
||||
{
|
||||
public ParameterDescription()
|
||||
{
|
||||
Annotations = new Collection<ParameterAnnotation>();
|
||||
}
|
||||
|
||||
public Collection<ParameterAnnotation> Annotations { get; private set; }
|
||||
|
||||
public string Documentation { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public ModelDescription TypeDescription { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace MP_API.Areas.HelpPage.ModelDescriptions
|
||||
{
|
||||
public class SimpleTypeModelDescription : ModelDescription
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Web.Http.Description;
|
||||
using MP_API.Areas.HelpPage.ModelDescriptions;
|
||||
|
||||
namespace MP_API.Areas.HelpPage.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// The model that represents an API displayed on the help page.
|
||||
/// </summary>
|
||||
public class HelpPageApiModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HelpPageApiModel"/> class.
|
||||
/// </summary>
|
||||
public HelpPageApiModel()
|
||||
{
|
||||
UriParameters = new Collection<ParameterDescription>();
|
||||
SampleRequests = new Dictionary<MediaTypeHeaderValue, object>();
|
||||
SampleResponses = new Dictionary<MediaTypeHeaderValue, object>();
|
||||
ErrorMessages = new Collection<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="ApiDescription"/> that describes the API.
|
||||
/// </summary>
|
||||
public ApiDescription ApiDescription { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="ParameterDescription"/> collection that describes the URI parameters for the API.
|
||||
/// </summary>
|
||||
public Collection<ParameterDescription> UriParameters { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the documentation for the request.
|
||||
/// </summary>
|
||||
public string RequestDocumentation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="ModelDescription"/> that describes the request body.
|
||||
/// </summary>
|
||||
public ModelDescription RequestModelDescription { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the request body parameter descriptions.
|
||||
/// </summary>
|
||||
public IList<ParameterDescription> RequestBodyParameters
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetParameterDescriptions(RequestModelDescription);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="ModelDescription"/> that describes the resource.
|
||||
/// </summary>
|
||||
public ModelDescription ResourceDescription { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the resource property descriptions.
|
||||
/// </summary>
|
||||
public IList<ParameterDescription> ResourceProperties
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetParameterDescriptions(ResourceDescription);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the sample requests associated with the API.
|
||||
/// </summary>
|
||||
public IDictionary<MediaTypeHeaderValue, object> SampleRequests { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the sample responses associated with the API.
|
||||
/// </summary>
|
||||
public IDictionary<MediaTypeHeaderValue, object> SampleResponses { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the error messages associated with this model.
|
||||
/// </summary>
|
||||
public Collection<string> ErrorMessages { get; private set; }
|
||||
|
||||
private static IList<ParameterDescription> GetParameterDescriptions(ModelDescription modelDescription)
|
||||
{
|
||||
ComplexTypeModelDescription complexTypeModelDescription = modelDescription as ComplexTypeModelDescription;
|
||||
if (complexTypeModelDescription != null)
|
||||
{
|
||||
return complexTypeModelDescription.Properties;
|
||||
}
|
||||
|
||||
CollectionModelDescription collectionModelDescription = modelDescription as CollectionModelDescription;
|
||||
if (collectionModelDescription != null)
|
||||
{
|
||||
complexTypeModelDescription = collectionModelDescription.ElementDescription as ComplexTypeModelDescription;
|
||||
if (complexTypeModelDescription != null)
|
||||
{
|
||||
return complexTypeModelDescription.Properties;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,444 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Formatting;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Web.Http.Description;
|
||||
using System.Xml.Linq;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace MP_API.Areas.HelpPage
|
||||
{
|
||||
/// <summary>
|
||||
/// This class will generate the samples for the help page.
|
||||
/// </summary>
|
||||
public class HelpPageSampleGenerator
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HelpPageSampleGenerator"/> class.
|
||||
/// </summary>
|
||||
public HelpPageSampleGenerator()
|
||||
{
|
||||
ActualHttpMessageTypes = new Dictionary<HelpPageSampleKey, Type>();
|
||||
ActionSamples = new Dictionary<HelpPageSampleKey, object>();
|
||||
SampleObjects = new Dictionary<Type, object>();
|
||||
SampleObjectFactories = new List<Func<HelpPageSampleGenerator, Type, object>>
|
||||
{
|
||||
DefaultSampleObjectFactory,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets CLR types that are used as the content of <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/>.
|
||||
/// </summary>
|
||||
public IDictionary<HelpPageSampleKey, Type> ActualHttpMessageTypes { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the objects that are used directly as samples for certain actions.
|
||||
/// </summary>
|
||||
public IDictionary<HelpPageSampleKey, object> ActionSamples { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the objects that are serialized as samples by the supported formatters.
|
||||
/// </summary>
|
||||
public IDictionary<Type, object> SampleObjects { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets factories for the objects that the supported formatters will serialize as samples. Processed in order,
|
||||
/// stopping when the factory successfully returns a non-<see langref="null"/> object.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Collection includes just <see cref="ObjectGenerator.GenerateObject(Type)"/> initially. Use
|
||||
/// <code>SampleObjectFactories.Insert(0, func)</code> to provide an override and
|
||||
/// <code>SampleObjectFactories.Add(func)</code> to provide a fallback.</remarks>
|
||||
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures",
|
||||
Justification = "This is an appropriate nesting of generic types")]
|
||||
public IList<Func<HelpPageSampleGenerator, Type, object>> SampleObjectFactories { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the request body samples for a given <see cref="ApiDescription"/>.
|
||||
/// </summary>
|
||||
/// <param name="api">The <see cref="ApiDescription"/>.</param>
|
||||
/// <returns>The samples keyed by media type.</returns>
|
||||
public IDictionary<MediaTypeHeaderValue, object> GetSampleRequests(ApiDescription api)
|
||||
{
|
||||
return GetSample(api, SampleDirection.Request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the response body samples for a given <see cref="ApiDescription"/>.
|
||||
/// </summary>
|
||||
/// <param name="api">The <see cref="ApiDescription"/>.</param>
|
||||
/// <returns>The samples keyed by media type.</returns>
|
||||
public IDictionary<MediaTypeHeaderValue, object> GetSampleResponses(ApiDescription api)
|
||||
{
|
||||
return GetSample(api, SampleDirection.Response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the request or response body samples.
|
||||
/// </summary>
|
||||
/// <param name="api">The <see cref="ApiDescription"/>.</param>
|
||||
/// <param name="sampleDirection">The value indicating whether the sample is for a request or for a response.</param>
|
||||
/// <returns>The samples keyed by media type.</returns>
|
||||
public virtual IDictionary<MediaTypeHeaderValue, object> GetSample(ApiDescription api, SampleDirection sampleDirection)
|
||||
{
|
||||
if (api == null)
|
||||
{
|
||||
throw new ArgumentNullException("api");
|
||||
}
|
||||
string controllerName = api.ActionDescriptor.ControllerDescriptor.ControllerName;
|
||||
string actionName = api.ActionDescriptor.ActionName;
|
||||
IEnumerable<string> parameterNames = api.ParameterDescriptions.Select(p => p.Name);
|
||||
Collection<MediaTypeFormatter> formatters;
|
||||
Type type = ResolveType(api, controllerName, actionName, parameterNames, sampleDirection, out formatters);
|
||||
var samples = new Dictionary<MediaTypeHeaderValue, object>();
|
||||
|
||||
// Use the samples provided directly for actions
|
||||
var actionSamples = GetAllActionSamples(controllerName, actionName, parameterNames, sampleDirection);
|
||||
foreach (var actionSample in actionSamples)
|
||||
{
|
||||
samples.Add(actionSample.Key.MediaType, WrapSampleIfString(actionSample.Value));
|
||||
}
|
||||
|
||||
// Do the sample generation based on formatters only if an action doesn't return an HttpResponseMessage.
|
||||
// Here we cannot rely on formatters because we don't know what's in the HttpResponseMessage, it might not even use formatters.
|
||||
if (type != null && !typeof(HttpResponseMessage).IsAssignableFrom(type))
|
||||
{
|
||||
object sampleObject = GetSampleObject(type);
|
||||
foreach (var formatter in formatters)
|
||||
{
|
||||
foreach (MediaTypeHeaderValue mediaType in formatter.SupportedMediaTypes)
|
||||
{
|
||||
if (!samples.ContainsKey(mediaType))
|
||||
{
|
||||
object sample = GetActionSample(controllerName, actionName, parameterNames, type, formatter, mediaType, sampleDirection);
|
||||
|
||||
// If no sample found, try generate sample using formatter and sample object
|
||||
if (sample == null && sampleObject != null)
|
||||
{
|
||||
sample = WriteSampleObjectUsingFormatter(formatter, sampleObject, type, mediaType);
|
||||
}
|
||||
|
||||
samples.Add(mediaType, WrapSampleIfString(sample));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return samples;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Search for samples that are provided directly through <see cref="ActionSamples"/>.
|
||||
/// </summary>
|
||||
/// <param name="controllerName">Name of the controller.</param>
|
||||
/// <param name="actionName">Name of the action.</param>
|
||||
/// <param name="parameterNames">The parameter names.</param>
|
||||
/// <param name="type">The CLR type.</param>
|
||||
/// <param name="formatter">The formatter.</param>
|
||||
/// <param name="mediaType">The media type.</param>
|
||||
/// <param name="sampleDirection">The value indicating whether the sample is for a request or for a response.</param>
|
||||
/// <returns>The sample that matches the parameters.</returns>
|
||||
public virtual object GetActionSample(string controllerName, string actionName, IEnumerable<string> parameterNames, Type type, MediaTypeFormatter formatter, MediaTypeHeaderValue mediaType, SampleDirection sampleDirection)
|
||||
{
|
||||
object sample;
|
||||
|
||||
// First, try to get the sample provided for the specified mediaType, sampleDirection, controllerName, actionName and parameterNames.
|
||||
// If not found, try to get the sample provided for the specified mediaType, sampleDirection, controllerName and actionName regardless of the parameterNames.
|
||||
// If still not found, try to get the sample provided for the specified mediaType and type.
|
||||
// Finally, try to get the sample provided for the specified mediaType.
|
||||
if (ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, parameterNames), out sample) ||
|
||||
ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, new[] { "*" }), out sample) ||
|
||||
ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, type), out sample) ||
|
||||
ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType), out sample))
|
||||
{
|
||||
return sample;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the sample object that will be serialized by the formatters.
|
||||
/// First, it will look at the <see cref="SampleObjects"/>. If no sample object is found, it will try to create
|
||||
/// one using <see cref="DefaultSampleObjectFactory"/> (which wraps an <see cref="ObjectGenerator"/>) and other
|
||||
/// factories in <see cref="SampleObjectFactories"/>.
|
||||
/// </summary>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <returns>The sample object.</returns>
|
||||
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
|
||||
Justification = "Even if all items in SampleObjectFactories throw, problem will be visible as missing sample.")]
|
||||
public virtual object GetSampleObject(Type type)
|
||||
{
|
||||
object sampleObject;
|
||||
|
||||
if (!SampleObjects.TryGetValue(type, out sampleObject))
|
||||
{
|
||||
// No specific object available, try our factories.
|
||||
foreach (Func<HelpPageSampleGenerator, Type, object> factory in SampleObjectFactories)
|
||||
{
|
||||
if (factory == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
sampleObject = factory(this, type);
|
||||
if (sampleObject != null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ignore any problems encountered in the factory; go on to the next one (if any).
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return sampleObject;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resolves the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> passed to the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
|
||||
/// </summary>
|
||||
/// <param name="api">The <see cref="ApiDescription"/>.</param>
|
||||
/// <returns>The type.</returns>
|
||||
public virtual Type ResolveHttpRequestMessageType(ApiDescription api)
|
||||
{
|
||||
string controllerName = api.ActionDescriptor.ControllerDescriptor.ControllerName;
|
||||
string actionName = api.ActionDescriptor.ActionName;
|
||||
IEnumerable<string> parameterNames = api.ParameterDescriptions.Select(p => p.Name);
|
||||
Collection<MediaTypeFormatter> formatters;
|
||||
return ResolveType(api, controllerName, actionName, parameterNames, SampleDirection.Request, out formatters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resolves the type of the action parameter or return value when <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/> is used.
|
||||
/// </summary>
|
||||
/// <param name="api">The <see cref="ApiDescription"/>.</param>
|
||||
/// <param name="controllerName">Name of the controller.</param>
|
||||
/// <param name="actionName">Name of the action.</param>
|
||||
/// <param name="parameterNames">The parameter names.</param>
|
||||
/// <param name="sampleDirection">The value indicating whether the sample is for a request or a response.</param>
|
||||
/// <param name="formatters">The formatters.</param>
|
||||
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", Justification = "This is only used in advanced scenarios.")]
|
||||
public virtual Type ResolveType(ApiDescription api, string controllerName, string actionName, IEnumerable<string> parameterNames, SampleDirection sampleDirection, out Collection<MediaTypeFormatter> formatters)
|
||||
{
|
||||
if (!Enum.IsDefined(typeof(SampleDirection), sampleDirection))
|
||||
{
|
||||
throw new InvalidEnumArgumentException("sampleDirection", (int)sampleDirection, typeof(SampleDirection));
|
||||
}
|
||||
if (api == null)
|
||||
{
|
||||
throw new ArgumentNullException("api");
|
||||
}
|
||||
Type type;
|
||||
if (ActualHttpMessageTypes.TryGetValue(new HelpPageSampleKey(sampleDirection, controllerName, actionName, parameterNames), out type) ||
|
||||
ActualHttpMessageTypes.TryGetValue(new HelpPageSampleKey(sampleDirection, controllerName, actionName, new[] { "*" }), out type))
|
||||
{
|
||||
// Re-compute the supported formatters based on type
|
||||
Collection<MediaTypeFormatter> newFormatters = new Collection<MediaTypeFormatter>();
|
||||
foreach (var formatter in api.ActionDescriptor.Configuration.Formatters)
|
||||
{
|
||||
if (IsFormatSupported(sampleDirection, formatter, type))
|
||||
{
|
||||
newFormatters.Add(formatter);
|
||||
}
|
||||
}
|
||||
formatters = newFormatters;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (sampleDirection)
|
||||
{
|
||||
case SampleDirection.Request:
|
||||
ApiParameterDescription requestBodyParameter = api.ParameterDescriptions.FirstOrDefault(p => p.Source == ApiParameterSource.FromBody);
|
||||
type = requestBodyParameter == null ? null : requestBodyParameter.ParameterDescriptor.ParameterType;
|
||||
formatters = api.SupportedRequestBodyFormatters;
|
||||
break;
|
||||
case SampleDirection.Response:
|
||||
default:
|
||||
type = api.ResponseDescription.ResponseType ?? api.ResponseDescription.DeclaredType;
|
||||
formatters = api.SupportedResponseFormatters;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes the sample object using formatter.
|
||||
/// </summary>
|
||||
/// <param name="formatter">The formatter.</param>
|
||||
/// <param name="value">The value.</param>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="mediaType">Type of the media.</param>
|
||||
/// <returns></returns>
|
||||
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is recorded as InvalidSample.")]
|
||||
public virtual object WriteSampleObjectUsingFormatter(MediaTypeFormatter formatter, object value, Type type, MediaTypeHeaderValue mediaType)
|
||||
{
|
||||
if (formatter == null)
|
||||
{
|
||||
throw new ArgumentNullException("formatter");
|
||||
}
|
||||
if (mediaType == null)
|
||||
{
|
||||
throw new ArgumentNullException("mediaType");
|
||||
}
|
||||
|
||||
object sample = String.Empty;
|
||||
MemoryStream ms = null;
|
||||
HttpContent content = null;
|
||||
try
|
||||
{
|
||||
if (formatter.CanWriteType(type))
|
||||
{
|
||||
ms = new MemoryStream();
|
||||
content = new ObjectContent(type, value, formatter, mediaType);
|
||||
formatter.WriteToStreamAsync(type, value, ms, content, null).Wait();
|
||||
ms.Position = 0;
|
||||
StreamReader reader = new StreamReader(ms);
|
||||
string serializedSampleString = reader.ReadToEnd();
|
||||
if (mediaType.MediaType.ToUpperInvariant().Contains("XML"))
|
||||
{
|
||||
serializedSampleString = TryFormatXml(serializedSampleString);
|
||||
}
|
||||
else if (mediaType.MediaType.ToUpperInvariant().Contains("JSON"))
|
||||
{
|
||||
serializedSampleString = TryFormatJson(serializedSampleString);
|
||||
}
|
||||
|
||||
sample = new TextSample(serializedSampleString);
|
||||
}
|
||||
else
|
||||
{
|
||||
sample = new InvalidSample(String.Format(
|
||||
CultureInfo.CurrentCulture,
|
||||
"Failed to generate the sample for media type '{0}'. Cannot use formatter '{1}' to write type '{2}'.",
|
||||
mediaType,
|
||||
formatter.GetType().Name,
|
||||
type.Name));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
sample = new InvalidSample(String.Format(
|
||||
CultureInfo.CurrentCulture,
|
||||
"An exception has occurred while using the formatter '{0}' to generate sample for media type '{1}'. Exception message: {2}",
|
||||
formatter.GetType().Name,
|
||||
mediaType.MediaType,
|
||||
UnwrapException(e).Message));
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (ms != null)
|
||||
{
|
||||
ms.Dispose();
|
||||
}
|
||||
if (content != null)
|
||||
{
|
||||
content.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
return sample;
|
||||
}
|
||||
|
||||
internal static Exception UnwrapException(Exception exception)
|
||||
{
|
||||
AggregateException aggregateException = exception as AggregateException;
|
||||
if (aggregateException != null)
|
||||
{
|
||||
return aggregateException.Flatten().InnerException;
|
||||
}
|
||||
return exception;
|
||||
}
|
||||
|
||||
// Default factory for sample objects
|
||||
private static object DefaultSampleObjectFactory(HelpPageSampleGenerator sampleGenerator, Type type)
|
||||
{
|
||||
// Try to create a default sample object
|
||||
ObjectGenerator objectGenerator = new ObjectGenerator();
|
||||
return objectGenerator.GenerateObject(type);
|
||||
}
|
||||
|
||||
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")]
|
||||
private static string TryFormatJson(string str)
|
||||
{
|
||||
try
|
||||
{
|
||||
object parsedJson = JsonConvert.DeserializeObject(str);
|
||||
return JsonConvert.SerializeObject(parsedJson, Formatting.Indented);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// can't parse JSON, return the original string
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")]
|
||||
private static string TryFormatXml(string str)
|
||||
{
|
||||
try
|
||||
{
|
||||
XDocument xml = XDocument.Parse(str);
|
||||
return xml.ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// can't parse XML, return the original string
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsFormatSupported(SampleDirection sampleDirection, MediaTypeFormatter formatter, Type type)
|
||||
{
|
||||
switch (sampleDirection)
|
||||
{
|
||||
case SampleDirection.Request:
|
||||
return formatter.CanReadType(type);
|
||||
case SampleDirection.Response:
|
||||
return formatter.CanWriteType(type);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private IEnumerable<KeyValuePair<HelpPageSampleKey, object>> GetAllActionSamples(string controllerName, string actionName, IEnumerable<string> parameterNames, SampleDirection sampleDirection)
|
||||
{
|
||||
HashSet<string> parameterNamesSet = new HashSet<string>(parameterNames, StringComparer.OrdinalIgnoreCase);
|
||||
foreach (var sample in ActionSamples)
|
||||
{
|
||||
HelpPageSampleKey sampleKey = sample.Key;
|
||||
if (String.Equals(controllerName, sampleKey.ControllerName, StringComparison.OrdinalIgnoreCase) &&
|
||||
String.Equals(actionName, sampleKey.ActionName, StringComparison.OrdinalIgnoreCase) &&
|
||||
(sampleKey.ParameterNames.SetEquals(new[] { "*" }) || parameterNamesSet.SetEquals(sampleKey.ParameterNames)) &&
|
||||
sampleDirection == sampleKey.SampleDirection)
|
||||
{
|
||||
yield return sample;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static object WrapSampleIfString(object sample)
|
||||
{
|
||||
string stringSample = sample as string;
|
||||
if (stringSample != null)
|
||||
{
|
||||
return new TextSample(stringSample);
|
||||
}
|
||||
|
||||
return sample;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,172 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Net.Http.Headers;
|
||||
|
||||
namespace MP_API.Areas.HelpPage
|
||||
{
|
||||
/// <summary>
|
||||
/// This is used to identify the place where the sample should be applied.
|
||||
/// </summary>
|
||||
public class HelpPageSampleKey
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="HelpPageSampleKey"/> based on media type.
|
||||
/// </summary>
|
||||
/// <param name="mediaType">The media type.</param>
|
||||
public HelpPageSampleKey(MediaTypeHeaderValue mediaType)
|
||||
{
|
||||
if (mediaType == null)
|
||||
{
|
||||
throw new ArgumentNullException("mediaType");
|
||||
}
|
||||
|
||||
ActionName = String.Empty;
|
||||
ControllerName = String.Empty;
|
||||
MediaType = mediaType;
|
||||
ParameterNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="HelpPageSampleKey"/> based on media type and CLR type.
|
||||
/// </summary>
|
||||
/// <param name="mediaType">The media type.</param>
|
||||
/// <param name="type">The CLR type.</param>
|
||||
public HelpPageSampleKey(MediaTypeHeaderValue mediaType, Type type)
|
||||
: this(mediaType)
|
||||
{
|
||||
if (type == null)
|
||||
{
|
||||
throw new ArgumentNullException("type");
|
||||
}
|
||||
|
||||
ParameterType = type;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="HelpPageSampleKey"/> based on <see cref="SampleDirection"/>, controller name, action name and parameter names.
|
||||
/// </summary>
|
||||
/// <param name="sampleDirection">The <see cref="SampleDirection"/>.</param>
|
||||
/// <param name="controllerName">Name of the controller.</param>
|
||||
/// <param name="actionName">Name of the action.</param>
|
||||
/// <param name="parameterNames">The parameter names.</param>
|
||||
public HelpPageSampleKey(SampleDirection sampleDirection, string controllerName, string actionName, IEnumerable<string> parameterNames)
|
||||
{
|
||||
if (!Enum.IsDefined(typeof(SampleDirection), sampleDirection))
|
||||
{
|
||||
throw new InvalidEnumArgumentException("sampleDirection", (int)sampleDirection, typeof(SampleDirection));
|
||||
}
|
||||
if (controllerName == null)
|
||||
{
|
||||
throw new ArgumentNullException("controllerName");
|
||||
}
|
||||
if (actionName == null)
|
||||
{
|
||||
throw new ArgumentNullException("actionName");
|
||||
}
|
||||
if (parameterNames == null)
|
||||
{
|
||||
throw new ArgumentNullException("parameterNames");
|
||||
}
|
||||
|
||||
ControllerName = controllerName;
|
||||
ActionName = actionName;
|
||||
ParameterNames = new HashSet<string>(parameterNames, StringComparer.OrdinalIgnoreCase);
|
||||
SampleDirection = sampleDirection;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="HelpPageSampleKey"/> based on media type, <see cref="SampleDirection"/>, controller name, action name and parameter names.
|
||||
/// </summary>
|
||||
/// <param name="mediaType">The media type.</param>
|
||||
/// <param name="sampleDirection">The <see cref="SampleDirection"/>.</param>
|
||||
/// <param name="controllerName">Name of the controller.</param>
|
||||
/// <param name="actionName">Name of the action.</param>
|
||||
/// <param name="parameterNames">The parameter names.</param>
|
||||
public HelpPageSampleKey(MediaTypeHeaderValue mediaType, SampleDirection sampleDirection, string controllerName, string actionName, IEnumerable<string> parameterNames)
|
||||
: this(sampleDirection, controllerName, actionName, parameterNames)
|
||||
{
|
||||
if (mediaType == null)
|
||||
{
|
||||
throw new ArgumentNullException("mediaType");
|
||||
}
|
||||
|
||||
MediaType = mediaType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the controller.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The name of the controller.
|
||||
/// </value>
|
||||
public string ControllerName { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the action.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The name of the action.
|
||||
/// </value>
|
||||
public string ActionName { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the media type.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The media type.
|
||||
/// </value>
|
||||
public MediaTypeHeaderValue MediaType { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the parameter names.
|
||||
/// </summary>
|
||||
public HashSet<string> ParameterNames { get; private set; }
|
||||
|
||||
public Type ParameterType { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="SampleDirection"/>.
|
||||
/// </summary>
|
||||
public SampleDirection? SampleDirection { get; private set; }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
HelpPageSampleKey otherKey = obj as HelpPageSampleKey;
|
||||
if (otherKey == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return String.Equals(ControllerName, otherKey.ControllerName, StringComparison.OrdinalIgnoreCase) &&
|
||||
String.Equals(ActionName, otherKey.ActionName, StringComparison.OrdinalIgnoreCase) &&
|
||||
(MediaType == otherKey.MediaType || (MediaType != null && MediaType.Equals(otherKey.MediaType))) &&
|
||||
ParameterType == otherKey.ParameterType &&
|
||||
SampleDirection == otherKey.SampleDirection &&
|
||||
ParameterNames.SetEquals(otherKey.ParameterNames);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
int hashCode = ControllerName.ToUpperInvariant().GetHashCode() ^ ActionName.ToUpperInvariant().GetHashCode();
|
||||
if (MediaType != null)
|
||||
{
|
||||
hashCode ^= MediaType.GetHashCode();
|
||||
}
|
||||
if (SampleDirection != null)
|
||||
{
|
||||
hashCode ^= SampleDirection.GetHashCode();
|
||||
}
|
||||
if (ParameterType != null)
|
||||
{
|
||||
hashCode ^= ParameterType.GetHashCode();
|
||||
}
|
||||
foreach (string parameterName in ParameterNames)
|
||||
{
|
||||
hashCode ^= parameterName.ToUpperInvariant().GetHashCode();
|
||||
}
|
||||
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace MP_API.Areas.HelpPage
|
||||
{
|
||||
/// <summary>
|
||||
/// This represents an image sample on the help page. There's a display template named ImageSample associated with this class.
|
||||
/// </summary>
|
||||
public class ImageSample
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ImageSample"/> class.
|
||||
/// </summary>
|
||||
/// <param name="src">The URL of an image.</param>
|
||||
public ImageSample(string src)
|
||||
{
|
||||
if (src == null)
|
||||
{
|
||||
throw new ArgumentNullException("src");
|
||||
}
|
||||
Src = src;
|
||||
}
|
||||
|
||||
public string Src { get; private set; }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
ImageSample other = obj as ImageSample;
|
||||
return other != null && Src == other.Src;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Src.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Src;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace MP_API.Areas.HelpPage
|
||||
{
|
||||
/// <summary>
|
||||
/// This represents an invalid sample on the help page. There's a display template named InvalidSample associated with this class.
|
||||
/// </summary>
|
||||
public class InvalidSample
|
||||
{
|
||||
public InvalidSample(string errorMessage)
|
||||
{
|
||||
if (errorMessage == null)
|
||||
{
|
||||
throw new ArgumentNullException("errorMessage");
|
||||
}
|
||||
ErrorMessage = errorMessage;
|
||||
}
|
||||
|
||||
public string ErrorMessage { get; private set; }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
InvalidSample other = obj as InvalidSample;
|
||||
return other != null && ErrorMessage == other.ErrorMessage;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return ErrorMessage.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return ErrorMessage;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,456 +0,0 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace MP_API.Areas.HelpPage
|
||||
{
|
||||
/// <summary>
|
||||
/// This class will create an object of a given type and populate it with sample data.
|
||||
/// </summary>
|
||||
public class ObjectGenerator
|
||||
{
|
||||
internal const int DefaultCollectionSize = 2;
|
||||
private readonly SimpleTypeObjectGenerator SimpleObjectGenerator = new SimpleTypeObjectGenerator();
|
||||
|
||||
/// <summary>
|
||||
/// Generates an object for a given type. The type needs to be public, have a public default constructor and settable public properties/fields. Currently it supports the following types:
|
||||
/// Simple types: <see cref="int"/>, <see cref="string"/>, <see cref="Enum"/>, <see cref="DateTime"/>, <see cref="Uri"/>, etc.
|
||||
/// Complex types: POCO types.
|
||||
/// Nullables: <see cref="Nullable{T}"/>.
|
||||
/// Arrays: arrays of simple types or complex types.
|
||||
/// Key value pairs: <see cref="KeyValuePair{TKey,TValue}"/>
|
||||
/// Tuples: <see cref="Tuple{T1}"/>, <see cref="Tuple{T1,T2}"/>, etc
|
||||
/// Dictionaries: <see cref="IDictionary{TKey,TValue}"/> or anything deriving from <see cref="IDictionary{TKey,TValue}"/>.
|
||||
/// Collections: <see cref="IList{T}"/>, <see cref="IEnumerable{T}"/>, <see cref="ICollection{T}"/>, <see cref="IList"/>, <see cref="IEnumerable"/>, <see cref="ICollection"/> or anything deriving from <see cref="ICollection{T}"/> or <see cref="IList"/>.
|
||||
/// Queryables: <see cref="IQueryable"/>, <see cref="IQueryable{T}"/>.
|
||||
/// </summary>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <returns>An object of the given type.</returns>
|
||||
public object GenerateObject(Type type)
|
||||
{
|
||||
return GenerateObject(type, new Dictionary<Type, object>());
|
||||
}
|
||||
|
||||
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Here we just want to return null if anything goes wrong.")]
|
||||
private object GenerateObject(Type type, Dictionary<Type, object> createdObjectReferences)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (SimpleTypeObjectGenerator.CanGenerateObject(type))
|
||||
{
|
||||
return SimpleObjectGenerator.GenerateObject(type);
|
||||
}
|
||||
|
||||
if (type.IsArray)
|
||||
{
|
||||
return GenerateArray(type, DefaultCollectionSize, createdObjectReferences);
|
||||
}
|
||||
|
||||
if (type.IsGenericType)
|
||||
{
|
||||
return GenerateGenericType(type, DefaultCollectionSize, createdObjectReferences);
|
||||
}
|
||||
|
||||
if (type == typeof(IDictionary))
|
||||
{
|
||||
return GenerateDictionary(typeof(Hashtable), DefaultCollectionSize, createdObjectReferences);
|
||||
}
|
||||
|
||||
if (typeof(IDictionary).IsAssignableFrom(type))
|
||||
{
|
||||
return GenerateDictionary(type, DefaultCollectionSize, createdObjectReferences);
|
||||
}
|
||||
|
||||
if (type == typeof(IList) ||
|
||||
type == typeof(IEnumerable) ||
|
||||
type == typeof(ICollection))
|
||||
{
|
||||
return GenerateCollection(typeof(ArrayList), DefaultCollectionSize, createdObjectReferences);
|
||||
}
|
||||
|
||||
if (typeof(IList).IsAssignableFrom(type))
|
||||
{
|
||||
return GenerateCollection(type, DefaultCollectionSize, createdObjectReferences);
|
||||
}
|
||||
|
||||
if (type == typeof(IQueryable))
|
||||
{
|
||||
return GenerateQueryable(type, DefaultCollectionSize, createdObjectReferences);
|
||||
}
|
||||
|
||||
if (type.IsEnum)
|
||||
{
|
||||
return GenerateEnum(type);
|
||||
}
|
||||
|
||||
if (type.IsPublic || type.IsNestedPublic)
|
||||
{
|
||||
return GenerateComplexObject(type, createdObjectReferences);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Returns null if anything fails
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static object GenerateGenericType(Type type, int collectionSize, Dictionary<Type, object> createdObjectReferences)
|
||||
{
|
||||
Type genericTypeDefinition = type.GetGenericTypeDefinition();
|
||||
if (genericTypeDefinition == typeof(Nullable<>))
|
||||
{
|
||||
return GenerateNullable(type, createdObjectReferences);
|
||||
}
|
||||
|
||||
if (genericTypeDefinition == typeof(KeyValuePair<,>))
|
||||
{
|
||||
return GenerateKeyValuePair(type, createdObjectReferences);
|
||||
}
|
||||
|
||||
if (IsTuple(genericTypeDefinition))
|
||||
{
|
||||
return GenerateTuple(type, createdObjectReferences);
|
||||
}
|
||||
|
||||
Type[] genericArguments = type.GetGenericArguments();
|
||||
if (genericArguments.Length == 1)
|
||||
{
|
||||
if (genericTypeDefinition == typeof(IList<>) ||
|
||||
genericTypeDefinition == typeof(IEnumerable<>) ||
|
||||
genericTypeDefinition == typeof(ICollection<>))
|
||||
{
|
||||
Type collectionType = typeof(List<>).MakeGenericType(genericArguments);
|
||||
return GenerateCollection(collectionType, collectionSize, createdObjectReferences);
|
||||
}
|
||||
|
||||
if (genericTypeDefinition == typeof(IQueryable<>))
|
||||
{
|
||||
return GenerateQueryable(type, collectionSize, createdObjectReferences);
|
||||
}
|
||||
|
||||
Type closedCollectionType = typeof(ICollection<>).MakeGenericType(genericArguments[0]);
|
||||
if (closedCollectionType.IsAssignableFrom(type))
|
||||
{
|
||||
return GenerateCollection(type, collectionSize, createdObjectReferences);
|
||||
}
|
||||
}
|
||||
|
||||
if (genericArguments.Length == 2)
|
||||
{
|
||||
if (genericTypeDefinition == typeof(IDictionary<,>))
|
||||
{
|
||||
Type dictionaryType = typeof(Dictionary<,>).MakeGenericType(genericArguments);
|
||||
return GenerateDictionary(dictionaryType, collectionSize, createdObjectReferences);
|
||||
}
|
||||
|
||||
Type closedDictionaryType = typeof(IDictionary<,>).MakeGenericType(genericArguments[0], genericArguments[1]);
|
||||
if (closedDictionaryType.IsAssignableFrom(type))
|
||||
{
|
||||
return GenerateDictionary(type, collectionSize, createdObjectReferences);
|
||||
}
|
||||
}
|
||||
|
||||
if (type.IsPublic || type.IsNestedPublic)
|
||||
{
|
||||
return GenerateComplexObject(type, createdObjectReferences);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static object GenerateTuple(Type type, Dictionary<Type, object> createdObjectReferences)
|
||||
{
|
||||
Type[] genericArgs = type.GetGenericArguments();
|
||||
object[] parameterValues = new object[genericArgs.Length];
|
||||
bool failedToCreateTuple = true;
|
||||
ObjectGenerator objectGenerator = new ObjectGenerator();
|
||||
for (int i = 0; i < genericArgs.Length; i++)
|
||||
{
|
||||
parameterValues[i] = objectGenerator.GenerateObject(genericArgs[i], createdObjectReferences);
|
||||
failedToCreateTuple &= parameterValues[i] == null;
|
||||
}
|
||||
if (failedToCreateTuple)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
object result = Activator.CreateInstance(type, parameterValues);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static bool IsTuple(Type genericTypeDefinition)
|
||||
{
|
||||
return genericTypeDefinition == typeof(Tuple<>) ||
|
||||
genericTypeDefinition == typeof(Tuple<,>) ||
|
||||
genericTypeDefinition == typeof(Tuple<,,>) ||
|
||||
genericTypeDefinition == typeof(Tuple<,,,>) ||
|
||||
genericTypeDefinition == typeof(Tuple<,,,,>) ||
|
||||
genericTypeDefinition == typeof(Tuple<,,,,,>) ||
|
||||
genericTypeDefinition == typeof(Tuple<,,,,,,>) ||
|
||||
genericTypeDefinition == typeof(Tuple<,,,,,,,>);
|
||||
}
|
||||
|
||||
private static object GenerateKeyValuePair(Type keyValuePairType, Dictionary<Type, object> createdObjectReferences)
|
||||
{
|
||||
Type[] genericArgs = keyValuePairType.GetGenericArguments();
|
||||
Type typeK = genericArgs[0];
|
||||
Type typeV = genericArgs[1];
|
||||
ObjectGenerator objectGenerator = new ObjectGenerator();
|
||||
object keyObject = objectGenerator.GenerateObject(typeK, createdObjectReferences);
|
||||
object valueObject = objectGenerator.GenerateObject(typeV, createdObjectReferences);
|
||||
if (keyObject == null && valueObject == null)
|
||||
{
|
||||
// Failed to create key and values
|
||||
return null;
|
||||
}
|
||||
object result = Activator.CreateInstance(keyValuePairType, keyObject, valueObject);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static object GenerateArray(Type arrayType, int size, Dictionary<Type, object> createdObjectReferences)
|
||||
{
|
||||
Type type = arrayType.GetElementType();
|
||||
Array result = Array.CreateInstance(type, size);
|
||||
bool areAllElementsNull = true;
|
||||
ObjectGenerator objectGenerator = new ObjectGenerator();
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
object element = objectGenerator.GenerateObject(type, createdObjectReferences);
|
||||
result.SetValue(element, i);
|
||||
areAllElementsNull &= element == null;
|
||||
}
|
||||
|
||||
if (areAllElementsNull)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static object GenerateDictionary(Type dictionaryType, int size, Dictionary<Type, object> createdObjectReferences)
|
||||
{
|
||||
Type typeK = typeof(object);
|
||||
Type typeV = typeof(object);
|
||||
if (dictionaryType.IsGenericType)
|
||||
{
|
||||
Type[] genericArgs = dictionaryType.GetGenericArguments();
|
||||
typeK = genericArgs[0];
|
||||
typeV = genericArgs[1];
|
||||
}
|
||||
|
||||
object result = Activator.CreateInstance(dictionaryType);
|
||||
MethodInfo addMethod = dictionaryType.GetMethod("Add") ?? dictionaryType.GetMethod("TryAdd");
|
||||
MethodInfo containsMethod = dictionaryType.GetMethod("Contains") ?? dictionaryType.GetMethod("ContainsKey");
|
||||
ObjectGenerator objectGenerator = new ObjectGenerator();
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
object newKey = objectGenerator.GenerateObject(typeK, createdObjectReferences);
|
||||
if (newKey == null)
|
||||
{
|
||||
// Cannot generate a valid key
|
||||
return null;
|
||||
}
|
||||
|
||||
bool containsKey = (bool)containsMethod.Invoke(result, new object[] { newKey });
|
||||
if (!containsKey)
|
||||
{
|
||||
object newValue = objectGenerator.GenerateObject(typeV, createdObjectReferences);
|
||||
addMethod.Invoke(result, new object[] { newKey, newValue });
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static object GenerateEnum(Type enumType)
|
||||
{
|
||||
Array possibleValues = Enum.GetValues(enumType);
|
||||
if (possibleValues.Length > 0)
|
||||
{
|
||||
return possibleValues.GetValue(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static object GenerateQueryable(Type queryableType, int size, Dictionary<Type, object> createdObjectReferences)
|
||||
{
|
||||
bool isGeneric = queryableType.IsGenericType;
|
||||
object list;
|
||||
if (isGeneric)
|
||||
{
|
||||
Type listType = typeof(List<>).MakeGenericType(queryableType.GetGenericArguments());
|
||||
list = GenerateCollection(listType, size, createdObjectReferences);
|
||||
}
|
||||
else
|
||||
{
|
||||
list = GenerateArray(typeof(object[]), size, createdObjectReferences);
|
||||
}
|
||||
if (list == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (isGeneric)
|
||||
{
|
||||
Type argumentType = typeof(IEnumerable<>).MakeGenericType(queryableType.GetGenericArguments());
|
||||
MethodInfo asQueryableMethod = typeof(Queryable).GetMethod("AsQueryable", new[] { argumentType });
|
||||
return asQueryableMethod.Invoke(null, new[] { list });
|
||||
}
|
||||
|
||||
return Queryable.AsQueryable((IEnumerable)list);
|
||||
}
|
||||
|
||||
private static object GenerateCollection(Type collectionType, int size, Dictionary<Type, object> createdObjectReferences)
|
||||
{
|
||||
Type type = collectionType.IsGenericType ?
|
||||
collectionType.GetGenericArguments()[0] :
|
||||
typeof(object);
|
||||
object result = Activator.CreateInstance(collectionType);
|
||||
MethodInfo addMethod = collectionType.GetMethod("Add");
|
||||
bool areAllElementsNull = true;
|
||||
ObjectGenerator objectGenerator = new ObjectGenerator();
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
object element = objectGenerator.GenerateObject(type, createdObjectReferences);
|
||||
addMethod.Invoke(result, new object[] { element });
|
||||
areAllElementsNull &= element == null;
|
||||
}
|
||||
|
||||
if (areAllElementsNull)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static object GenerateNullable(Type nullableType, Dictionary<Type, object> createdObjectReferences)
|
||||
{
|
||||
Type type = nullableType.GetGenericArguments()[0];
|
||||
ObjectGenerator objectGenerator = new ObjectGenerator();
|
||||
return objectGenerator.GenerateObject(type, createdObjectReferences);
|
||||
}
|
||||
|
||||
private static object GenerateComplexObject(Type type, Dictionary<Type, object> createdObjectReferences)
|
||||
{
|
||||
object result = null;
|
||||
|
||||
if (createdObjectReferences.TryGetValue(type, out result))
|
||||
{
|
||||
// The object has been created already, just return it. This will handle the circular reference case.
|
||||
return result;
|
||||
}
|
||||
|
||||
if (type.IsValueType)
|
||||
{
|
||||
result = Activator.CreateInstance(type);
|
||||
}
|
||||
else
|
||||
{
|
||||
ConstructorInfo defaultCtor = type.GetConstructor(Type.EmptyTypes);
|
||||
if (defaultCtor == null)
|
||||
{
|
||||
// Cannot instantiate the type because it doesn't have a default constructor
|
||||
return null;
|
||||
}
|
||||
|
||||
result = defaultCtor.Invoke(new object[0]);
|
||||
}
|
||||
createdObjectReferences.Add(type, result);
|
||||
SetPublicProperties(type, result, createdObjectReferences);
|
||||
SetPublicFields(type, result, createdObjectReferences);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static void SetPublicProperties(Type type, object obj, Dictionary<Type, object> createdObjectReferences)
|
||||
{
|
||||
PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
|
||||
ObjectGenerator objectGenerator = new ObjectGenerator();
|
||||
foreach (PropertyInfo property in properties)
|
||||
{
|
||||
if (property.CanWrite)
|
||||
{
|
||||
object propertyValue = objectGenerator.GenerateObject(property.PropertyType, createdObjectReferences);
|
||||
property.SetValue(obj, propertyValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetPublicFields(Type type, object obj, Dictionary<Type, object> createdObjectReferences)
|
||||
{
|
||||
FieldInfo[] fields = type.GetFields(BindingFlags.Public | BindingFlags.Instance);
|
||||
ObjectGenerator objectGenerator = new ObjectGenerator();
|
||||
foreach (FieldInfo field in fields)
|
||||
{
|
||||
object fieldValue = objectGenerator.GenerateObject(field.FieldType, createdObjectReferences);
|
||||
field.SetValue(obj, fieldValue);
|
||||
}
|
||||
}
|
||||
|
||||
private class SimpleTypeObjectGenerator
|
||||
{
|
||||
private long _index = 0;
|
||||
private static readonly Dictionary<Type, Func<long, object>> DefaultGenerators = InitializeGenerators();
|
||||
|
||||
[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "These are simple type factories and cannot be split up.")]
|
||||
private static Dictionary<Type, Func<long, object>> InitializeGenerators()
|
||||
{
|
||||
return new Dictionary<Type, Func<long, object>>
|
||||
{
|
||||
{ typeof(Boolean), index => true },
|
||||
{ typeof(Byte), index => (Byte)64 },
|
||||
{ typeof(Char), index => (Char)65 },
|
||||
{ typeof(DateTime), index => DateTime.Now },
|
||||
{ typeof(DateTimeOffset), index => new DateTimeOffset(DateTime.Now) },
|
||||
{ typeof(DBNull), index => DBNull.Value },
|
||||
{ typeof(Decimal), index => (Decimal)index },
|
||||
{ typeof(Double), index => (Double)(index + 0.1) },
|
||||
{ typeof(Guid), index => Guid.NewGuid() },
|
||||
{ typeof(Int16), index => (Int16)(index % Int16.MaxValue) },
|
||||
{ typeof(Int32), index => (Int32)(index % Int32.MaxValue) },
|
||||
{ typeof(Int64), index => (Int64)index },
|
||||
{ typeof(Object), index => new object() },
|
||||
{ typeof(SByte), index => (SByte)64 },
|
||||
{ typeof(Single), index => (Single)(index + 0.1) },
|
||||
{
|
||||
typeof(String), index =>
|
||||
{
|
||||
return String.Format(CultureInfo.CurrentCulture, "sample string {0}", index);
|
||||
}
|
||||
},
|
||||
{
|
||||
typeof(TimeSpan), index =>
|
||||
{
|
||||
return TimeSpan.FromTicks(1234567);
|
||||
}
|
||||
},
|
||||
{ typeof(UInt16), index => (UInt16)(index % UInt16.MaxValue) },
|
||||
{ typeof(UInt32), index => (UInt32)(index % UInt32.MaxValue) },
|
||||
{ typeof(UInt64), index => (UInt64)index },
|
||||
{
|
||||
typeof(Uri), index =>
|
||||
{
|
||||
return new Uri(String.Format(CultureInfo.CurrentCulture, "http://webapihelppage{0}.com", index));
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
public static bool CanGenerateObject(Type type)
|
||||
{
|
||||
return DefaultGenerators.ContainsKey(type);
|
||||
}
|
||||
|
||||
public object GenerateObject(Type type)
|
||||
{
|
||||
return DefaultGenerators[type](++_index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
namespace MP_API.Areas.HelpPage
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates whether the sample is used for request or response
|
||||
/// </summary>
|
||||
public enum SampleDirection
|
||||
{
|
||||
Request = 0,
|
||||
Response
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace MP_API.Areas.HelpPage
|
||||
{
|
||||
/// <summary>
|
||||
/// This represents a preformatted text sample on the help page. There's a display template named TextSample associated with this class.
|
||||
/// </summary>
|
||||
public class TextSample
|
||||
{
|
||||
public TextSample(string text)
|
||||
{
|
||||
if (text == null)
|
||||
{
|
||||
throw new ArgumentNullException("text");
|
||||
}
|
||||
Text = text;
|
||||
}
|
||||
|
||||
public string Text { get; private set; }
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
TextSample other = obj as TextSample;
|
||||
return other != null && Text == other.Text;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Text.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
@using System.Web.Http
|
||||
@using MP_API.Areas.HelpPage.Models
|
||||
@model HelpPageApiModel
|
||||
|
||||
@{
|
||||
var description = Model.ApiDescription;
|
||||
ViewBag.Title = description.HttpMethod.Method + " " + description.RelativePath;
|
||||
}
|
||||
|
||||
<link type="text/css" href="~/Areas/HelpPage/HelpPage.css" rel="stylesheet" />
|
||||
<div id="body" class="help-page">
|
||||
<section class="featured">
|
||||
<div class="content-wrapper">
|
||||
<p>
|
||||
@Html.ActionLink("Help Page Home", "Index")
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
<section class="content-wrapper main-content clear-fix">
|
||||
@Html.DisplayForModel()
|
||||
</section>
|
||||
</div>
|
||||
@@ -1,41 +0,0 @@
|
||||
@using System.Web.Http
|
||||
@using System.Web.Http.Controllers
|
||||
@using System.Web.Http.Description
|
||||
@using MP_API.Areas.HelpPage
|
||||
@using MP_API.Areas.HelpPage.Models
|
||||
@model IGrouping<HttpControllerDescriptor, ApiDescription>
|
||||
|
||||
@{
|
||||
var controllerDocumentation = ViewBag.DocumentationProvider != null ?
|
||||
ViewBag.DocumentationProvider.GetDocumentation(Model.Key) :
|
||||
null;
|
||||
}
|
||||
|
||||
<h2 id="@Model.Key.ControllerName">@Model.Key.ControllerName</h2>
|
||||
@if (!String.IsNullOrEmpty(controllerDocumentation))
|
||||
{
|
||||
<p>@controllerDocumentation</p>
|
||||
}
|
||||
<table class="help-page-table">
|
||||
<thead>
|
||||
<tr><th>API</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var api in Model)
|
||||
{
|
||||
<tr>
|
||||
<td class="api-name"><a href="@Url.Action("Api", "Help", new { apiId = api.GetFriendlyId() })">@api.HttpMethod.Method @api.RelativePath</a></td>
|
||||
<td class="api-documentation">
|
||||
@if (api.Documentation != null)
|
||||
{
|
||||
<p>@api.Documentation</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<p>No documentation available.</p>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -1,6 +0,0 @@
|
||||
@using MP_API.Areas.HelpPage.ModelDescriptions
|
||||
@model CollectionModelDescription
|
||||
@if (Model.ElementDescription is ComplexTypeModelDescription)
|
||||
{
|
||||
@Html.DisplayFor(m => m.ElementDescription)
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
@using MP_API.Areas.HelpPage.ModelDescriptions
|
||||
@model ComplexTypeModelDescription
|
||||
@Html.DisplayFor(m => m.Properties, "Parameters")
|
||||
@@ -1,4 +0,0 @@
|
||||
@using MP_API.Areas.HelpPage.ModelDescriptions
|
||||
@model DictionaryModelDescription
|
||||
Dictionary of @Html.DisplayFor(m => Model.KeyModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.KeyModelDescription }) [key]
|
||||
and @Html.DisplayFor(m => Model.ValueModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.ValueModelDescription }) [value]
|
||||
@@ -1,24 +0,0 @@
|
||||
@using MP_API.Areas.HelpPage.ModelDescriptions
|
||||
@model EnumTypeModelDescription
|
||||
|
||||
<p>Possible enumeration values:</p>
|
||||
|
||||
<table class="help-page-table">
|
||||
<thead>
|
||||
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (EnumValueDescription value in Model.Values)
|
||||
{
|
||||
<tr>
|
||||
<td class="enum-name"><b>@value.Name</b></td>
|
||||
<td class="enum-value">
|
||||
<p>@value.Value</p>
|
||||
</td>
|
||||
<td class="enum-description">
|
||||
<p>@value.Documentation</p>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -1,67 +0,0 @@
|
||||
@using System.Web.Http
|
||||
@using System.Web.Http.Description
|
||||
@using MP_API.Areas.HelpPage.Models
|
||||
@using MP_API.Areas.HelpPage.ModelDescriptions
|
||||
@model HelpPageApiModel
|
||||
|
||||
@{
|
||||
ApiDescription description = Model.ApiDescription;
|
||||
}
|
||||
<h1>@description.HttpMethod.Method @description.RelativePath</h1>
|
||||
<div>
|
||||
<p>@description.Documentation</p>
|
||||
|
||||
<h2>Request Information</h2>
|
||||
|
||||
<h3>URI Parameters</h3>
|
||||
@Html.DisplayFor(m => m.UriParameters, "Parameters")
|
||||
|
||||
<h3>Body Parameters</h3>
|
||||
|
||||
<p>@Model.RequestDocumentation</p>
|
||||
|
||||
@if (Model.RequestModelDescription != null)
|
||||
{
|
||||
@Html.DisplayFor(m => m.RequestModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.RequestModelDescription })
|
||||
if (Model.RequestBodyParameters != null)
|
||||
{
|
||||
@Html.DisplayFor(m => m.RequestBodyParameters, "Parameters")
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<p>None.</p>
|
||||
}
|
||||
|
||||
@if (Model.SampleRequests.Count > 0)
|
||||
{
|
||||
<h3>Request Formats</h3>
|
||||
@Html.DisplayFor(m => m.SampleRequests, "Samples")
|
||||
}
|
||||
|
||||
<h2>Response Information</h2>
|
||||
|
||||
<h3>Resource Description</h3>
|
||||
|
||||
<p>@description.ResponseDescription.Documentation</p>
|
||||
|
||||
@if (Model.ResourceDescription != null)
|
||||
{
|
||||
@Html.DisplayFor(m => m.ResourceDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.ResourceDescription })
|
||||
if (Model.ResourceProperties != null)
|
||||
{
|
||||
@Html.DisplayFor(m => m.ResourceProperties, "Parameters")
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<p>None.</p>
|
||||
}
|
||||
|
||||
@if (Model.SampleResponses.Count > 0)
|
||||
{
|
||||
<h3>Response Formats</h3>
|
||||
@Html.DisplayFor(m => m.SampleResponses, "Samples")
|
||||
}
|
||||
|
||||
</div>
|
||||
@@ -1,4 +0,0 @@
|
||||
@using MP_API.Areas.HelpPage
|
||||
@model ImageSample
|
||||
|
||||
<img src="@Model.Src" />
|
||||
@@ -1,13 +0,0 @@
|
||||
@using MP_API.Areas.HelpPage
|
||||
@model InvalidSample
|
||||
|
||||
@if (HttpContext.Current.IsDebuggingEnabled)
|
||||
{
|
||||
<div class="warning-message-container">
|
||||
<p>@Model.ErrorMessage</p>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<p>Sample not available.</p>
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
@using MP_API.Areas.HelpPage.ModelDescriptions
|
||||
@model KeyValuePairModelDescription
|
||||
Pair of @Html.DisplayFor(m => Model.KeyModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.KeyModelDescription }) [key]
|
||||
and @Html.DisplayFor(m => Model.ValueModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.ValueModelDescription }) [value]
|
||||
@@ -1,26 +0,0 @@
|
||||
@using MP_API.Areas.HelpPage.ModelDescriptions
|
||||
@model Type
|
||||
@{
|
||||
ModelDescription modelDescription = ViewBag.modelDescription;
|
||||
if (modelDescription is ComplexTypeModelDescription || modelDescription is EnumTypeModelDescription)
|
||||
{
|
||||
if (Model == typeof(Object))
|
||||
{
|
||||
@:Object
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.ActionLink(modelDescription.Name, "ResourceModel", "Help", new { modelName = modelDescription.Name }, null)
|
||||
}
|
||||
}
|
||||
else if (modelDescription is CollectionModelDescription)
|
||||
{
|
||||
var collectionDescription = modelDescription as CollectionModelDescription;
|
||||
var elementDescription = collectionDescription.ElementDescription;
|
||||
@:Collection of @Html.DisplayFor(m => elementDescription.ModelType, "ModelDescriptionLink", new { modelDescription = elementDescription })
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.DisplayFor(m => modelDescription)
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
@using System.Collections.Generic
|
||||
@using System.Collections.ObjectModel
|
||||
@using System.Web.Http.Description
|
||||
@using System.Threading
|
||||
@using MP_API.Areas.HelpPage.ModelDescriptions
|
||||
@model IList<ParameterDescription>
|
||||
|
||||
@if (Model.Count > 0)
|
||||
{
|
||||
<table class="help-page-table">
|
||||
<thead>
|
||||
<tr><th>Name</th><th>Description</th><th>Type</th><th>Additional information</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (ParameterDescription parameter in Model)
|
||||
{
|
||||
ModelDescription modelDescription = parameter.TypeDescription;
|
||||
<tr>
|
||||
<td class="parameter-name">@parameter.Name</td>
|
||||
<td class="parameter-documentation">
|
||||
<p>@parameter.Documentation</p>
|
||||
</td>
|
||||
<td class="parameter-type">
|
||||
@Html.DisplayFor(m => modelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = modelDescription })
|
||||
</td>
|
||||
<td class="parameter-annotations">
|
||||
@if (parameter.Annotations.Count > 0)
|
||||
{
|
||||
foreach (var annotation in parameter.Annotations)
|
||||
{
|
||||
<p>@annotation.Documentation</p>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<p>None.</p>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<p>None.</p>
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
@using System.Net.Http.Headers
|
||||
@model Dictionary<MediaTypeHeaderValue, object>
|
||||
|
||||
@{
|
||||
// Group the samples into a single tab if they are the same.
|
||||
Dictionary<string, object> samples = Model.GroupBy(pair => pair.Value).ToDictionary(
|
||||
pair => String.Join(", ", pair.Select(m => m.Key.ToString()).ToArray()),
|
||||
pair => pair.Key);
|
||||
var mediaTypes = samples.Keys;
|
||||
}
|
||||
<div>
|
||||
@foreach (var mediaType in mediaTypes)
|
||||
{
|
||||
<h4 class="sample-header">@mediaType</h4>
|
||||
<div class="sample-content">
|
||||
<span><b>Sample:</b></span>
|
||||
@{
|
||||
var sample = samples[mediaType];
|
||||
if (sample == null)
|
||||
{
|
||||
<p>Sample not available.</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.DisplayFor(s => sample);
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -1,3 +0,0 @@
|
||||
@using MP_API.Areas.HelpPage.ModelDescriptions
|
||||
@model SimpleTypeModelDescription
|
||||
@Model.Documentation
|
||||
@@ -1,6 +0,0 @@
|
||||
@using MP_API.Areas.HelpPage
|
||||
@model TextSample
|
||||
|
||||
<pre class="wrapped">
|
||||
@Model.Text
|
||||
</pre>
|
||||
@@ -1,46 +0,0 @@
|
||||
@using System.Web.Http
|
||||
@using System.Web.Http.Controllers
|
||||
@using System.Web.Http.Description
|
||||
@using System.Collections.ObjectModel
|
||||
@using MP_API.Areas.HelpPage.Models
|
||||
@model Collection<ApiDescription>
|
||||
|
||||
@{
|
||||
ViewBag.Title = "ASP.NET Web API Help Page";
|
||||
|
||||
// Group APIs by controller
|
||||
ILookup<HttpControllerDescriptor, ApiDescription> apiGroups = Model.ToLookup(api => api.ActionDescriptor.ControllerDescriptor);
|
||||
}
|
||||
|
||||
<link type="text/css" href="~/Areas/HelpPage/HelpPage.css" rel="stylesheet" />
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<header class="help-page">
|
||||
<div class="content-wrapper">
|
||||
<div class="float-left">
|
||||
<h1>@ViewBag.Title</h1>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div id="body" class="help-page">
|
||||
<section class="featured">
|
||||
<div class="content-wrapper">
|
||||
<h2>MP-MAG</h2>
|
||||
<p>
|
||||
Qui di seguito sono riprotate le classi REST definite nel progetto
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
<section class="content-wrapper main-content clear-fix">
|
||||
@foreach (var group in apiGroups)
|
||||
{
|
||||
@Html.DisplayFor(m => group, "ApiGroup")
|
||||
}
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,19 +0,0 @@
|
||||
@using System.Web.Http
|
||||
@using MP_API.Areas.HelpPage.ModelDescriptions
|
||||
@model ModelDescription
|
||||
|
||||
<link type="text/css" href="~/Areas/HelpPage/HelpPage.css" rel="stylesheet" />
|
||||
<div id="body" class="help-page">
|
||||
<section class="featured">
|
||||
<div class="content-wrapper">
|
||||
<p>
|
||||
@Html.ActionLink("Help Page Home", "Index")
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
<h1>@Model.Name</h1>
|
||||
<p>@Model.Documentation</p>
|
||||
<section class="content-wrapper main-content clear-fix">
|
||||
@Html.DisplayFor(m => Model)
|
||||
</section>
|
||||
</div>
|
||||
@@ -1,12 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<title>@ViewBag.Title</title>
|
||||
@RenderSection("scripts", required: false)
|
||||
</head>
|
||||
<body>
|
||||
@RenderBody()
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,41 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<pages pageBaseType="System.Web.Mvc.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc" />
|
||||
<add namespace="System.Web.Mvc.Ajax" />
|
||||
<add namespace="System.Web.Mvc.Html" />
|
||||
<add namespace="System.Web.Routing" />
|
||||
</namespaces>
|
||||
</pages>
|
||||
</system.web.webPages.razor>
|
||||
|
||||
<appSettings>
|
||||
<add key="webpages:Enabled" value="false" />
|
||||
</appSettings>
|
||||
|
||||
<system.web>
|
||||
<compilation debug="true">
|
||||
<assemblies>
|
||||
<add assembly="System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
</assemblies>
|
||||
</compilation>
|
||||
</system.web>
|
||||
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<remove name="BlockViewHandler"/>
|
||||
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
@@ -1,4 +0,0 @@
|
||||
@{
|
||||
// Change the Layout path below to blend the look and feel of the help page with your existing web pages
|
||||
Layout = "~/Views/Shared/_Layout.cshtml";
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.Description;
|
||||
using System.Xml.XPath;
|
||||
using MP_API.Areas.HelpPage.ModelDescriptions;
|
||||
|
||||
namespace MP_API.Areas.HelpPage
|
||||
{
|
||||
/// <summary>
|
||||
/// A custom <see cref="IDocumentationProvider"/> that reads the API documentation from an XML documentation file.
|
||||
/// </summary>
|
||||
public class XmlDocumentationProvider : IDocumentationProvider, IModelDocumentationProvider
|
||||
{
|
||||
private XPathNavigator _documentNavigator;
|
||||
private const string TypeExpression = "/doc/members/member[@name='T:{0}']";
|
||||
private const string MethodExpression = "/doc/members/member[@name='M:{0}']";
|
||||
private const string PropertyExpression = "/doc/members/member[@name='P:{0}']";
|
||||
private const string FieldExpression = "/doc/members/member[@name='F:{0}']";
|
||||
private const string ParameterExpression = "param[@name='{0}']";
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="XmlDocumentationProvider"/> class.
|
||||
/// </summary>
|
||||
/// <param name="documentPath">The physical path to XML document.</param>
|
||||
public XmlDocumentationProvider(string documentPath)
|
||||
{
|
||||
if (documentPath == null)
|
||||
{
|
||||
throw new ArgumentNullException("documentPath");
|
||||
}
|
||||
XPathDocument xpath = new XPathDocument(documentPath);
|
||||
_documentNavigator = xpath.CreateNavigator();
|
||||
}
|
||||
|
||||
public string GetDocumentation(HttpControllerDescriptor controllerDescriptor)
|
||||
{
|
||||
XPathNavigator typeNode = GetTypeNode(controllerDescriptor.ControllerType);
|
||||
return GetTagValue(typeNode, "summary");
|
||||
}
|
||||
|
||||
public virtual string GetDocumentation(HttpActionDescriptor actionDescriptor)
|
||||
{
|
||||
XPathNavigator methodNode = GetMethodNode(actionDescriptor);
|
||||
return GetTagValue(methodNode, "summary");
|
||||
}
|
||||
|
||||
public virtual string GetDocumentation(HttpParameterDescriptor parameterDescriptor)
|
||||
{
|
||||
ReflectedHttpParameterDescriptor reflectedParameterDescriptor = parameterDescriptor as ReflectedHttpParameterDescriptor;
|
||||
if (reflectedParameterDescriptor != null)
|
||||
{
|
||||
XPathNavigator methodNode = GetMethodNode(reflectedParameterDescriptor.ActionDescriptor);
|
||||
if (methodNode != null)
|
||||
{
|
||||
string parameterName = reflectedParameterDescriptor.ParameterInfo.Name;
|
||||
XPathNavigator parameterNode = methodNode.SelectSingleNode(String.Format(CultureInfo.InvariantCulture, ParameterExpression, parameterName));
|
||||
if (parameterNode != null)
|
||||
{
|
||||
return parameterNode.Value.Trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public string GetResponseDocumentation(HttpActionDescriptor actionDescriptor)
|
||||
{
|
||||
XPathNavigator methodNode = GetMethodNode(actionDescriptor);
|
||||
return GetTagValue(methodNode, "returns");
|
||||
}
|
||||
|
||||
public string GetDocumentation(MemberInfo member)
|
||||
{
|
||||
string memberName = String.Format(CultureInfo.InvariantCulture, "{0}.{1}", GetTypeName(member.DeclaringType), member.Name);
|
||||
string expression = member.MemberType == MemberTypes.Field ? FieldExpression : PropertyExpression;
|
||||
string selectExpression = String.Format(CultureInfo.InvariantCulture, expression, memberName);
|
||||
XPathNavigator propertyNode = _documentNavigator.SelectSingleNode(selectExpression);
|
||||
return GetTagValue(propertyNode, "summary");
|
||||
}
|
||||
|
||||
public string GetDocumentation(Type type)
|
||||
{
|
||||
XPathNavigator typeNode = GetTypeNode(type);
|
||||
return GetTagValue(typeNode, "summary");
|
||||
}
|
||||
|
||||
private XPathNavigator GetMethodNode(HttpActionDescriptor actionDescriptor)
|
||||
{
|
||||
ReflectedHttpActionDescriptor reflectedActionDescriptor = actionDescriptor as ReflectedHttpActionDescriptor;
|
||||
if (reflectedActionDescriptor != null)
|
||||
{
|
||||
string selectExpression = String.Format(CultureInfo.InvariantCulture, MethodExpression, GetMemberName(reflectedActionDescriptor.MethodInfo));
|
||||
return _documentNavigator.SelectSingleNode(selectExpression);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static string GetMemberName(MethodInfo method)
|
||||
{
|
||||
string name = String.Format(CultureInfo.InvariantCulture, "{0}.{1}", GetTypeName(method.DeclaringType), method.Name);
|
||||
ParameterInfo[] parameters = method.GetParameters();
|
||||
if (parameters.Length != 0)
|
||||
{
|
||||
string[] parameterTypeNames = parameters.Select(param => GetTypeName(param.ParameterType)).ToArray();
|
||||
name += String.Format(CultureInfo.InvariantCulture, "({0})", String.Join(",", parameterTypeNames));
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
private static string GetTagValue(XPathNavigator parentNode, string tagName)
|
||||
{
|
||||
if (parentNode != null)
|
||||
{
|
||||
XPathNavigator node = parentNode.SelectSingleNode(tagName);
|
||||
if (node != null)
|
||||
{
|
||||
return node.Value.Trim();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private XPathNavigator GetTypeNode(Type type)
|
||||
{
|
||||
string controllerTypeName = GetTypeName(type);
|
||||
string selectExpression = String.Format(CultureInfo.InvariantCulture, TypeExpression, controllerTypeName);
|
||||
return _documentNavigator.SelectSingleNode(selectExpression);
|
||||
}
|
||||
|
||||
private static string GetTypeName(Type type)
|
||||
{
|
||||
string name = type.FullName;
|
||||
if (type.IsGenericType)
|
||||
{
|
||||
// Format the generic type name to something like: Generic{System.Int32,System.String}
|
||||
Type genericType = type.GetGenericTypeDefinition();
|
||||
Type[] genericArguments = type.GetGenericArguments();
|
||||
string genericTypeName = genericType.FullName;
|
||||
|
||||
// Trim the generic parameter counts from the name
|
||||
genericTypeName = genericTypeName.Substring(0, genericTypeName.IndexOf('`'));
|
||||
string[] argumentTypeNames = genericArguments.Select(t => GetTypeName(t)).ToArray();
|
||||
name = String.Format(CultureInfo.InvariantCulture, "{0}{{{1}}}", genericTypeName, String.Join(",", argumentTypeNames));
|
||||
}
|
||||
if (type.IsNested)
|
||||
{
|
||||
// Changing the nested type name from OuterType+InnerType to OuterType.InnerType to match the XML documentation syntax.
|
||||
name = name.Replace("+", ".");
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
body {
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
|
||||
/* Set padding to keep content from hitting the edges */
|
||||
.body-content {
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
/* Set width on the form input elements since they're 100% wide by default */
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
max-width: 280px;
|
||||
}
|
||||
Vendored
-3899
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user