Compare commits
259 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 52c1fa654e | |||
| 43ebd3db5b | |||
| 3aab1d8d8c | |||
| 96e78e1c72 | |||
| 7cc1eb1561 | |||
| 29c0ea3537 | |||
| 76d7ef8c25 | |||
| 130b71aaf7 | |||
| 33c55dfc62 | |||
| 080a9cfbf2 | |||
| 8f1b068850 | |||
| f1624982c6 | |||
| 4449a73137 | |||
| a7e5206f45 | |||
| dbeef11a90 | |||
| b9dc343dc8 | |||
| cfabbc6eff | |||
| 43b89de822 | |||
| 912c3370fc | |||
| 5f7ddbfb1e | |||
| 9e7f25dba0 | |||
| 54f5e599b5 | |||
| 7e296f37b0 | |||
| 2bddb280ee | |||
| 942fb1de9a | |||
| e854d97b74 | |||
| f12b98a3c3 | |||
| 14a4fe5841 | |||
| 8293b71c5e | |||
| b8aa5ceea2 | |||
| 768897e507 | |||
| 35feb72c76 | |||
| ab55298847 | |||
| e7467b19d0 | |||
| cd6e98a59c | |||
| 92d465fd77 | |||
| a6ce521f47 | |||
| 386b253115 | |||
| 3ba550c124 | |||
| 7e442efc5f | |||
| 85763bc747 | |||
| f62ad2b019 | |||
| dcee1f0438 | |||
| 3192bdf419 | |||
| 8899b245d6 | |||
| 13cfef1437 | |||
| 9d66e95ca9 | |||
| 9d3d5ef273 | |||
| 8ed0c450ed | |||
| e07c961508 | |||
| 3282db3824 | |||
| d2647c142e | |||
| ad490d0e91 | |||
| 0b14efd595 | |||
| 6c498e1857 | |||
| cf047a84fb | |||
| f21b0b8a17 | |||
| f544ea0eae | |||
| d2045f8c0d | |||
| dc4b79f1c3 | |||
| 38f9c80d93 | |||
| e551461f49 | |||
| c6c721240d | |||
| 95bdf3b5e7 | |||
| 63dd00e512 | |||
| f4a55298f7 | |||
| c6d75c4418 | |||
| afd5d7e4f7 | |||
| 96dd57eba6 | |||
| 0332d47e56 | |||
| f5f0b268d8 | |||
| 088bae8052 | |||
| 5942c8dc04 | |||
| 9a57d0df03 | |||
| 67a2701b16 | |||
| 894372b8be | |||
| 62e71947ef | |||
| b2671c97c5 | |||
| 0296830d3b | |||
| 7d2d0db7d3 | |||
| 93a50e226c | |||
| 2af9d633f0 | |||
| 0f67fcdef4 | |||
| dce37f0be5 | |||
| f30c2aac3b | |||
| 3d87675d77 | |||
| 7abd9feb72 | |||
| d514bfe40c | |||
| 38c0cc3fee | |||
| e28d32fbad | |||
| 1c5359eb7d | |||
| 89dce20add | |||
| 6ea61efc76 | |||
| 17cf56ada2 | |||
| 1ec81f1359 | |||
| a78d146550 | |||
| 8b5d024feb | |||
| 0c7018b2d3 | |||
| 9a85978461 | |||
| a2544d7334 | |||
| f49c92d96c | |||
| afd264a5ca | |||
| a31bb77889 | |||
| 1bd2939e84 | |||
| cae404e4f1 | |||
| 8b02512c63 | |||
| 97c69c79db | |||
| 687e38d88c | |||
| 8dc2b6d1ce | |||
| c74919a59b | |||
| 54cf4d11e9 | |||
| 8cae935899 | |||
| 76deea81c4 | |||
| 91754b4df7 | |||
| c74e5e3b39 | |||
| 2d0ace0def | |||
| acd4592345 | |||
| ee2c21b3b9 | |||
| 71925e3ea1 | |||
| 55e6dd62a6 | |||
| 79588172a7 | |||
| 33925d68b3 | |||
| bf2644768e | |||
| 44a9430d0d | |||
| f817daded5 | |||
| ab9346af02 | |||
| 864d929ea6 | |||
| 0ed6719508 | |||
| a269ad0fda | |||
| dbbfef35a9 | |||
| 4132212605 | |||
| a26b93f8a9 | |||
| 7efd7c353a | |||
| 98cc52e84f | |||
| 65db8b285c | |||
| e69f6f37d4 | |||
| 8a49d500a4 | |||
| 3991db50c4 | |||
| 9714631b68 | |||
| fdd4bfec6e | |||
| a8900568f6 | |||
| 6aefdb8b84 | |||
| 10e2f5a341 | |||
| e338412abb | |||
| ef08937e05 | |||
| 37ca0b1ae2 | |||
| bcc7af3acd | |||
| 71f5cf1ec6 | |||
| eaab42ee14 | |||
| b3a9cbbfd8 | |||
| 417d857547 | |||
| 56ad2003ac | |||
| 51bbdb6d24 | |||
| 194fd34c34 | |||
| 3ec507a967 | |||
| fcfc9f0da2 | |||
| e1de69babd | |||
| 51fb7ad34e | |||
| ad775341ad | |||
| 5df2e5e314 | |||
| 410b2155da | |||
| ebb16b6136 | |||
| fef8aaaa2f | |||
| 9fac681033 | |||
| 19732e091b | |||
| 739205f972 | |||
| 06da8c6b48 | |||
| 672ec76955 | |||
| 12dc64eb15 | |||
| 356c6b6f85 | |||
| 8e0aa7ba0c | |||
| 6047080f37 | |||
| 5d2daaf7cd | |||
| a6b10d57b7 | |||
| 68a6a3ff1b | |||
| 2109fbd65e | |||
| 01c00226bd | |||
| f1578bfe4b | |||
| d245421d52 | |||
| aab825d4fc | |||
| 3b33c1a34d | |||
| 1f2e7ce0f6 | |||
| 692c9e707b | |||
| 6d920a2453 | |||
| 67e8b2af54 | |||
| 803670f5e8 | |||
| 35272d7460 | |||
| 6f91af6546 | |||
| 8dceab40f3 | |||
| 84f76348ad | |||
| b445a17280 | |||
| 9d957975d0 | |||
| f85cc1bd33 | |||
| 89d75a36cf | |||
| d8d16a7972 | |||
| dd67130eb5 | |||
| f66fe0cb1c | |||
| 3dbc5dfb38 | |||
| 28a1a3d828 | |||
| 155da598fa | |||
| cff9bbc5c7 | |||
| e06614fd60 | |||
| 734d155d3d | |||
| 3b9bc051dd | |||
| 8df4e74a56 | |||
| beb025984e | |||
| 10d7ef179a | |||
| ec13ba8257 | |||
| f896f59bcc | |||
| 43de071280 | |||
| 2bab549ab7 | |||
| 988e91630b | |||
| 940ddae3e0 | |||
| be241f04d2 | |||
| 3873d468e7 | |||
| 318bb6d3d9 | |||
| 62d692dc32 | |||
| 228994e1e9 | |||
| 1de156f0a3 | |||
| d97fda4a83 | |||
| 9270fed036 | |||
| 4a477df49d | |||
| dc52e06160 | |||
| 1b0162ea53 | |||
| 1cde6e7e58 | |||
| 45ad346924 | |||
| 5c7b5c677d | |||
| a9f526af15 | |||
| 467010dc13 | |||
| ba13697dda | |||
| 6a51eae198 | |||
| f18f13dac4 | |||
| 825412e81a | |||
| 464c22f743 | |||
| 91524932f4 | |||
| a464c989c3 | |||
| 559206cd70 | |||
| 819928805f | |||
| 24300e8805 | |||
| 5896862614 | |||
| 70078533d2 | |||
| 07b7ad6ee3 | |||
| fc1ce2ce53 | |||
| c32715a4b5 | |||
| a83752e565 | |||
| ec2ce96b3b | |||
| d131e0b42d | |||
| efea14db89 | |||
| c09d8a6b0f | |||
| 946ad1d29c | |||
| c5f1d1669f | |||
| 689e81219b | |||
| 05ec565f84 | |||
| 0e7866922d | |||
| fb92f9faea | |||
| f65d07ab22 | |||
| f140b6df54 | |||
| 441ddc4397 | |||
| 8c42493382 |
@@ -178,6 +178,16 @@ Public Class BTLPartM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Public m_MaterialM As MaterialM
|
||||||
|
Public Property MaterialM As MaterialM
|
||||||
|
Get
|
||||||
|
Return m_MaterialM
|
||||||
|
End Get
|
||||||
|
Set(value As MaterialM)
|
||||||
|
m_MaterialM = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
Public m_sTIMBERGRADE As String
|
Public m_sTIMBERGRADE As String
|
||||||
Public Property sTIMBERGRADE As String
|
Public Property sTIMBERGRADE As String
|
||||||
Get
|
Get
|
||||||
@@ -922,6 +932,7 @@ Public Class BTLPartM
|
|||||||
NewBTLPart.m_nINVERTED = 0
|
NewBTLPart.m_nINVERTED = 0
|
||||||
End If
|
End If
|
||||||
EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewBTLPart.m_sMATERIAL)
|
EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewBTLPart.m_sMATERIAL)
|
||||||
|
' EgtGetInfo(nPartId, BTL_PRT_WAREHOUSEMATERIAL, NewBTLPart.m_sWAREHOUSEMATERIAL)
|
||||||
If Not EgtGetInfo(nPartId, LOCK_ROT, NewBTLPart.m_bLockRotation) Then
|
If Not EgtGetInfo(nPartId, LOCK_ROT, NewBTLPart.m_bLockRotation) Then
|
||||||
NewBTLPart.m_bLockRotation = False
|
NewBTLPart.m_bLockRotation = False
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -302,6 +302,7 @@
|
|||||||
Public Const BTLFILENAME As String = "BTLFILENAME"
|
Public Const BTLFILENAME As String = "BTLFILENAME"
|
||||||
Public Const EXP_PART As String = "ImportExport"
|
Public Const EXP_PART As String = "ImportExport"
|
||||||
Public Const EXP_MACHINE As String = "Machine"
|
Public Const EXP_MACHINE As String = "Machine"
|
||||||
|
Public Const EXP_CLOUDID As String = "CloudId"
|
||||||
' parametro che indica se il progetto e' stato appena importato e quindi bisogna riverificare i MachGroup
|
' parametro che indica se il progetto e' stato appena importato e quindi bisogna riverificare i MachGroup
|
||||||
Public Const IMP_VERIFYMACHGROUP As String = "VerifyMachGroup"
|
Public Const IMP_VERIFYMACHGROUP As String = "VerifyMachGroup"
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,10 @@
|
|||||||
Public Const COL_NAME As String = "colNAME"
|
Public Const COL_NAME As String = "colNAME"
|
||||||
Public Const COL_H As String = "colH"
|
Public Const COL_H As String = "colH"
|
||||||
Public Const COL_MATERIAL As String = "colMATERIAL"
|
Public Const COL_MATERIAL As String = "colMATERIAL"
|
||||||
|
Public Const COL_WAREHOUSEMATERIAL As String = "colWAREHOUSEMATERIAL"
|
||||||
Public Const COL_USAGE As String = "colUSAGE"
|
Public Const COL_USAGE As String = "colUSAGE"
|
||||||
Public Const COL_WASTE As String = "colWASTE"
|
Public Const COL_WASTE As String = "colWASTE"
|
||||||
Public Const COL_ARCHIVED As String = "colARCHIVED"
|
Public Const COL_ARCHIVED As String = "colARCHIVED"
|
||||||
|
Public Const COL_USEQTY As String = "colUSEQTY"
|
||||||
|
|
||||||
End Module
|
End Module
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ Public Module ConstIni
|
|||||||
Public Const K_FASTPRODUCE As String = "FastProduce"
|
Public Const K_FASTPRODUCE As String = "FastProduce"
|
||||||
Public Const K_ADDPROJ As String = "AddProj"
|
Public Const K_ADDPROJ As String = "AddProj"
|
||||||
Public Const K_PROJECTMODE As String = "ProjectMode"
|
Public Const K_PROJECTMODE As String = "ProjectMode"
|
||||||
|
Public Const K_NETWAREHOUSE As String = "NetWarehouse"
|
||||||
|
|
||||||
'Public Const S_LANGUAGES As String = "Languages"
|
'Public Const S_LANGUAGES As String = "Languages"
|
||||||
'Public Const K_LANGUAGE As String = "Language"
|
'Public Const K_LANGUAGE As String = "Language"
|
||||||
@@ -162,6 +163,12 @@ Public Module ConstIni
|
|||||||
Public Const S_WAREHOUSE As String = "Warehouse"
|
Public Const S_WAREHOUSE As String = "Warehouse"
|
||||||
Public Const K_TYPE As String = "Type"
|
Public Const K_TYPE As String = "Type"
|
||||||
Public Const K_DEFAULTQUANTITY As String = "DefaultQuantity"
|
Public Const K_DEFAULTQUANTITY As String = "DefaultQuantity"
|
||||||
|
Public Const K_LASTSYNCHRONIZATION As String = "LastSynchronization"
|
||||||
|
Public Const K_USENETWAREHOUSE As String = "UseNetWarehouse"
|
||||||
|
Public Const K_SHOWWAREHOUSEMATERIAL As String = "ShowWarehouseMaterial"
|
||||||
|
Public Const K_NETADDRESS As String = "NetAddress"
|
||||||
|
Public Const K_AUTHTOKEN As String = "AuthToken"
|
||||||
|
Public Const K_SENDESTIMONSAVE As String = "SendEstimOnSave"
|
||||||
|
|
||||||
Public Const S_BACKUPANDRESTORE As String = "Backup&Restore"
|
Public Const S_BACKUPANDRESTORE As String = "Backup&Restore"
|
||||||
Public Const K_EXTERNALBACKUPACTIVE As String = "ExternalBackupActive"
|
Public Const K_EXTERNALBACKUPACTIVE As String = "ExternalBackupActive"
|
||||||
|
|||||||
@@ -116,6 +116,7 @@
|
|||||||
<DependentUpon>NewOpenProjectFileDialogV.xaml</DependentUpon>
|
<DependentUpon>NewOpenProjectFileDialogV.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="NewOpenProjectFileDialog\NewOpenProjectFileDialogVM.vb" />
|
<Compile Include="NewOpenProjectFileDialog\NewOpenProjectFileDialogVM.vb" />
|
||||||
|
<Compile Include="ProjectFileVM\ProdItem.vb" />
|
||||||
<Compile Include="Utility\DimensionsIniFile.vb" />
|
<Compile Include="Utility\DimensionsIniFile.vb" />
|
||||||
<Compile Include="Utility\Enum.vb" />
|
<Compile Include="Utility\Enum.vb" />
|
||||||
<Compile Include="MachGroupPanel\MyMachGroupPanelVM.vb" />
|
<Compile Include="MachGroupPanel\MyMachGroupPanelVM.vb" />
|
||||||
@@ -145,6 +146,7 @@
|
|||||||
<Compile Include="Lib\MachGroupPanelM.vb" />
|
<Compile Include="Lib\MachGroupPanelM.vb" />
|
||||||
<Compile Include="MachGroupModel\MyMachGroupPanelM.vb" />
|
<Compile Include="MachGroupModel\MyMachGroupPanelM.vb" />
|
||||||
<Compile Include="Utility\ManageWindow.vb" />
|
<Compile Include="Utility\ManageWindow.vb" />
|
||||||
|
<Compile Include="Utility\RawPart.vb" />
|
||||||
<Compile Include="Utility\MyMachine.vb" />
|
<Compile Include="Utility\MyMachine.vb" />
|
||||||
<Compile Include="OpenProjectFileDialog\OpenProjectFileDialogV.xaml.vb">
|
<Compile Include="OpenProjectFileDialog\OpenProjectFileDialogV.xaml.vb">
|
||||||
<DependentUpon>OpenProjectFileDialogV.xaml</DependentUpon>
|
<DependentUpon>OpenProjectFileDialogV.xaml</DependentUpon>
|
||||||
@@ -157,6 +159,7 @@
|
|||||||
<Compile Include="ProjectManager\ProjectFileVM.vb" />
|
<Compile Include="ProjectManager\ProjectFileVM.vb" />
|
||||||
<Compile Include="ProjectManager\ProjFileVM.vb" />
|
<Compile Include="ProjectManager\ProjFileVM.vb" />
|
||||||
<Compile Include="ProjectFileVM\ProjFileM.vb" />
|
<Compile Include="ProjectFileVM\ProjFileM.vb" />
|
||||||
|
<Compile Include="Utility\Material.vb" />
|
||||||
<Compile Include="Utility\SectionXMaterial.vb" />
|
<Compile Include="Utility\SectionXMaterial.vb" />
|
||||||
<Compile Include="Utility\BTLIniFile.vb" />
|
<Compile Include="Utility\BTLIniFile.vb" />
|
||||||
<Compile Include="Utility\CoreMap.vb" />
|
<Compile Include="Utility\CoreMap.vb" />
|
||||||
|
|||||||
@@ -370,6 +370,7 @@ Public Class EgtDataGrid
|
|||||||
End Class
|
End Class
|
||||||
|
|
||||||
Public Class EgtDataGridColumn
|
Public Class EgtDataGridColumn
|
||||||
|
Inherits VMBase
|
||||||
|
|
||||||
Private m_dgColumn As DataGridColumn
|
Private m_dgColumn As DataGridColumn
|
||||||
|
|
||||||
@@ -507,7 +508,7 @@ Public Class EgtDataGridColumn
|
|||||||
Private m_ColumnVisibility As Visibility
|
Private m_ColumnVisibility As Visibility
|
||||||
Public Property ColumnVisibility As Visibility
|
Public Property ColumnVisibility As Visibility
|
||||||
Get
|
Get
|
||||||
Return If(m_Visible, Visibility.Visible, Visibility.Collapsed)
|
Return If(m_ColumnVisibility, Visibility.Visible, Visibility.Collapsed)
|
||||||
End Get
|
End Get
|
||||||
Set(value As Visibility)
|
Set(value As Visibility)
|
||||||
m_ColumnVisibility = value
|
m_ColumnVisibility = value
|
||||||
@@ -527,6 +528,9 @@ Public Class EgtDataGridColumn
|
|||||||
End If
|
End If
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
Public Sub SetColumnVisibility(value As Visibility)
|
||||||
|
ColumnVisibility = value
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private m_CanUserEditVisible As Boolean
|
Private m_CanUserEditVisible As Boolean
|
||||||
Public Property CanUserEditVisible As Boolean
|
Public Property CanUserEditVisible As Boolean
|
||||||
|
|||||||
@@ -113,6 +113,26 @@ Public Class MyMachGroupM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Protected m_sWAREHOUSEMATERIAL As String
|
||||||
|
Public Property sWAREHOUSEMATERIAL As String
|
||||||
|
Get
|
||||||
|
Return m_sWAREHOUSEMATERIAL
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
m_sWAREHOUSEMATERIAL = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Protected m_RawPartM As RawPartM
|
||||||
|
Public Property RawPartM As RawPartM
|
||||||
|
Get
|
||||||
|
Return m_RawPartM
|
||||||
|
End Get
|
||||||
|
Set(value As RawPartM)
|
||||||
|
m_RawPartM = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
' lista dei pezzi che sono nel grezzo
|
' lista dei pezzi che sono nel grezzo
|
||||||
Protected m_PartMList As New List(Of PartM)
|
Protected m_PartMList As New List(Of PartM)
|
||||||
Public Property PartMList As List(Of PartM)
|
Public Property PartMList As List(Of PartM)
|
||||||
|
|||||||
@@ -215,20 +215,46 @@ Public Class MyMachGroupPanelM
|
|||||||
If nBWType = BWType.WALL Then
|
If nBWType = BWType.WALL Then
|
||||||
' salvo parametri Q
|
' salvo parametri Q
|
||||||
QArray(Duploindex) = New Dictionary(Of String, Dictionary(Of String, String))
|
QArray(Duploindex) = New Dictionary(Of String, Dictionary(Of String, String))
|
||||||
|
' ciclo sulle feature
|
||||||
|
Dim nGlobPRId As Integer = 1
|
||||||
|
Dim nFeatureLayer As Integer = EgtGetFirstNameInGroup(DuploArray(Duploindex), PROCESSINGS)
|
||||||
|
If nFeatureLayer <> GDB_ID.NULL Then
|
||||||
|
Dim nFeatureId As Integer = EgtGetFirstInGroup(nFeatureLayer)
|
||||||
|
While nFeatureId <> GDB_ID.NULL
|
||||||
|
' verifico che sia feature
|
||||||
|
Dim nPRC As Integer
|
||||||
|
If EgtGetInfo(nFeatureId, MGR_FTR_PRC, nPRC) Then
|
||||||
|
nPRId = 0
|
||||||
|
EgtGetInfo(nFeatureId, MGR_FTR_PRID, nPRId)
|
||||||
|
If nPRId > nGlobPRId Then nGlobPRId = nPRId
|
||||||
|
Dim sKey As String = nPRId & "." & nPRC
|
||||||
|
QArray(Duploindex).Add(sKey, New Dictionary(Of String, String))
|
||||||
|
For QIndex = 1 To 10
|
||||||
|
Dim QKey As String = "Q" & QIndex.ToString("D2")
|
||||||
|
Dim QValue As Integer = 0
|
||||||
|
If EgtGetInfo(nFeatureId, QKey, QValue) Then
|
||||||
|
QArray(Duploindex)(sKey).Add(QKey, QValue)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
nFeatureId = EgtGetNext(nFeatureId)
|
||||||
|
End While
|
||||||
|
End If
|
||||||
' ciclo sugli outline
|
' ciclo sugli outline
|
||||||
nOutlineLayer = EgtGetFirstNameInGroup(DuploArray(Duploindex), OUTLINE)
|
nOutlineLayer = EgtGetFirstNameInGroup(DuploArray(Duploindex), OUTLINE)
|
||||||
If nOutlineLayer <> GDB_ID.NULL Then
|
If nOutlineLayer <> GDB_ID.NULL Then
|
||||||
Dim nGlobPRId As Integer = 1
|
|
||||||
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
|
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
|
||||||
While nOutlineId <> GDB_ID.NULL
|
While nOutlineId <> GDB_ID.NULL
|
||||||
' verifico che sia feature
|
' verifico che sia feature
|
||||||
Dim nPRC As Integer
|
Dim nPRC As Integer
|
||||||
If EgtGetInfo(nOutlineId, MGR_FTR_PRC, nPRC) Then
|
If EgtGetInfo(nOutlineId, MGR_FTR_PRC, nPRC) Then
|
||||||
nPRId = 0
|
nPRId = 0
|
||||||
If Not EgtGetInfo(nOutlineId, MGR_FTR_PRID, nPRId) Then
|
If Not EgtGetInfo(nOutlineId, MGR_FTR_PRID, nPRId) OrElse nPRId < nGlobPRId Then
|
||||||
|
nGlobPRId += 1
|
||||||
EgtSetInfo(nOutlineId, MGR_FTR_PRID, nGlobPRId)
|
EgtSetInfo(nOutlineId, MGR_FTR_PRID, nGlobPRId)
|
||||||
nPRId = nGlobPRId
|
nPRId = nGlobPRId
|
||||||
nGlobPRId += 1
|
Else
|
||||||
|
If nPRId > nGlobPRId Then nGlobPRId = nPRId
|
||||||
End If
|
End If
|
||||||
Dim sKey As String = nPRId & "." & nPRC
|
Dim sKey As String = nPRId & "." & nPRC
|
||||||
QArray(Duploindex).Add(sKey, New Dictionary(Of String, String))
|
QArray(Duploindex).Add(sKey, New Dictionary(Of String, String))
|
||||||
@@ -243,29 +269,6 @@ Public Class MyMachGroupPanelM
|
|||||||
nOutlineId = EgtGetNext(nOutlineId)
|
nOutlineId = EgtGetNext(nOutlineId)
|
||||||
End While
|
End While
|
||||||
End If
|
End If
|
||||||
' ciclo sulle feature
|
|
||||||
Dim nFeatureLayer As Integer = EgtGetFirstNameInGroup(DuploArray(Duploindex), PROCESSINGS)
|
|
||||||
If nFeatureLayer <> GDB_ID.NULL Then
|
|
||||||
Dim nFeatureId As Integer = EgtGetFirstInGroup(nFeatureLayer)
|
|
||||||
While nFeatureId <> GDB_ID.NULL
|
|
||||||
' verifico che sia feature
|
|
||||||
Dim nPRC As Integer
|
|
||||||
If EgtGetInfo(nFeatureId, MGR_FTR_PRC, nPRC) Then
|
|
||||||
nPRId = 0
|
|
||||||
EgtGetInfo(nFeatureId, MGR_FTR_PRID, nPRId)
|
|
||||||
Dim sKey As String = nPRId & "." & nPRC
|
|
||||||
QArray(Duploindex).Add(sKey, New Dictionary(Of String, String))
|
|
||||||
For QIndex = 1 To 10
|
|
||||||
Dim QKey As String = "Q" & QIndex.ToString("D2")
|
|
||||||
Dim QValue As Integer = 0
|
|
||||||
If EgtGetInfo(nFeatureId, QKey, QValue) Then
|
|
||||||
QArray(Duploindex)(sKey).Add(QKey, QValue)
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
End If
|
|
||||||
nFeatureId = EgtGetNext(nFeatureId)
|
|
||||||
End While
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
' aggiornamento dei Duplo
|
' aggiornamento dei Duplo
|
||||||
|
|||||||
@@ -210,6 +210,16 @@ Public Class PartM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Public m_MaterialM As MaterialM
|
||||||
|
Public Property MaterialM As MaterialM
|
||||||
|
Get
|
||||||
|
Return m_MaterialM
|
||||||
|
End Get
|
||||||
|
Set(value As MaterialM)
|
||||||
|
m_MaterialM = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
Public m_sSTOREY As String
|
Public m_sSTOREY As String
|
||||||
Public Property sSTOREY As String
|
Public Property sSTOREY As String
|
||||||
Get
|
Get
|
||||||
|
|||||||
@@ -116,6 +116,18 @@ Public MustInherit Class MyMachGroupVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property sWAREHOUSEMATERIAL As String
|
||||||
|
Get
|
||||||
|
Return MyMachGroupM.RawPartM.Material.sWarehouseMaterial
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property RawPartM As RawPartM
|
||||||
|
Get
|
||||||
|
Return MyMachGroupM.RawPartM
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Public ReadOnly Property sUnitTime As String
|
Public ReadOnly Property sUnitTime As String
|
||||||
Get
|
Get
|
||||||
Return TimeSpan.FromSeconds(nCALC_TIME).ToString()
|
Return TimeSpan.FromSeconds(nCALC_TIME).ToString()
|
||||||
@@ -130,7 +142,7 @@ Public MustInherit Class MyMachGroupVM
|
|||||||
|
|
||||||
Public ReadOnly Property Section As SectionXMaterial
|
Public ReadOnly Property Section As SectionXMaterial
|
||||||
Get
|
Get
|
||||||
Return New SectionXMaterial(dW, dH, dL, MyMachGroupM.sMATERIAL)
|
Return New SectionXMaterial(dW, dH, dL, MyMachGroupM.RawPartM.Material.sMaterial, MyMachGroupM.sWAREHOUSEMATERIAL)
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
|||||||
@@ -162,6 +162,19 @@ Public MustInherit Class PartVM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property sWAREHOUSEMATERIAL As String
|
||||||
|
Get
|
||||||
|
Return m_PartM.MaterialM.sWarehouseMaterial
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property MaterialM As MaterialM
|
||||||
|
Get
|
||||||
|
Return m_PartM.MaterialM
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
Public ReadOnly Property sSTOREY As String
|
Public ReadOnly Property sSTOREY As String
|
||||||
Get
|
Get
|
||||||
Return m_PartM.sSTOREY
|
Return m_PartM.sSTOREY
|
||||||
|
|||||||
@@ -779,94 +779,3 @@ Public MustInherit Class NewOpenProjectFileDialogVM
|
|||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
Public Class ProdItem
|
|
||||||
Inherits VMBase
|
|
||||||
|
|
||||||
Public Shared m_delIsModifiedSetUp As Action(Of Boolean)
|
|
||||||
|
|
||||||
Protected m_ProdFileVM As ProdFileVM
|
|
||||||
Public ReadOnly Property ProdFileVM As ProdFileVM
|
|
||||||
Get
|
|
||||||
Return m_ProdFileVM
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Private m_ProjFileList As New List(Of ProjectFileVM)
|
|
||||||
Public ReadOnly Property ProjFileList As List(Of ProjectFileVM)
|
|
||||||
Get
|
|
||||||
Return m_ProjFileList
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property sProdId As String
|
|
||||||
Get
|
|
||||||
Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sProdId, "")
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public Overridable Property sName As String
|
|
||||||
Get
|
|
||||||
Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sName, "")
|
|
||||||
End Get
|
|
||||||
Set(value As String)
|
|
||||||
If Not IsNothing(m_ProdFileVM) Then
|
|
||||||
m_ProdFileVM.sName = value
|
|
||||||
End If
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property dtCreateDate As Date
|
|
||||||
Get
|
|
||||||
Return If(Not IsNothing(m_ProdFileVM), {m_ProdFileVM.dtCreateDate, m_ProjFileList.Min(Function(x) x.dtCreateDate)}.Min(), m_ProjFileList.Min(Function(x) x.dtCreateDate))
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Public ReadOnly Property sCreateDate As String
|
|
||||||
Get
|
|
||||||
Return dtCreateDate.ToString()
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property sMachine As String
|
|
||||||
Get
|
|
||||||
If Not IsNothing(m_ProdFileVM) Then
|
|
||||||
Return m_ProdFileVM.sMachine
|
|
||||||
ElseIf Not IsNothing(m_ProjFileList(0)) Then
|
|
||||||
Return m_ProjFileList(0).sMachine
|
|
||||||
Else Return ""
|
|
||||||
End If
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property bIsArchived As Boolean
|
|
||||||
Get
|
|
||||||
If Not IsNothing(m_ProdFileVM) Then
|
|
||||||
Return m_ProdFileVM.bIsArchived
|
|
||||||
ElseIf Not IsNothing(m_ProjFileList(0)) Then
|
|
||||||
Return m_ProjFileList(0).bIsArchived
|
|
||||||
Else
|
|
||||||
Return True
|
|
||||||
End If
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property Archived_Visibility As Visibility
|
|
||||||
Get
|
|
||||||
Return If(bIsArchived, Visibility.Visible, Visibility.Collapsed)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Sub New(ProdFileVM As ProdFileVM, ProjFileVM As ProjFileVM)
|
|
||||||
m_ProdFileVM = ProdFileVM
|
|
||||||
m_ProjFileList.Add(ProjFileVM)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Sub New(ProjFileVM As ProjFileVM)
|
|
||||||
m_ProjFileList = New List(Of ProjectFileVM)({ProjFileVM})
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Sub New(ProdFileVM As ProjectFileVM, ProjFileVMList As List(Of ProjectFileVM))
|
|
||||||
m_ProdFileVM = ProdFileVM
|
|
||||||
m_ProjFileList = ProjFileVMList
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
End Class
|
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ Public MustInherit Class OpenProjectFileDialogVM
|
|||||||
|
|
||||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||||
|
|
||||||
|
Protected m_GoToProd As Boolean = False
|
||||||
|
|
||||||
Protected m_ProjectColumns As New ObservableCollection(Of EgtDataGridColumn)
|
Protected m_ProjectColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||||
Public Property ProjectColumns As ObservableCollection(Of EgtDataGridColumn)
|
Public Property ProjectColumns As ObservableCollection(Of EgtDataGridColumn)
|
||||||
Get
|
Get
|
||||||
@@ -438,7 +440,7 @@ Public MustInherit Class OpenProjectFileDialogVM
|
|||||||
#Region "METHODS"
|
#Region "METHODS"
|
||||||
|
|
||||||
Public MustOverride Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
|
Public MustOverride Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
|
||||||
Public Overridable Sub RefreshProjectList(Optional GoToProd As Boolean = False)
|
Public Overridable Sub RefreshProjectList()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub LoadColumns(ProjectType As ProjectType)
|
Protected Sub LoadColumns(ProjectType As ProjectType)
|
||||||
|
|||||||
@@ -14,6 +14,13 @@ Public Class ProdFileM
|
|||||||
m_nProjIdList = value
|
m_nProjIdList = value
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Protected m_ProjMList As List(Of ProjFileM)
|
||||||
|
Public ReadOnly Property ProjMList As List(Of ProjFileM)
|
||||||
|
Get
|
||||||
|
Return m_ProjMList
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Protected m_sName As String
|
Protected m_sName As String
|
||||||
Public Property sName As String
|
Public Property sName As String
|
||||||
Get
|
Get
|
||||||
@@ -34,6 +41,16 @@ Public Class ProdFileM
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Protected m_nProjCloudId As Integer
|
||||||
|
Public Property nProjCloudId As Integer
|
||||||
|
Get
|
||||||
|
Return m_nProjCloudId
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
m_nProjCloudId = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
#Region "CONSTRUCTORS"
|
#Region "CONSTRUCTORS"
|
||||||
|
|
||||||
Protected Sub New()
|
Protected Sub New()
|
||||||
@@ -44,7 +61,7 @@ Public Class ProdFileM
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Shared Function CreateProdFileM(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType,
|
Public Shared Function CreateProdFileM(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType,
|
||||||
sMachine As String, sLockedBy As String, dtLock As DateTime, bIsActive As Boolean, bIsProduced As Boolean, bIsArchived As Boolean) As ProdFileM
|
sMachine As String, sLockedBy As String, dtLock As DateTime, bIsActive As Boolean, bIsProduced As Boolean, bIsArchived As Boolean, Optional nProjCloudId As Integer = 0) As ProdFileM
|
||||||
Dim NewProjectFileM As New ProdFileM
|
Dim NewProjectFileM As New ProdFileM
|
||||||
NewProjectFileM.m_nProdId = nProdId
|
NewProjectFileM.m_nProdId = nProdId
|
||||||
NewProjectFileM.m_nProjIdList = nProjIdList
|
NewProjectFileM.m_nProjIdList = nProjIdList
|
||||||
@@ -57,6 +74,25 @@ Public Class ProdFileM
|
|||||||
NewProjectFileM.m_bIsActive = bIsActive
|
NewProjectFileM.m_bIsActive = bIsActive
|
||||||
NewProjectFileM.m_bIsProduced = bIsProduced
|
NewProjectFileM.m_bIsProduced = bIsProduced
|
||||||
NewProjectFileM.m_bIsArchived = bIsArchived
|
NewProjectFileM.m_bIsArchived = bIsArchived
|
||||||
|
NewProjectFileM.m_nProjCloudId = nProjCloudId
|
||||||
|
Return NewProjectFileM
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function CreateProdFileM(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType,
|
||||||
|
sMachine As String, sLockedBy As String, dtLock As DateTime, bIsActive As Boolean, bIsProduced As Boolean, bIsArchived As Boolean, ProjMList As List(Of ProjFileM)) As ProdFileM
|
||||||
|
Dim NewProjectFileM As New ProdFileM
|
||||||
|
NewProjectFileM.m_nProdId = nProdId
|
||||||
|
NewProjectFileM.m_nProjIdList = nProjIdList
|
||||||
|
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
|
||||||
|
NewProjectFileM.m_sName = sName
|
||||||
|
NewProjectFileM.m_nType = nType
|
||||||
|
NewProjectFileM.m_sMachine = sMachine
|
||||||
|
NewProjectFileM.m_sLockedBy = sLockedBy
|
||||||
|
NewProjectFileM.m_dtLock = dtLock
|
||||||
|
NewProjectFileM.m_bIsActive = bIsActive
|
||||||
|
NewProjectFileM.m_bIsProduced = bIsProduced
|
||||||
|
NewProjectFileM.m_bIsArchived = bIsArchived
|
||||||
|
NewProjectFileM.m_ProjMList = ProjMList
|
||||||
Return NewProjectFileM
|
Return NewProjectFileM
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,116 @@
|
|||||||
|
|
||||||
|
Imports EgtWPFLib5
|
||||||
|
Imports System.Windows
|
||||||
|
|
||||||
|
Public Class ProdItem
|
||||||
|
Inherits VMBase
|
||||||
|
|
||||||
|
Public Shared m_delIsModifiedSetUp As Action(Of Boolean)
|
||||||
|
|
||||||
|
Protected m_ProdFileVM As ProdFileVM
|
||||||
|
Public ReadOnly Property ProdFileVM As ProdFileVM
|
||||||
|
Get
|
||||||
|
Return m_ProdFileVM
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_ProjFileList As New List(Of ProjectFileVM)
|
||||||
|
Public ReadOnly Property ProjFileList As List(Of ProjectFileVM)
|
||||||
|
Get
|
||||||
|
Return m_ProjFileList
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property sProdId As String
|
||||||
|
Get
|
||||||
|
Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sProdId, "")
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public Overridable Property sName As String
|
||||||
|
Get
|
||||||
|
Return If(Not IsNothing(m_ProdFileVM), m_ProdFileVM.sName, "")
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
If Not IsNothing(m_ProdFileVM) Then
|
||||||
|
m_ProdFileVM.sName = value
|
||||||
|
End If
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property dtCreateDate As Date
|
||||||
|
Get
|
||||||
|
Return If(Not IsNothing(m_ProdFileVM), {m_ProdFileVM.dtCreateDate, m_ProjFileList.Min(Function(x) x.dtCreateDate)}.Min(), m_ProjFileList.Min(Function(x) x.dtCreateDate))
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
Public ReadOnly Property sCreateDate As String
|
||||||
|
Get
|
||||||
|
Return dtCreateDate.ToString()
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property sMachine As String
|
||||||
|
Get
|
||||||
|
If Not IsNothing(m_ProdFileVM) Then
|
||||||
|
Return m_ProdFileVM.sMachine
|
||||||
|
ElseIf Not IsNothing(m_ProjFileList(0)) Then
|
||||||
|
Return m_ProjFileList(0).sMachine
|
||||||
|
Else Return ""
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property bIsArchived As Boolean
|
||||||
|
Get
|
||||||
|
If Not IsNothing(m_ProdFileVM) Then
|
||||||
|
Return m_ProdFileVM.bIsArchived
|
||||||
|
ElseIf Not IsNothing(m_ProjFileList(0)) Then
|
||||||
|
Return m_ProjFileList(0).bIsArchived
|
||||||
|
Else
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property Archived_Visibility As Visibility
|
||||||
|
Get
|
||||||
|
Return If(bIsArchived, Visibility.Visible, Visibility.Collapsed)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Sub New(ProdFileVM As ProdFileVM, ProjFileVM As ProjFileVM)
|
||||||
|
m_ProdFileVM = ProdFileVM
|
||||||
|
m_ProjFileList.Add(ProjFileVM)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub New(ProjFileVM As ProjFileVM)
|
||||||
|
m_ProjFileList = New List(Of ProjectFileVM)({ProjFileVM})
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub New(ProdFileVM As ProjectFileVM, ProjFileVMList As List(Of ProjectFileVM))
|
||||||
|
m_ProdFileVM = ProdFileVM
|
||||||
|
m_ProjFileList = ProjFileVMList
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Public Shared Function CreateProdItem(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType,
|
||||||
|
sMachine As String, sLockedBy As String, dtLock As DateTime, bIsActive As Boolean, bIsProduced As Boolean, bIsArchived As Boolean, ProjMList As List(Of ProjFileM)) As ProdItem
|
||||||
|
|
||||||
|
|
||||||
|
Dim NewProdFileM = ProdFileM.CreateProdFileM(nProdId, nProjIdList, dtCreateProjDate, sName, nType, sMachine, sLockedBy, dtLock, bIsActive, bIsProduced, bIsArchived)
|
||||||
|
Dim NewProdFileVM = New ProdFileVM(NewProdFileM)
|
||||||
|
Dim NewProjFileVM As IEnumerable(Of ProjectFileVM)
|
||||||
|
NewProjFileVM = ProjMList.Select(Of ProjFileVM)(Function(j) New ProjFileVM(j)).ToList
|
||||||
|
Dim NewProdItem = New ProdItem(NewProdFileVM, NewProjFileVM.ToList)
|
||||||
|
|
||||||
|
Return NewProdItem
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function CreateProdItem(ProjFileM As ProjFileM) As ProdItem
|
||||||
|
|
||||||
|
Dim NewProdItem = New ProdItem(New ProjFileVM(ProjFileM))
|
||||||
|
|
||||||
|
Return NewProdItem
|
||||||
|
End Function
|
||||||
|
|
||||||
|
End Class
|
||||||
@@ -29,25 +29,35 @@ Public Class ProjFileM
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected m_sDescription As String = String.Empty
|
Protected m_sDescription As String = String.Empty
|
||||||
Public Property sDescription As String
|
Public Property sDescription As String
|
||||||
Get
|
Get
|
||||||
Return m_sDescription
|
Return m_sDescription
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
Set(value As String)
|
||||||
m_sDescription = value
|
m_sDescription = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Protected m_nProjCloudId As Integer
|
||||||
|
Public Property nProjCloudId As Integer
|
||||||
|
Get
|
||||||
|
Return m_nProjCloudId
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
m_nProjCloudId = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
#Region "CONSTRUCTORS"
|
#Region "CONSTRUCTORS"
|
||||||
|
|
||||||
Protected Sub New()
|
Protected Sub New()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Shared Function CreateNewProjFileM() As ProjFileM
|
Public Shared Function CreateNewProjFileM() As ProjFileM
|
||||||
Return New ProjFileM
|
Return New ProjFileM
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Shared Function CreateProjFileM(nProjId As Integer, nProdId As Integer, dtCreateProjDate As DateTime, dtExportDate As DateTime, sListName As String, sBTLFileName As String, sDescription As String, IsNew As Boolean, IsLocked As Boolean, nType As BWType, sMachine As String, bIsActive As Boolean, bIsArchived As Boolean) As ProjFileM
|
Public Shared Function CreateProjFileM(nProjId As Integer, nProdId As Integer, dtCreateProjDate As DateTime, dtExportDate As DateTime, sListName As String, sBTLFileName As String, sDescription As String, IsNew As Boolean, IsLocked As Boolean, nType As BWType, sMachine As String, bIsActive As Boolean, bIsArchived As Boolean, Optional nProjCloudId As Integer = 0) As ProjFileM
|
||||||
Dim NewProjectFileM As New ProjFileM
|
Dim NewProjectFileM As New ProjFileM
|
||||||
NewProjectFileM.m_nProjId = nProjId
|
NewProjectFileM.m_nProjId = nProjId
|
||||||
NewProjectFileM.m_nProdId = nProdId
|
NewProjectFileM.m_nProdId = nProdId
|
||||||
@@ -62,6 +72,7 @@ Public Class ProjFileM
|
|||||||
NewProjectFileM.m_sMachine = sMachine
|
NewProjectFileM.m_sMachine = sMachine
|
||||||
NewProjectFileM.m_bIsActive = bIsActive
|
NewProjectFileM.m_bIsActive = bIsActive
|
||||||
NewProjectFileM.m_bIsArchived = bIsArchived
|
NewProjectFileM.m_bIsArchived = bIsArchived
|
||||||
|
NewProjectFileM.m_nProjCloudId = nProjCloudId
|
||||||
Return NewProjectFileM
|
Return NewProjectFileM
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
Imports EgtUILib
|
||||||
|
Imports EgtWPFLib5
|
||||||
|
Imports EgtBEAMWALL.Core
|
||||||
|
Imports EgtBEAMWALL.ViewerOptimizer
|
||||||
|
|
||||||
|
Public Module DbControllers
|
||||||
|
|
||||||
|
Public m_MaterialsController As DataLayer.Controllers.MaterialsController
|
||||||
|
Public m_RawItemsController As DataLayer.Controllers.RawItemsController
|
||||||
|
|
||||||
|
Sub Init()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub New()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub LoadControllers(MaterialsController As DataLayer.Controllers.MaterialsController, RawItemsController As DataLayer.Controllers.RawItemsController)
|
||||||
|
m_MaterialsController = MaterialsController
|
||||||
|
m_RawItemsController = RawItemsController
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Module
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
#Region "Private Fields"
|
#Region "Private Fields"
|
||||||
|
|
||||||
Public Enum MachLogTypes
|
Public Enum MachLogTypes
|
||||||
|
NULL = 0
|
||||||
PART_STATUS = 1
|
PART_STATUS = 1
|
||||||
MACHGROUP_STATUS = 2
|
MACHGROUP_STATUS = 2
|
||||||
MACHINE_MODE = 3
|
MACHINE_MODE = 3
|
||||||
@@ -13,20 +14,13 @@
|
|||||||
ALARM = 8
|
ALARM = 8
|
||||||
OPERATOR_MSG = 9
|
OPERATOR_MSG = 9
|
||||||
PROGRAM_SEND = 10
|
PROGRAM_SEND = 10
|
||||||
|
APPLICATION = 11
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
Private m_AlarmCode As String
|
|
||||||
Private m_AlarmDateTime As DateTime
|
Private m_AlarmDateTime As DateTime
|
||||||
Private m_AlarmMessage As String
|
Private m_nProdId As Integer
|
||||||
Private m_AlarmOperation As Integer
|
Private m_ResultType As MachLogTypes
|
||||||
Private m_AlarmType As Integer
|
Private m_SupervisorId As String
|
||||||
Private m_CommandExecutedCorrectly As Boolean
|
|
||||||
Private m_CommandState As CommandStates
|
|
||||||
Private m_CommandType As LogCommandTypes
|
|
||||||
Private m_Description As String
|
|
||||||
Private m_newOpState As Integer
|
|
||||||
Private m_ResultType As ResultTypes
|
|
||||||
Private m_VarAddress As String
|
|
||||||
Private m_VarValue As String
|
Private m_VarValue As String
|
||||||
|
|
||||||
' variabili del log macchina
|
' variabili del log macchina
|
||||||
@@ -96,18 +90,10 @@
|
|||||||
#Region "Protected Constructors"
|
#Region "Protected Constructors"
|
||||||
|
|
||||||
Protected Sub New()
|
Protected Sub New()
|
||||||
m_AlarmCode = ""
|
|
||||||
m_AlarmDateTime = DateTime.MinValue
|
m_AlarmDateTime = DateTime.MinValue
|
||||||
m_AlarmMessage = ""
|
m_nProdId = 0
|
||||||
m_AlarmOperation = 0
|
|
||||||
m_AlarmType = 0
|
|
||||||
m_CommandExecutedCorrectly = False
|
|
||||||
m_CommandState = CommandStates.NULL
|
|
||||||
m_CommandType = LogCommandTypes.NULL
|
|
||||||
m_Description = ""
|
|
||||||
m_newOpState = 0
|
|
||||||
m_ResultType = ResultTypes.NULL
|
m_ResultType = ResultTypes.NULL
|
||||||
m_VarAddress = ""
|
m_SupervisorId = ""
|
||||||
m_VarValue = ""
|
m_VarValue = ""
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -115,63 +101,15 @@
|
|||||||
|
|
||||||
#Region "Public Properties"
|
#Region "Public Properties"
|
||||||
|
|
||||||
Public ReadOnly Property AlarmCode As String
|
|
||||||
Get
|
|
||||||
Return m_AlarmCode
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property AlarmDateTime As Date
|
Public ReadOnly Property AlarmDateTime As Date
|
||||||
Get
|
Get
|
||||||
Return m_AlarmDateTime
|
Return m_AlarmDateTime
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public ReadOnly Property AlarmMessage As String
|
Public ReadOnly Property ProdId As Integer
|
||||||
Get
|
Get
|
||||||
Return m_AlarmMessage
|
Return m_nProdId
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property AlarmOperation As Integer
|
|
||||||
Get
|
|
||||||
Return m_AlarmOperation
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property AlarmType As Integer
|
|
||||||
Get
|
|
||||||
Return m_AlarmType
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property CommandExecutedCorrectly As Boolean
|
|
||||||
Get
|
|
||||||
Return m_CommandExecutedCorrectly
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property CommandState As CommandStates
|
|
||||||
Get
|
|
||||||
Return m_CommandState
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property CommandType As LogCommandTypes
|
|
||||||
Get
|
|
||||||
Return m_CommandType
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property Description As String
|
|
||||||
Get
|
|
||||||
Return m_Description
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property newOpState As Integer
|
|
||||||
Get
|
|
||||||
Return m_newOpState
|
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
@@ -183,7 +121,7 @@
|
|||||||
|
|
||||||
Public ReadOnly Property VarAddress As String
|
Public ReadOnly Property VarAddress As String
|
||||||
Get
|
Get
|
||||||
Return m_VarAddress
|
Return m_SupervisorId
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
@@ -199,28 +137,20 @@
|
|||||||
|
|
||||||
Public Shared Function CreateAlarmLog(AlarmOperation As Integer, AlarmType As Integer, AlarmMessage As String, AlarmCode As String, AlarmDateTime As String)
|
Public Shared Function CreateAlarmLog(AlarmOperation As Integer, AlarmType As Integer, AlarmMessage As String, AlarmCode As String, AlarmDateTime As String)
|
||||||
Dim NewMachLog As New MachLog
|
Dim NewMachLog As New MachLog
|
||||||
NewMachLog.m_CommandType = LogCommandTypes.ALARM
|
|
||||||
NewMachLog.m_AlarmOperation = AlarmOperation
|
|
||||||
NewMachLog.m_AlarmType = AlarmType
|
|
||||||
NewMachLog.m_AlarmMessage = AlarmMessage
|
|
||||||
NewMachLog.m_AlarmCode = AlarmCode
|
|
||||||
DateTime.TryParse(AlarmDateTime, NewMachLog.m_AlarmDateTime)
|
DateTime.TryParse(AlarmDateTime, NewMachLog.m_AlarmDateTime)
|
||||||
Return NewMachLog
|
Return NewMachLog
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Shared Function CreateOPStateLog(newOpState As Integer)
|
Public Shared Function CreateOPStateLog(newOpState As Integer)
|
||||||
Dim NewMachLog As New MachLog
|
Dim NewMachLog As New MachLog
|
||||||
NewMachLog.m_CommandType = LogCommandTypes.NEWOP
|
NewMachLog.m_nProdId = newOpState
|
||||||
NewMachLog.m_newOpState = newOpState
|
|
||||||
NewMachLog.m_AlarmDateTime = DateTime.Now()
|
NewMachLog.m_AlarmDateTime = DateTime.Now()
|
||||||
Return NewMachLog
|
Return NewMachLog
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Shared Function CreateReadLog(CommandExecutedCorrectly As Boolean, VarAddress As String, VarValue As String)
|
Public Shared Function CreateReadLog(CommandExecutedCorrectly As Boolean, VarAddress As String, VarValue As String)
|
||||||
Dim NewMachLog As New MachLog
|
Dim NewMachLog As New MachLog
|
||||||
NewMachLog.m_CommandType = CommandTypes.READ_TPA
|
NewMachLog.m_SupervisorId = VarAddress
|
||||||
NewMachLog.m_CommandExecutedCorrectly = CommandExecutedCorrectly
|
|
||||||
NewMachLog.m_VarAddress = VarAddress
|
|
||||||
NewMachLog.m_VarValue = VarValue
|
NewMachLog.m_VarValue = VarValue
|
||||||
NewMachLog.m_AlarmDateTime = DateTime.Now()
|
NewMachLog.m_AlarmDateTime = DateTime.Now()
|
||||||
Return NewMachLog
|
Return NewMachLog
|
||||||
@@ -228,20 +158,18 @@
|
|||||||
|
|
||||||
Public Shared Function CreateResultLog(CommandType As LogCommandTypes, CommandState As CommandStates, ResultType As ResultTypes, Description As String)
|
Public Shared Function CreateResultLog(CommandType As LogCommandTypes, CommandState As CommandStates, ResultType As ResultTypes, Description As String)
|
||||||
Dim NewMachLog As New MachLog
|
Dim NewMachLog As New MachLog
|
||||||
NewMachLog.m_CommandType = CommandType
|
|
||||||
NewMachLog.m_CommandState = CommandState
|
|
||||||
NewMachLog.m_ResultType = ResultType
|
NewMachLog.m_ResultType = ResultType
|
||||||
NewMachLog.m_Description = Description
|
|
||||||
NewMachLog.m_AlarmDateTime = DateTime.Now()
|
NewMachLog.m_AlarmDateTime = DateTime.Now()
|
||||||
Return NewMachLog
|
Return NewMachLog
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Shared Function CreateMachLog(EventType As MachLogTypes, EventDateTime As DateTime, Value As String, SupervisorID As String)
|
Public Shared Function CreateMachLog(EventType As MachLogTypes, EventDateTime As DateTime, Value As String, nProdId As Integer, SupervisorID As String)
|
||||||
Dim NewMachEvent As New MachLog
|
Dim NewMachEvent As New MachLog
|
||||||
NewMachEvent.m_ResultType = EventType
|
NewMachEvent.m_ResultType = EventType
|
||||||
NewMachEvent.m_AlarmDateTime = EventDateTime
|
NewMachEvent.m_AlarmDateTime = EventDateTime
|
||||||
NewMachEvent.m_VarValue = Value
|
NewMachEvent.m_VarValue = Value
|
||||||
NewMachEvent.m_VarAddress = SupervisorID
|
NewMachEvent.m_nProdId = nProdId
|
||||||
|
NewMachEvent.m_SupervisorId = SupervisorID
|
||||||
Return NewMachEvent
|
Return NewMachEvent
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@@ -252,18 +180,10 @@
|
|||||||
Public Shared Function CreateMachLog(AlarmCode As String, AlarmDateTime As Date, AlarmMessage As String, AlarmOperation As Integer, AlarmType As Integer, CommandExecutedCorrectly As Boolean, CommandState As CommandStates, CommandType As LogCommandTypes, Description As String, newOpState As Integer, ResultType As ResultTypes, VarAddress As String, VarValue As String) As MachLog
|
Public Shared Function CreateMachLog(AlarmCode As String, AlarmDateTime As Date, AlarmMessage As String, AlarmOperation As Integer, AlarmType As Integer, CommandExecutedCorrectly As Boolean, CommandState As CommandStates, CommandType As LogCommandTypes, Description As String, newOpState As Integer, ResultType As ResultTypes, VarAddress As String, VarValue As String) As MachLog
|
||||||
|
|
||||||
Dim NewMachLog As New MachLog
|
Dim NewMachLog As New MachLog
|
||||||
NewMachLog.m_AlarmCode = AlarmCode
|
|
||||||
NewMachLog.m_AlarmDateTime = AlarmDateTime
|
NewMachLog.m_AlarmDateTime = AlarmDateTime
|
||||||
NewMachLog.m_AlarmMessage = AlarmMessage
|
NewMachLog.m_nProdId = newOpState
|
||||||
NewMachLog.m_AlarmOperation = AlarmOperation
|
|
||||||
NewMachLog.m_AlarmType = AlarmType
|
|
||||||
NewMachLog.m_CommandExecutedCorrectly = CommandExecutedCorrectly
|
|
||||||
NewMachLog.m_CommandState = CommandState
|
|
||||||
NewMachLog.m_CommandType = CommandType
|
|
||||||
NewMachLog.m_Description = Description
|
|
||||||
NewMachLog.m_newOpState = newOpState
|
|
||||||
NewMachLog.m_ResultType = ResultType
|
NewMachLog.m_ResultType = ResultType
|
||||||
NewMachLog.m_VarAddress = VarAddress
|
NewMachLog.m_SupervisorId = VarAddress
|
||||||
NewMachLog.m_VarValue = VarValue
|
NewMachLog.m_VarValue = VarValue
|
||||||
|
|
||||||
Return NewMachLog
|
Return NewMachLog
|
||||||
|
|||||||
@@ -0,0 +1,111 @@
|
|||||||
|
Imports System.Windows
|
||||||
|
Imports EgtUILib
|
||||||
|
Imports EgtWPFLib5
|
||||||
|
|
||||||
|
Public Class MaterialM
|
||||||
|
|
||||||
|
Protected m_nId As Integer = 0
|
||||||
|
Public ReadOnly Property nId As Integer
|
||||||
|
Get
|
||||||
|
Return m_nId
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
Public Sub SetId(nId As Integer)
|
||||||
|
m_nId = nId
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected m_sMaterial As String
|
||||||
|
Public ReadOnly Property sMaterial As String
|
||||||
|
Get
|
||||||
|
Return m_sMaterial
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
Public Sub SetMaterial(sMaterial As String)
|
||||||
|
m_sMaterial = sMaterial
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected m_sWarehouseMaterial As String
|
||||||
|
Public ReadOnly Property sWarehouseMaterial As String
|
||||||
|
Get
|
||||||
|
Return m_sWarehouseMaterial
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
Public Sub SetWarehouseMaterial(sWarehouseMaterial As String)
|
||||||
|
m_sWarehouseMaterial = sWarehouseMaterial
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected m_dW As Double = 0
|
||||||
|
Public ReadOnly Property dW As Double
|
||||||
|
Get
|
||||||
|
Return m_dW
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Protected m_dH As Double = 0
|
||||||
|
Public ReadOnly Property dH As Double
|
||||||
|
Get
|
||||||
|
Return m_dH
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Protected m_dL As Double = 0
|
||||||
|
Public ReadOnly Property dL As Double
|
||||||
|
Get
|
||||||
|
Return m_dL
|
||||||
|
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Shared Operator =(ByVal S1 As MaterialM, ByVal S2 As MaterialM) As Boolean
|
||||||
|
If IsNothing(S1) OrElse IsNothing(S2) Then Return False
|
||||||
|
Return (Math.Abs(S1.m_dH - S2.m_dH) < 100 * EPS_SMALL AndAlso
|
||||||
|
Math.Abs(S1.m_dW - S2.m_dW) < 100 * EPS_SMALL AndAlso
|
||||||
|
Math.Abs(S1.m_dL - S2.m_dL) < 100 * EPS_SMALL AndAlso
|
||||||
|
S1.m_sWarehouseMaterial = S2.m_sWarehouseMaterial)
|
||||||
|
End Operator
|
||||||
|
|
||||||
|
Shared Operator <>(ByVal S1 As MaterialM, ByVal S2 As MaterialM) As Boolean
|
||||||
|
Return Not S1 = S2
|
||||||
|
End Operator
|
||||||
|
|
||||||
|
Public Overrides Function Equals(ByVal obj As Object) As Boolean
|
||||||
|
If TypeOf obj Is MaterialM Then
|
||||||
|
Return Me = DirectCast(obj, MaterialM) '(m_dH = obj.dH AndAlso m_dW = obj.dW AndAlso m_dL = obj.dL AndAlso m_Material.Any(Function(x) DirectCast(obj.sMaterial, List(Of String)).Any(Function(y) y = x)))
|
||||||
|
End If
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Sub New(dW As Double, dH As Double, dL As Double, sMaterial As String)
|
||||||
|
m_dW = dW
|
||||||
|
m_dH = dH
|
||||||
|
m_dL = dL
|
||||||
|
m_sMaterial = sMaterial
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub New(dW As Double, dH As Double, dL As Double, sMaterial As String, sWarehouseMaterial As String)
|
||||||
|
m_dW = dW
|
||||||
|
m_dH = dH
|
||||||
|
m_dL = dL
|
||||||
|
m_sMaterial = sMaterial
|
||||||
|
m_sWarehouseMaterial = sWarehouseMaterial
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' costruttore per DataLayer
|
||||||
|
Sub New(nId As Integer, dW As Double, dH As Double, dL As Double, sMaterial As String, sWarehouseMaterial As String)
|
||||||
|
m_nId = nId
|
||||||
|
m_dW = dW
|
||||||
|
m_dH = dH
|
||||||
|
m_dL = dL
|
||||||
|
m_sMaterial = sMaterial
|
||||||
|
m_sWarehouseMaterial = sWarehouseMaterial
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub Update(dW As Double, dH As Double, dL As Double, sMaterial As String)
|
||||||
|
m_dW = dW
|
||||||
|
m_dH = dH
|
||||||
|
m_dL = dL
|
||||||
|
m_sMaterial = sMaterial
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
|
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
Imports EgtWPFLib5
|
||||||
|
|
||||||
|
Public Class RawPartM
|
||||||
|
Inherits VMBase
|
||||||
|
|
||||||
|
Protected m_nId As Integer
|
||||||
|
Public ReadOnly Property nId As Integer
|
||||||
|
Get
|
||||||
|
Return m_nId
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
Public Sub SetId(nId As Integer)
|
||||||
|
m_nId = nId
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private m_bActive As Boolean
|
||||||
|
Public Property bActive As Boolean
|
||||||
|
Get
|
||||||
|
Return m_bActive
|
||||||
|
End Get
|
||||||
|
Set(value As Boolean)
|
||||||
|
m_bActive = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_Material As MaterialM
|
||||||
|
Public Property Material As MaterialM
|
||||||
|
Get
|
||||||
|
Return m_Material
|
||||||
|
End Get
|
||||||
|
Set(value As MaterialM)
|
||||||
|
m_Material = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_dW As Double
|
||||||
|
Public Property dW As Double
|
||||||
|
Get
|
||||||
|
Return m_dW
|
||||||
|
End Get
|
||||||
|
Set(value As Double)
|
||||||
|
m_dW = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_dL As Double
|
||||||
|
Public Property dL As Double
|
||||||
|
Get
|
||||||
|
Return m_dL
|
||||||
|
End Get
|
||||||
|
Set(value As Double)
|
||||||
|
m_dL = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private m_nQuantity As Integer
|
||||||
|
Public Property nQuantity As Integer
|
||||||
|
Get
|
||||||
|
Return m_nQuantity
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
m_nQuantity = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
Private m_bUseQuantity As Boolean
|
||||||
|
Public Property bUseQuantity As Boolean
|
||||||
|
Get
|
||||||
|
Return m_bUseQuantity
|
||||||
|
End Get
|
||||||
|
Set(value As Boolean)
|
||||||
|
m_bUseQuantity = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Sub New(Material As MaterialM, W As Double, L As Double, Qty As Integer, Active As Boolean)
|
||||||
|
m_Material = Material
|
||||||
|
m_dW = W
|
||||||
|
m_dL = L
|
||||||
|
m_nQuantity = Qty
|
||||||
|
m_bActive = Active
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub New(nId As Integer, Material As MaterialM, W As Double, L As Double, Qty As Integer, bUseQty As Boolean, Active As Boolean)
|
||||||
|
m_nId = nId
|
||||||
|
m_Material = Material
|
||||||
|
m_dW = W
|
||||||
|
m_dL = L
|
||||||
|
m_nQuantity = Qty
|
||||||
|
m_bUseQuantity = bUseQty
|
||||||
|
m_bActive = Active
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub New(Material As MaterialM, W As Double, L As Double)
|
||||||
|
m_Material = Material
|
||||||
|
m_dW = W
|
||||||
|
m_dL = L
|
||||||
|
m_nQuantity = 0
|
||||||
|
m_bUseQuantity = False
|
||||||
|
m_bActive = False
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub Update(RawPart As RawPartM)
|
||||||
|
m_Material = RawPart.m_Material
|
||||||
|
m_dW = RawPart.dW
|
||||||
|
m_dL = RawPart.dL
|
||||||
|
m_nQuantity = RawPart.m_nQuantity
|
||||||
|
m_bUseQuantity = RawPart.m_bUseQuantity
|
||||||
|
m_bActive = RawPart.m_bActive
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub Update(W As Double, L As Double)
|
||||||
|
m_dW = W
|
||||||
|
m_dL = L
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Function Copy() As RawPartM
|
||||||
|
Return New RawPartM(m_nId, m_Material, m_dW, m_dL, m_nQuantity, bUseQuantity, bActive)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
End Class
|
||||||
|
|
||||||
@@ -15,77 +15,91 @@ Public Class SectionXMaterial
|
|||||||
m_nType = nType
|
m_nType = nType
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected m_Material As List(Of String)
|
Public ReadOnly Property sMaterial As String
|
||||||
Public ReadOnly Property sMaterial As List(Of String)
|
|
||||||
Get
|
Get
|
||||||
Return m_Material
|
Return m_MaterialM.sMaterial
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected m_MaterialForSameSection_List As New List(Of String)
|
Public ReadOnly Property sWarehouseMaterial As String
|
||||||
Public Property MaterialForSameSection_List As List(Of String)
|
|
||||||
Get
|
Get
|
||||||
Return m_MaterialForSameSection_List
|
Return m_MaterialM.sWarehouseMaterial
|
||||||
End Get
|
End Get
|
||||||
Set(value As List(Of String))
|
|
||||||
m_MaterialForSameSection_List = value
|
|
||||||
End Set
|
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected m_SelMaterialForSameSection As String
|
'Protected m_MaterialForSameSection_List As New List(Of String)
|
||||||
Public Property SelMaterialForSameSection As String
|
'Public Property MaterialForSameSection_List As List(Of String)
|
||||||
|
' Get
|
||||||
|
' Return m_MaterialForSameSection_List
|
||||||
|
' End Get
|
||||||
|
' Set(value As List(Of String))
|
||||||
|
' m_MaterialForSameSection_List = value
|
||||||
|
' End Set
|
||||||
|
'End Property
|
||||||
|
|
||||||
|
'Protected m_SelMaterialForSameSection As String
|
||||||
|
'Public Property SelMaterialForSameSection As String
|
||||||
|
' Get
|
||||||
|
' Return m_SelMaterialForSameSection
|
||||||
|
' End Get
|
||||||
|
' Set(value As String)
|
||||||
|
' m_SelMaterialForSameSection = value
|
||||||
|
' End Set
|
||||||
|
'End Property
|
||||||
|
|
||||||
|
Protected m_MaterialM As MaterialM
|
||||||
|
Public ReadOnly Property MaterialM As MaterialM
|
||||||
Get
|
Get
|
||||||
Return m_SelMaterialForSameSection
|
Return m_MaterialM
|
||||||
End Get
|
End Get
|
||||||
Set(value As String)
|
|
||||||
m_SelMaterialForSameSection = value
|
|
||||||
End Set
|
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected m_dW As Double = 0
|
|
||||||
Public ReadOnly Property dW As Double
|
Public ReadOnly Property dW As Double
|
||||||
Get
|
Get
|
||||||
Return m_dW
|
Return m_MaterialM.dW
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected m_dH As Double = 0
|
|
||||||
Public ReadOnly Property dH As Double
|
Public ReadOnly Property dH As Double
|
||||||
Get
|
Get
|
||||||
Return m_dH
|
Return m_MaterialM.dH
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Protected m_dL As Double = 0
|
|
||||||
Public ReadOnly Property dL As Double
|
Public ReadOnly Property dL As Double
|
||||||
Get
|
Get
|
||||||
Return m_dL
|
Return m_MaterialM.dL
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public ReadOnly Property sSectionXMaterial As String
|
Public ReadOnly Property sSectionXMaterial As String
|
||||||
Get
|
Get
|
||||||
Dim sAlias As String = String.Empty
|
|
||||||
For Each sMatItem In sMaterial
|
|
||||||
sAlias &= sMatItem & ";"
|
|
||||||
Next
|
|
||||||
sAlias = sAlias.TrimEnd(";")
|
|
||||||
If Me = Empty Then
|
If Me = Empty Then
|
||||||
Return ""
|
Return ""
|
||||||
ElseIf m_nType = MachineType.BEAM Then
|
ElseIf m_nType = MachineType.BEAM Then
|
||||||
Return LenToString(m_dW, 3) & " x " & LenToString(m_dH, 3) & " " & sAlias
|
Return LenToString(m_MaterialM.dW, 3) & " x " & LenToString(m_MaterialM.dH, 3) & " " & If(GetMainPrivateProfileInt(S_WAREHOUSE, K_SHOWWAREHOUSEMATERIAL, 0) = 1, sWarehouseMaterial, sMaterial)
|
||||||
ElseIf m_nType = MachineType.WALL Then
|
ElseIf m_nType = MachineType.WALL Then
|
||||||
Return LenToString(m_dH, 3) & " " & sAlias
|
Return LenToString(m_MaterialM.dH, 3) & " " & If(GetMainPrivateProfileInt(S_WAREHOUSE, K_SHOWWAREHOUSEMATERIAL, 0) = 1, sWarehouseMaterial, sMaterial)
|
||||||
|
Else Return ""
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property sWarehouseSectionXMaterial As String
|
||||||
|
Get
|
||||||
|
If Me = Empty Then
|
||||||
|
Return ""
|
||||||
|
ElseIf m_nType = MachineType.BEAM Then
|
||||||
|
Return LenToString(m_MaterialM.dW, 3) & " x " & LenToString(m_MaterialM.dH, 3) & " " & sWarehouseMaterial
|
||||||
|
ElseIf m_nType = MachineType.WALL Then
|
||||||
|
Return LenToString(m_MaterialM.dH, 3) & " " & sWarehouseMaterial
|
||||||
Else Return ""
|
Else Return ""
|
||||||
End If
|
End If
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Shared Operator =(ByVal S1 As SectionXMaterial, ByVal S2 As SectionXMaterial) As Boolean
|
Shared Operator =(ByVal S1 As SectionXMaterial, ByVal S2 As SectionXMaterial) As Boolean
|
||||||
Return (Math.Abs( S1.m_dH - S2.m_dH) < 100 * EPS_SMALL AndAlso
|
Return S1.m_MaterialM = S2.m_MaterialM
|
||||||
Math.Abs( S1.m_dW - S2.m_dW) < 100 * EPS_SMALL AndAlso
|
|
||||||
Math.Abs( S1.m_dL - S2.m_dL) < 100 * EPS_SMALL AndAlso
|
|
||||||
S1.m_Material.Any(Function(x) S2.m_Material.Any(Function(y) y = x)))
|
|
||||||
End Operator
|
End Operator
|
||||||
|
|
||||||
Shared Operator <>(ByVal S1 As SectionXMaterial, ByVal S2 As SectionXMaterial) As Boolean
|
Shared Operator <>(ByVal S1 As SectionXMaterial, ByVal S2 As SectionXMaterial) As Boolean
|
||||||
@@ -99,122 +113,110 @@ Public Class SectionXMaterial
|
|||||||
Return False
|
Return False
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Sub New(dW As Double, dH As Double, dL As Double, sMaterial As String)
|
Sub New(dW As Double, dH As Double, dL As Double, sMaterial As String, sWarehouseMaterial As String)
|
||||||
If m_nType = BWType.BEAM Then
|
If m_nType = BWType.BEAM Then
|
||||||
m_dW = dW
|
m_MaterialM = New MaterialM(dW, dH, 0, sMaterial, sWarehouseMaterial)
|
||||||
m_dH = dH
|
|
||||||
ElseIf m_nType = BWType.WALL Then
|
ElseIf m_nType = BWType.WALL Then
|
||||||
m_dH = dH
|
m_MaterialM = New MaterialM(0, dH, 0, sMaterial, sWarehouseMaterial)
|
||||||
Else
|
Else
|
||||||
m_dW = dW
|
m_MaterialM = New MaterialM(dW, dH, dL, sMaterial, sWarehouseMaterial)
|
||||||
m_dH = dH
|
|
||||||
m_dL = dL
|
|
||||||
End If
|
End If
|
||||||
m_Material = New List(Of String)
|
|
||||||
Dim sMaterialArray() As String = Split(sMaterial, ";")
|
|
||||||
For Each sMatItem In sMaterialArray
|
|
||||||
m_Material.Add(sMatItem)
|
|
||||||
Next
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Shared Empty As New SectionXMaterial(-1, -1, -1, "")
|
Sub New(MaterialM As MaterialM)
|
||||||
|
m_MaterialM = MaterialM
|
||||||
#Region "Import BTL <-> Warehouse"
|
|
||||||
|
|
||||||
Private m_dNewW As Double
|
|
||||||
Public Property dNewW As Double
|
|
||||||
Get
|
|
||||||
Return m_dNewW
|
|
||||||
End Get
|
|
||||||
Set(value As Double)
|
|
||||||
m_dNewW = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Private m_dNewL As Double
|
|
||||||
Public Property dNewL As Double
|
|
||||||
Get
|
|
||||||
Return m_dNewL
|
|
||||||
End Get
|
|
||||||
Set(value As Double)
|
|
||||||
m_dNewL = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Private m_nQuantity As Integer
|
|
||||||
Public Property nQuantity As Integer
|
|
||||||
Get
|
|
||||||
Return m_nQuantity
|
|
||||||
End Get
|
|
||||||
Set(value As Integer)
|
|
||||||
m_nQuantity = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Private m_Alias_IsEnabled As Boolean
|
|
||||||
Public Property Alias_IsEnabled As Boolean
|
|
||||||
Get
|
|
||||||
Return m_Alias_IsEnabled
|
|
||||||
End Get
|
|
||||||
Set(value As Boolean)
|
|
||||||
m_Alias_IsEnabled = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Private m_Alias_IsChecked As Boolean
|
|
||||||
Public Overridable Property Alias_IsChecked As Boolean
|
|
||||||
Get
|
|
||||||
Return m_Alias_IsChecked
|
|
||||||
End Get
|
|
||||||
Set(value As Boolean)
|
|
||||||
m_Alias_IsChecked = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property L_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(61604)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property W_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(61605)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property H_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(61606)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Public ReadOnly Property Quantity_Msg As String
|
|
||||||
Get
|
|
||||||
Return EgtMsg(61774)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
Sub New(dW As Double, dH As Double, dL As Double, sMaterial As String, nQuantity As Integer)
|
|
||||||
If m_nType = BWType.BEAM Then
|
|
||||||
m_dW = dW
|
|
||||||
m_dH = dH
|
|
||||||
ElseIf m_nType = BWType.WALL Then
|
|
||||||
m_dH = dH
|
|
||||||
Else
|
|
||||||
m_dW = dW
|
|
||||||
m_dH = dH
|
|
||||||
m_dL = dL
|
|
||||||
End If
|
|
||||||
m_Material = New List(Of String)
|
|
||||||
Dim sMaterialArray() As String = Split(sMaterial, ";")
|
|
||||||
For Each sMatItem In sMaterialArray
|
|
||||||
m_Material.Add(sMatItem)
|
|
||||||
Next
|
|
||||||
m_nQuantity = nQuantity
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region ' Import BTL <-> Warehouse
|
Public Shared Empty As New SectionXMaterial(-1, -1, -1, "", "")
|
||||||
|
|
||||||
|
'#Region "Import BTL <-> Warehouse"
|
||||||
|
|
||||||
|
' Private m_dNewW As Double
|
||||||
|
' Public Property dNewW As Double
|
||||||
|
' Get
|
||||||
|
' Return m_dNewW
|
||||||
|
' End Get
|
||||||
|
' Set(value As Double)
|
||||||
|
' m_dNewW = value
|
||||||
|
' End Set
|
||||||
|
' End Property
|
||||||
|
|
||||||
|
' Private m_dNewL As Double
|
||||||
|
' Public Property dNewL As Double
|
||||||
|
' Get
|
||||||
|
' Return m_dNewL
|
||||||
|
' End Get
|
||||||
|
' Set(value As Double)
|
||||||
|
' m_dNewL = value
|
||||||
|
' End Set
|
||||||
|
' End Property
|
||||||
|
|
||||||
|
' Private m_nQuantity As Integer
|
||||||
|
' Public Property nQuantity As Integer
|
||||||
|
' Get
|
||||||
|
' Return m_nQuantity
|
||||||
|
' End Get
|
||||||
|
' Set(value As Integer)
|
||||||
|
' m_nQuantity = value
|
||||||
|
' End Set
|
||||||
|
' End Property
|
||||||
|
|
||||||
|
' Private m_Alias_IsEnabled As Boolean
|
||||||
|
' Public Property Alias_IsEnabled As Boolean
|
||||||
|
' Get
|
||||||
|
' Return m_Alias_IsEnabled
|
||||||
|
' End Get
|
||||||
|
' Set(value As Boolean)
|
||||||
|
' m_Alias_IsEnabled = value
|
||||||
|
' End Set
|
||||||
|
' End Property
|
||||||
|
|
||||||
|
' Private m_Alias_IsChecked As Boolean
|
||||||
|
' Public Overridable Property Alias_IsChecked As Boolean
|
||||||
|
' Get
|
||||||
|
' Return m_Alias_IsChecked
|
||||||
|
' End Get
|
||||||
|
' Set(value As Boolean)
|
||||||
|
' m_Alias_IsChecked = value
|
||||||
|
' End Set
|
||||||
|
' End Property
|
||||||
|
|
||||||
|
' Public ReadOnly Property L_Msg As String
|
||||||
|
' Get
|
||||||
|
' Return EgtMsg(61604)
|
||||||
|
' End Get
|
||||||
|
' End Property
|
||||||
|
|
||||||
|
' Public ReadOnly Property W_Msg As String
|
||||||
|
' Get
|
||||||
|
' Return EgtMsg(61605)
|
||||||
|
' End Get
|
||||||
|
' End Property
|
||||||
|
|
||||||
|
' Public ReadOnly Property H_Msg As String
|
||||||
|
' Get
|
||||||
|
' Return EgtMsg(61606)
|
||||||
|
' End Get
|
||||||
|
' End Property
|
||||||
|
|
||||||
|
' Public ReadOnly Property Quantity_Msg As String
|
||||||
|
' Get
|
||||||
|
' Return EgtMsg(61774)
|
||||||
|
' End Get
|
||||||
|
' End Property
|
||||||
|
|
||||||
|
' Sub New(dW As Double, dH As Double, dL As Double, sMaterial As String, nQuantity As Integer, sWarehouseMaterial As String)
|
||||||
|
' If m_nType = BWType.BEAM Then
|
||||||
|
' m_MaterialM = New MaterialM(dW, dH, 0, sMaterial, sWarehouseMaterial)
|
||||||
|
' ElseIf m_nType = BWType.WALL Then
|
||||||
|
' m_MaterialM = New MaterialM(0, dH, 0, sMaterial, sWarehouseMaterial)
|
||||||
|
' Else
|
||||||
|
' m_MaterialM = New MaterialM(dW, dH, dL, sMaterial, sWarehouseMaterial)
|
||||||
|
' End If
|
||||||
|
' m_nQuantity = nQuantity
|
||||||
|
' End Sub
|
||||||
|
|
||||||
|
'#End Region ' Import BTL <-> Warehouse
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|||||||
@@ -1,49 +1,81 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<configSections>
|
<configSections>
|
||||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||||
</configSections>
|
</configSections>
|
||||||
<entityFramework>
|
<entityFramework>
|
||||||
<!--<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.EntityFramework" />-->
|
<!--<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.EntityFramework" />-->
|
||||||
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
|
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
|
||||||
<providers>
|
<providers>
|
||||||
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
|
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||||
</provider>
|
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.4.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
|
||||||
</providers>
|
</providers>
|
||||||
</entityFramework>
|
</entityFramework>
|
||||||
<connectionStrings>
|
<connectionStrings>
|
||||||
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=steamware;password=Egalware_24068!;Persist Security Info=True;database=EgtBwDb_000470;SslMode=none" providerName="MySql.Data.MySqlClient" />
|
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=steamware;password=steamware_password;Persist Security Info=True;database=EgtBwDb_000470;SslMode=none" providerName="MySql.Data.MySqlClient" />
|
||||||
</connectionStrings>
|
</connectionStrings>
|
||||||
<runtime>
|
<runtime>
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-8.0.21.0" newVersion="8.0.21.0" />
|
<bindingRedirect oldVersion="0.0.0.0-1.8.9.0" newVersion="1.8.9.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
<bindingRedirect oldVersion="0.0.0.0-3.27.0.0" newVersion="3.27.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
|
<assemblyIdentity name="K4os.Compression.LZ4" publicKeyToken="2186fa9121ef231d" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-3.21.9.0" newVersion="3.21.9.0" />
|
<bindingRedirect oldVersion="0.0.0.0-1.2.5.0" newVersion="1.2.5.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
|
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-1.3.5.0" newVersion="1.3.5.0" />
|
<bindingRedirect oldVersion="0.0.0.0-1.3.8.0" newVersion="1.3.8.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
|
<assemblyIdentity name="K4os.Hash.xxHash" publicKeyToken="32cd54395057cec3" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-1.9.0.0" newVersion="1.9.0.0" />
|
<bindingRedirect oldVersion="0.0.0.0-1.0.8.0" newVersion="1.0.8.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
|
<bindingRedirect oldVersion="0.0.0.0-8.0.32.0" newVersion="8.0.32.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
<dependentAssembly>
|
||||||
</runtime>
|
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<startup>
|
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
</dependentAssembly>
|
||||||
</startup>
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||||
|
</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="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-8.0.0.3" newVersion="8.0.0.3" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="RestSharp" publicKeyToken="598062e77f915f75" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-111.2.0.0" newVersion="111.2.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="ZstdSharp" publicKeyToken="8d151af33a4ad5cf" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-0.8.1.0" newVersion="0.8.1.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
</assemblyBinding>
|
||||||
|
</runtime>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||||
|
</startup>
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -0,0 +1,270 @@
|
|||||||
|
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||||
|
using EgwProxy.MagMan.DTO;
|
||||||
|
using NLog;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gestione Alias su DB (es: materiali da BTL e su DB)
|
||||||
|
/// </summary>
|
||||||
|
public class AliasController : IDisposable
|
||||||
|
{
|
||||||
|
#region Public Constructors
|
||||||
|
|
||||||
|
public AliasController()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Constructors
|
||||||
|
|
||||||
|
#if false
|
||||||
|
/// <summary>
|
||||||
|
/// Conversion of DB model class to base class
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="coreMat"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static Core.AliasM ConvToCore(AliasModel dbRec)
|
||||||
|
{
|
||||||
|
Core.AliasM answ = new Core.AliasM(dbRec.ValueOriginal, dbRec.ValueAlias);
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper conversione a DTO
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static AliasDTO ConvToDto(AliasModel currRec)
|
||||||
|
{
|
||||||
|
AliasDTO answ = new AliasDTO()
|
||||||
|
{
|
||||||
|
ValOrig = currRec.ValueOriginal,
|
||||||
|
ValAlias = currRec.ValueAlias,
|
||||||
|
IsActive = true
|
||||||
|
};
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper conversione da DTO
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec"></param>
|
||||||
|
/// <param name="family"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static AliasModel ConvToModel(AliasDTO currRec, string family)
|
||||||
|
{
|
||||||
|
AliasModel answ = new AliasModel()
|
||||||
|
{
|
||||||
|
Family = family,
|
||||||
|
ValueOriginal = currRec.ValOrig,
|
||||||
|
ValueAlias = currRec.ValAlias
|
||||||
|
};
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete by key
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Family"></param>
|
||||||
|
/// <param name="ValueOriginal"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool DeleteByKey(string Family, string ValueOriginal)
|
||||||
|
{
|
||||||
|
bool done = false;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
var items2del = localDbCtx
|
||||||
|
.AliasList
|
||||||
|
.Where(x => x.Family == Family && x.ValueOriginal == ValueOriginal);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Add to database
|
||||||
|
localDbCtx.AliasList.RemoveRange(items2del);
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"EXCEPTION on Alias.DeleteByKey: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return done;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ricerca record da chiave (=valore ALIAS)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ValueOriginal">Valore ALIAS cercato</param>
|
||||||
|
/// <param name="Family">Famiglia alias cercato (MatCode se non specificato)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public AliasModel FindByDbId(string ValueOriginal, string Family = "MatCode")
|
||||||
|
{
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
return localDbCtx
|
||||||
|
.AliasList
|
||||||
|
.Where(x => x.Family == Family && x.ValueOriginal.ToLower() == ValueOriginal.ToLower())
|
||||||
|
.SingleOrDefault();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco Alias x famiglia
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Family">se "" restituisce tutti</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<AliasModel> GetFilt(string Family)
|
||||||
|
{
|
||||||
|
// retrieve
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
return localDbCtx
|
||||||
|
.AliasList
|
||||||
|
.Where(x => x.Family == Family)
|
||||||
|
.OrderBy(x => x.ValueOriginal)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update or insert Alias record
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="updItem"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool Upsert(AliasModel updItem)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var item2update = localDbCtx
|
||||||
|
.AliasList
|
||||||
|
.Where(x => x.Family == updItem.Family && x.ValueOriginal.Equals(updItem.ValueOriginal, StringComparison.InvariantCulture))
|
||||||
|
.SingleOrDefault();
|
||||||
|
|
||||||
|
if (item2update != null)
|
||||||
|
{
|
||||||
|
// update, vers 1...
|
||||||
|
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
localDbCtx.AliasList.Add(updItem);
|
||||||
|
}
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
fatto = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"EXCEPTION on Alias.Upsert: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update or insert Alias record list
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="updList"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool UpsertList(List<AliasModel> updList)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
foreach (var updItem in updList)
|
||||||
|
{
|
||||||
|
|
||||||
|
var item2update = localDbCtx
|
||||||
|
.AliasList
|
||||||
|
.Where(x => x.Family == updItem.Family && x.ValueOriginal.ToLower() == updItem.ValueOriginal.ToLower())
|
||||||
|
.SingleOrDefault();
|
||||||
|
|
||||||
|
if (item2update != null)
|
||||||
|
{
|
||||||
|
if (item2update.ValueAlias.ToLower() != updItem.ValueAlias.ToLower())
|
||||||
|
{
|
||||||
|
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
localDbCtx.AliasList.Add(updItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
fatto = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"EXCEPTION on Alias.UpsertList: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Eliminazione eventuali record Alias nella lista (se presenti)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="updList"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool DeleteList(List<AliasModel> updList)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
foreach (var updItem in updList)
|
||||||
|
{
|
||||||
|
|
||||||
|
var item2del = localDbCtx
|
||||||
|
.AliasList
|
||||||
|
.Where(x => x.Family == updItem.Family && x.ValueOriginal.ToLower() == updItem.ValueOriginal.ToLower())
|
||||||
|
.SingleOrDefault();
|
||||||
|
|
||||||
|
if (item2del != null)
|
||||||
|
{
|
||||||
|
localDbCtx.AliasList.Remove(item2del);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
fatto = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"EXCEPTION on Alias.DeleteList: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Methods
|
||||||
|
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Istanza logger
|
||||||
|
/// </summary>
|
||||||
|
private Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
using NLog;
|
using NLog;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.Remoting.Contexts;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||||
{
|
{
|
||||||
@@ -41,7 +43,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
bool answ = false;
|
bool answ = false;
|
||||||
string domain = isNetwork ? "%" : "localhost";
|
string domain = isNetwork ? "%" : "localhost";
|
||||||
answ = doCheckCreate(username, pwd, answ, domain, false);
|
answ = doCheckCreate(username, pwd, domain, false);
|
||||||
if (answ)
|
if (answ)
|
||||||
{
|
{
|
||||||
doGrantPriv(username, domain, "ALL ON *.*");
|
doGrantPriv(username, domain, "ALL ON *.*");
|
||||||
@@ -76,36 +78,67 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
bool answ = false;
|
bool answ = false;
|
||||||
|
|
||||||
// in primis refresh delle view
|
try
|
||||||
string sqlCommand = @"CREATE OR REPLACE VIEW v_expProdRaw AS
|
{
|
||||||
SELECT DbId, AlarmDtEvent AS DtEvent, VarValue,
|
// migrazione minima x eseguire refresh viste
|
||||||
|
string minMigration = "202404261445205_UpdateLogMachineTable";
|
||||||
|
//// cerco se ho la migration minima per proseguire...
|
||||||
|
//var numRec = dbCtx
|
||||||
|
// .MigrList
|
||||||
|
// .Where(x => x.MigrationId == minMigration)
|
||||||
|
// .ToList()
|
||||||
|
// .Count;
|
||||||
|
|
||||||
|
//string sqlQuery = $"SELECT 'Migration' AS TableName, COUNT(*) AS Count FROM __MigrationHistory WHERE MigrationId = '{minMigration}' LIMIT 1;";
|
||||||
|
//var table = dbCtx
|
||||||
|
// .DbSetCounts
|
||||||
|
// .SqlQuery(sqlQuery)
|
||||||
|
// .AsNoTracking()
|
||||||
|
//.ToList();
|
||||||
|
|
||||||
|
string sqlQuery = $"SELECT COUNT(*) AS Count FROM __MigrationHistory WHERE MigrationId = '{minMigration}' LIMIT 1;";
|
||||||
|
var total = dbCtx.Database.SqlQuery<int>(sqlQuery).Single();
|
||||||
|
|
||||||
|
//if (table != null && table.Count > 0)
|
||||||
|
if (total > 0)
|
||||||
|
{
|
||||||
|
// in primis refresh delle view
|
||||||
|
string sqlCommand = @"CREATE OR REPLACE VIEW v_expProdRaw AS
|
||||||
|
SELECT DbId, DtEvent, VarValue,
|
||||||
SUBSTRING_INDEX(VarValue, ';', 1) AS Prod,
|
SUBSTRING_INDEX(VarValue, ';', 1) AS Prod,
|
||||||
SUBSTRING_INDEX(SUBSTRING_INDEX(VarValue, ';', 2), ';', -1) AS MachGroupId,
|
SUBSTRING_INDEX(SUBSTRING_INDEX(VarValue, ';', 2), ';', -1) AS MachGroupId,
|
||||||
SUBSTRING_INDEX(SUBSTRING_INDEX(VarValue, ';', -2), ';', 1) AS PartId,
|
SUBSTRING_INDEX(SUBSTRING_INDEX(VarValue, ';', -2), ';', 1) AS PartId,
|
||||||
SUBSTRING_INDEX(VarValue, ';', -1) AS Status
|
SUBSTRING_INDEX(VarValue, ';', -1) AS Status
|
||||||
FROM logmachine
|
FROM logmachine
|
||||||
WHERE ResultType = 1
|
WHERE EvType = 1
|
||||||
AND VarAddress = 1;
|
AND SupervId = 1;
|
||||||
|
|
||||||
CREATE OR REPLACE VIEW v_expProd AS
|
CREATE OR REPLACE VIEW v_expProd AS
|
||||||
SELECT vp.DtEvent, vp.Prod, mgl.Name AS mgName, pl.PDN, vp.`Status`
|
SELECT vp.DtEvent, vp.Prod, mgl.Name AS mgName, pl.PDN, vp.`Status`
|
||||||
FROM v_expProdRaw AS vp
|
FROM v_expProdRaw AS vp
|
||||||
INNER JOIN MachGroupList mgl ON vp.MachGroupId = mgl.Id
|
INNER JOIN MachGroupList mgl ON vp.MachGroupId = mgl.Id
|
||||||
INNER JOIN partlist pl ON vp.PartId = pl.Id;";
|
INNER JOIN partlist pl ON vp.PartId = pl.Id;";
|
||||||
dbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
dbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
|
|
||||||
// ora setup parametri x utente
|
// ora setup parametri x utente
|
||||||
string domain = "%";
|
string domain = "%";
|
||||||
|
|
||||||
// ora controllo utente con diritti
|
// ora controllo utente con diritti
|
||||||
answ = doCheckCreate(username, pwd, answ, domain, true);
|
answ = doCheckCreate(username, pwd, domain, true);
|
||||||
if (answ)
|
if (answ)
|
||||||
{
|
{
|
||||||
doGrantPriv(username, domain, "USAGE ON *.*");
|
doGrantPriv(username, domain, "USAGE ON *.*");
|
||||||
doGrantPriv(username, domain, $"SELECT ON {dbName}.v_expProd");
|
doGrantPriv(username, domain, $"SELECT ON {dbName}.v_expProd");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string errMessage = $"EXCEPTION on DbController.refreshViews: {Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,43 +190,49 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="username"></param>
|
/// <param name="username"></param>
|
||||||
/// <param name="pwd"></param>
|
/// <param name="pwd"></param>
|
||||||
/// <param name="answ"></param>
|
|
||||||
/// <param name="domain"></param>
|
/// <param name="domain"></param>
|
||||||
/// <param name="force">Force = esegue un drop prima...</param>
|
/// <param name="force">Force = esegue un drop prima...</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private bool doCheckCreate(string username, string pwd, bool answ, string domain, bool force)
|
private bool doCheckCreate(string username, string pwd, string domain, bool force)
|
||||||
{
|
{
|
||||||
// ricerca utente...
|
bool answ = false;
|
||||||
var numUser = adbCtx
|
try
|
||||||
.UserList
|
|
||||||
.Where(x => x.User == username)
|
|
||||||
.ToList()
|
|
||||||
.Count;
|
|
||||||
if (numUser > 0)
|
|
||||||
{
|
{
|
||||||
answ = true;
|
// ricerca utente...
|
||||||
}
|
var numUser = adbCtx
|
||||||
if (!answ)
|
.UserList
|
||||||
{
|
.Where(x => x.User == username && x.Host == domain)
|
||||||
// creo utente
|
.ToList()
|
||||||
string sqlCommand = $"DROP USER IF EXISTS {username};";
|
.Count;
|
||||||
if (force)
|
if (numUser > 0)
|
||||||
{
|
{
|
||||||
|
answ = true;
|
||||||
|
}
|
||||||
|
if (!answ)
|
||||||
|
{
|
||||||
|
// creo utente
|
||||||
|
string sqlCommand = $"DROP USER IF EXISTS {username};";
|
||||||
|
if (force)
|
||||||
|
{
|
||||||
|
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||||
|
Thread.Sleep(100);
|
||||||
|
}
|
||||||
|
sqlCommand = "FLUSH PRIVILEGES;";
|
||||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
|
sqlCommand = $"CREATE USER '{username}'@'{domain}' IDENTIFIED BY '{pwd}';";
|
||||||
|
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||||
|
Thread.Sleep(100);
|
||||||
|
sqlCommand = "FLUSH PRIVILEGES;";
|
||||||
|
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
||||||
|
Thread.Sleep(100);
|
||||||
|
answ = true;
|
||||||
}
|
}
|
||||||
sqlCommand = "FLUSH PRIVILEGES;";
|
|
||||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
|
||||||
Thread.Sleep(100);
|
|
||||||
sqlCommand = $"CREATE USER '{username}'@'{domain}' IDENTIFIED BY '{pwd}';";
|
|
||||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
|
||||||
Thread.Sleep(100);
|
|
||||||
sqlCommand = "FLUSH PRIVILEGES;";
|
|
||||||
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
|
|
||||||
Thread.Sleep(100);
|
|
||||||
answ = true;
|
|
||||||
}
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"Eccezione in doCheckCreate:{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||||
|
using EgwProxy.MagMan.DTO;
|
||||||
using NLog;
|
using NLog;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -18,6 +19,24 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper conversione a LogMachineDTO
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static LogMachineDTO ConvToItemDto(LogMachineModel currRec)
|
||||||
|
{
|
||||||
|
LogMachineDTO answ = new LogMachineDTO()
|
||||||
|
{
|
||||||
|
DtEvent = currRec.DtEvent,
|
||||||
|
EvType = (EgwProxy.MagMan.MachLogTypes)currRec.EvType,
|
||||||
|
ProjCloudId = currRec.ProjCloudId,
|
||||||
|
SupervId = currRec.SupervId,
|
||||||
|
VarValue = currRec.VarValue
|
||||||
|
};
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Conversion of base class to DB model class
|
/// Conversion of base class to DB model class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -25,24 +44,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public LogMachineModel ConvertFromCore(Core.MachLog coreMacLog)
|
public LogMachineModel ConvertFromCore(Core.MachLog coreMacLog)
|
||||||
{
|
{
|
||||||
|
int projCloudId = 0;
|
||||||
|
// calcolo projCloudId da ProdId...
|
||||||
|
using (var localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
// Add to database
|
||||||
|
var projRec = localDbCtx.ProdList.Where(x => x.ProdId == coreMacLog.ProdId).FirstOrDefault();
|
||||||
|
if (projRec != null)
|
||||||
|
{
|
||||||
|
projCloudId = projRec.ProjCloudId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// converto!
|
||||||
LogMachineModel answ = new LogMachineModel();
|
LogMachineModel answ = new LogMachineModel();
|
||||||
if (coreMacLog != null)
|
if (coreMacLog != null)
|
||||||
{
|
{
|
||||||
answ = new LogMachineModel()
|
answ = new LogMachineModel()
|
||||||
{
|
{
|
||||||
AlarmCode = coreMacLog.AlarmCode,
|
EvType = coreMacLog.EventType,
|
||||||
AlarmDatetime = coreMacLog.AlarmDateTime,
|
DtEvent = coreMacLog.AlarmDateTime,
|
||||||
AlarmMessage = coreMacLog.AlarmMessage,
|
SupervId = coreMacLog.VarAddress,
|
||||||
AlarmOperation = coreMacLog.AlarmOperation,
|
VarValue = coreMacLog.VarValue,
|
||||||
AlarmType = coreMacLog.AlarmType,
|
ProdId = coreMacLog.ProdId,
|
||||||
CommandExecutedCorrectly = coreMacLog.CommandExecutedCorrectly,
|
ProjCloudId = projCloudId
|
||||||
CommandState = coreMacLog.CommandState,
|
|
||||||
CommandType = coreMacLog.CommandType,
|
|
||||||
Description = coreMacLog.Description,
|
|
||||||
NewOpState = coreMacLog.newOpState,
|
|
||||||
ResultType = coreMacLog.ResultType,
|
|
||||||
VarAddress = coreMacLog.VarAddress,
|
|
||||||
VarValue = coreMacLog.VarValue
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
@@ -55,7 +79,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Core.MachLog ConvertToCore(LogMachineModel dbLog)
|
public Core.MachLog ConvertToCore(LogMachineModel dbLog)
|
||||||
{
|
{
|
||||||
var newRecord = Core.MachLog.CreateMachLog(dbLog.AlarmCode, dbLog.AlarmDatetime, dbLog.AlarmMessage, dbLog.AlarmOperation, dbLog.AlarmType, dbLog.CommandExecutedCorrectly, dbLog.CommandState, dbLog.CommandType, dbLog.Description, dbLog.NewOpState, dbLog.ResultType, dbLog.VarAddress, dbLog.VarValue);
|
var newRecord = (Core.MachLog)Core.MachLog.CreateMachLog(dbLog.EvType, dbLog.DtEvent, dbLog.VarValue, dbLog.ProdId, dbLog.SupervId);
|
||||||
return newRecord;
|
return newRecord;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,38 +90,36 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool Create(LogMachineModel newLogMac)
|
public bool Create(LogMachineModel newLogMac)
|
||||||
{
|
{
|
||||||
bool fatto = false;
|
bool done = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
try
|
using (var locDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
using (var locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
// Add to database
|
||||||
{
|
locDbCtx.LogMachineList.Add(newLogMac);
|
||||||
// Add to database
|
// Commit changes
|
||||||
locallocalDbCtx.LogMachineList.Add(newLogMac);
|
locDbCtx.SaveChanges();
|
||||||
// Commit changes
|
done = true;
|
||||||
locallocalDbCtx.SaveChanges();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception exc)
|
|
||||||
{
|
|
||||||
string errMessage = $"EXCEPTION on LogMachine.Create: {Environment.NewLine}{exc}";
|
|
||||||
Console.WriteLine(errMessage);
|
|
||||||
Log.Error(errMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch (Exception exc)
|
||||||
{ }
|
{
|
||||||
return fatto;
|
string errMessage = $"EXCEPTION on LogMachine.Create: {Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create machine LOG record (da modello dati CORE)
|
/// Create machine LOG record (da modello dati CORE)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="newLogMac"></param>
|
/// <param name="newLogMac">Record Log</param>
|
||||||
|
/// <param name="projDbId">ProjID da DB (locale)</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool Create(Core.MachLog newMachLog)
|
public bool Create(Core.MachLog newMachLog)
|
||||||
{
|
{
|
||||||
|
// converto record
|
||||||
var dbLogModel = ConvertFromCore(newMachLog);
|
var dbLogModel = ConvertFromCore(newMachLog);
|
||||||
return Create(dbLogModel);
|
return Create(dbLogModel);
|
||||||
}
|
}
|
||||||
@@ -147,9 +169,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
return localDbCtx
|
return localDbCtx
|
||||||
.LogMachineList
|
.LogMachineList
|
||||||
.Where(x => x.LogDbId == LogDbId)
|
.Where(x => x.LogDbId == LogDbId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,10 +187,10 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
// retrieve
|
// retrieve
|
||||||
return localDbCtx
|
return localDbCtx
|
||||||
.LogMachineList
|
.LogMachineList
|
||||||
.Where(x => x.AlarmDatetime >= dtStart && x.AlarmDatetime <= dtEnd)
|
.Where(x => x.DtEvent >= dtStart && x.DtEvent <= dtEnd)
|
||||||
.OrderBy(x => x.AlarmDatetime)
|
.OrderBy(x => x.DtEvent)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,13 +232,195 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
// retrieve
|
// retrieve
|
||||||
return localDbCtx
|
return localDbCtx
|
||||||
.LogMachineList
|
.LogMachineList
|
||||||
.Where(x => x.AlarmDatetime >= dtStart && x.AlarmDatetime <= dtEnd)
|
.Where(x => x.DtEvent >= dtStart && x.DtEvent <= dtEnd)
|
||||||
.OrderByDescending(x => x.AlarmDatetime)
|
.OrderByDescending(x => x.DtEvent)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recupero i dati NON sincronizzati in ordine crescente fino al num max indicato
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="numMax"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<LogMachineModel> GetUnsentAsc(int numMax)
|
||||||
|
{
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
// retrieve
|
||||||
|
return localDbCtx
|
||||||
|
.LogMachineList
|
||||||
|
.Where(x => (x.DtSent == null || x.DtSent < x.DtEvent) && x.ProjCloudId > 0)
|
||||||
|
.OrderBy(x => x.DtEvent)
|
||||||
|
.Take(numMax)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creazione LOG record di avvio programma
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool RecordAppStartup()
|
||||||
|
{
|
||||||
|
bool done = false;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (var locDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
// cerco ultimo record registrato
|
||||||
|
var lastRec = locDbCtx
|
||||||
|
.LogMachineList
|
||||||
|
.OrderByDescending(x => x.DtEvent)
|
||||||
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
// cerco ultimo evento chiusura
|
||||||
|
var lastRecClose = locDbCtx
|
||||||
|
.LogMachineList
|
||||||
|
.Where(x => x.EvType == Core.MachLog.MachLogTypes.APPLICATION
|
||||||
|
&& x.VarValue == "0")
|
||||||
|
.OrderByDescending(x => x.DtEvent)
|
||||||
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
// preparo nuovo record avvio!
|
||||||
|
LogMachineModel recStartApp = new LogMachineModel()
|
||||||
|
{
|
||||||
|
DtEvent = DateTime.Now.AddSeconds(-1),
|
||||||
|
EvType = Core.MachLog.MachLogTypes.APPLICATION,
|
||||||
|
VarValue = "1",
|
||||||
|
ProdId = lastRec != null ? lastRec.ProdId : 0,
|
||||||
|
ProjCloudId = lastRec != null ? lastRec.ProjCloudId : 0,
|
||||||
|
SupervId = lastRec != null ? lastRec.SupervId : "1"
|
||||||
|
};
|
||||||
|
|
||||||
|
// verifico esistenza record chiusura...
|
||||||
|
if (lastRecClose != null && lastRec != null)
|
||||||
|
{
|
||||||
|
// se l'ultimo record registrato NON fosse di chiusura... lo genero!
|
||||||
|
if (lastRecClose.DtEvent < lastRec.DtEvent)
|
||||||
|
{
|
||||||
|
var recCloseApp = new LogMachineModel()
|
||||||
|
{
|
||||||
|
DtEvent = lastRec.DtEvent.AddSeconds(1),
|
||||||
|
EvType = recStartApp.EvType,
|
||||||
|
VarValue = "0",
|
||||||
|
ProdId = lastRec != null ? lastRec.ProdId : 0,
|
||||||
|
ProjCloudId = lastRec != null ? lastRec.ProjCloudId : 0,
|
||||||
|
SupervId = lastRec != null ? lastRec.SupervId : "1"
|
||||||
|
};
|
||||||
|
// aggiungo rec chiusura
|
||||||
|
locDbCtx.LogMachineList.Add(recCloseApp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// aggiungo rec avvio
|
||||||
|
locDbCtx.LogMachineList.Add(recStartApp);
|
||||||
|
// salvataggio
|
||||||
|
locDbCtx.SaveChanges();
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string errMessage = $"EXCEPTION on LogMachine.RecordAppStartup: {Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
|
return done;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Aggiorna i record indicati inserendo dataora corrente x DtSent
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="rec2upd"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool SetDtSent(List<LogMachineModel> rec2upd)
|
||||||
|
{
|
||||||
|
bool done = false;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
DateTime adesso = DateTime.Now;
|
||||||
|
foreach (var item in rec2upd)
|
||||||
|
{
|
||||||
|
var currRec = localDbCtx
|
||||||
|
.LogMachineList
|
||||||
|
.Where(x => (x.DtSent == null || x.DtSent < x.DtEvent) && x.LogDbId == item.LogDbId)
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (currRec != null)
|
||||||
|
{
|
||||||
|
currRec.DtSent = adesso;
|
||||||
|
// indico modificato
|
||||||
|
localDbCtx.Entry(currRec).State = System.Data.Entity.EntityState.Modified;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Salvataggio finale
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
}
|
||||||
|
return done;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Cerca di sistemare gli ID di Prod e ProjCloud mancanti
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool TryFixProjCloudId()
|
||||||
|
{
|
||||||
|
// init vars
|
||||||
|
bool fatto = false;
|
||||||
|
int prodId = 0;
|
||||||
|
// vado sul DB
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
// retrieve
|
||||||
|
var list2proc = localDbCtx
|
||||||
|
.LogMachineList
|
||||||
|
.Where(x => x.ProjCloudId == 0 && (x.EvType == Core.MachLog.MachLogTypes.PART_STATUS || x.EvType == Core.MachLog.MachLogTypes.MACHGROUP_STATUS))
|
||||||
|
.OrderBy(x => x.DtEvent)
|
||||||
|
.ToList();
|
||||||
|
// se ci sono...
|
||||||
|
if (list2proc != null && list2proc.Count > 0)
|
||||||
|
{
|
||||||
|
// recupero elenco PROD
|
||||||
|
List<ProdModel> prodList = localDbCtx
|
||||||
|
.ProdList
|
||||||
|
.AsNoTracking()
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
foreach (var item in list2proc)
|
||||||
|
{
|
||||||
|
prodId = 0;
|
||||||
|
// cerco valore
|
||||||
|
string[] dataList = item.VarValue.Split(';');
|
||||||
|
if (dataList != null && dataList.Count() > 0)
|
||||||
|
{
|
||||||
|
int.TryParse(dataList[0], out prodId);
|
||||||
|
// se trovato
|
||||||
|
if (prodId > 0)
|
||||||
|
{
|
||||||
|
// salvo il valore prodId
|
||||||
|
item.ProdId = prodId;
|
||||||
|
// cerco il projCloudId in elenco
|
||||||
|
var projRec = prodList.Where(x => x.ProdId == prodId).FirstOrDefault();
|
||||||
|
if (projRec != null)
|
||||||
|
{
|
||||||
|
item.ProjCloudId = projRec.ProjCloudId;
|
||||||
|
}
|
||||||
|
// indico modificato
|
||||||
|
localDbCtx.Entry(item).State = System.Data.Entity.EntityState.Modified;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// salvo
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
// registro
|
||||||
|
fatto = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// risultato
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update single LogMachineModel
|
/// Update single LogMachineModel
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,322 @@
|
|||||||
|
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||||
|
using EgwProxy.MagMan.DTO;
|
||||||
|
using NLog;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gestione MagmanSync su DB (registrazione operazioni di sync con MagMan online)
|
||||||
|
/// </summary>
|
||||||
|
public class MagmanSyncController : IDisposable
|
||||||
|
{
|
||||||
|
#region Public Constructors
|
||||||
|
|
||||||
|
public MagmanSyncController()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Constructors
|
||||||
|
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Purge dei record inviati oltre periodo di giorni indicato
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="NumDayMax">Num gg max da mantenere in registro</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool DeleteOlder(int NumDayMax)
|
||||||
|
{
|
||||||
|
bool done = false;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
DateTime adesso = DateTime.Now;
|
||||||
|
var items2del = localDbCtx
|
||||||
|
.SyncList
|
||||||
|
.Where(x => x.DtExe != null && adesso.Subtract(x.DtReq).TotalDays > NumDayMax);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Add to database
|
||||||
|
localDbCtx.SyncList.RemoveRange(items2del);
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"EXCEPTION on MagmanSync.DeleteOlder | NumDayMax: {NumDayMax}{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return done;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Purge dei record NON INVIATI date condizioni filtro
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ProjCloudId">Id progetto x cui filtrare</param>
|
||||||
|
/// <param name="SyncType">Tipo di record da cercare</param>
|
||||||
|
/// <param name="DtLimit">DataOra limite (max) x cui cercare record non inviati</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool DeleteUnsentFilt(int ProjCloudId, string SyncType, DateTime DtLimit)
|
||||||
|
{
|
||||||
|
bool done = false;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
// cercl candidati
|
||||||
|
var items2del = localDbCtx
|
||||||
|
.SyncList
|
||||||
|
.Where(x => x.DtExe == null && x.CloudId == ProjCloudId && x.SyncType == SyncType && x.DtReq <= DtLimit);
|
||||||
|
// se ne ho trovato...
|
||||||
|
if (items2del != null && items2del.Count() > 0)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Add to database
|
||||||
|
localDbCtx.SyncList.RemoveRange(items2del);
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"EXCEPTION on MagmanSync.DeleteUnsentFilt | ProjCloudId: {ProjCloudId} | SyncType: {SyncType} | DtLimit: {DtLimit}{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return done;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Lista record filtrati
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="SyncType">Tipo di record richiesti, se "" = tutti</param>
|
||||||
|
/// <param name="DtMax">Data-Ora limite per recupero ordinato DESC</param>
|
||||||
|
/// <param name="NumMax">num max di record da restituire</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<MagmanSyncModel> GetFilt(string SyncType, DateTime DtMax, int NumMax)
|
||||||
|
{
|
||||||
|
List<MagmanSyncModel> dbResult = new List<MagmanSyncModel>();
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
dbResult = localDbCtx
|
||||||
|
.SyncList
|
||||||
|
.Where(x => (string.IsNullOrEmpty(SyncType) || x.SyncType == SyncType) && x.DtReq <= DtMax)
|
||||||
|
.OrderByDescending(x => x.DtReq)
|
||||||
|
.Take(NumMax)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recupero ultimo record di sync dato tipo
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="SyncType">TIpo di sync richiesto, tipicamente ProjArchSync x fix stato archived</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public MagmanSyncModel GetLastBySync(string SyncType)
|
||||||
|
{
|
||||||
|
// record default a 1 anno fa...
|
||||||
|
DateTime dtLim = DateTime.Today.AddYears(-1);
|
||||||
|
MagmanSyncModel dbResult = new MagmanSyncModel()
|
||||||
|
{
|
||||||
|
CloudId = 0,
|
||||||
|
SyncType = SyncType,
|
||||||
|
DtReq = dtLim,
|
||||||
|
Payload = ""
|
||||||
|
};
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
var rawRes = localDbCtx
|
||||||
|
.SyncList
|
||||||
|
.Where(x => (!string.IsNullOrEmpty(SyncType) && x.SyncType == SyncType))
|
||||||
|
.OrderByDescending(x => x.DtReq)
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (rawRes != null)
|
||||||
|
{
|
||||||
|
dbResult = rawRes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Lista record NON inviati filtrati x tipo e num max
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="SyncType">Tipo di record richiesti, se "" = tutti</param>
|
||||||
|
/// <param name="DtMax">Data-Ora limite per recupero ordinato ASC</param>
|
||||||
|
/// <param name="NumMax">num max di record da restituire</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<MagmanSyncModel> GetUnsentFilt(string SyncType, DateTime DtMax, int NumMax)
|
||||||
|
{
|
||||||
|
List<MagmanSyncModel> dbResult = new List<MagmanSyncModel>();
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
dbResult = localDbCtx
|
||||||
|
.SyncList
|
||||||
|
.Where(x => x.DtExe == null && (string.IsNullOrEmpty(SyncType) || x.SyncType == SyncType) && x.DtReq <= DtMax)
|
||||||
|
.OrderBy(x => x.DtReq)
|
||||||
|
.Take(NumMax)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return dbResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Insert record MagmanSync
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="newRec"></param>
|
||||||
|
/// <returns>ID record inserito</returns>
|
||||||
|
public int Insert(MagmanSyncModel newRec)
|
||||||
|
{
|
||||||
|
int newId = 0;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// inserisco record
|
||||||
|
localDbCtx.SyncList.Add(newRec);
|
||||||
|
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
newId = newRec.SyncId;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"EXCEPTION on MagmanSync.Insert: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return newId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update con indicazione DtExt di completamento
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="SyncId">ID record</param>
|
||||||
|
/// <param name="DtExe">Data-Ora exe</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool SetCompleted(int SyncId, DateTime DtExe)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var item2update = localDbCtx
|
||||||
|
.SyncList
|
||||||
|
.Where(x => x.SyncId == SyncId)
|
||||||
|
.SingleOrDefault();
|
||||||
|
|
||||||
|
if (item2update != null)
|
||||||
|
{
|
||||||
|
// update
|
||||||
|
item2update.DtExe = DtExe;
|
||||||
|
localDbCtx.Entry(item2update).State = System.Data.Entity.EntityState.Modified;
|
||||||
|
}
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
fatto = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"EXCEPTION on MagmanSync.SetCompleted: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update or insert record MagmanSync
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="updItem"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool Upsert(MagmanSyncModel updItem)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var item2update = localDbCtx
|
||||||
|
.SyncList
|
||||||
|
.Where(x => x.SyncId == updItem.SyncId)
|
||||||
|
.SingleOrDefault();
|
||||||
|
|
||||||
|
if (item2update != null)
|
||||||
|
{
|
||||||
|
// update, vers 1...
|
||||||
|
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
localDbCtx.SyncList.Add(updItem);
|
||||||
|
}
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
fatto = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"EXCEPTION on MagmanSync.Upsert: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update or insert Alias record list
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="updList"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool UpsertList(List<MagmanSyncModel> updList)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
foreach (var updItem in updList)
|
||||||
|
{
|
||||||
|
var item2update = localDbCtx
|
||||||
|
.SyncList
|
||||||
|
.Where(x => x.SyncId == updItem.SyncId)
|
||||||
|
.SingleOrDefault();
|
||||||
|
|
||||||
|
if (item2update != null)
|
||||||
|
{
|
||||||
|
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
localDbCtx.SyncList.Add(updItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
fatto = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"EXCEPTION on MagmanSync.UpsertList: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Methods
|
||||||
|
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Istanza logger
|
||||||
|
/// </summary>
|
||||||
|
private Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,538 @@
|
|||||||
|
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||||
|
using EgwProxy.MagMan.DTO;
|
||||||
|
using NLog;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using static EgtBEAMWALL.DataLayer.Controllers.MaterialsController.SearchResult;
|
||||||
|
|
||||||
|
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gestione Materiali su DB (= magazzino locale)
|
||||||
|
/// </summary>
|
||||||
|
public class MaterialsController : IDisposable
|
||||||
|
{
|
||||||
|
#region Public Constructors
|
||||||
|
|
||||||
|
public MaterialsController()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Constructors
|
||||||
|
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Conversion of DB model class to base class
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="coreMat"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static Core.MaterialM ConvToCore(MaterialModel dbRec)
|
||||||
|
{
|
||||||
|
Core.MaterialM answ = new Core.MaterialM(dbRec.MatId, (double)dbRec.WMm, (double)dbRec.HMm, (double)dbRec.LMm, "", dbRec.MatCode);
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper conversione a DTO
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static MaterialDTO ConvToDto(MaterialModel currRec)
|
||||||
|
{
|
||||||
|
MaterialDTO answ = new MaterialDTO()
|
||||||
|
{
|
||||||
|
MatCloudId = currRec.MatCloudId,
|
||||||
|
MatLocalId = currRec.MatId,
|
||||||
|
MatCode = currRec.MatCode,
|
||||||
|
MatDesc = currRec.MatDesc,
|
||||||
|
HMm = currRec.HMm,
|
||||||
|
LMm = currRec.LMm,
|
||||||
|
WMm = currRec.WMm
|
||||||
|
};
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper conversione da DTO
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static MaterialModel ConvToModel(MaterialDTO currRec)
|
||||||
|
{
|
||||||
|
MaterialModel answ = new MaterialModel()
|
||||||
|
{
|
||||||
|
MatCloudId = currRec.MatCloudId,
|
||||||
|
MatId = currRec.MatLocalId,
|
||||||
|
MatCode = currRec.MatCode,
|
||||||
|
MatDesc = currRec.MatDesc,
|
||||||
|
HMm = currRec.HMm,
|
||||||
|
LMm = currRec.LMm,
|
||||||
|
WMm = currRec.WMm
|
||||||
|
};
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Conversion of base class to DB model class
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="coreRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static MaterialModel ConvToModel(Core.MaterialM coreRec)
|
||||||
|
{
|
||||||
|
MaterialModel answ = new MaterialModel();
|
||||||
|
if (coreRec != null)
|
||||||
|
{
|
||||||
|
answ = new MaterialModel()
|
||||||
|
{
|
||||||
|
MatId = coreRec.nId,
|
||||||
|
MatCode = coreRec.sWarehouseMaterial,
|
||||||
|
HMm = (decimal)Math.Round(coreRec.dH, 2),
|
||||||
|
LMm = (decimal)Math.Round(coreRec.dL, 2),
|
||||||
|
WMm = (decimal)Math.Round(coreRec.dW, 2),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete by key
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="MatId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool DeleteByKey(int MatId)
|
||||||
|
{
|
||||||
|
bool done = false;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
var items2del = localDbCtx
|
||||||
|
.MaterialsList
|
||||||
|
.Where(x => x.MatId == MatId);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Add to database
|
||||||
|
localDbCtx.MaterialsList.RemoveRange(items2del);
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"EXCEPTION on Materials.DeleteByKey: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return done;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get record by Key
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="MatId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Core.MaterialM FindByDbId(int MatId)
|
||||||
|
{
|
||||||
|
Core.MaterialM result = new Core.MaterialM(0, 0, 0, "", "");
|
||||||
|
var rawData = FindByDbIdModel(MatId);
|
||||||
|
if (rawData != null)
|
||||||
|
{
|
||||||
|
result = ConvToCore(rawData);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get record by Key in formato Model
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="MatId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public MaterialModel FindByDbIdModel(int MatId)
|
||||||
|
{
|
||||||
|
MaterialModel result = new MaterialModel();
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
result = localDbCtx
|
||||||
|
.MaterialsList
|
||||||
|
.Where(x => x.MatId == MatId)
|
||||||
|
.SingleOrDefault();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get Material (filtro x MatId) in formato Core
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="MatCode">se "" restituisce tutti</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<Core.MaterialM> GetFilt(string MatCode)
|
||||||
|
{
|
||||||
|
// recupero e converto
|
||||||
|
List<Core.MaterialM> result = new List<Core.MaterialM>();
|
||||||
|
var rawData = GetFiltModel(MatCode);
|
||||||
|
if (rawData != null)
|
||||||
|
{
|
||||||
|
result = rawData.Select(x => ConvToCore(x)).ToList();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get Material (filtro x MatId) in formato Model
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="MatCode">se "" restituisce tutti</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<MaterialModel> GetFiltModel(string MatCode)
|
||||||
|
{
|
||||||
|
List<MaterialModel> result = new List<MaterialModel>();
|
||||||
|
// retrieve
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
result = localDbCtx
|
||||||
|
.MaterialsList
|
||||||
|
.Where(x => string.IsNullOrEmpty(MatCode) || x.MatCode == MatCode)
|
||||||
|
.OrderBy(x => x.MatDesc)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Insert Material record from CoreM if missing or return existing (for Id)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="coreItem"></param>
|
||||||
|
/// <returns>MatId (existing or new)</returns>
|
||||||
|
public int Insert(Core.MaterialM coreItem)
|
||||||
|
{
|
||||||
|
int newIdx = 0;
|
||||||
|
// converto
|
||||||
|
MaterialModel updItem = ConvToModel(coreItem);
|
||||||
|
newIdx = Insert(updItem);
|
||||||
|
return newIdx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Insert Material record
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="updItem"></param>
|
||||||
|
/// <returns>MatId (existing or new)</returns>
|
||||||
|
public int Insert(MaterialModel updItem)
|
||||||
|
{
|
||||||
|
int newIdx = 0;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var item2update = localDbCtx
|
||||||
|
.MaterialsList
|
||||||
|
.Where(x => (updItem.MatId > 0 && x.MatId == updItem.MatId)
|
||||||
|
|| (updItem.MatCloudId > 0 && x.MatCloudId == updItem.MatCloudId)
|
||||||
|
|| (x.MatCode == updItem.MatCode && x.WMm == updItem.WMm && x.HMm == updItem.HMm && x.LMm == updItem.LMm))
|
||||||
|
.OrderBy(x => x.MatId)
|
||||||
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
if (item2update != null)
|
||||||
|
{
|
||||||
|
newIdx = item2update.MatId;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
localDbCtx.MaterialsList.Add(updItem);
|
||||||
|
// verifico se c'è già "alias original"
|
||||||
|
var aliasOrig = localDbCtx
|
||||||
|
.AliasList
|
||||||
|
.Where(x => x.ValueOriginal == updItem.MatCode)
|
||||||
|
.FirstOrDefault();
|
||||||
|
if (aliasOrig == null || string.IsNullOrEmpty(aliasOrig.ValueOriginal) || aliasOrig.ValueOriginal != updItem.MatCode)
|
||||||
|
{
|
||||||
|
// inserisco alias!
|
||||||
|
localDbCtx.AliasList.Add(new AliasModel() { Family = "MatCode", ValueOriginal = updItem.MatCode, ValueAlias = updItem.MatCode });
|
||||||
|
}
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
newIdx = updItem.MatId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"EXCEPTION on Materials.Insert: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return newIdx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get Last RawItem used for Material
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="updItem"></param>
|
||||||
|
/// <returns>Returns 0 if not found</returns>
|
||||||
|
public int LastRawItemGet(int MatId)
|
||||||
|
{
|
||||||
|
int RawItemIdLast = 0;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var item2update = localDbCtx
|
||||||
|
.MaterialsList
|
||||||
|
.Where(x => (MatId > 0 && x.MatId == MatId))
|
||||||
|
.SingleOrDefault();
|
||||||
|
|
||||||
|
if (item2update != null)
|
||||||
|
{
|
||||||
|
RawItemIdLast = item2update.RawItemIdLast;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"EXCEPTION on Materials.LastRawItemGet: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return RawItemIdLast;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update Last RawItem used for Material record
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="MatId">Id locale materiale</param>
|
||||||
|
/// <param name="RawItemIdLast">Id del RawItem</param>
|
||||||
|
/// <returns>Returns true if updated</returns>
|
||||||
|
public bool LastRawItemSet(int MatId, int RawItemIdLast)
|
||||||
|
{
|
||||||
|
bool done = false;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var item2update = localDbCtx
|
||||||
|
.MaterialsList
|
||||||
|
.Where(x => (MatId > 0 && x.MatId == MatId))
|
||||||
|
.SingleOrDefault();
|
||||||
|
|
||||||
|
if (item2update != null)
|
||||||
|
{
|
||||||
|
item2update.RawItemIdLast = RawItemIdLast;
|
||||||
|
localDbCtx.Entry(item2update).State = System.Data.Entity.EntityState.Modified;
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"EXCEPTION on Materials.LastRawItemSet: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return done;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Restituisce il primo materiale (se esiste) per MatCode (diretto o tramite Alias)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="MatCode">Non accetta ""</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public SearchResult SearchFilt(string MatCode)
|
||||||
|
{
|
||||||
|
// init valori esito ricerca + risultato
|
||||||
|
TypeFound esito = string.IsNullOrEmpty(MatCode) ? TypeFound.MISSING_CODE : TypeFound.NOT_FOUND;
|
||||||
|
List<Core.MaterialM> result = new List<Core.MaterialM>();
|
||||||
|
// solo se ho una VERA ricerca x MatCode
|
||||||
|
if (!string.IsNullOrEmpty(MatCode))
|
||||||
|
{
|
||||||
|
// cerco nei materiali
|
||||||
|
var rawData = GetFiltModel(MatCode);
|
||||||
|
if (rawData != null && rawData.Count > 0)
|
||||||
|
{
|
||||||
|
// ...e converto
|
||||||
|
result = rawData.Select(x => ConvToCore(x)).ToList();
|
||||||
|
esito = TypeFound.MATERIAL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// cerco negli alias...
|
||||||
|
using (AliasController aliasDbContr = new AliasController())
|
||||||
|
{
|
||||||
|
var aliasRec = aliasDbContr.FindByDbId(MatCode);
|
||||||
|
if (aliasRec != null)
|
||||||
|
{
|
||||||
|
rawData = GetFiltModel(aliasRec.ValueAlias);
|
||||||
|
if (rawData != null && rawData.Count > 0)
|
||||||
|
{
|
||||||
|
// ...e converto
|
||||||
|
result = rawData.Select(x => ConvToCore(x)).ToList();
|
||||||
|
esito = TypeFound.ALIAS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// compongo risposta!
|
||||||
|
SearchResult answ = new SearchResult()
|
||||||
|
{
|
||||||
|
Tipo = esito,
|
||||||
|
Result = result
|
||||||
|
};
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update Material record from CoreM
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="coreItem"></param>
|
||||||
|
/// <returns>Returns 0 if not found</returns>
|
||||||
|
public int Update(Core.MaterialM coreItem)
|
||||||
|
{
|
||||||
|
int newIdx = 0;
|
||||||
|
// converto
|
||||||
|
MaterialModel updItem = ConvToModel(coreItem);
|
||||||
|
newIdx = Update(updItem);
|
||||||
|
return newIdx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update Material record
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="updItem"></param>
|
||||||
|
/// <returns>Returns 0 if not found</returns>
|
||||||
|
public int Update(MaterialModel updItem)
|
||||||
|
{
|
||||||
|
int newIdx = 0;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var item2update = localDbCtx
|
||||||
|
.MaterialsList
|
||||||
|
.Where(x => (updItem.MatId > 0 && x.MatId == updItem.MatId)
|
||||||
|
|| (updItem.MatCloudId > 0 && x.MatCloudId == updItem.MatCloudId)
|
||||||
|
|| (x.MatCode == updItem.MatCode && x.WMm == updItem.WMm && x.HMm == updItem.HMm && x.LMm == updItem.LMm))
|
||||||
|
.SingleOrDefault();
|
||||||
|
|
||||||
|
if (item2update != null)
|
||||||
|
{
|
||||||
|
//// update, vers 1...
|
||||||
|
//localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||||
|
item2update.MatCloudId = updItem.MatCloudId;
|
||||||
|
// aggiorno SE presente...
|
||||||
|
if (!string.IsNullOrEmpty(updItem.MatDesc))
|
||||||
|
{
|
||||||
|
item2update.MatDesc = updItem.MatDesc;
|
||||||
|
}
|
||||||
|
localDbCtx.Entry(item2update).State = System.Data.Entity.EntityState.Modified;
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
newIdx = item2update.MatId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"EXCEPTION on Materials.Update: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return newIdx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Upsert Material record
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="updItem"></param>
|
||||||
|
/// <returns>MatId (existing or new)</returns>
|
||||||
|
public int Upsert(MaterialModel updItem)
|
||||||
|
{
|
||||||
|
int newIdx = 0;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var item2update = localDbCtx
|
||||||
|
.MaterialsList
|
||||||
|
.Where(x => (updItem.MatId > 0 && x.MatId == updItem.MatId)
|
||||||
|
|| (updItem.MatCloudId > 0 && x.MatCloudId == updItem.MatCloudId)
|
||||||
|
|| (x.MatCode == updItem.MatCode && x.WMm == updItem.WMm && x.HMm == updItem.HMm && x.LMm == updItem.LMm))
|
||||||
|
.SingleOrDefault();
|
||||||
|
|
||||||
|
if (item2update != null)
|
||||||
|
{
|
||||||
|
//// update, vers 1...
|
||||||
|
//localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||||
|
item2update.MatCloudId = updItem.MatCloudId;
|
||||||
|
// aggiorno SE presente...
|
||||||
|
if (!string.IsNullOrEmpty(updItem.MatDesc))
|
||||||
|
{
|
||||||
|
item2update.MatDesc = updItem.MatDesc;
|
||||||
|
}
|
||||||
|
localDbCtx.Entry(item2update).State = System.Data.Entity.EntityState.Modified;
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
newIdx = item2update.MatId;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
localDbCtx.MaterialsList.Add(updItem);
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
newIdx = updItem.MatId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"EXCEPTION on Materials.Insert: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return newIdx;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Methods
|
||||||
|
|
||||||
|
#region Public Classes
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Risultato ricerca materiali
|
||||||
|
/// </summary>
|
||||||
|
public class SearchResult
|
||||||
|
{
|
||||||
|
#region Public Enums
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum del risultato della ricerca materiali
|
||||||
|
/// </summary>
|
||||||
|
public enum TypeFound
|
||||||
|
{
|
||||||
|
MISSING_CODE = 0,
|
||||||
|
NOT_FOUND,
|
||||||
|
ALIAS,
|
||||||
|
MATERIAL
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Enums
|
||||||
|
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Materiali trovati
|
||||||
|
/// </summary>
|
||||||
|
public List<Core.MaterialM> Result { get; set; } = new List<Core.MaterialM>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tipologia oggetto trovato
|
||||||
|
/// </summary>
|
||||||
|
public TypeFound Tipo { get; set; } = TypeFound.MISSING_CODE;
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Classes
|
||||||
|
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Istanza logger
|
||||||
|
/// </summary>
|
||||||
|
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -203,9 +203,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public PartModel FindByPartId(int ProdId, int PartId)
|
public PartModel FindByPartId(int ProdId, int PartId)
|
||||||
{
|
{
|
||||||
PartModel answ = null;
|
PartModel answ = null;
|
||||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext locDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
answ = locallocalDbCtx
|
answ = locDbCtx
|
||||||
.PartList
|
.PartList
|
||||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.PartId == PartId)
|
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.PartId == PartId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
@@ -221,10 +221,10 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public bool Update(PartModel updItem)
|
public bool Update(PartModel updItem)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext locDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var myStatusMapCtrl = new StatusMapController();
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
var item2upd = locallocalDbCtx
|
var item2upd = locDbCtx
|
||||||
.PartList
|
.PartList
|
||||||
.Where(x => x.PartDbId == updItem.PartDbId)
|
.Where(x => x.PartDbId == updItem.PartDbId)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
@@ -233,14 +233,14 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// update, vers 1...
|
// update, vers 1...
|
||||||
locallocalDbCtx.Entry(item2upd).CurrentValues.SetValues(updItem);
|
locDbCtx.Entry(item2upd).CurrentValues.SetValues(updItem);
|
||||||
|
|
||||||
//// update, vers 2
|
//// update, vers 2
|
||||||
//localDbCtx.PartList.Remove(item2del);
|
//localDbCtx.PartList.Remove(item2del);
|
||||||
//localDbCtx.PartList.Add(updItem);
|
//localDbCtx.PartList.Add(updItem);
|
||||||
|
|
||||||
// Commit changes
|
// Commit changes
|
||||||
locallocalDbCtx.SaveChanges();
|
locDbCtx.SaveChanges();
|
||||||
done = true;
|
done = true;
|
||||||
// aggiorno info sullo status
|
// aggiorno info sullo status
|
||||||
myStatusMapCtrl.UpdateAction("", updItem.MachGroup.Prod.ProdId, updItem.PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.MachGroupMod, "");
|
myStatusMapCtrl.UpdateAction("", updItem.MachGroup.Prod.ProdId, updItem.PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.MachGroupMod, "");
|
||||||
@@ -271,13 +271,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public bool UpdateEnd(int ProdId, int MachGroupId, int PartId, DateTime DtEnd)
|
public bool UpdateEnd(int ProdId, int MachGroupId, int PartId, DateTime DtEnd)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext locDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var myStatusMapCtrl = new StatusMapController();
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
var item2upd = locallocalDbCtx
|
var item2upd = locDbCtx
|
||||||
.PartList
|
.PartList
|
||||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
@@ -286,7 +286,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
item2upd.DtEnd = DtEnd;
|
item2upd.DtEnd = DtEnd;
|
||||||
// Commit changes
|
// Commit changes
|
||||||
locallocalDbCtx.SaveChanges();
|
locDbCtx.SaveChanges();
|
||||||
done = true;
|
done = true;
|
||||||
// aggiorno info sullo status
|
// aggiorno info sullo status
|
||||||
myStatusMapCtrl.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
|
myStatusMapCtrl.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
|
||||||
@@ -317,13 +317,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public bool UpdateStart(int ProdId, int MachGroupId, int PartId, DateTime DtStart)
|
public bool UpdateStart(int ProdId, int MachGroupId, int PartId, DateTime DtStart)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext locDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var myStatusMapCtrl = new StatusMapController();
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
var item2upd = locallocalDbCtx
|
var item2upd = locDbCtx
|
||||||
.PartList
|
.PartList
|
||||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
@@ -331,7 +331,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
item2upd.DtStart = DtStart;
|
item2upd.DtStart = DtStart;
|
||||||
// Commit changes
|
// Commit changes
|
||||||
locallocalDbCtx.SaveChanges();
|
locDbCtx.SaveChanges();
|
||||||
done = true;
|
done = true;
|
||||||
// aggiorno info sullo status
|
// aggiorno info sullo status
|
||||||
myStatusMapCtrl.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
|
myStatusMapCtrl.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
|
||||||
@@ -363,13 +363,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
public bool UpdateStatus(int ProdId, int MachGroupId, int PartId, Core.ItemState newState)
|
public bool UpdateStatus(int ProdId, int MachGroupId, int PartId, Core.ItemState newState)
|
||||||
{
|
{
|
||||||
bool done = false;
|
bool done = false;
|
||||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext locDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var myStatusMapCtrl = new StatusMapController();
|
var myStatusMapCtrl = new StatusMapController();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// aggiorno
|
// aggiorno
|
||||||
var item2upd = locallocalDbCtx
|
var item2upd = locDbCtx
|
||||||
.PartList
|
.PartList
|
||||||
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
@@ -377,7 +377,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
item2upd.State = newState;
|
item2upd.State = newState;
|
||||||
// Commit changes
|
// Commit changes
|
||||||
locallocalDbCtx.SaveChanges();
|
locDbCtx.SaveChanges();
|
||||||
done = true;
|
done = true;
|
||||||
// aggiorno info sullo status
|
// aggiorno info sullo status
|
||||||
myStatusMapCtrl.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, newState == Core.ItemState.Scrapped ? Core.StatusMapOpType.SetPartScrapped : Core.StatusMapOpType.MachGroupMod, "");
|
myStatusMapCtrl.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, newState == Core.ItemState.Scrapped ? Core.StatusMapOpType.SetPartScrapped : Core.StatusMapOpType.MachGroupMod, "");
|
||||||
@@ -405,7 +405,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
#region Protected Methods
|
#region Protected Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get BtlPartDBId by ProjId + PDN
|
/// Get BtlPartDBId by ProdId + PDN
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ProjId"></param>
|
/// <param name="ProjId"></param>
|
||||||
/// <param name="PDN"></param>
|
/// <param name="PDN"></param>
|
||||||
@@ -414,9 +414,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
int BtlPartDbId = 0;
|
int BtlPartDbId = 0;
|
||||||
|
|
||||||
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext locDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
var btlPart = locallocalDbCtx
|
var btlPart = locDbCtx
|
||||||
.BTLPartList
|
.BTLPartList
|
||||||
.Where(x => x.Project.ProjId == ProjId && x.PDN == PDN)
|
.Where(x => x.Project.ProjId == ProjId && x.PDN == PDN)
|
||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
@@ -430,7 +430,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get BtlPartDBId by ProjId + BtlPartId
|
/// Get BtlPartDBId by ProdId + BtlPartId
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ProjId"></param>
|
/// <param name="ProjId"></param>
|
||||||
/// <param name="BtlPartId"></param>
|
/// <param name="BtlPartId"></param>
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||||
|
using EgwProxy.MagMan.DTO;
|
||||||
using NLog;
|
using NLog;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Data.Entity;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Linq.Expressions;
|
||||||
using static EgtBEAMWALL.Core.ConstBeam;
|
using static EgtBEAMWALL.Core.ConstBeam;
|
||||||
|
|
||||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||||
@@ -20,6 +23,42 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper conversione a ProjectDTO
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec">record in formato ProdModel</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static ProjectDTO ConvToDto(ProdModel currRec)
|
||||||
|
{
|
||||||
|
// ho valori mancanti che saranno calcolati dal cloud e valori messi a zero di default
|
||||||
|
ProjectDTO answ = new ProjectDTO()
|
||||||
|
{
|
||||||
|
ProjCloudId = currRec.ProjCloudId,
|
||||||
|
ProjLocalId = currRec.ProdDbId,
|
||||||
|
ProjExtId = currRec.ProdId,
|
||||||
|
// è calcolato sul cloud, da token --> machine ID
|
||||||
|
MachineCloudId = 0,
|
||||||
|
// è calcolato sul cloud, da token --> KeyNum
|
||||||
|
KeyNum = 0,
|
||||||
|
// disponibile solo su PROJ
|
||||||
|
BTLFileName = "",
|
||||||
|
PType = (EgwProxy.MagMan.BWType)currRec.PType,
|
||||||
|
Machine = currRec.Machine,
|
||||||
|
ProjDescription = currRec.Description,
|
||||||
|
DtCreated = currRec.DtCreated,
|
||||||
|
DtLastAction = DateTime.MinValue,
|
||||||
|
DtSchedule = DateTime.MinValue,
|
||||||
|
DtStartProd = DateTime.MinValue,
|
||||||
|
// disponibile solo su PROJ
|
||||||
|
ListName = "",
|
||||||
|
ProcTimeEst = 0,
|
||||||
|
ProcTimeReal = 0,
|
||||||
|
IsActive = currRec.IsActive,
|
||||||
|
IsArchived = currRec.IsArchived
|
||||||
|
};
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Aggiunta di un PROJ ad un PROD
|
/// Aggiunta di un PROJ ad un PROD
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -57,6 +96,39 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper conversione modelli verso Core.ProdItem
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currProd"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Core.ProdItem ConvToCore(ProdModel currProd)
|
||||||
|
{
|
||||||
|
Core.ProdItem answ = Core.ProdItem.CreateProdItem(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived, currProd.ProjListNav.Select(j => Core.ProjFileM.CreateProjFileM(j.ProjId, currProd.ProdId, j.DtCreated, j.DtExported, j.ListName, j.BTLFileName, j.ProjDescription, j.IsNew, j.Locked, j.PType, j.Machine, j.IsActive, j.IsActive, j.ProjCloudId)).ToList());
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper conversione modelli verso Core.ProdItem
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currProd"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Core.ProdItem ConvToCore(ProjModel currProj)
|
||||||
|
{
|
||||||
|
Core.ProdItem answ = Core.ProdItem.CreateProdItem(Core.ProjFileM.CreateProjFileM(currProj.ProjId, 0, currProj.DtCreated, currProj.DtExported, currProj.ListName, currProj.BTLFileName, currProj.ProjDescription, currProj.IsNew, currProj.Locked, currProj.PType, currProj.Machine, currProj.IsActive, currProj.IsActive, currProj.ProjCloudId));
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper conversione modelli
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currProd"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Core.ProdFileM ConvToCoreFile(ProdModel currProd)
|
||||||
|
{
|
||||||
|
Core.ProdFileM answ = Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived, currProd.ProjCloudId);
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Delete Prod(+proj...) logically / on DB by ProdId
|
/// Delete Prod(+proj...) logically / on DB by ProdId
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -95,6 +167,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
}
|
}
|
||||||
// segno eliminazione logica al prod
|
// segno eliminazione logica al prod
|
||||||
currProd.IsActive = false;
|
currProd.IsActive = false;
|
||||||
|
currProd.DtLastMod = DateTime.Now;
|
||||||
// Commit changes
|
// Commit changes
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
done = true;
|
done = true;
|
||||||
@@ -202,17 +275,17 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived);
|
return Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived, currProd.ProjCloudId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elenco prod
|
/// Elenco prod
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="numRecord">Num max record da recuperare</param>
|
/// <param name="NumRecord">Num max record da recuperare</param>
|
||||||
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
|
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
|
||||||
/// <param name="ShowArchived">Se true: mostra anche archiviati (default li nasconde)</param>
|
/// <param name="ShowArchived">Se true: mostra anche archiviati (default li nasconde)</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<Core.ProdFileM> GetLastDesc(int numRecord, bool OnlyActive, bool ShowArchived = false)
|
public List<Core.ProdFileM> GetLastDesc(int NumRecord, bool OnlyActive, bool ShowArchived = false)
|
||||||
{
|
{
|
||||||
List<Core.ProdFileM> result = new List<Core.ProdFileM>();
|
List<Core.ProdFileM> result = new List<Core.ProdFileM>();
|
||||||
//List<ProdModel> dbResult = GetLastDbModelDesc(numRecord);
|
//List<ProdModel> dbResult = GetLastDbModelDesc(numRecord);
|
||||||
@@ -220,9 +293,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
// se numRecord = 0 --> passo tutti
|
// se numRecord = 0 --> passo tutti
|
||||||
if (numRecord == 0)
|
if (NumRecord == 0)
|
||||||
{
|
{
|
||||||
numRecord = localDbCtx.ProdList.Count();
|
NumRecord = localDbCtx.ProdList.Count();
|
||||||
}
|
}
|
||||||
// retrieve
|
// retrieve
|
||||||
dbResult = localDbCtx
|
dbResult = localDbCtx
|
||||||
@@ -235,25 +308,25 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
(p, e) => p)
|
(p, e) => p)
|
||||||
.Distinct()
|
.Distinct()
|
||||||
.OrderByDescending(x => x.ProdId)
|
.OrderByDescending(x => x.ProdId)
|
||||||
.Take(numRecord)
|
.Take(NumRecord)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
// conversione
|
// conversione
|
||||||
result = dbResult.Select(x => Core.ProdFileM.CreateProdFileM(x.ProdId, ProjIdByProd(x.ProdId), x.DtCreated, x.Description, x.PType, x.Machine, x.LockedBy, x.LockDate, x.IsActive, x.IsProduced, x.IsArchived)).ToList();
|
result = dbResult.Select(x => Core.ProdFileM.CreateProdFileM(x.ProdId, ProjIdByProd(x.ProdId), x.DtCreated, x.Description, x.PType, x.Machine, x.LockedBy, x.LockDate, x.IsActive, x.IsProduced, x.IsArchived, x.ProjCloudId)).ToList();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Elenco prod
|
/// Elenco prod
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dtStart">Inizio periodo estrazione</param>
|
/// <param name="DtStart">Inizio periodo estrazione</param>
|
||||||
/// <param name="dtEnd">Fine periodo estrazione</param>
|
/// <param name="DtEnd">Fine periodo estrazione</param>
|
||||||
/// <param name="numRecord">Num max record da recuperare</param>
|
/// <param name="NumRecord">Num max record da recuperare</param>
|
||||||
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
|
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
|
||||||
/// <param name="ShowArchived">Se true: mostra anche archiviati (default li nasconde)</param>
|
/// <param name="ShowArchived">Se true: mostra anche archiviati (default li nasconde)</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<Core.ProdFileM> GetLastDesc(DateTime dtStart, DateTime dtEnd, int numRecord, bool OnlyActive, bool ShowArchived = false)
|
public List<Core.ProdFileM> GetLastDesc(DateTime DtStart, DateTime DtEnd, int NumRecord, bool OnlyActive, bool ShowArchived = false)
|
||||||
{
|
{
|
||||||
List<Core.ProdFileM> result = new List<Core.ProdFileM>();
|
List<Core.ProdFileM> result = new List<Core.ProdFileM>();
|
||||||
//List<ProdModel> dbResult = GetLastDbModelDesc(numRecord);
|
//List<ProdModel> dbResult = GetLastDbModelDesc(numRecord);
|
||||||
@@ -261,14 +334,14 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
// se numRecord = 0 --> passo tutti
|
// se numRecord = 0 --> passo tutti
|
||||||
if (numRecord == 0)
|
if (NumRecord == 0)
|
||||||
{
|
{
|
||||||
numRecord = localDbCtx.ProdList.Count();
|
NumRecord = localDbCtx.ProdList.Count();
|
||||||
}
|
}
|
||||||
// retrieve
|
// retrieve
|
||||||
dbResult = localDbCtx
|
dbResult = localDbCtx
|
||||||
.ProdList
|
.ProdList
|
||||||
.Where(x => x.DtCreated >= dtStart && x.DtCreated <= dtEnd && (!x.IsArchived || ShowArchived))
|
.Where(x => x.DtCreated >= DtStart && x.DtCreated <= DtEnd && (!x.IsArchived || ShowArchived))
|
||||||
// condizione join sui PROJ
|
// condizione join sui PROJ
|
||||||
.Join(localDbCtx.ProjList.Where(x => x.IsActive || !OnlyActive),
|
.Join(localDbCtx.ProjList.Where(x => x.IsActive || !OnlyActive),
|
||||||
p => p.ProdDbId,
|
p => p.ProdDbId,
|
||||||
@@ -276,15 +349,210 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
(p, e) => p)
|
(p, e) => p)
|
||||||
.Distinct()
|
.Distinct()
|
||||||
.OrderByDescending(x => x.ProdId)
|
.OrderByDescending(x => x.ProdId)
|
||||||
.Take(numRecord)
|
.Take(NumRecord)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
// conversione
|
// conversione
|
||||||
result = dbResult.Select(x => Core.ProdFileM.CreateProdFileM(x.ProdId, ProjIdByProd(x.ProdId), x.DtCreated, x.Description, x.PType, x.Machine, x.LockedBy, x.LockDate, x.IsActive, x.IsProduced, x.IsArchived)).ToList();
|
result = dbResult.Select(x => Core.ProdFileM.CreateProdFileM(x.ProdId, ProjIdByProd(x.ProdId), x.DtCreated, x.Description, x.PType, x.Machine, x.LockedBy, x.LockDate, x.IsActive, x.IsProduced, x.IsArchived, x.ProjCloudId)).ToList();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco prod
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="NumRecord">Num max record da recuperare</param>
|
||||||
|
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
|
||||||
|
/// <param name="ShowArchived">Se true: mostra anche archiviati (default li nasconde)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<Core.ProdItem> GetLastDescFull(int NumRecord, bool OnlyActive, bool ShowArchived = false)
|
||||||
|
{
|
||||||
|
List<Core.ProdItem> result = new List<Core.ProdItem>();
|
||||||
|
// elenco prod completi
|
||||||
|
List<ProdModel> dbResultProd = new List<ProdModel>();
|
||||||
|
// elenco proj "orfani"
|
||||||
|
List<ProjModel> dbResultProj = new List<ProjModel>();
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
// se numRecord = 0 --> passo tutti
|
||||||
|
if (NumRecord == 0)
|
||||||
|
{
|
||||||
|
NumRecord = localDbCtx.ProdList.Count();
|
||||||
|
}
|
||||||
|
// recupero PROD + proj relativi
|
||||||
|
dbResultProd = localDbCtx
|
||||||
|
.ProdList
|
||||||
|
.Where(x => (!x.IsArchived || ShowArchived))
|
||||||
|
//.Include(j => j.)
|
||||||
|
// condizione join sui PROJ
|
||||||
|
.Join(localDbCtx.ProjList.Where(x => x.IsActive || !OnlyActive),
|
||||||
|
p => p.ProdDbId,
|
||||||
|
e => e.ProdDbId,
|
||||||
|
(p, e) => p)
|
||||||
|
.Distinct()
|
||||||
|
.Include(j => j.ProjListNav)
|
||||||
|
.OrderByDescending(x => x.ProdId)
|
||||||
|
.Take(NumRecord)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
// recupero i proj "orfani"
|
||||||
|
dbResultProj = localDbCtx
|
||||||
|
.ProjList
|
||||||
|
.Where(x => (x.IsActive || !OnlyActive) && x.Prod == null)
|
||||||
|
.OrderByDescending(x => x.ProjId)
|
||||||
|
.Take(NumRecord)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// conversione
|
||||||
|
result = dbResultProd.Select(x => ConvToCore(x)).ToList();
|
||||||
|
var resProj = dbResultProj.Select(x => ConvToCore(x)).ToList();
|
||||||
|
// sommo i risultati
|
||||||
|
result.AddRange(resProj);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco prod
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="DtStart">Inizio periodo estrazione</param>
|
||||||
|
/// <param name="DtEnd">Fine periodo estrazione</param>
|
||||||
|
/// <param name="NumRecord">Num max record da recuperare</param>
|
||||||
|
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
|
||||||
|
/// <param name="ShowArchived">Se true: mostra anche archiviati (default li nasconde)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<Core.ProdItem> GetLastDescFull(DateTime DtStart, DateTime DtEnd, int NumRecord, bool OnlyActive, bool ShowArchived = false)
|
||||||
|
{
|
||||||
|
List<Core.ProdItem> result = new List<Core.ProdItem>();
|
||||||
|
// elenco prod completi
|
||||||
|
List<ProdModel> dbResultProd = new List<ProdModel>();
|
||||||
|
// elenco proj "orfani"
|
||||||
|
List<ProjModel> dbResultProj = new List<ProjModel>();
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
// se numRecord = 0 --> passo tutti
|
||||||
|
if (NumRecord == 0)
|
||||||
|
{
|
||||||
|
NumRecord = localDbCtx.ProdList.Count();
|
||||||
|
}
|
||||||
|
// retrieve
|
||||||
|
dbResultProd = localDbCtx
|
||||||
|
.ProdList
|
||||||
|
.Where(x => x.DtCreated >= DtStart && x.DtCreated <= DtEnd && (!x.IsArchived || ShowArchived))
|
||||||
|
// condizione join sui PROJ
|
||||||
|
.Join(localDbCtx.ProjList.Where(x => x.IsActive || !OnlyActive),
|
||||||
|
p => p.ProdDbId,
|
||||||
|
e => e.ProdDbId,
|
||||||
|
(p, e) => p)
|
||||||
|
.Distinct()
|
||||||
|
.Include(j => j.ProjListNav)
|
||||||
|
.OrderByDescending(x => x.ProdId)
|
||||||
|
.Take(NumRecord)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
// recupero i proj "orfani"
|
||||||
|
dbResultProj = localDbCtx
|
||||||
|
.ProjList
|
||||||
|
.Where(x => (x.IsActive || !OnlyActive) && x.Prod == null && (x.DtCreated >= DtStart && x.DtCreated <= DtEnd))
|
||||||
|
.OrderByDescending(x => x.ProjId)
|
||||||
|
.Take(NumRecord)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
// conversione
|
||||||
|
result = dbResultProd.Select(x => ConvToCore(x)).ToList();
|
||||||
|
var resProj = dbResultProj.Select(x => ConvToCore(x)).ToList();
|
||||||
|
// sommo i risultati
|
||||||
|
result.AddRange(resProj);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco prod
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="DtStart">Inizio periodo estrazione</param>
|
||||||
|
/// <param name="DtEnd">Fine periodo estrazione</param>
|
||||||
|
/// <param name="DtIsCreation">Ture: usa data creazione / False: usa data export</param>
|
||||||
|
/// <param name="NumRecord">Num max record da recuperare</param>
|
||||||
|
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
|
||||||
|
/// <param name="Machine">Nome Macchina (default vuoto = non usato)</param>
|
||||||
|
/// <param name="BtlFileName">Nome file BTL (default vuoto = non usato)</param>
|
||||||
|
/// <param name="ListName">Nome List (default vuoto = non usato)</param>
|
||||||
|
/// <param name="ShowArchived">Se true: mostra anche archiviati (default li nasconde)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<Core.ProdItem> GetLastDescFull(DateTime DtStart, DateTime DtEnd, bool DtIsCreation, int NumRecord, bool OnlyActive, string Machine = "", string BtlFileName = "", string ListName = "", bool ShowArchived = false)
|
||||||
|
{
|
||||||
|
List<Core.ProdItem> result = new List<Core.ProdItem>();
|
||||||
|
List<ProdModel> dbResultProd = new List<ProdModel>();
|
||||||
|
// elenco proj "orfani"
|
||||||
|
List<ProjModel> dbResultProj = new List<ProjModel>();
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
// se numRecord = 0 --> passo tutti
|
||||||
|
if (NumRecord == 0)
|
||||||
|
{
|
||||||
|
NumRecord = localDbCtx.ProdList.Count();
|
||||||
|
}
|
||||||
|
// retrieve
|
||||||
|
dbResultProd = localDbCtx
|
||||||
|
.ProdList
|
||||||
|
.Where(x => (!x.IsArchived || ShowArchived))
|
||||||
|
// condizione join sui PROJ
|
||||||
|
.Join(localDbCtx.ProjList.Where(x =>
|
||||||
|
(x.IsActive || !OnlyActive)
|
||||||
|
&& (string.IsNullOrEmpty(Machine) || x.Machine.ToLower().Contains(Machine.ToLower()))
|
||||||
|
&& (string.IsNullOrEmpty(BtlFileName) || x.BTLFileName.ToLower().Contains(BtlFileName.ToLower()))
|
||||||
|
&& (string.IsNullOrEmpty(ListName) || x.ListName.ToLower().Contains(ListName.ToLower()))
|
||||||
|
&& ((DtIsCreation && (x.DtCreated >= DtStart && x.DtCreated <= DtEnd)) || (!DtIsCreation && (x.DtExported >= DtStart && x.DtExported <= DtEnd)))
|
||||||
|
),
|
||||||
|
p => p.ProdDbId,
|
||||||
|
e => e.ProdDbId,
|
||||||
|
(p, e) => p)
|
||||||
|
.Distinct()
|
||||||
|
.Include(j => j.ProjListNav)
|
||||||
|
.OrderByDescending(x => x.ProdId)
|
||||||
|
.Take(NumRecord)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
// recupero i proj "orfani"
|
||||||
|
dbResultProj = localDbCtx
|
||||||
|
.ProjList
|
||||||
|
.Where(x =>
|
||||||
|
(x.IsActive || !OnlyActive)
|
||||||
|
&& x.Prod == null
|
||||||
|
&& (string.IsNullOrEmpty(Machine) || x.Machine.ToLower().Contains(Machine.ToLower()))
|
||||||
|
&& (string.IsNullOrEmpty(BtlFileName) || x.BTLFileName.ToLower().Contains(BtlFileName.ToLower()))
|
||||||
|
&& (string.IsNullOrEmpty(ListName) || x.ListName.ToLower().Contains(ListName.ToLower()))
|
||||||
|
&& ((DtIsCreation && (x.DtCreated >= DtStart && x.DtCreated <= DtEnd)) || (!DtIsCreation && (x.DtExported >= DtStart && x.DtExported <= DtEnd))))
|
||||||
|
.OrderByDescending(x => x.ProjId)
|
||||||
|
.Take(NumRecord)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
// conversione
|
||||||
|
result = dbResultProd.Select(x => ConvToCore(x)).ToList();
|
||||||
|
var resProj = dbResultProj.Select(x => ConvToCore(x)).ToList();
|
||||||
|
// sommo i risultati
|
||||||
|
result.AddRange(resProj);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recupero i dati modificati dopo la data richiesta x sincr su cloud
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="DtLimit"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<ProdModel> GetModAfter(DateTime DtLimit)
|
||||||
|
{
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
// retrieve
|
||||||
|
return localDbCtx
|
||||||
|
.ProdList
|
||||||
|
.Where(x => x.DtLastMod >= DtLimit)
|
||||||
|
.OrderBy(x => x.ProdDbId)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fornisce nuovo indice VUOTO da usare (allocando sul DB)
|
/// Fornisce nuovo indice VUOTO da usare (allocando sul DB)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -338,6 +606,25 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
return nextId;
|
return nextId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recupero i dati NON sincronizzati
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dtStart"></param>
|
||||||
|
/// <param name="dtEnd"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<ProdModel> GetUnsentAsc()
|
||||||
|
{
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
// retrieve
|
||||||
|
return localDbCtx
|
||||||
|
.ProdList
|
||||||
|
.Where(x => x.ProjCloudId == 0)
|
||||||
|
.OrderBy(x => x.ProdDbId)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Verifica prod assegnato a supervisor: ...se c'e' anche un solo machgroup del prod
|
/// Verifica prod assegnato a supervisor: ...se c'e' anche un solo machgroup del prod
|
||||||
/// assegnato ad un supervisor o in stato 0 (dovrebbe essere la stessa cosa?)
|
/// assegnato ad un supervisor o in stato 0 (dovrebbe essere la stessa cosa?)
|
||||||
@@ -358,7 +645,11 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
return numAssigned > 0;
|
return numAssigned > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Return Lock by ProdId (proj & prod) </summary> <param name="ProdId"></param> <returns></returns>
|
/// <summary>
|
||||||
|
/// Return Lock by ProdId (proj & prod)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ProdId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public bool IsLockByProdId(int ProdId)
|
public bool IsLockByProdId(int ProdId)
|
||||||
{
|
{
|
||||||
bool bIsLock = false;
|
bool bIsLock = false;
|
||||||
@@ -388,9 +679,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
return bIsLock;
|
return bIsLock;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Manage Lock by ProdId (proj & prod) </summary> <param name="ProdId"></param>
|
/// <summary>
|
||||||
/// <param name="Locked">Stato Lock da impostare</param> <param name="UserKey">User ID / Key
|
/// Manage Lock by ProdId (proj & prod)
|
||||||
/// number</param> <returns></returns>
|
/// </summary>
|
||||||
|
/// <param name="ProdId"></param>
|
||||||
|
/// <param name="Locked">Stato Lock da impostare</param>
|
||||||
|
/// <param name="UserKey">User ID / Key number</param>
|
||||||
|
/// <returns></returns>
|
||||||
public ProdModel LockByProdId(int ProdId, bool Locked, string UserKey = "USER01")
|
public ProdModel LockByProdId(int ProdId, bool Locked, string UserKey = "USER01")
|
||||||
{
|
{
|
||||||
ProdModel currProd;
|
ProdModel currProd;
|
||||||
@@ -407,7 +702,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
currProd.Locked = Locked;
|
currProd.Locked = Locked;
|
||||||
currProd.LockDate = DateTime.Now;
|
currProd.LockDate = DateTime.Now;
|
||||||
currProd.LockedBy = Locked ? UserKey : "";
|
currProd.LockedBy = Locked ? UserKey : "";
|
||||||
localDbCtx.Entry(currProd).State = System.Data.Entity.EntityState.Modified;
|
localDbCtx.Entry(currProd).State = EntityState.Modified;
|
||||||
|
|
||||||
var currProj = localDbCtx
|
var currProj = localDbCtx
|
||||||
.ProjList
|
.ProjList
|
||||||
@@ -420,7 +715,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
item.Locked = Locked;
|
item.Locked = Locked;
|
||||||
item.LockDate = DateTime.Now;
|
item.LockDate = DateTime.Now;
|
||||||
item.LockedBy = Locked ? UserKey : "";
|
item.LockedBy = Locked ? UserKey : "";
|
||||||
localDbCtx.Entry(item).State = System.Data.Entity.EntityState.Modified;
|
localDbCtx.Entry(item).State = EntityState.Modified;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -483,6 +778,36 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Esegue syncro sul DB dell'elenco dei record
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="cloudStatus">Dizionario valori cloudId / isArchived</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool UpdateListArchived(Dictionary<int, bool> cloudStatus)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
int numDone = 0;
|
||||||
|
int num2do = cloudStatus.Count;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DateTime adesso = DateTime.Now;
|
||||||
|
// ciclo tutti i record e segno update...
|
||||||
|
foreach (var item in cloudStatus)
|
||||||
|
{
|
||||||
|
// chiamo metodo singolo
|
||||||
|
numDone += UpdateArchivedByCloudId(item.Key, item.Value) ? 1 : 0;
|
||||||
|
}
|
||||||
|
fatto = numDone == num2do;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string errMessage = $"EXCEPTION on Prod.UpdateListArchived: {Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update record su DB x campo IsArchived
|
/// Update record su DB x campo IsArchived
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -511,6 +836,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
{
|
{
|
||||||
// aggiorno valore descrizione
|
// aggiorno valore descrizione
|
||||||
currData.IsArchived = IsArchived;
|
currData.IsArchived = IsArchived;
|
||||||
|
currData.DtLastMod = DateTime.Now;
|
||||||
|
|
||||||
// update dei proj relativi
|
// update dei proj relativi
|
||||||
foreach (var item in proj2update)
|
foreach (var item in proj2update)
|
||||||
@@ -538,6 +864,64 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
return fatto;
|
return fatto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update record su DB x ProjectCloudId
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ProdId"></param>
|
||||||
|
/// <param name="Description"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Core.ProdFileM UpdateCloudId(int ProdId, int ProjCloudId)
|
||||||
|
{
|
||||||
|
// cerco specifico Proj
|
||||||
|
ProdModel currData;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
currData = localDbCtx
|
||||||
|
.ProdList
|
||||||
|
.Where(x => x.ProdId == ProdId)
|
||||||
|
.SingleOrDefault();
|
||||||
|
if (currData != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// aggiorno valore BTL
|
||||||
|
currData.ProjCloudId = ProjCloudId;
|
||||||
|
|
||||||
|
// salvo record PROD
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
|
||||||
|
// cerco se ci siano projects collegati ed aggiorno pure loro...
|
||||||
|
var projList = localDbCtx
|
||||||
|
.ProjList
|
||||||
|
.Where(x => x.ProdDbId == currData.ProdDbId)
|
||||||
|
.ToList();
|
||||||
|
if (projList != null)
|
||||||
|
{
|
||||||
|
foreach (var item in projList)
|
||||||
|
{
|
||||||
|
item.ProjCloudId = ProjCloudId;
|
||||||
|
}
|
||||||
|
// salvo modifihce ai PROJ
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string errMessage = $"EXCEPTION on Prod.UpdateCloudId:{Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on Prod.UpdateCloudId: req item was not found | ProdId {ProdId} | ProjCloudId {ProjCloudId}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ConvToCoreFile(currData);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update record su DB x Description
|
/// Update record su DB x Description
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -807,7 +1191,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
Log.Error(errMessage);
|
Log.Error(errMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return coreConv(currData);
|
return ConvToCoreFile(currData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -829,7 +1213,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
.SingleOrDefault();
|
.SingleOrDefault();
|
||||||
if (currData != null)
|
if (currData != null)
|
||||||
{
|
{
|
||||||
// aggiorno valore BTL
|
// aggiorno valore tipo
|
||||||
currData.PType = PType;
|
currData.PType = PType;
|
||||||
|
|
||||||
// Commit changes
|
// Commit changes
|
||||||
@@ -849,7 +1233,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
Log.Error(errMessage);
|
Log.Error(errMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return coreConv(currData);
|
return ConvToCoreFile(currData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Return User Code/Key that Locks by ProdId (proj & prod) </summary> <param
|
/// <summary> Return User Code/Key that Locks by ProdId (proj & prod) </summary> <param
|
||||||
@@ -902,22 +1286,68 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
|
|
||||||
#region Protected Methods
|
#region Protected Methods
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Helper conversione modelli
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="currProd"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected Core.ProdFileM coreConv(ProdModel currProd)
|
|
||||||
{
|
|
||||||
Core.ProdFileM answ = Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived);
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected List<int> ProjIdByProd(int ProdId)
|
protected List<int> ProjIdByProd(int ProdId)
|
||||||
{
|
{
|
||||||
var ProjCtr = new ProjController();
|
var ProjCtr = new ProjController();
|
||||||
return ProjCtr.GetByProdAsc(ProdId).Select(y => y.nProjId).ToList();
|
return ProjCtr.GetByProdAsc(ProdId).Select(y => y.nProjId).ToList();
|
||||||
//return DbManager.obj.ProjCtr.GetByProdAsc(ProdId).Select(y => y.nProjId).ToList();
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update record su DB x campo IsArchived dato CloudId
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ProjCloudId"></param>
|
||||||
|
/// <param name="IsArchived"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
protected bool UpdateArchivedByCloudId(int ProjCloudId, bool IsArchived)
|
||||||
|
{
|
||||||
|
bool fatto = false;
|
||||||
|
DateTime adesso = DateTime.Now;
|
||||||
|
// cerco specifico Prod
|
||||||
|
ProdModel currData = new ProdModel();
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
currData = localDbCtx
|
||||||
|
.ProdList
|
||||||
|
.Where(x => x.ProjCloudId == ProjCloudId)
|
||||||
|
.SingleOrDefault();
|
||||||
|
if (currData != null)
|
||||||
|
{
|
||||||
|
// sel dei proj da aggiornare...
|
||||||
|
var proj2update = localDbCtx
|
||||||
|
.ProjList
|
||||||
|
.Where(x => x.ProdDbId == currData.ProdDbId)
|
||||||
|
.ToList();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// aggiorno valore descrizione
|
||||||
|
currData.IsArchived = IsArchived;
|
||||||
|
currData.DtLastMod = adesso;
|
||||||
|
|
||||||
|
// update dei proj relativi
|
||||||
|
foreach (var item in proj2update)
|
||||||
|
{
|
||||||
|
item.IsArchived = IsArchived;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
fatto = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
string errMessage = $"EXCEPTION on Prod.UpdateArchivedByCloudId:{Environment.NewLine}{exc}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string errMessage = $"ERROR on Prod.UpdateArchivedByCloudId: req item was not found | ProjCloudId {ProjCloudId} | IsArchived {IsArchived}";
|
||||||
|
Console.WriteLine(errMessage);
|
||||||
|
Log.Error(errMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fatto;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Protected Methods
|
#endregion Protected Methods
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||||
|
using EgwProxy.MagMan.DTO;
|
||||||
using NLog;
|
using NLog;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -19,9 +20,75 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper conversione a ProjectDTO
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec">record in formato ProjModel</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static ProjectDTO ConvToDto(ProjModel currRec)
|
||||||
|
{
|
||||||
|
// ho valori mancanti che saranno calcolati dal cloud e valori messi a zero di default
|
||||||
|
ProjectDTO answ = new ProjectDTO()
|
||||||
|
{
|
||||||
|
ProjCloudId = currRec.ProjCloudId,
|
||||||
|
ProjLocalId = currRec.ProjDbId,
|
||||||
|
ProjExtId = currRec.ProjId,
|
||||||
|
// è calcolato sul cloud, da token --> machine ID
|
||||||
|
MachineCloudId = 0,
|
||||||
|
// è calcolato sul cloud, da token --> KeyNum
|
||||||
|
KeyNum = 0,
|
||||||
|
BTLFileName = currRec.BTLFileName,
|
||||||
|
PType = (EgwProxy.MagMan.BWType)currRec.PType,
|
||||||
|
Machine = currRec.Machine,
|
||||||
|
ProjDescription = currRec.ProjDescription,
|
||||||
|
DtCreated = currRec.DtCreated,
|
||||||
|
DtLastAction = DateTime.MinValue,
|
||||||
|
DtSchedule = DateTime.MinValue,
|
||||||
|
DtStartProd = DateTime.MinValue,
|
||||||
|
ListName = currRec.ListName,
|
||||||
|
ProcTimeEst = 0,
|
||||||
|
ProcTimeReal = 0,
|
||||||
|
IsActive = currRec.IsActive,
|
||||||
|
IsArchived = currRec.IsArchived
|
||||||
|
};
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper conversione a ProjModel
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec"></param>
|
||||||
|
/// <param name="isActive"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static ProjModel ConvToModel(ProjectDTO currRec, bool isActive)
|
||||||
|
{
|
||||||
|
ProjModel answ = new ProjModel()
|
||||||
|
{
|
||||||
|
ProjCloudId = currRec.ProjCloudId,
|
||||||
|
ProjDbId = currRec.ProjLocalId,
|
||||||
|
ProjId = currRec.ProjExtId,
|
||||||
|
//MachineID = currRec.MachineCloudId,
|
||||||
|
//KeyNum = currRec.KeyNum,
|
||||||
|
BTLFileName = currRec.BTLFileName,
|
||||||
|
PType = (BWType)currRec.PType,
|
||||||
|
Machine = currRec.Machine,
|
||||||
|
ProjDescription = currRec.ProjDescription,
|
||||||
|
DtCreated = currRec.DtCreated,
|
||||||
|
//DtLastAction = currRec.DtLastAction,
|
||||||
|
//DtSchedule = currRec.DtSchedule,
|
||||||
|
//DtStartProd = currRec.DtStartProd,
|
||||||
|
ListName = currRec.ListName,
|
||||||
|
//ProcTimeEst = currRec.ProcTimeEst,
|
||||||
|
//ProcTimeReal = currRec.ProcTimeReal,
|
||||||
|
IsActive = currRec.IsActive,
|
||||||
|
IsArchived = currRec.IsArchived
|
||||||
|
};
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Search for already imported BTL from FileName (only)
|
/// Search for already imported BTL from FileName (only)
|
||||||
/// =0 : NOT found >0 : ProjId (already present) for overwrite
|
/// =0 : NOT found >0 : ProdId (already present) for overwrite
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="BTLFileName"></param>
|
/// <param name="BTLFileName"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
@@ -33,6 +100,8 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
var dbResult = localDbCtx
|
var dbResult = localDbCtx
|
||||||
.ProjList
|
.ProjList
|
||||||
.Where(x => x.BTLFileName == BTLFileName)
|
.Where(x => x.BTLFileName == BTLFileName)
|
||||||
|
//valutare se usare solo attivi...
|
||||||
|
//.Where(x => x.BTLFileName == BTLFileName && x.IsActive == true)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
|
||||||
//se avesse trovato-- > riporto id...
|
//se avesse trovato-- > riporto id...
|
||||||
@@ -45,7 +114,22 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Delete Proj logically / on DB by ProjId
|
/// Helper conversione modelli
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec">record in formato ProjModel</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Core.ProjFileM ConvToCore(ProjModel currRec)
|
||||||
|
{
|
||||||
|
Core.ProjFileM answ = null;
|
||||||
|
if (currRec != null)
|
||||||
|
{
|
||||||
|
answ = Core.ProjFileM.CreateProjFileM(currRec.ProjId, ProdIdByProdDbId(currRec.ProdDbId), currRec.DtCreated, currRec.DtExported, currRec.ListName, currRec.BTLFileName, currRec.ProjDescription, currRec.IsNew, currRec.Locked, currRec.PType, currRec.Machine, currRec.IsActive, currRec.IsArchived, currRec.ProjCloudId);
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete Proj logically / on DB by ProdId
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ProjId"></param>
|
/// <param name="ProjId"></param>
|
||||||
/// <param name="IsLogical"></param>
|
/// <param name="IsLogical"></param>
|
||||||
@@ -160,43 +244,53 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public ProjModel FindByProjDbId(int ProjDbId)
|
public ProjModel FindByProjDbId(int ProjDbId)
|
||||||
{
|
{
|
||||||
ProjModel answ;
|
ProjModel answ = new ProjModel();
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
answ = localDbCtx
|
try
|
||||||
.ProjList
|
{
|
||||||
.Where(x => x.ProjDbId == ProjDbId)
|
answ = localDbCtx
|
||||||
.SingleOrDefault();
|
.ProjList
|
||||||
|
.Where(x => x.ProjDbId == ProjDbId)
|
||||||
|
.SingleOrDefault();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get record by ProjId
|
/// Get record by ProdId
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ProjId"></param>
|
/// <param name="ProjId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public ProjModel FindByProjId(int ProjId)
|
public ProjModel FindByProjId(int ProjId)
|
||||||
{
|
{
|
||||||
ProjModel answ;
|
ProjModel answ = new ProjModel();
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
answ = localDbCtx
|
try
|
||||||
.ProjList
|
{
|
||||||
.Where(x => x.ProjId == ProjId)
|
answ = localDbCtx
|
||||||
.SingleOrDefault();
|
.ProjList
|
||||||
|
.Where(x => x.ProjId == ProjId)
|
||||||
|
.SingleOrDefault();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get record by ProjId converted
|
/// Get record by ProdId converted
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ProjId"></param>
|
/// <param name="ProjId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Core.ProjFileM FindByProjIdConv(int ProjId)
|
public Core.ProjFileM FindByProjIdConv(int ProjId)
|
||||||
{
|
{
|
||||||
return coreConv(FindByProjId(ProjId));
|
return ConvToCore(FindByProjId(ProjId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -234,7 +328,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
.OrderBy(x => x.ProdDbId)
|
.OrderBy(x => x.ProdDbId)
|
||||||
.ToList();
|
.ToList();
|
||||||
// conversione
|
// conversione
|
||||||
answ = dbRes.Select(x => coreConv(x)).ToList();
|
answ = dbRes.Select(x => ConvToCore(x)).ToList();
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
@@ -274,7 +368,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
.OrderByDescending(x => x.ProdDbId)
|
.OrderByDescending(x => x.ProdDbId)
|
||||||
.ToList();
|
.ToList();
|
||||||
// conversione
|
// conversione
|
||||||
answ = dbRes.Select(x => coreConv(x)).ToList();
|
answ = dbRes.Select(x => ConvToCore(x)).ToList();
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
@@ -327,7 +421,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
.Take(numRecord)
|
.Take(numRecord)
|
||||||
.ToList();
|
.ToList();
|
||||||
// conversione
|
// conversione
|
||||||
answ = dbRes.Select(x => coreConv(x)).ToList();
|
answ = dbRes.Select(x => ConvToCore(x)).ToList();
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
@@ -358,7 +452,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
.Take(numRecord)
|
.Take(numRecord)
|
||||||
.ToList();
|
.ToList();
|
||||||
// conversione
|
// conversione
|
||||||
answ = dbRes.Select(x => coreConv(x)).ToList();
|
answ = dbRes.Select(x => ConvToCore(x)).ToList();
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
@@ -391,7 +485,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
.Take(numRecord)
|
.Take(numRecord)
|
||||||
.ToList();
|
.ToList();
|
||||||
// conversione
|
// conversione
|
||||||
answ = dbRes.Select(x => coreConv(x)).ToList();
|
answ = dbRes.Select(x => ConvToCore(x)).ToList();
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
@@ -446,7 +540,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
return nextId;
|
return nextId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Manage Lock by ProjId (proj & prod) </summary> <param name="ProjId">ID
|
/// <summary> Manage Lock by ProdId (proj & prod) </summary> <param name="ProjId">ID
|
||||||
/// Proj</param> <param name="Locked">Stato Lock da impostare</param> <param
|
/// Proj</param> <param name="Locked">Stato Lock da impostare</param> <param
|
||||||
/// name="UserKey">User ID / Key number</param> <returns></returns>
|
/// name="UserKey">User ID / Key number</param> <returns></returns>
|
||||||
public Core.ProjFileM LockByProjId(int ProjId, bool Locked, string UserKey = "USER01")
|
public Core.ProjFileM LockByProjId(int ProjId, bool Locked, string UserKey = "USER01")
|
||||||
@@ -497,7 +591,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
// salvataggio
|
// salvataggio
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
}
|
}
|
||||||
return coreConv(currProj);
|
return ConvToCore(currProj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -527,7 +621,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
currProj.IsNew = false;
|
currProj.IsNew = false;
|
||||||
localDbCtx.SaveChanges();
|
localDbCtx.SaveChanges();
|
||||||
}
|
}
|
||||||
return coreConv(currProj);
|
return ConvToCore(currProj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -569,7 +663,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string errMessage = $"ERROR on Proj.Update: req item was not found | ProjId {updItem.ProjId} | ProjDbId {updItem.ProjDbId} | ProdDbId {updItem.ProdDbId}";
|
string errMessage = $"ERROR on Proj.Update: req item was not found | ProdId {updItem.ProjId} | ProjDbId {updItem.ProjDbId} | ProdDbId {updItem.ProdDbId}";
|
||||||
Console.WriteLine(errMessage);
|
Console.WriteLine(errMessage);
|
||||||
Log.Error(errMessage);
|
Log.Error(errMessage);
|
||||||
}
|
}
|
||||||
@@ -581,7 +675,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
/// Update record su DB x elenco BTLParts
|
/// Update record su DB x elenco BTLParts
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ProjId"></param>
|
/// <param name="ProjId"></param>
|
||||||
/// <param name="newBTLFileName"></param>
|
/// <param name="BtlPartList"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public ProjModel UpdateBtlParts(int ProjId, List<Core.BTLPartM> BtlPartList)
|
public ProjModel UpdateBtlParts(int ProjId, List<Core.BTLPartM> BtlPartList)
|
||||||
{
|
{
|
||||||
@@ -661,7 +755,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string errMessage = $"ERROR on Proj.UpdateBtlParts: req item was not found | ProjId {ProjId} | BtlPartList {BtlPartList.Count} items";
|
string errMessage = $"ERROR on Proj.UpdateBtlParts: req item was not found | ProdId {ProjId} | BtlPartList {BtlPartList.Count} items";
|
||||||
Console.WriteLine(errMessage);
|
Console.WriteLine(errMessage);
|
||||||
Log.Error(errMessage);
|
Log.Error(errMessage);
|
||||||
}
|
}
|
||||||
@@ -704,13 +798,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string errMessage = $"ERROR on Proj.UpdateDescription: req item was not found | ProjId {ProjId} | Description {Description}";
|
string errMessage = $"ERROR on Proj.UpdateDescription: req item was not found | ProdId {ProjId} | Description {Description}";
|
||||||
Console.WriteLine(errMessage);
|
Console.WriteLine(errMessage);
|
||||||
Log.Error(errMessage);
|
Log.Error(errMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return coreConv(currData);
|
return ConvToCore(currData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -749,7 +843,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
// se ne ho esattamente 1 nel DB allora DEVE essere il record Parent
|
// se ne ho esattamente 1 nel DB allora DEVE essere il record Parent
|
||||||
if (duplicateList.Count == 1)
|
if (duplicateList.Count == 1)
|
||||||
{
|
{
|
||||||
// verifico se ProjId variato
|
// verifico se ProdId variato
|
||||||
if (!duplicateList[0].ProjId.Equals(currData.ProjId))
|
if (!duplicateList[0].ProjId.Equals(currData.ProjId))
|
||||||
{
|
{
|
||||||
// in questo caso ho il PRIMO duplicato
|
// in questo caso ho il PRIMO duplicato
|
||||||
@@ -795,13 +889,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string errMessage = $"ERROR on Proj.UpdateInfo: req item was not found | ProjId {ProjId} | Description {BTLFileName} | ListName {ListName} | DtExported {DtExported} | PType {PType} | Machine {Machine}";
|
string errMessage = $"ERROR on Proj.UpdateInfo: req item was not found | ProdId {ProjId} | Description {BTLFileName} | ListName {ListName} | DtExported {DtExported} | PType {PType} | Machine {Machine}";
|
||||||
Console.WriteLine(errMessage);
|
Console.WriteLine(errMessage);
|
||||||
Log.Error(errMessage);
|
Log.Error(errMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return coreConv(currData);
|
return ConvToCore(currData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -831,7 +925,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string errMessage = $"ERROR on Proj.UpdateListName: req item was not found | ProjId {ProjId} | ListName {ListName}";
|
string errMessage = $"ERROR on Proj.UpdateListName: req item was not found | ProdId {ProjId} | ListName {ListName}";
|
||||||
Console.WriteLine(errMessage);
|
Console.WriteLine(errMessage);
|
||||||
Log.Error(errMessage);
|
Log.Error(errMessage);
|
||||||
}
|
}
|
||||||
@@ -843,7 +937,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
Log.Error(errMessage);
|
Log.Error(errMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return coreConv(currData);
|
return ConvToCore(currData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -874,7 +968,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string errMessage = $"ERROR on Proj.UpdateMachine: req item was not found | ProjId {ProjId} | Machine {Machine}";
|
string errMessage = $"ERROR on Proj.UpdateMachine: req item was not found | ProdId {ProjId} | Machine {Machine}";
|
||||||
Console.WriteLine(errMessage);
|
Console.WriteLine(errMessage);
|
||||||
Log.Error(errMessage);
|
Log.Error(errMessage);
|
||||||
}
|
}
|
||||||
@@ -886,28 +980,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
Log.Error(errMessage);
|
Log.Error(errMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return coreConv(currData);
|
return ConvToCore(currData);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
|
|
||||||
#region Protected Methods
|
#region Protected Methods
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Helper conversione modelli
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="currProj"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected Core.ProjFileM coreConv(ProjModel currProj)
|
|
||||||
{
|
|
||||||
Core.ProjFileM answ = null;
|
|
||||||
if (currProj != null)
|
|
||||||
{
|
|
||||||
answ = Core.ProjFileM.CreateProjFileM(currProj.ProjId, ProdIdByProdDbId(currProj.ProdDbId), currProj.DtCreated, currProj.DtExported, currProj.ListName, currProj.BTLFileName, currProj.ProjDescription, currProj.IsNew, currProj.Locked, currProj.PType, currProj.Machine, currProj.IsActive, currProj.IsArchived);
|
|
||||||
}
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get LAST paginated data from DB (DESC ordered)
|
/// Get LAST paginated data from DB (DESC ordered)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -0,0 +1,372 @@
|
|||||||
|
using EgtBEAMWALL.DataLayer.DatabaseModels;
|
||||||
|
using EgwProxy.MagMan.DTO;
|
||||||
|
using NLog;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data.Entity;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gestione RawItem (barre) su DB (= magazzino locale)
|
||||||
|
/// </summary>
|
||||||
|
public class RawItemsController : IDisposable
|
||||||
|
{
|
||||||
|
#region Public Constructors
|
||||||
|
|
||||||
|
public RawItemsController()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Constructors
|
||||||
|
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper conversion da DB model class a base class (VB)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dbRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static Core.RawPartM ConvToCore(RawItemModel dbRec)
|
||||||
|
{
|
||||||
|
// converto in primis il materiale relativo
|
||||||
|
Core.MaterialM matRec = MaterialsController.ConvToCore(dbRec.MaterialNav);
|
||||||
|
Core.RawPartM answ = new Core.RawPartM(dbRec.RawItemId, matRec, (double)dbRec.WMm, (double)dbRec.LMm, dbRec.QtyAvail, dbRec.UseQty, dbRec.IsActive);
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper conversione a ItemDTO
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static ItemDTO ConvToItemDto(RawItemModel currRec)
|
||||||
|
{
|
||||||
|
ItemDTO answ = new ItemDTO()
|
||||||
|
{
|
||||||
|
MatCloudId = currRec.MaterialNav != null ? currRec.MaterialNav.MatCloudId : 0,
|
||||||
|
MatLocalId = currRec.MatId,
|
||||||
|
RawItemCloudId = currRec.RawItemCloudId,
|
||||||
|
RawItemLocalId = currRec.RawItemId,
|
||||||
|
IsRemn = currRec.IsRemn,
|
||||||
|
IsDeleted = currRec.IsDeleted,
|
||||||
|
QtyAvail = currRec.QtyAvail,
|
||||||
|
HMm = currRec.HMm,
|
||||||
|
LMm = currRec.LMm,
|
||||||
|
WMm = currRec.WMm,
|
||||||
|
Note = currRec.Note
|
||||||
|
};
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper conversione da ItemDTO
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec"></param>
|
||||||
|
/// <param name="isActive"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static RawItemModel ConvToModel(ItemDTO currRec, bool isActive)
|
||||||
|
{
|
||||||
|
RawItemModel answ = new RawItemModel()
|
||||||
|
{
|
||||||
|
RawItemCloudId = currRec.RawItemCloudId,
|
||||||
|
RawItemId = currRec.RawItemLocalId,
|
||||||
|
QtyAvail = currRec.QtyAvail,
|
||||||
|
HMm = currRec.HMm,
|
||||||
|
LMm = currRec.LMm,
|
||||||
|
WMm = currRec.WMm,
|
||||||
|
MatId = currRec.MatLocalId,
|
||||||
|
IsDeleted = currRec.IsDeleted,
|
||||||
|
IsRemn = currRec.IsRemn,
|
||||||
|
// attivo = selezionato x nesting
|
||||||
|
IsActive = isActive,
|
||||||
|
UseQty = true,
|
||||||
|
Note = currRec.Note
|
||||||
|
};
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper conversione da ResourceExpDTO
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec"></param>
|
||||||
|
/// <param name="matLocalId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static RawItemModel ConvToModel(ResourceExpDTO currRec, int matLocalId)
|
||||||
|
{
|
||||||
|
RawItemModel answ = new RawItemModel()
|
||||||
|
{
|
||||||
|
RawItemCloudId = currRec.RawItemCloudId,
|
||||||
|
RawItemId = currRec.RawItemLocalId,
|
||||||
|
QtyAvail = currRec.Qty,
|
||||||
|
HMm = currRec.HMm,
|
||||||
|
LMm = currRec.LMm,
|
||||||
|
WMm = currRec.WMm,
|
||||||
|
MatId = matLocalId,
|
||||||
|
IsRemn = currRec.IsRemn,
|
||||||
|
IsDeleted = currRec.IsDeleted,
|
||||||
|
UseQty = true,
|
||||||
|
Note = currRec.Note
|
||||||
|
};
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Conversion of base class to DB model class
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="coreRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static RawItemModel ConvToModel(Core.RawPartM coreRec)
|
||||||
|
{
|
||||||
|
RawItemModel answ = new RawItemModel();
|
||||||
|
if (coreRec != null)
|
||||||
|
{
|
||||||
|
answ = new RawItemModel()
|
||||||
|
{
|
||||||
|
RawItemId = coreRec.nId,
|
||||||
|
MatId = coreRec.Material.nId,
|
||||||
|
HMm = (decimal)Math.Round(coreRec.Material.dH, 2),
|
||||||
|
LMm = (decimal)Math.Round(coreRec.dL, 2),
|
||||||
|
WMm = coreRec.dW > 0 ? (decimal)Math.Round(coreRec.dW, 2) : (decimal)Math.Round(coreRec.Material.dW, 2),
|
||||||
|
IsActive = coreRec.bActive,
|
||||||
|
UseQty = coreRec.bUseQuantity,
|
||||||
|
QtyAvail = coreRec.nQuantity
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper conversione a ResourceDTO
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="currRec"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static ResourceDTO ConvToResDto(RawItemModel currRec)
|
||||||
|
{
|
||||||
|
ResourceDTO answ = new ResourceDTO()
|
||||||
|
{
|
||||||
|
RawItemCloudId = currRec.RawItemCloudId,
|
||||||
|
RawItemLocalId = currRec.RawItemId,
|
||||||
|
Qty = currRec.QtyAvail
|
||||||
|
};
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// Helper conversione a ResourceDTO con garanzia valori Qty negativi
|
||||||
|
///// </summary>
|
||||||
|
///// <param name="currRec"></param>
|
||||||
|
///// <returns></returns>
|
||||||
|
//public static ResourceDTO ConvToResDtoNeg(RawItemModel currRec)
|
||||||
|
//{
|
||||||
|
// ResourceDTO answ = new ResourceDTO()
|
||||||
|
// {
|
||||||
|
// RawItemCloudId = currRec.RawItemCloudId,
|
||||||
|
// RawItemLocalId = currRec.RawItemId,
|
||||||
|
// Qty = -Math.Abs(currRec.QtyAvail)
|
||||||
|
// };
|
||||||
|
// return answ;
|
||||||
|
//}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete by key
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="RawItemId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool DeleteByKey(int RawItemId)
|
||||||
|
{
|
||||||
|
bool done = false;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
var items2del = localDbCtx
|
||||||
|
.RawItemList
|
||||||
|
.Where(x => x.RawItemId == RawItemId)
|
||||||
|
.FirstOrDefault();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// verifico SE esista
|
||||||
|
if (items2del != null)
|
||||||
|
{
|
||||||
|
// verifico seabbia un cloud id (fa canc logica)...
|
||||||
|
if (items2del.RawItemCloudId > 0)
|
||||||
|
{
|
||||||
|
items2del.IsDeleted = true;
|
||||||
|
localDbCtx.Entry(items2del).State = EntityState.Modified;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// ...o meno: fa eliminazione vera
|
||||||
|
localDbCtx.RawItemList.Remove(items2del);
|
||||||
|
}
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
}
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"EXCEPTION on RawItems.DeleteByKey: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return done;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get record by Key / Core
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="RawItemId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Core.RawPartM FindByDbId(int RawItemId)
|
||||||
|
{
|
||||||
|
var rawdata = FindByDbIdModel(RawItemId);
|
||||||
|
var result = ConvToCore(rawdata);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get record by Key / Db Model
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="RawItemId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public RawItemModel FindByDbIdModel(int RawItemId)
|
||||||
|
{
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
return localDbCtx
|
||||||
|
.RawItemList
|
||||||
|
.Where(x => x.RawItemId == RawItemId)
|
||||||
|
.Include(m => m.MaterialNav)
|
||||||
|
.SingleOrDefault();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get Material (filtro x MatId) / Core
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="MatId">0 = tutti</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<Core.RawPartM> GetFilt(int MatId)
|
||||||
|
{
|
||||||
|
var rawList = GetFiltModel(MatId);
|
||||||
|
var result = rawList.Select(x => ConvToCore(x)).ToList();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get Material (filtro x MatId)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="MatId">0 = tutti</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<RawItemModel> GetFiltModel(int MatId)
|
||||||
|
{
|
||||||
|
// retrieve
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
return localDbCtx
|
||||||
|
.RawItemList
|
||||||
|
.Include(j => j.MaterialNav)
|
||||||
|
.Where(x => MatId == 0 || x.MatId == MatId)
|
||||||
|
.OrderBy(x => x.LMm)
|
||||||
|
.ThenBy(x => x.WMm)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update or insert RawItem record
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="updItem">Recorda da registrare</param>
|
||||||
|
/// <param name="changeUseQty">Indica se, in caso di modifica, vada aggiornato UseQty</param>
|
||||||
|
/// <param name="changeQtyAvail">Indica se, in caso di modifica, vada aggiornato QtyAvail</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public int Upsert(RawItemModel updItem, bool changeUseQty, bool changeQtyAvail)
|
||||||
|
{
|
||||||
|
int newIdx = 0;
|
||||||
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var item2update = localDbCtx
|
||||||
|
.RawItemList
|
||||||
|
.Where(x => (updItem.RawItemId > 0 && x.RawItemId == updItem.RawItemId)
|
||||||
|
|| (x.MatId == updItem.MatId && x.WMm == updItem.WMm && x.HMm == updItem.HMm && x.LMm == updItem.LMm))
|
||||||
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
if (item2update != null)
|
||||||
|
{
|
||||||
|
// se ho un valore > 0 x CloudId sennò NON modifica
|
||||||
|
if (updItem.RawItemCloudId > 0)
|
||||||
|
{
|
||||||
|
item2update.RawItemCloudId = updItem.RawItemCloudId;
|
||||||
|
}
|
||||||
|
item2update.HMm = updItem.HMm;
|
||||||
|
item2update.LMm = updItem.LMm;
|
||||||
|
item2update.WMm = updItem.WMm;
|
||||||
|
item2update.IsActive = updItem.IsActive;
|
||||||
|
item2update.IsDeleted = updItem.IsDeleted;
|
||||||
|
item2update.IsRemn = updItem.IsRemn;
|
||||||
|
if (changeUseQty)
|
||||||
|
{
|
||||||
|
item2update.UseQty = updItem.UseQty;
|
||||||
|
}
|
||||||
|
if (changeQtyAvail)
|
||||||
|
{
|
||||||
|
item2update.QtyAvail = updItem.QtyAvail;
|
||||||
|
item2update.LastSync = DateTime.Now;
|
||||||
|
}
|
||||||
|
localDbCtx.Entry(item2update).State = EntityState.Modified;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
localDbCtx.RawItemList.Add(updItem);
|
||||||
|
}
|
||||||
|
// Commit changes
|
||||||
|
localDbCtx.SaveChanges();
|
||||||
|
if (item2update != null)
|
||||||
|
{
|
||||||
|
newIdx = item2update.RawItemId;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newIdx = updItem.RawItemId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Log.Error($"EXCEPTION on RawItems.Upsert: {Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return newIdx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update or insert RawItem record from CoreM
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="coreItem"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public int Upsert(Core.RawPartM coreItem)
|
||||||
|
{
|
||||||
|
int newIdx = 0;
|
||||||
|
// converto
|
||||||
|
RawItemModel updItem = ConvToModel(coreItem);
|
||||||
|
newIdx = Upsert(updItem, true, true);
|
||||||
|
return newIdx;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Methods
|
||||||
|
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Istanza logger
|
||||||
|
/// </summary>
|
||||||
|
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -136,12 +136,17 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
|||||||
// Initialize database context
|
// Initialize database context
|
||||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||||
{
|
{
|
||||||
// retrieve
|
try
|
||||||
answ = localDbCtx
|
{
|
||||||
.StatusMapList
|
// retrieve
|
||||||
.Where(x => x.Session == Session && x.ItemType == Core.StatusMapItemType.Prod)
|
answ = localDbCtx
|
||||||
.OrderByDescending(x => x.Index)
|
.StatusMapList
|
||||||
.ToList();
|
.Where(x => x.Session == Session && x.ItemType == Core.StatusMapItemType.Prod)
|
||||||
|
.OrderByDescending(x => x.Index)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using System.IO;
|
|||||||
|
|
||||||
namespace EgtBEAMWALL.DataLayer
|
namespace EgtBEAMWALL.DataLayer
|
||||||
{
|
{
|
||||||
|
#if false
|
||||||
//[DbConfigurationType(typeof(MySqlEFConfiguration))]
|
//[DbConfigurationType(typeof(MySqlEFConfiguration))]
|
||||||
public class aMySqlConfiguration : MySqlEFConfiguration
|
public class aMySqlConfiguration : MySqlEFConfiguration
|
||||||
{
|
{
|
||||||
@@ -19,7 +20,8 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
[DbConfigurationType(typeof(MySqlEFConfiguration))]
|
[DbConfigurationType(typeof(MySqlEFConfiguration))]
|
||||||
public class DatabaseContext : DbContext
|
public class DatabaseContext : DbContext
|
||||||
@@ -38,6 +40,21 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
|
|
||||||
|
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#if false
|
||||||
|
// fix valori decimal
|
||||||
|
modelBuilder.Entity<MaterialModel>().Property(x => x.HMm).HasPrecision(18, 6);
|
||||||
|
modelBuilder.Entity<MaterialModel>().Property(x => x.LMm).HasPrecision(18, 6);
|
||||||
|
modelBuilder.Entity<MaterialModel>().Property(x => x.WMm).HasPrecision(18, 6);
|
||||||
|
modelBuilder.Entity<RawItemModel>().Property(x => x.HMm).HasPrecision(18, 6);
|
||||||
|
modelBuilder.Entity<RawItemModel>().Property(x => x.LMm).HasPrecision(18, 6);
|
||||||
|
modelBuilder.Entity<RawItemModel>().Property(x => x.WMm).HasPrecision(18, 6);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
base.OnModelCreating(modelBuilder);
|
||||||
|
}
|
||||||
|
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -80,6 +97,27 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public DbSet<StatusMapModel> StatusMapList { get; set; }
|
public DbSet<StatusMapModel> StatusMapList { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wharehouse materials management
|
||||||
|
/// </summary>
|
||||||
|
public DbSet<MaterialModel> MaterialsList { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wharehouse items management
|
||||||
|
/// </summary>
|
||||||
|
public DbSet<RawItemModel> RawItemList { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Alias management
|
||||||
|
/// </summary>
|
||||||
|
public DbSet<AliasModel> AliasList { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Alias management
|
||||||
|
/// </summary>
|
||||||
|
public DbSet<MagmanSyncModel> SyncList { get; set; }
|
||||||
|
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||||
|
{
|
||||||
|
// <Auto-Generated>
|
||||||
|
// This is here so CodeMaid doesn't reorganize this document
|
||||||
|
// </Auto-Generated>
|
||||||
|
[Table("AliasList")]
|
||||||
|
public class AliasModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Famiglia di sinonimi
|
||||||
|
/// </summary>
|
||||||
|
[Column("Family", Order = 1), Key]
|
||||||
|
public string Family { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Codice originale (da trasformare)
|
||||||
|
/// </summary>
|
||||||
|
[Column("ValueOriginal", Order = 2), Key]
|
||||||
|
public string ValueOriginal { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Codice Alias in cui viene convertito
|
||||||
|
/// </summary>
|
||||||
|
public string ValueAlias { get; set; } = "";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,86 +16,53 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Codice Allarme
|
/// Chiave primaria evento LOG
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Column("AlarmCode")]
|
|
||||||
public string AlarmCode { get; set; } = "";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Data Evento
|
|
||||||
/// </summary>
|
|
||||||
[Column("AlarmDtEvent")]
|
|
||||||
public DateTime AlarmDatetime { get; set; } = DateTime.Now;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Messaggio Allarme
|
|
||||||
/// </summary>
|
|
||||||
[Column("AlarmMessage")]
|
|
||||||
public string AlarmMessage { get; set; } = "";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Alarm Operation
|
|
||||||
/// </summary>
|
|
||||||
[Column("AlarmOperation")]
|
|
||||||
public int AlarmOperation { get; set; } = 0;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Alarm Type
|
|
||||||
/// </summary>
|
|
||||||
[Column("AlarmType")]
|
|
||||||
public int AlarmType { get; set; } = 0;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Esaecuzione comando corretta
|
|
||||||
/// </summary>
|
|
||||||
[Column("CommExecuted")]
|
|
||||||
public bool CommandExecutedCorrectly { get; set; } = false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Stato da enum Core
|
|
||||||
/// </summary>
|
|
||||||
[Column("CommandState")]
|
|
||||||
public Core.ConstMachComm.CommandStates CommandState { get; set; } = Core.ConstMachComm.CommandStates.NULL;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Tipo Comando da enum Core
|
|
||||||
/// </summary>
|
|
||||||
[Column("CommandType")]
|
|
||||||
public Core.ConstMachComm.LogCommandTypes CommandType { get; set; } = Core.ConstMachComm.LogCommandTypes.NULL;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Descrizione
|
|
||||||
/// </summary>
|
|
||||||
[Column("Description")]
|
|
||||||
public string Description { get; set; } = "";
|
|
||||||
|
|
||||||
[Key, Column("DbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[Key, Column("DbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
public int LogDbId { get; set; }
|
public int LogDbId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// New OP State
|
|
||||||
/// </summary>
|
|
||||||
[Column("NewOpState")]
|
|
||||||
public int NewOpState { get; set; } = 0;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stato da enum Core
|
/// Stato da enum Core
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Column("ResultType")]
|
[Column("EvType")]
|
||||||
public Core.ConstMachComm.ResultTypes ResultType { get; set; } = Core.ConstMachComm.ResultTypes.NULL;
|
public Core.MachLog.MachLogTypes EvType { get; set; } = Core.MachLog.MachLogTypes.NULL;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indirizzo VAR
|
/// Data Evento
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Column("VarAddress")]
|
[Column("DtEvent")]
|
||||||
public string VarAddress { get; set; } = "";
|
public DateTime DtEvent { get; set; } = DateTime.Now;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Valore VAR
|
/// Key prod attivo (DB locale)
|
||||||
|
/// </summary>
|
||||||
|
[Column("ProdId")]
|
||||||
|
public int ProdId { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Key progetto (cloud)
|
||||||
|
/// </summary>
|
||||||
|
[Column("ProjCloudId")]
|
||||||
|
public int ProjCloudId { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ID Supervisore (Indirizzo VAR)
|
||||||
|
/// </summary>
|
||||||
|
[Column("SupervId")]
|
||||||
|
public string SupervId { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Valore VAR (oggetto del log da decodificare)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Column("VarValue")]
|
[Column("VarValue")]
|
||||||
public string VarValue { get; set; } = "";
|
public string VarValue { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data di invio evento (su cloud)
|
||||||
|
/// </summary>
|
||||||
|
[Column("DtSent")]
|
||||||
|
public DateTime? DtSent { get; set; } = null;
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||||
|
{
|
||||||
|
// <Auto-Generated>
|
||||||
|
// This is here so CodeMaid doesn't reorganize this document
|
||||||
|
// </Auto-Generated>
|
||||||
|
[Table("MagmanSync")]
|
||||||
|
public partial class MagmanSyncModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Primary Key AUTO
|
||||||
|
/// </summary>
|
||||||
|
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public int SyncId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tipologia Sync
|
||||||
|
/// </summary>
|
||||||
|
public string SyncType { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id riferimento remoto cloud x invio (es ProjCloudId)
|
||||||
|
/// </summary>
|
||||||
|
public int CloudId { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DataOra inserimento richiesta
|
||||||
|
/// </summary>
|
||||||
|
public DateTime DtReq { get; set; } = DateTime.Now;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DataOra esecuzione richiesta
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? DtExe { get; set; } = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Payload trasmesso/da trasmettere (serializzato)
|
||||||
|
/// </summary>
|
||||||
|
public string Payload { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Record inviato se DtExe != null && >= dtReq
|
||||||
|
/// </summary>
|
||||||
|
[NotMapped]
|
||||||
|
public bool Sent
|
||||||
|
{
|
||||||
|
get => DtExe != null && DtExe > DtReq;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||||
|
{
|
||||||
|
// <Auto-Generated>
|
||||||
|
// This is here so CodeMaid doesn't reorganize this document
|
||||||
|
// </Auto-Generated>
|
||||||
|
[Table("MaterialsList")]
|
||||||
|
public partial class MaterialModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Init classe
|
||||||
|
/// </summary>
|
||||||
|
public MaterialModel()
|
||||||
|
{
|
||||||
|
RawItemList = new HashSet<RawItemModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Primary Key AUTO
|
||||||
|
/// </summary>
|
||||||
|
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public int MatId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Codice materiale (Identificativo DB esterno del magazzino in sync)
|
||||||
|
/// </summary>
|
||||||
|
public int MatCloudId { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Codice Materiale
|
||||||
|
/// </summary>
|
||||||
|
public string MatCode { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Descrizione Materiale
|
||||||
|
/// </summary>
|
||||||
|
public string MatDesc { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Lenght/Lunghezza in mm
|
||||||
|
/// </summary>
|
||||||
|
public decimal LMm { get; set; } = 0;
|
||||||
|
/// <summary>
|
||||||
|
/// Width/Larghezza in mm
|
||||||
|
/// </summary>
|
||||||
|
public decimal WMm { get; set; } = 0;
|
||||||
|
/// <summary>
|
||||||
|
/// Height (Thikness/Spessore) in mm
|
||||||
|
/// </summary>
|
||||||
|
public decimal HMm { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ID dell'ultimo articolo (variante) usato per il materiale
|
||||||
|
/// </summary>
|
||||||
|
public int RawItemIdLast { get; set; } = 0;
|
||||||
|
|
||||||
|
#if false
|
||||||
|
/// <summary>
|
||||||
|
/// Lenght/Lunghezza in inch
|
||||||
|
/// </summary>
|
||||||
|
[NotMapped]
|
||||||
|
public decimal LIn
|
||||||
|
{
|
||||||
|
get => Math.Round(LMm / (decimal)25.4, 3);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Width/Larghezza in inch
|
||||||
|
/// </summary>
|
||||||
|
[NotMapped]
|
||||||
|
public decimal WIn
|
||||||
|
{
|
||||||
|
get => Math.Round(WMm / (decimal)25.4, 3);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Height/Altezza (Thikness/Spessore) in inch
|
||||||
|
/// </summary>
|
||||||
|
[NotMapped]
|
||||||
|
public decimal HIn
|
||||||
|
{
|
||||||
|
get => Math.Round(HMm / (decimal)25.4, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Codice materiale x QR/Datamatrix
|
||||||
|
/// </summary>
|
||||||
|
[NotMapped]
|
||||||
|
public string MatDtmx
|
||||||
|
{
|
||||||
|
get => $"MT{MatExtId:00000000}";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/// <summary>
|
||||||
|
/// Verifica che sia Beam, quando L == 0
|
||||||
|
/// </summary>
|
||||||
|
[NotMapped]
|
||||||
|
public bool IsBeam
|
||||||
|
{
|
||||||
|
get => (LMm == 0 && (HMm > 0 && WMm > 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Verifica che sia Wall, quando W/L == 0
|
||||||
|
/// </summary>
|
||||||
|
[NotMapped]
|
||||||
|
public bool IsWall
|
||||||
|
{
|
||||||
|
get => (LMm == 0 && WMm == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual ICollection<RawItemModel> RawItemList { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,7 +8,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tabelal delle singole istsanze prodotte\
|
/// Tabella delle singole istanze prodotte
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Table("PartList")]
|
[Table("PartList")]
|
||||||
public class PartModel
|
public class PartModel
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using static EgtBEAMWALL.Core.ConstBeam;
|
using static EgtBEAMWALL.Core.ConstBeam;
|
||||||
@@ -19,6 +17,11 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
{
|
{
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
|
public ProdModel()
|
||||||
|
{
|
||||||
|
ProjListNav = new HashSet<ProjModel>();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Chiave univoca DB
|
/// Chiave univoca DB
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -54,6 +57,11 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
[Index]
|
[Index]
|
||||||
public int ProdId { get; set; }
|
public int ProdId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Codice Proj per sync info (Identificativo DB esterno del magazzino in sync)
|
||||||
|
/// </summary>
|
||||||
|
public int ProjCloudId { get; set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tipologia del progetto (Travi, Pareti, ...)
|
/// Tipologia del progetto (Travi, Pareti, ...)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -75,7 +83,7 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
/// DataOra ultima operazione di Lock (o di rimozione di lock), quando aperto da un dispositivo in rete
|
/// DataOra ultima operazione di Lock (o di rimozione di lock), quando aperto da un dispositivo in rete
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Column("LockDate")]
|
[Column("LockDate")]
|
||||||
public DateTime LockDate { get; set; } = DateTime.MinValue;
|
public DateTime LockDate { get; set; } = new DateTime(1900, 01, 01);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Record attivo (se false == cancellazione logica)
|
/// Record attivo (se false == cancellazione logica)
|
||||||
@@ -98,6 +106,18 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
[Column("IsArchived")]
|
[Column("IsArchived")]
|
||||||
public bool IsArchived { get; set; } = false;
|
public bool IsArchived { get; set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data Creazione
|
||||||
|
/// </summary>
|
||||||
|
[Index]
|
||||||
|
[Column("DtLastMod")]
|
||||||
|
public DateTime DtLastMod { get; set; } = new DateTime(1900, 01, 01);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Collezione oggetti Proj associati (almeno 1 by design)
|
||||||
|
/// </summary>
|
||||||
|
public virtual ICollection<ProjModel> ProjListNav { get; set; }
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,6 +65,11 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
[Index]
|
[Index]
|
||||||
public int ProjId { get; set; }
|
public int ProjId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Codice Proj per sync info (Identificativo DB esterno del magazzino in sync)
|
||||||
|
/// </summary>
|
||||||
|
public int ProjCloudId { get; set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tipologia del progetto (Travi, Pareti, ...)
|
/// Tipologia del progetto (Travi, Pareti, ...)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -87,7 +92,7 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
|||||||
/// dispositivo in rete
|
/// dispositivo in rete
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Column("LockDate")]
|
[Column("LockDate")]
|
||||||
public DateTime LockDate { get; set; } = DateTime.MinValue;
|
public DateTime LockDate { get; set; } = new DateTime(1900, 01, 01);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Record attivo (se false == cancellazione logica)
|
/// Record attivo (se false == cancellazione logica)
|
||||||
|
|||||||
@@ -0,0 +1,129 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||||
|
{
|
||||||
|
// <Auto-Generated>
|
||||||
|
// This is here so CodeMaid doesn't reorganize this document
|
||||||
|
// </Auto-Generated>
|
||||||
|
//[Index(nameof(Installazione), nameof(Active), nameof(DiskStatus))]
|
||||||
|
[Table("RawItemList")]
|
||||||
|
public partial class RawItemModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Primary Key AUTO
|
||||||
|
/// </summary>
|
||||||
|
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public int RawItemId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Codice RawMat univoco e in sync (Identificativo DB esterno del magazzino in sync)
|
||||||
|
/// </summary>
|
||||||
|
public int RawItemCloudId { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ForeignKey Materiale
|
||||||
|
/// </summary>
|
||||||
|
public int MatId { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Qty available on wharehouse
|
||||||
|
/// </summary>
|
||||||
|
public int QtyAvail { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Active = can be used
|
||||||
|
/// </summary>
|
||||||
|
public bool IsActive { get; set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remnant
|
||||||
|
/// </summary>
|
||||||
|
public bool IsRemn { get; set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deleted = from cloud, not to use
|
||||||
|
/// </summary>
|
||||||
|
public bool IsDeleted { get; set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Item's Lenght
|
||||||
|
/// </summary>
|
||||||
|
public decimal LMm { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Item's Width
|
||||||
|
/// </summary>
|
||||||
|
public decimal WMm { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Item's Height (Thikness/Spessore) in mm
|
||||||
|
/// </summary>
|
||||||
|
public decimal HMm { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Note (optional)
|
||||||
|
/// </summary>
|
||||||
|
public string Note { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indica se debba usare qty effettiva o indefinita (x nesting/schedulazione a capacita illimitata)
|
||||||
|
/// </summary>
|
||||||
|
public bool UseQty { get; set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DataOra ultimo aggiornamento dal cloud dei dati (in particolare giacenza)
|
||||||
|
/// </summary>
|
||||||
|
public DateTime LastSync { get; set; } = DateTime.Today.AddYears(-10);
|
||||||
|
|
||||||
|
#if false
|
||||||
|
[NotMapped]
|
||||||
|
public decimal LIn
|
||||||
|
{
|
||||||
|
get => Math.Round(LMm / (decimal)25.4, 3);
|
||||||
|
}
|
||||||
|
[NotMapped]
|
||||||
|
public decimal WIn
|
||||||
|
{
|
||||||
|
get => Math.Round(WMm / (decimal)25.4, 3);
|
||||||
|
}
|
||||||
|
[NotMapped]
|
||||||
|
public decimal HIn
|
||||||
|
{
|
||||||
|
get => Math.Round(HMm / (decimal)25.4, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
[NotMapped]
|
||||||
|
public decimal Area
|
||||||
|
{
|
||||||
|
get => LMm * WMm;
|
||||||
|
}
|
||||||
|
|
||||||
|
[NotMapped]
|
||||||
|
public string ItemDtmx
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string answ = $"MT99999999-{LMm * 1000:00000000}";
|
||||||
|
if (MaterialNav != null)
|
||||||
|
{
|
||||||
|
answ = $"MT{MaterialNav.MatExtId:00000000}-{LMm * 1000:00000000}";
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Navigation property to Material
|
||||||
|
/// </summary>
|
||||||
|
[ForeignKey("MatId")]
|
||||||
|
public virtual MaterialModel MaterialNav { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -28,14 +28,31 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// DB Connection string per azioni amministrative
|
/// DB Connection string per azioni amministrative:
|
||||||
|
/// aggiunto parametro "allow user variables", da https://forums.mysql.com/read.php?38,609672,610320#msg-610320
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string ADMIN_CONNECTION_STRING { get; set; } = "";
|
public static string ADMIN_CONNECTION_STRING { get; set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// DB Connection string, per effettuare migration riportare valore connessione admin cablato (server=localhost;port=3306;database=EgtBwDb_000102;)
|
/// DB Connection string, per effettuare migration riportare valore connessione admin cablato
|
||||||
|
/// DB Manu: server=localhost;port=3306;database=EgtBwDb_000102;uid=root;pwd=Egalware_24068!;
|
||||||
|
/// DB Sam: server=localhost;port=3306;database=EgtBwDb_000470;uid=root;pwd=Egalware_24068!;
|
||||||
|
/// DB Lovato: server=localhost;port=3306;database=EgtBwDb_000656;uid=root;pwd=Egalware_24068!;
|
||||||
|
///
|
||||||
|
/// DB RETE Lovato: server=mdb.ufficio;port=3306;database=EgtBwDb_000656;uid=steamware;pwd=Egalware_24068!;
|
||||||
|
/// DB TET corelocal: server=corelocal.egalware.com;port=3306;database=EgtBwDb_000999;uid=steamware;pwd=Egalware_24068!;
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string CONNECTION_STRING { get; set; } = "";
|
//public static string CONNECTION_STRING { get; set; } = "server=localhost;port=3306;database=EgtBwDb_000470;uid=root;pwd=Egalware_24068!;allow user variables=true";
|
||||||
|
|
||||||
|
//public static string CONNECTION_STRING { get; set; } = "server=localhost;port=3306;database=EgtBwDb_000656;uid=root;pwd=Egalware_24068!;allow user variables=true";
|
||||||
|
//public static string CONNECTION_STRING { get; set; } = "server=corelocal.egalware.com;port=3306;database=EgtBwDb_000656;uid=root;pwd=Egalware_24068!;allow user variables=true";
|
||||||
|
//public static string CONNECTION_STRING { get; set; } = "server=mdb.ufficio;port=3306;database=EgtBwDb_000656;uid=steamware;pwd=Egalware_24068!;allow user variables=true";
|
||||||
|
|
||||||
|
public static string CONNECTION_STRING { get; set; } = "server=localhost;port=3306;database=EgtBwDb_000656;uid=root;pwd=Egalware_24068!;allow user variables=true";
|
||||||
|
//public static string CONNECTION_STRING { get; set; } = "server=localhost;port=3306;database=EgtBwDb_000102;uid=root;pwd=Egalware_24068!;allow user variables=true";
|
||||||
|
//public static string CONNECTION_STRING { get; set; } = "server=localhost;port=3306;database=EgtBwDb_000999;uid=root;pwd=Egalware_24068!;allow user variables=true";
|
||||||
|
//public static string CONNECTION_STRING { get; set; } = "server=corelocal.egalware.com;port=3306;database=EgtBwDb_000999;uid=root;pwd=Egalware_24068!;allow user variables=true";
|
||||||
|
//public static string CONNECTION_STRING { get; set; } = "server=mdb.ufficio;port=3306;database=EgtBwDb_000999;uid=steamware;pwd=Egalware_24068!;allow user variables=true";
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
|
|
||||||
@@ -73,8 +90,10 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static bool CheckViews(string nKey, string sKey)
|
public static bool CheckViews(string nKey, string sKey)
|
||||||
{
|
{
|
||||||
// esecuzione script di install locale
|
return false;
|
||||||
return Controllers.DbController.man.refreshViews(DATABASE_NAME);
|
// commento, scambiare con migrations da file?!?
|
||||||
|
//// esecuzione script di install locale
|
||||||
|
//return Controllers.DbController.man.refreshViews(DATABASE_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -83,9 +102,9 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
/// <param name="zipFilePath">Percorso di salvataggio del dump (*.zip)</param>
|
/// <param name="zipFilePath">Percorso di salvataggio del dump (*.zip)</param>
|
||||||
/// <param name="dbName">Nome del DB da processare (se vuoto quello di default calcolato)</param>
|
/// <param name="dbName">Nome del DB da processare (se vuoto quello di default calcolato)</param>
|
||||||
/// <param name="mysqlDumpPath">Nome o Percorso Eseguibile mysqldump (opzionale)</param>
|
/// <param name="mysqlDumpPath">Nome o Percorso Eseguibile mysqldump (opzionale)</param>
|
||||||
/// <param name="exportOpt">Opzioni in fase di export (default: --skip-extended-insert)</param>
|
/// <param name="exportOpt">Opzioni in fase di export | default: --add-drop-database --skip-extended-insert --hex-blob</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static bool DataBaseDumpToFile(string zipFilePath, string dbName = "", string mysqlDumpPath = "mysqldump", string exportOpt = "--skip-extended-insert")
|
public static bool DataBaseDumpToFile(string zipFilePath, string dbName = "", string mysqlDumpPath = "mysqldump", string exportOpt = "--add-drop-database --skip-extended-insert --hex-blob")
|
||||||
{
|
{
|
||||||
bool fatto = false;
|
bool fatto = false;
|
||||||
// fix path eseguibile
|
// fix path eseguibile
|
||||||
@@ -119,12 +138,16 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
{
|
{
|
||||||
File.Delete(zipFilePath);
|
File.Delete(zipFilePath);
|
||||||
}
|
}
|
||||||
|
// 2024.06.28 aggiunto --hex-blob x dati binary
|
||||||
// creazione SQL, tramite script esterno... importante parametro "--skip-extended-insert" altrimenti problemi con restore (anche se + verboso e lento in backup...)
|
// creazione SQL, tramite script esterno... importante parametro "--skip-extended-insert" altrimenti problemi con restore (anche se + verboso e lento in backup...)
|
||||||
string callScript = $"\"{mysqlDumpPath}\" -u{DATABASE_USER} -p{DATABASE_PWD} {dbName} {exportOpt} > {tempSqlPath}";
|
string callScript = $"\"{mysqlDumpPath}\" -u{DATABASE_USER} -p{DATABASE_PWD} --databases {dbName} {exportOpt} > {tempSqlPath}";
|
||||||
ExecuteCommand(callScript);
|
ExecuteCommand(callScript);
|
||||||
// compressione con pwd!
|
// compressione con pwd!
|
||||||
using (ZipFile zip = new ZipFile())
|
using (ZipFile zip = new ZipFile())
|
||||||
{
|
{
|
||||||
|
// non paiono necessarie x ripristino
|
||||||
|
//zip.CompressionMethod = CompressionMethod.BZip2;
|
||||||
|
//zip.UseUnicodeAsNecessary = true;
|
||||||
// aggiungo pwd
|
// aggiungo pwd
|
||||||
zip.Password = ZIP_PWD;
|
zip.Password = ZIP_PWD;
|
||||||
// inserisco file
|
// inserisco file
|
||||||
@@ -249,9 +272,9 @@ namespace EgtBEAMWALL.DataLayer
|
|||||||
DATABASE_USER = $"user_{nKey}";
|
DATABASE_USER = $"user_{nKey}";
|
||||||
DATABASE_PWD = $"pwd_{sKey}";
|
DATABASE_PWD = $"pwd_{sKey}";
|
||||||
ZIP_PWD = $"{DATABASE_USER}:{DATABASE_PWD}:{DATABASE_USER}:{DATABASE_PWD}";
|
ZIP_PWD = $"{DATABASE_USER}:{DATABASE_PWD}:{DATABASE_USER}:{DATABASE_PWD}";
|
||||||
CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database={DATABASE_NAME};uid={DATABASE_USER};pwd={DATABASE_PWD};SslMode=None";
|
CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database={DATABASE_NAME};uid={DATABASE_USER};pwd={DATABASE_PWD};SslMode=None;allow user variables=true";
|
||||||
// stringa admin con utente root egalware...
|
// stringa admin con utente root egalware...
|
||||||
ADMIN_CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database=mysql;uid=root;pwd=Egalware_24068!;SslMode=none;CHARSET=utf8";
|
ADMIN_CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database=mysql;uid=root;pwd=Egalware_24068!;SslMode=none;CHARSET=utf8;allow user variables=true";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -37,8 +37,8 @@
|
|||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
|
<Reference Include="BouncyCastle.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=072edcf4a5328938, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
|
<HintPath>..\packages\BouncyCastle.Cryptography.2.4.0\lib\net461\BouncyCastle.Cryptography.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="DotNetZip, Version=1.16.0.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
|
<Reference Include="DotNetZip, Version=1.16.0.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\DotNetZip.1.16.0\lib\net40\DotNetZip.dll</HintPath>
|
<HintPath>..\packages\DotNetZip.1.16.0\lib\net40\DotNetZip.dll</HintPath>
|
||||||
@@ -46,38 +46,53 @@
|
|||||||
<Reference Include="EgtWPFLib5">
|
<Reference Include="EgtWPFLib5">
|
||||||
<HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath>
|
<HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="EgwProxy.MagMan, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\EgwProxy.MagMan.1.0.2408.514\lib\EgwProxy.MagMan.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Google.Protobuf, Version=3.21.9.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
<Reference Include="Google.Protobuf, Version=3.27.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll</HintPath>
|
<HintPath>..\packages\Google.Protobuf.3.27.0\lib\net45\Google.Protobuf.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="K4os.Compression.LZ4, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
<Reference Include="K4os.Compression.LZ4, Version=1.3.8.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\K4os.Compression.LZ4.1.3.5\lib\net462\K4os.Compression.LZ4.dll</HintPath>
|
<HintPath>..\packages\K4os.Compression.LZ4.1.3.8\lib\net462\K4os.Compression.LZ4.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.8.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.5\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
|
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.8\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
|
<Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll</HintPath>
|
<HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="MySql.Data, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MySql.Data.8.0.21\lib\net452\MySql.Data.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=8.0.0.1, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MySql.Data.EntityFramework.8.0.21\lib\net452\MySql.Data.EntityFramework.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.8.0.1\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.1, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.8.0.1\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="MySql.Data, Version=8.4.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\MySql.Data.8.4.0\lib\net462\MySql.Data.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="MySql.Data.EntityFramework, Version=8.4.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\MySql.Data.EntityFramework.8.4.0\lib\net462\MySql.Data.EntityFramework.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NLog.5.0.1\lib\net46\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.5.3.2\lib\net46\NLog.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Renci.SshNet, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL">
|
<Reference Include="Renci.SshNet, Version=2024.0.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll</HintPath>
|
<HintPath>..\packages\SSH.NET.2024.0.0\lib\net462\Renci.SshNet.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="RestSharp, Version=111.2.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\RestSharp.111.2.0\lib\net471\RestSharp.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
@@ -86,18 +101,25 @@
|
|||||||
<Reference Include="System.ComponentModel" />
|
<Reference Include="System.ComponentModel" />
|
||||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
|
<Reference Include="System.Configuration.ConfigurationManager, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Configuration.ConfigurationManager.8.0.0\lib\net462\System.Configuration.ConfigurationManager.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Configuration.Install" />
|
<Reference Include="System.Configuration.Install" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Diagnostics.DiagnosticSource, Version=8.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.8.0.1\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.Drawing.Design" />
|
<Reference Include="System.Drawing.Design" />
|
||||||
<Reference Include="System.IO.Compression" />
|
<Reference Include="System.IO.Compression" />
|
||||||
<Reference Include="System.IO.Pipelines, Version=5.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.IO.Pipelines, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.IO.Pipelines.5.0.2\lib\net461\System.IO.Pipelines.dll</HintPath>
|
<HintPath>..\packages\System.IO.Pipelines.8.0.0\lib\net462\System.IO.Pipelines.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Management" />
|
<Reference Include="System.Management" />
|
||||||
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
<Reference Include="System.Numerics" />
|
<Reference Include="System.Numerics" />
|
||||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||||
@@ -108,24 +130,40 @@
|
|||||||
<Reference Include="System.Security" />
|
<Reference Include="System.Security" />
|
||||||
<Reference Include="System.ServiceModel" />
|
<Reference Include="System.ServiceModel" />
|
||||||
<Reference Include="System.ServiceProcess" />
|
<Reference Include="System.ServiceProcess" />
|
||||||
|
<Reference Include="System.Text.Encodings.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Text.Json, Version=8.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Text.Json.8.0.3\lib\net462\System.Text.Json.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Transactions" />
|
<Reference Include="System.Transactions" />
|
||||||
|
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Web" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="Ubiety.Dns.Core, Version=2.2.1.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
<Reference Include="ZstdSharp, Version=0.8.1.0, Culture=neutral, PublicKeyToken=8d151af33a4ad5cf, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MySql.Data.8.0.21\lib\net452\Ubiety.Dns.Core.dll</HintPath>
|
<HintPath>..\packages\ZstdSharp.Port.0.8.1\lib\net462\ZstdSharp.dll</HintPath>
|
||||||
</Reference>
|
|
||||||
<Reference Include="Zstandard.Net, Version=1.1.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\MySql.Data.8.0.21\lib\net452\Zstandard.Net.dll</HintPath>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="AdminContext.cs" />
|
<Compile Include="AdminContext.cs" />
|
||||||
|
<Compile Include="Controllers\MagmanSyncController.cs" />
|
||||||
|
<Compile Include="Controllers\MagmanController.cs" />
|
||||||
|
<Compile Include="Controllers\AliasController.cs" />
|
||||||
|
<Compile Include="Controllers\RawItemsController.cs" />
|
||||||
|
<Compile Include="Controllers\MaterialsController.cs" />
|
||||||
|
<Compile Include="DatabaseModels\AliasModel.cs" />
|
||||||
|
<Compile Include="DatabaseModels\MagmanSyncModel.cs" />
|
||||||
|
<Compile Include="DatabaseModels\MaterialModel.cs" />
|
||||||
|
<Compile Include="DatabaseModels\RawItemModel.cs" />
|
||||||
<Compile Include="DatabaseModels\UserPrivModel.cs" />
|
<Compile Include="DatabaseModels\UserPrivModel.cs" />
|
||||||
<Compile Include="DbConfig.cs" />
|
<Compile Include="DbConfig.cs" />
|
||||||
<Compile Include="Controllers\LogMachineController.cs" />
|
<Compile Include="Controllers\LogMachineController.cs" />
|
||||||
@@ -187,6 +225,62 @@
|
|||||||
<Compile Include="Migrations\202308250853396_AddProjArchivedField.designer.cs">
|
<Compile Include="Migrations\202308250853396_AddProjArchivedField.designer.cs">
|
||||||
<DependentUpon>202308250853396_AddProjArchivedField.cs</DependentUpon>
|
<DependentUpon>202308250853396_AddProjArchivedField.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Migrations\202401181534084_AddAliasMaterialRawItemsModel.cs" />
|
||||||
|
<Compile Include="Migrations\202401181534084_AddAliasMaterialRawItemsModel.designer.cs">
|
||||||
|
<DependentUpon>202401181534084_AddAliasMaterialRawItemsModel.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Migrations\202401291722150_FixMatItemCloudId.cs" />
|
||||||
|
<Compile Include="Migrations\202401291722150_FixMatItemCloudId.designer.cs">
|
||||||
|
<DependentUpon>202401291722150_FixMatItemCloudId.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Migrations\202401310830146_FixItemRemn.cs" />
|
||||||
|
<Compile Include="Migrations\202401310830146_FixItemRemn.designer.cs">
|
||||||
|
<DependentUpon>202401310830146_FixItemRemn.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Migrations\202402141003461_RawItemAddUseQty.cs" />
|
||||||
|
<Compile Include="Migrations\202402141003461_RawItemAddUseQty.designer.cs">
|
||||||
|
<DependentUpon>202402141003461_RawItemAddUseQty.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Migrations\202402290716188_AddProjCloudId.cs" />
|
||||||
|
<Compile Include="Migrations\202402290716188_AddProjCloudId.Designer.cs">
|
||||||
|
<DependentUpon>202402290716188_AddProjCloudId.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Migrations\202403120645357_RawItemAddLastSync.cs" />
|
||||||
|
<Compile Include="Migrations\202403120645357_RawItemAddLastSync.Designer.cs">
|
||||||
|
<DependentUpon>202403120645357_RawItemAddLastSync.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Migrations\202403120803297_AddMagmanSyncTab.cs" />
|
||||||
|
<Compile Include="Migrations\202403120803297_AddMagmanSyncTab.Designer.cs">
|
||||||
|
<DependentUpon>202403120803297_AddMagmanSyncTab.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Migrations\202404261445205_UpdateLogMachineTable.cs" />
|
||||||
|
<Compile Include="Migrations\202404261445205_UpdateLogMachineTable.Designer.cs">
|
||||||
|
<DependentUpon>202404261445205_UpdateLogMachineTable.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Migrations\202404261505131_UpdateLogMachineTable02.cs" />
|
||||||
|
<Compile Include="Migrations\202404261505131_UpdateLogMachineTable02.Designer.cs">
|
||||||
|
<DependentUpon>202404261505131_UpdateLogMachineTable02.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Migrations\202404290906337_UpdateLogMachineTable03.cs" />
|
||||||
|
<Compile Include="Migrations\202404290906337_UpdateLogMachineTable03.Designer.cs">
|
||||||
|
<DependentUpon>202404290906337_UpdateLogMachineTable03.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Migrations\202404291620416_UpdateLogMachineTable04.cs" />
|
||||||
|
<Compile Include="Migrations\202404291620416_UpdateLogMachineTable04.Designer.cs">
|
||||||
|
<DependentUpon>202404291620416_UpdateLogMachineTable04.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Migrations\202406070826284_AddStoredProc01.cs" />
|
||||||
|
<Compile Include="Migrations\202406070826284_AddStoredProc01.Designer.cs">
|
||||||
|
<DependentUpon>202406070826284_AddStoredProc01.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Migrations\202407170704518_AddProdDtLastMod.cs" />
|
||||||
|
<Compile Include="Migrations\202407170704518_AddProdDtLastMod.Designer.cs">
|
||||||
|
<DependentUpon>202407170704518_AddProdDtLastMod.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Migrations\202408051054365_AddRawItemLogicalDelete.cs" />
|
||||||
|
<Compile Include="Migrations\202408051054365_AddRawItemLogicalDelete.Designer.cs">
|
||||||
|
<DependentUpon>202408051054365_AddRawItemLogicalDelete.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Migrations\Configuration.cs" />
|
<Compile Include="Migrations\Configuration.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Utils.cs" />
|
<Compile Include="Utils.cs" />
|
||||||
@@ -235,6 +329,53 @@
|
|||||||
<EmbeddedResource Include="Migrations\202308250853396_AddProjArchivedField.resx">
|
<EmbeddedResource Include="Migrations\202308250853396_AddProjArchivedField.resx">
|
||||||
<DependentUpon>202308250853396_AddProjArchivedField.cs</DependentUpon>
|
<DependentUpon>202308250853396_AddProjArchivedField.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Migrations\202401181534084_AddAliasMaterialRawItemsModel.resx">
|
||||||
|
<DependentUpon>202401181534084_AddAliasMaterialRawItemsModel.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Migrations\202401291722150_FixMatItemCloudId.resx">
|
||||||
|
<DependentUpon>202401291722150_FixMatItemCloudId.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Migrations\202401310830146_FixItemRemn.resx">
|
||||||
|
<DependentUpon>202401310830146_FixItemRemn.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Migrations\202402141003461_RawItemAddUseQty.resx">
|
||||||
|
<DependentUpon>202402141003461_RawItemAddUseQty.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Migrations\202402290716188_AddProjCloudId.resx">
|
||||||
|
<DependentUpon>202402290716188_AddProjCloudId.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Migrations\202403120645357_RawItemAddLastSync.resx">
|
||||||
|
<DependentUpon>202403120645357_RawItemAddLastSync.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Migrations\202403120803297_AddMagmanSyncTab.resx">
|
||||||
|
<DependentUpon>202403120803297_AddMagmanSyncTab.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Migrations\202404261445205_UpdateLogMachineTable.resx">
|
||||||
|
<DependentUpon>202404261445205_UpdateLogMachineTable.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Migrations\202404261505131_UpdateLogMachineTable02.resx">
|
||||||
|
<DependentUpon>202404261505131_UpdateLogMachineTable02.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Migrations\202404290906337_UpdateLogMachineTable03.resx">
|
||||||
|
<DependentUpon>202404290906337_UpdateLogMachineTable03.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Migrations\202404291620416_UpdateLogMachineTable04.resx">
|
||||||
|
<DependentUpon>202404291620416_UpdateLogMachineTable04.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Migrations\202406070826284_AddStoredProc01.resx">
|
||||||
|
<DependentUpon>202406070826284_AddStoredProc01.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Migrations\202407170704518_AddProdDtLastMod.resx">
|
||||||
|
<DependentUpon>202407170704518_AddProdDtLastMod.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Migrations\202408051054365_AddRawItemLogicalDelete.resx">
|
||||||
|
<DependentUpon>202408051054365_AddRawItemLogicalDelete.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="SqlScripts\Stored\stp_LogMachineFixPid.sql">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|||||||
Generated
+29
@@ -0,0 +1,29 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System.CodeDom.Compiler;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Data.Entity.Migrations.Infrastructure;
|
||||||
|
using System.Resources;
|
||||||
|
|
||||||
|
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
|
||||||
|
public sealed partial class AddAliasMaterialRawItemsModel : IMigrationMetadata
|
||||||
|
{
|
||||||
|
private readonly ResourceManager Resources = new ResourceManager(typeof(AddAliasMaterialRawItemsModel));
|
||||||
|
|
||||||
|
string IMigrationMetadata.Id
|
||||||
|
{
|
||||||
|
get { return "202401181534084_AddAliasMaterialRawItemsModel"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Source
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Target
|
||||||
|
{
|
||||||
|
get { return Resources.GetString("Target"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
public partial class AddAliasMaterialRawItemsModel : DbMigration
|
||||||
|
{
|
||||||
|
public override void Up()
|
||||||
|
{
|
||||||
|
CreateTable(
|
||||||
|
"dbo.AliasList",
|
||||||
|
c => new
|
||||||
|
{
|
||||||
|
Family = c.String(nullable: false, maxLength: 128, storeType: "nvarchar"),
|
||||||
|
ValueOriginal = c.String(nullable: false, maxLength: 128, storeType: "nvarchar"),
|
||||||
|
ValueAlias = c.String(unicode: false),
|
||||||
|
})
|
||||||
|
.PrimaryKey(t => new { t.Family, t.ValueOriginal });
|
||||||
|
|
||||||
|
CreateTable(
|
||||||
|
"dbo.MaterialsList",
|
||||||
|
c => new
|
||||||
|
{
|
||||||
|
MatId = c.Int(nullable: false, identity: true),
|
||||||
|
MatExtId = c.Int(nullable: false),
|
||||||
|
MatCode = c.String(unicode: false),
|
||||||
|
MatDesc = c.String(unicode: false),
|
||||||
|
LMm = c.Decimal(nullable: false, precision: 18, scale: 2),
|
||||||
|
WMm = c.Decimal(nullable: false, precision: 18, scale: 2),
|
||||||
|
HMm = c.Decimal(nullable: false, precision: 18, scale: 2),
|
||||||
|
RawItemIdLast = c.Int(nullable: false),
|
||||||
|
})
|
||||||
|
.PrimaryKey(t => t.MatId);
|
||||||
|
|
||||||
|
CreateTable(
|
||||||
|
"dbo.RawItemList",
|
||||||
|
c => new
|
||||||
|
{
|
||||||
|
RawItemId = c.Int(nullable: false, identity: true),
|
||||||
|
MatId = c.Int(nullable: false),
|
||||||
|
QtyAvail = c.Int(nullable: false),
|
||||||
|
IsActive = c.Boolean(nullable: false),
|
||||||
|
LMm = c.Decimal(nullable: false, precision: 18, scale: 2),
|
||||||
|
WMm = c.Decimal(nullable: false, precision: 18, scale: 2),
|
||||||
|
HMm = c.Decimal(nullable: false, precision: 18, scale: 2),
|
||||||
|
Note = c.String(unicode: false),
|
||||||
|
})
|
||||||
|
.PrimaryKey(t => t.RawItemId)
|
||||||
|
.ForeignKey("dbo.MaterialsList", t => t.MatId, cascadeDelete: true)
|
||||||
|
.Index(t => t.MatId);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Down()
|
||||||
|
{
|
||||||
|
DropForeignKey("dbo.RawItemList", "MatId", "dbo.MaterialsList");
|
||||||
|
DropIndex("dbo.RawItemList", new[] { "MatId" });
|
||||||
|
DropTable("dbo.RawItemList");
|
||||||
|
DropTable("dbo.MaterialsList");
|
||||||
|
DropTable("dbo.AliasList");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
+29
@@ -0,0 +1,29 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System.CodeDom.Compiler;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Data.Entity.Migrations.Infrastructure;
|
||||||
|
using System.Resources;
|
||||||
|
|
||||||
|
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
|
||||||
|
public sealed partial class FixMatItemCloudId : IMigrationMetadata
|
||||||
|
{
|
||||||
|
private readonly ResourceManager Resources = new ResourceManager(typeof(FixMatItemCloudId));
|
||||||
|
|
||||||
|
string IMigrationMetadata.Id
|
||||||
|
{
|
||||||
|
get { return "202401291722150_FixMatItemCloudId"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Source
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Target
|
||||||
|
{
|
||||||
|
get { return Resources.GetString("Target"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
public partial class FixMatItemCloudId : DbMigration
|
||||||
|
{
|
||||||
|
public override void Up()
|
||||||
|
{
|
||||||
|
AddColumn("dbo.MaterialsList", "MatCloudId", c => c.Int(nullable: false));
|
||||||
|
AddColumn("dbo.RawItemList", "RawItemCloudId", c => c.Int(nullable: false));
|
||||||
|
DropColumn("dbo.MaterialsList", "MatExtId");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Down()
|
||||||
|
{
|
||||||
|
AddColumn("dbo.MaterialsList", "MatExtId", c => c.Int(nullable: false));
|
||||||
|
DropColumn("dbo.RawItemList", "RawItemCloudId");
|
||||||
|
DropColumn("dbo.MaterialsList", "MatCloudId");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,29 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System.CodeDom.Compiler;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Data.Entity.Migrations.Infrastructure;
|
||||||
|
using System.Resources;
|
||||||
|
|
||||||
|
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
|
||||||
|
public sealed partial class FixItemRemn : IMigrationMetadata
|
||||||
|
{
|
||||||
|
private readonly ResourceManager Resources = new ResourceManager(typeof(FixItemRemn));
|
||||||
|
|
||||||
|
string IMigrationMetadata.Id
|
||||||
|
{
|
||||||
|
get { return "202401310830146_FixItemRemn"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Source
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Target
|
||||||
|
{
|
||||||
|
get { return Resources.GetString("Target"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
public partial class FixItemRemn : DbMigration
|
||||||
|
{
|
||||||
|
public override void Up()
|
||||||
|
{
|
||||||
|
AddColumn("dbo.RawItemList", "IsRemn", c => c.Boolean(nullable: false));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Down()
|
||||||
|
{
|
||||||
|
DropColumn("dbo.RawItemList", "IsRemn");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
+29
@@ -0,0 +1,29 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System.CodeDom.Compiler;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Data.Entity.Migrations.Infrastructure;
|
||||||
|
using System.Resources;
|
||||||
|
|
||||||
|
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
|
||||||
|
public sealed partial class RawItemAddUseQty : IMigrationMetadata
|
||||||
|
{
|
||||||
|
private readonly ResourceManager Resources = new ResourceManager(typeof(RawItemAddUseQty));
|
||||||
|
|
||||||
|
string IMigrationMetadata.Id
|
||||||
|
{
|
||||||
|
get { return "202402141003461_RawItemAddUseQty"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Source
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Target
|
||||||
|
{
|
||||||
|
get { return Resources.GetString("Target"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
public partial class RawItemAddUseQty : DbMigration
|
||||||
|
{
|
||||||
|
public override void Up()
|
||||||
|
{
|
||||||
|
AddColumn("dbo.RawItemList", "UseQty", c => c.Boolean(nullable: false));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Down()
|
||||||
|
{
|
||||||
|
DropColumn("dbo.RawItemList", "UseQty");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,29 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System.CodeDom.Compiler;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Data.Entity.Migrations.Infrastructure;
|
||||||
|
using System.Resources;
|
||||||
|
|
||||||
|
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
|
||||||
|
public sealed partial class AddProjCloudId : IMigrationMetadata
|
||||||
|
{
|
||||||
|
private readonly ResourceManager Resources = new ResourceManager(typeof(AddProjCloudId));
|
||||||
|
|
||||||
|
string IMigrationMetadata.Id
|
||||||
|
{
|
||||||
|
get { return "202402290716188_AddProjCloudId"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Source
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Target
|
||||||
|
{
|
||||||
|
get { return Resources.GetString("Target"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
public partial class AddProjCloudId : DbMigration
|
||||||
|
{
|
||||||
|
public override void Up()
|
||||||
|
{
|
||||||
|
AddColumn("dbo.ProjList", "ProjCloudId", c => c.Int(nullable: false));
|
||||||
|
AddColumn("dbo.ProdList", "ProjCloudId", c => c.Int(nullable: false));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Down()
|
||||||
|
{
|
||||||
|
DropColumn("dbo.ProdList", "ProjCloudId");
|
||||||
|
DropColumn("dbo.ProjList", "ProjCloudId");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
+29
@@ -0,0 +1,29 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System.CodeDom.Compiler;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Data.Entity.Migrations.Infrastructure;
|
||||||
|
using System.Resources;
|
||||||
|
|
||||||
|
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
|
||||||
|
public sealed partial class RawItemAddLastSync : IMigrationMetadata
|
||||||
|
{
|
||||||
|
private readonly ResourceManager Resources = new ResourceManager(typeof(RawItemAddLastSync));
|
||||||
|
|
||||||
|
string IMigrationMetadata.Id
|
||||||
|
{
|
||||||
|
get { return "202403120645357_RawItemAddLastSync"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Source
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Target
|
||||||
|
{
|
||||||
|
get { return Resources.GetString("Target"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
public partial class RawItemAddLastSync : DbMigration
|
||||||
|
{
|
||||||
|
public override void Up()
|
||||||
|
{
|
||||||
|
AddColumn("dbo.RawItemList", "LastSync", c => c.DateTime(nullable: false, precision: 0, defaultValueSql: "DATE('2000-01-01')"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Down()
|
||||||
|
{
|
||||||
|
DropColumn("dbo.RawItemList", "LastSync");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
+29
@@ -0,0 +1,29 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System.CodeDom.Compiler;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Data.Entity.Migrations.Infrastructure;
|
||||||
|
using System.Resources;
|
||||||
|
|
||||||
|
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
|
||||||
|
public sealed partial class AddMagmanSyncTab : IMigrationMetadata
|
||||||
|
{
|
||||||
|
private readonly ResourceManager Resources = new ResourceManager(typeof(AddMagmanSyncTab));
|
||||||
|
|
||||||
|
string IMigrationMetadata.Id
|
||||||
|
{
|
||||||
|
get { return "202403120803297_AddMagmanSyncTab"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Source
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Target
|
||||||
|
{
|
||||||
|
get { return Resources.GetString("Target"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
public partial class AddMagmanSyncTab : DbMigration
|
||||||
|
{
|
||||||
|
public override void Up()
|
||||||
|
{
|
||||||
|
CreateTable(
|
||||||
|
"dbo.MagmanSync",
|
||||||
|
c => new
|
||||||
|
{
|
||||||
|
SyncId = c.Int(nullable: false, identity: true),
|
||||||
|
SyncType = c.String(unicode: false),
|
||||||
|
CloudId = c.Int(nullable: false),
|
||||||
|
DtReq = c.DateTime(nullable: false, precision: 0),
|
||||||
|
DtExe = c.DateTime(precision: 0),
|
||||||
|
Payload = c.String(unicode: false),
|
||||||
|
})
|
||||||
|
.PrimaryKey(t => t.SyncId);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Down()
|
||||||
|
{
|
||||||
|
DropTable("dbo.MagmanSync");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
+29
@@ -0,0 +1,29 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System.CodeDom.Compiler;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Data.Entity.Migrations.Infrastructure;
|
||||||
|
using System.Resources;
|
||||||
|
|
||||||
|
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
|
||||||
|
public sealed partial class UpdateLogMachineTable : IMigrationMetadata
|
||||||
|
{
|
||||||
|
private readonly ResourceManager Resources = new ResourceManager(typeof(UpdateLogMachineTable));
|
||||||
|
|
||||||
|
string IMigrationMetadata.Id
|
||||||
|
{
|
||||||
|
get { return "202404261445205_UpdateLogMachineTable"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Source
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Target
|
||||||
|
{
|
||||||
|
get { return Resources.GetString("Target"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
public partial class UpdateLogMachineTable : DbMigration
|
||||||
|
{
|
||||||
|
public override void Up()
|
||||||
|
{
|
||||||
|
RenameColumn("dbo.LogMachine", "ResultType", "EvType");
|
||||||
|
RenameColumn("dbo.LogMachine", "AlarmDtEvent", "DtEvent");
|
||||||
|
RenameColumn("dbo.LogMachine", "VarAddress", "SupervId");
|
||||||
|
AddColumn("dbo.LogMachine", "DtSent", c => c.DateTime(nullable: false, precision: 0, defaultValueSql: "DATE('1900-01-01')"));
|
||||||
|
DropColumn("dbo.LogMachine", "AlarmCode");
|
||||||
|
DropColumn("dbo.LogMachine", "AlarmMessage");
|
||||||
|
DropColumn("dbo.LogMachine", "AlarmOperation");
|
||||||
|
DropColumn("dbo.LogMachine", "AlarmType");
|
||||||
|
DropColumn("dbo.LogMachine", "CommExecuted");
|
||||||
|
DropColumn("dbo.LogMachine", "CommandState");
|
||||||
|
DropColumn("dbo.LogMachine", "CommandType");
|
||||||
|
DropColumn("dbo.LogMachine", "Description");
|
||||||
|
DropColumn("dbo.LogMachine", "NewOpState");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Down()
|
||||||
|
{
|
||||||
|
RenameColumn("dbo.LogMachine", "EvType", "ResultType");
|
||||||
|
RenameColumn("dbo.LogMachine", "DtEvent", "AlarmDtEvent");
|
||||||
|
RenameColumn("dbo.LogMachine", "SupervId", "VarAddress");
|
||||||
|
DropColumn("dbo.LogMachine", "DtSent");
|
||||||
|
AddColumn("dbo.LogMachine", "NewOpState", c => c.Int(nullable: false));
|
||||||
|
AddColumn("dbo.LogMachine", "Description", c => c.String(unicode: false));
|
||||||
|
AddColumn("dbo.LogMachine", "CommandType", c => c.Int(nullable: false));
|
||||||
|
AddColumn("dbo.LogMachine", "CommandState", c => c.Int(nullable: false));
|
||||||
|
AddColumn("dbo.LogMachine", "CommExecuted", c => c.Boolean(nullable: false));
|
||||||
|
AddColumn("dbo.LogMachine", "AlarmType", c => c.Int(nullable: false));
|
||||||
|
AddColumn("dbo.LogMachine", "AlarmOperation", c => c.Int(nullable: false));
|
||||||
|
AddColumn("dbo.LogMachine", "AlarmMessage", c => c.String(unicode: false));
|
||||||
|
AddColumn("dbo.LogMachine", "AlarmCode", c => c.String(unicode: false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
+29
@@ -0,0 +1,29 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System.CodeDom.Compiler;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Data.Entity.Migrations.Infrastructure;
|
||||||
|
using System.Resources;
|
||||||
|
|
||||||
|
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
|
||||||
|
public sealed partial class UpdateLogMachineTable02 : IMigrationMetadata
|
||||||
|
{
|
||||||
|
private readonly ResourceManager Resources = new ResourceManager(typeof(UpdateLogMachineTable02));
|
||||||
|
|
||||||
|
string IMigrationMetadata.Id
|
||||||
|
{
|
||||||
|
get { return "202404261505131_UpdateLogMachineTable02"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Source
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Target
|
||||||
|
{
|
||||||
|
get { return Resources.GetString("Target"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
public partial class UpdateLogMachineTable02 : DbMigration
|
||||||
|
{
|
||||||
|
public override void Up()
|
||||||
|
{
|
||||||
|
AlterColumn("dbo.LogMachine", "DtSent", c => c.DateTime(precision: 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Down()
|
||||||
|
{
|
||||||
|
AlterColumn("dbo.LogMachine", "DtSent", c => c.DateTime(nullable: false, precision: 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
+29
@@ -0,0 +1,29 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System.CodeDom.Compiler;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Data.Entity.Migrations.Infrastructure;
|
||||||
|
using System.Resources;
|
||||||
|
|
||||||
|
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
|
||||||
|
public sealed partial class UpdateLogMachineTable03 : IMigrationMetadata
|
||||||
|
{
|
||||||
|
private readonly ResourceManager Resources = new ResourceManager(typeof(UpdateLogMachineTable03));
|
||||||
|
|
||||||
|
string IMigrationMetadata.Id
|
||||||
|
{
|
||||||
|
get { return "202404290906337_UpdateLogMachineTable03"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Source
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Target
|
||||||
|
{
|
||||||
|
get { return Resources.GetString("Target"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
public partial class UpdateLogMachineTable03 : DbMigration
|
||||||
|
{
|
||||||
|
public override void Up()
|
||||||
|
{
|
||||||
|
AddColumn("dbo.LogMachine", "ProdId", c => c.Int(nullable: false, defaultValue: 0, defaultValueSql: "0"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Down()
|
||||||
|
{
|
||||||
|
DropColumn("dbo.LogMachine", "ProdId");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
+29
@@ -0,0 +1,29 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System.CodeDom.Compiler;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Data.Entity.Migrations.Infrastructure;
|
||||||
|
using System.Resources;
|
||||||
|
|
||||||
|
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
|
||||||
|
public sealed partial class UpdateLogMachineTable04 : IMigrationMetadata
|
||||||
|
{
|
||||||
|
private readonly ResourceManager Resources = new ResourceManager(typeof(UpdateLogMachineTable04));
|
||||||
|
|
||||||
|
string IMigrationMetadata.Id
|
||||||
|
{
|
||||||
|
get { return "202404291620416_UpdateLogMachineTable04"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Source
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Target
|
||||||
|
{
|
||||||
|
get { return Resources.GetString("Target"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
public partial class UpdateLogMachineTable04 : DbMigration
|
||||||
|
{
|
||||||
|
public override void Up()
|
||||||
|
{
|
||||||
|
AddColumn("dbo.LogMachine", "ProjCloudId", c => c.Int(nullable: false, defaultValue: 0, defaultValueSql: "0"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Down()
|
||||||
|
{
|
||||||
|
DropColumn("dbo.LogMachine", "ProjCloudId");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
+29
@@ -0,0 +1,29 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System.CodeDom.Compiler;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Data.Entity.Migrations.Infrastructure;
|
||||||
|
using System.Resources;
|
||||||
|
|
||||||
|
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
|
||||||
|
public sealed partial class AddStoredProc01 : IMigrationMetadata
|
||||||
|
{
|
||||||
|
private readonly ResourceManager Resources = new ResourceManager(typeof(AddStoredProc01));
|
||||||
|
|
||||||
|
string IMigrationMetadata.Id
|
||||||
|
{
|
||||||
|
get { return "202406070826284_AddStoredProc01"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Source
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Target
|
||||||
|
{
|
||||||
|
get { return Resources.GetString("Target"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using Mysqlx.Crud;
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
public partial class AddStoredProc01 : DbMigration
|
||||||
|
{
|
||||||
|
public override void Up()
|
||||||
|
{
|
||||||
|
// aggiunta stored
|
||||||
|
addStored("stp_LogMachineFixPid");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Down()
|
||||||
|
{
|
||||||
|
// rimozione stored
|
||||||
|
remStored("stp_LogMachineFixPid");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addStored(string objName)
|
||||||
|
{
|
||||||
|
string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "SqlScripts", "Stored", $"{objName}.sql");
|
||||||
|
string sqlBody = File.ReadAllText(path);
|
||||||
|
Sql(sqlBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void remStored(string objName)
|
||||||
|
{
|
||||||
|
string sqlBody = $"DROP PROCEDURE IF EXISTS {objName};";
|
||||||
|
Sql(sqlBody);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
+29
@@ -0,0 +1,29 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System.CodeDom.Compiler;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Data.Entity.Migrations.Infrastructure;
|
||||||
|
using System.Resources;
|
||||||
|
|
||||||
|
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
|
||||||
|
public sealed partial class AddProdDtLastMod : IMigrationMetadata
|
||||||
|
{
|
||||||
|
private readonly ResourceManager Resources = new ResourceManager(typeof(AddProdDtLastMod));
|
||||||
|
|
||||||
|
string IMigrationMetadata.Id
|
||||||
|
{
|
||||||
|
get { return "202407170704518_AddProdDtLastMod"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Source
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Target
|
||||||
|
{
|
||||||
|
get { return Resources.GetString("Target"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
public partial class AddProdDtLastMod : DbMigration
|
||||||
|
{
|
||||||
|
public override void Up()
|
||||||
|
{
|
||||||
|
AddColumn("dbo.ProdList", "DtLastMod", c => c.DateTime(nullable: false, precision: 0, defaultValueSql: "DATE('1900-01-01')"));
|
||||||
|
CreateIndex("dbo.ProdList", "DtLastMod");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Down()
|
||||||
|
{
|
||||||
|
DropIndex("dbo.ProdList", new[] { "DtLastMod" });
|
||||||
|
DropColumn("dbo.ProdList", "DtLastMod");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
+29
@@ -0,0 +1,29 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System.CodeDom.Compiler;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Data.Entity.Migrations.Infrastructure;
|
||||||
|
using System.Resources;
|
||||||
|
|
||||||
|
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
|
||||||
|
public sealed partial class AddRawItemLogicalDelete : IMigrationMetadata
|
||||||
|
{
|
||||||
|
private readonly ResourceManager Resources = new ResourceManager(typeof(AddRawItemLogicalDelete));
|
||||||
|
|
||||||
|
string IMigrationMetadata.Id
|
||||||
|
{
|
||||||
|
get { return "202408051054365_AddRawItemLogicalDelete"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Source
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Target
|
||||||
|
{
|
||||||
|
get { return Resources.GetString("Target"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
public partial class AddRawItemLogicalDelete : DbMigration
|
||||||
|
{
|
||||||
|
public override void Up()
|
||||||
|
{
|
||||||
|
AddColumn("dbo.RawItemList", "IsDeleted", c => c.Boolean(nullable: false, defaultValue: false, defaultValueSql: "0"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Down()
|
||||||
|
{
|
||||||
|
DropColumn("dbo.RawItemList", "IsDeleted");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,26 @@
|
|||||||
|
DROP PROCEDURE IF EXISTS stp_LogMachineFixPid;
|
||||||
|
|
||||||
|
CREATE PROCEDURE stp_LogMachineFixPid()
|
||||||
|
LANGUAGE SQL
|
||||||
|
NOT DETERMINISTIC
|
||||||
|
CONTAINS SQL
|
||||||
|
SQL SECURITY DEFINER
|
||||||
|
COMMENT 'Procedura sistemazione dati LogMachine per ProdId e ProjCloudId'
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
# Step 1: Per prima cosa aggiorno il valore di ProdId dove mancasse
|
||||||
|
UPDATE LogMachine
|
||||||
|
SET ProdId = SUBSTRING(VarValue, 1, POSITION(';' IN VarValue)-1)
|
||||||
|
WHERE ProdId = 0
|
||||||
|
AND (EvType = 1 OR EvType=2);
|
||||||
|
|
||||||
|
# Step 2: aggiorno il CloudId dove mancasse
|
||||||
|
UPDATE LogMachine LM
|
||||||
|
INNER JOIN prodlist PL ON LM.ProdId = PL.Id
|
||||||
|
SET LM.ProjCloudId = PL.ProjCloudId
|
||||||
|
WHERE (LM.EvType = 1 OR LM.EvType=2)
|
||||||
|
AND LM.ProjCloudId = 0
|
||||||
|
AND PL.ProjCloudId > 0;
|
||||||
|
|
||||||
|
|
||||||
|
END;
|
||||||
@@ -1,22 +1,33 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="BouncyCastle" version="1.8.5" targetFramework="net472" />
|
<package id="BouncyCastle.Cryptography" version="2.4.0" targetFramework="net472" />
|
||||||
<package id="DotNetZip" version="1.16.0" targetFramework="net472" />
|
<package id="DotNetZip" version="1.16.0" targetFramework="net472" />
|
||||||
|
<package id="EgwProxy.MagMan" version="1.0.2408.514" targetFramework="net472" />
|
||||||
<package id="EntityFramework" version="6.4.4" targetFramework="net452" />
|
<package id="EntityFramework" version="6.4.4" targetFramework="net452" />
|
||||||
<package id="Google.Protobuf" version="3.21.9" targetFramework="net472" />
|
<package id="Google.Protobuf" version="3.27.0" targetFramework="net472" />
|
||||||
<package id="K4os.Compression.LZ4" version="1.3.5" targetFramework="net472" />
|
<package id="K4os.Compression.LZ4" version="1.3.8" targetFramework="net472" />
|
||||||
<package id="K4os.Compression.LZ4.Streams" version="1.3.5" targetFramework="net472" />
|
<package id="K4os.Compression.LZ4.Streams" version="1.3.8" targetFramework="net472" />
|
||||||
<package id="K4os.Hash.xxHash" version="1.0.8" targetFramework="net472" />
|
<package id="K4os.Hash.xxHash" version="1.0.8" targetFramework="net472" />
|
||||||
<package id="MySql.Data" version="8.0.21" targetFramework="net472" />
|
<package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net472" />
|
||||||
<package id="MySql.Data.EntityFramework" version="8.0.21" targetFramework="net472" />
|
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="8.0.1" targetFramework="net472" />
|
||||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net452" />
|
<package id="Microsoft.Extensions.Logging.Abstractions" version="8.0.1" targetFramework="net472" />
|
||||||
<package id="NLog" version="5.0.1" targetFramework="net472" />
|
<package id="MySql.Data" version="8.4.0" targetFramework="net472" />
|
||||||
|
<package id="MySql.Data.EntityFramework" version="8.4.0" targetFramework="net472" />
|
||||||
|
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
|
||||||
|
<package id="NLog" version="5.3.2" targetFramework="net472" />
|
||||||
<package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net472" />
|
<package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net472" />
|
||||||
<package id="SSH.NET" version="2016.1.0" targetFramework="net472" />
|
<package id="RestSharp" version="111.2.0" targetFramework="net472" />
|
||||||
|
<package id="SSH.NET" version="2024.0.0" targetFramework="net472" />
|
||||||
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
|
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
|
||||||
<package id="System.IO.Pipelines" version="5.0.2" targetFramework="net472" />
|
<package id="System.Configuration.ConfigurationManager" version="8.0.0" targetFramework="net472" />
|
||||||
|
<package id="System.Diagnostics.DiagnosticSource" version="8.0.1" targetFramework="net472" />
|
||||||
|
<package id="System.IO.Pipelines" version="8.0.0" targetFramework="net472" />
|
||||||
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
|
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
|
||||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
||||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
|
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
|
||||||
|
<package id="System.Text.Encodings.Web" version="8.0.0" targetFramework="net472" />
|
||||||
|
<package id="System.Text.Json" version="8.0.3" targetFramework="net472" />
|
||||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
|
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
|
||||||
|
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
|
||||||
|
<package id="ZstdSharp.Port" version="0.8.1" targetFramework="net472" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -143,8 +143,8 @@
|
|||||||
<HintPath>..\ExtLibs\APServer.dll</HintPath>
|
<HintPath>..\ExtLibs\APServer.dll</HintPath>
|
||||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
|
<Reference Include="BouncyCastle.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=072edcf4a5328938, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
|
<HintPath>..\packages\BouncyCastle.Cryptography.2.4.0\lib\net461\BouncyCastle.Cryptography.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Csv, Version=1.0.31.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Csv, Version=1.0.31.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Csv.1.0.31\lib\net40\Csv.dll</HintPath>
|
<HintPath>..\packages\Csv.1.0.31\lib\net40\Csv.dll</HintPath>
|
||||||
@@ -160,6 +160,9 @@
|
|||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath>
|
<HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="EgwProxy.MagMan, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\EgwProxy.MagMan.1.0.2407.1708\lib\EgwProxy.MagMan.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -169,8 +172,8 @@
|
|||||||
<Reference Include="FluentFTP, Version=19.2.2.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f, processorArchitecture=MSIL">
|
<Reference Include="FluentFTP, Version=19.2.2.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\FluentFTP.19.2.2\lib\net45\FluentFTP.dll</HintPath>
|
<HintPath>..\packages\FluentFTP.19.2.2\lib\net45\FluentFTP.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Google.Protobuf, Version=3.21.9.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
<Reference Include="Google.Protobuf, Version=3.27.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll</HintPath>
|
<HintPath>..\packages\Google.Protobuf.3.27.0\lib\net45\Google.Protobuf.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Interop.FXLog">
|
<Reference Include="Interop.FXLog">
|
||||||
<HintPath>..\ExtLibs\Interop.FXLog.dll</HintPath>
|
<HintPath>..\ExtLibs\Interop.FXLog.dll</HintPath>
|
||||||
@@ -183,36 +186,42 @@
|
|||||||
<Reference Include="ISOCNC.Remoting">
|
<Reference Include="ISOCNC.Remoting">
|
||||||
<HintPath>..\ExtLibs\ISOCNC.Remoting.dll</HintPath>
|
<HintPath>..\ExtLibs\ISOCNC.Remoting.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="K4os.Compression.LZ4, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
<Reference Include="K4os.Compression.LZ4, Version=1.3.8.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\K4os.Compression.LZ4.1.3.5\lib\net462\K4os.Compression.LZ4.dll</HintPath>
|
<HintPath>..\packages\K4os.Compression.LZ4.1.3.8\lib\net462\K4os.Compression.LZ4.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.8.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.5\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
|
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.8\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
|
<Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll</HintPath>
|
<HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="Microsoft.DotNet.PlatformAbstractions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.DotNet.PlatformAbstractions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.DotNet.PlatformAbstractions.2.1.0\lib\net45\Microsoft.DotNet.PlatformAbstractions.dll</HintPath>
|
<HintPath>..\packages\Microsoft.DotNet.PlatformAbstractions.2.1.0\lib\net45\Microsoft.DotNet.PlatformAbstractions.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Extensions.DependencyModel, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Extensions.DependencyModel, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.Extensions.DependencyModel.2.1.0\lib\net451\Microsoft.Extensions.DependencyModel.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Extensions.DependencyModel.8.0.0\lib\net462\Microsoft.Extensions.DependencyModel.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="MySql.Data, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
<Reference Include="MySql.Data, Version=8.4.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MySql.Data.8.0.21\lib\net452\MySql.Data.dll</HintPath>
|
<HintPath>..\packages\MySql.Data.8.4.0\lib\net462\MySql.Data.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
<Reference Include="MySql.Data.EntityFramework, Version=8.4.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MySql.Data.EntityFramework.8.0.21\lib\net452\MySql.Data.EntityFramework.dll</HintPath>
|
<HintPath>..\packages\MySql.Data.EntityFramework.8.4.0\lib\net462\MySql.Data.EntityFramework.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NLog.5.0.1\lib\net46\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.5.3.2\lib\net46\NLog.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Renci.SshNet, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL">
|
<Reference Include="Renci.SshNet, Version=2024.0.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll</HintPath>
|
<HintPath>..\packages\SSH.NET.2024.0.0\lib\net462\Renci.SshNet.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="RestSharp, Version=111.2.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\RestSharp.111.2.0\lib\net471\RestSharp.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SdkApi.Core, Version=2.15.2634.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="SdkApi.Core, Version=2.15.2634.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Zebra.Printer.SDK.2.15.2634\lib\net471\SdkApi.Core.dll</HintPath>
|
<HintPath>..\packages\Zebra.Printer.SDK.2.15.2634\lib\net471\SdkApi.Core.dll</HintPath>
|
||||||
@@ -223,8 +232,8 @@
|
|||||||
<Reference Include="SdkApi.Desktop.Usb, Version=2.15.2634.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="SdkApi.Desktop.Usb, Version=2.15.2634.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Zebra.Printer.SDK.2.15.2634\lib\net471\SdkApi.Desktop.Usb.dll</HintPath>
|
<HintPath>..\packages\Zebra.Printer.SDK.2.15.2634\lib\net471\SdkApi.Desktop.Usb.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SharpSnmpLib, Version=10.0.9.0, Culture=neutral, PublicKeyToken=4c00852d3788e005, processorArchitecture=MSIL">
|
<Reference Include="SharpSnmpLib, Version=12.1.0.0, Culture=neutral, PublicKeyToken=4c00852d3788e005, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Lextm.SharpSnmpLib.10.0.9\lib\net452\SharpSnmpLib.dll</HintPath>
|
<HintPath>..\packages\Lextm.SharpSnmpLib.12.1.0\lib\net471\SharpSnmpLib.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||||
@@ -237,18 +246,25 @@
|
|||||||
<Reference Include="System.ComponentModel" />
|
<Reference Include="System.ComponentModel" />
|
||||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
|
<Reference Include="System.Configuration.ConfigurationManager, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Configuration.ConfigurationManager.8.0.0\lib\net462\System.Configuration.ConfigurationManager.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Configuration.Install" />
|
<Reference Include="System.Configuration.Install" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Diagnostics.DiagnosticSource, Version=8.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.8.0.1\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.Drawing.Design" />
|
<Reference Include="System.Drawing.Design" />
|
||||||
<Reference Include="System.IO.Compression" />
|
<Reference Include="System.IO.Compression" />
|
||||||
<Reference Include="System.IO.Pipelines, Version=5.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.IO.Pipelines, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.IO.Pipelines.5.0.2\lib\net461\System.IO.Pipelines.dll</HintPath>
|
<HintPath>..\packages\System.IO.Pipelines.8.0.0\lib\net462\System.IO.Pipelines.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Management" />
|
<Reference Include="System.Management" />
|
||||||
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
<Reference Include="System.Net.NameResolution, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Net.NameResolution, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Net.NameResolution.4.3.0\lib\net46\System.Net.NameResolution.dll</HintPath>
|
<HintPath>..\packages\System.Net.NameResolution.4.3.0\lib\net46\System.Net.NameResolution.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
@@ -263,20 +279,30 @@
|
|||||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="System.Runtime" />
|
||||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.0.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
|
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Runtime.Remoting" />
|
<Reference Include="System.Runtime.Remoting" />
|
||||||
<Reference Include="System.Security" />
|
<Reference Include="System.Security" />
|
||||||
|
<Reference Include="System.Text.Encodings.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Text.Json, Version=8.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Text.Json.8.0.3\lib\net462\System.Text.Json.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Transactions" />
|
<Reference Include="System.Transactions" />
|
||||||
|
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System.Web" />
|
<Reference Include="System.Web" />
|
||||||
<Reference Include="System.Windows.Forms" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
@@ -292,9 +318,6 @@
|
|||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Ubiety.Dns.Core, Version=2.2.1.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\MySql.Data.8.0.21\lib\net452\Ubiety.Dns.Core.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="PresentationFramework" />
|
<Reference Include="PresentationFramework" />
|
||||||
@@ -302,8 +325,11 @@
|
|||||||
<Reference Include="ZebraPrinterSdk, Version=2.15.2634.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="ZebraPrinterSdk, Version=2.15.2634.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Zebra.Printer.SDK.2.15.2634\lib\net471\ZebraPrinterSdk.dll</HintPath>
|
<HintPath>..\packages\Zebra.Printer.SDK.2.15.2634\lib\net471\ZebraPrinterSdk.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Zstandard.Net, Version=1.1.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
<Reference Include="ZstdNet, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MySql.Data.8.0.21\lib\net452\Zstandard.Net.dll</HintPath>
|
<HintPath>..\packages\MySql.Data.8.0.31\lib\net452\ZstdNet.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ZstdSharp, Version=0.8.1.0, Culture=neutral, PublicKeyToken=8d151af33a4ad5cf, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\ZstdSharp.Port.0.8.1\lib\net462\ZstdSharp.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -156,6 +156,13 @@
|
|||||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||||
</DataGridTextColumn.Header>
|
</DataGridTextColumn.Header>
|
||||||
</DataGridTextColumn>
|
</DataGridTextColumn>
|
||||||
|
<!--WAREHOUSEMAT - Warehouse Materiale-->
|
||||||
|
<DataGridTextColumn x:Key="colWAREHOUSEMATERIAL" Binding="{Binding sWAREHOUSEMATERIAL}">
|
||||||
|
<DataGridTextColumn.Header>
|
||||||
|
<TextBlock Text="{Binding Path=DataContext.MAT_Msg,
|
||||||
|
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PartInRawPartListV}}}"/>
|
||||||
|
</DataGridTextColumn.Header>
|
||||||
|
</DataGridTextColumn>
|
||||||
<!--GRP - Gruppo-->
|
<!--GRP - Gruppo-->
|
||||||
<DataGridTextColumn x:Key="colGROUP" Binding="{Binding sGROUP}">
|
<DataGridTextColumn x:Key="colGROUP" Binding="{Binding sGROUP}">
|
||||||
<DataGridTextColumn.Header>
|
<DataGridTextColumn.Header>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
Imports System.Collections.ObjectModel
|
Imports System.Collections.ObjectModel
|
||||||
Imports EgtBEAMWALL.Core
|
Imports EgtBEAMWALL.Core
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
|
Imports EgtWPFLib5
|
||||||
|
|
||||||
Public Class PartInRawPartListVM
|
Public Class PartInRawPartListVM
|
||||||
|
|
||||||
@@ -142,10 +143,6 @@ Public Class PartInRawPartListVM
|
|||||||
m_colPartInRawPart_Flip = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_FLIP)
|
m_colPartInRawPart_Flip = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_FLIP)
|
||||||
m_colPartInRawPart_PosX = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSX)
|
m_colPartInRawPart_PosX = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSX)
|
||||||
m_colPartInRawPart_PosY = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSY)
|
m_colPartInRawPart_PosY = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSY)
|
||||||
' aggiorno la visibilità delle colonne
|
|
||||||
For Each col In PartInRawPartColumns
|
|
||||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
|
||||||
Next
|
|
||||||
' nascondo colonna redo
|
' nascondo colonna redo
|
||||||
If Not IsNothing(colPartInRawPart_Redo) Then
|
If Not IsNothing(colPartInRawPart_Redo) Then
|
||||||
colPartInRawPart_Redo.ColumnVisibility = Visibility.Collapsed
|
colPartInRawPart_Redo.ColumnVisibility = Visibility.Collapsed
|
||||||
@@ -155,14 +152,20 @@ Public Class PartInRawPartListVM
|
|||||||
#End Region ' CONSTRUCTOR
|
#End Region ' CONSTRUCTOR
|
||||||
|
|
||||||
Friend Sub UpdateColumns(nMachType As MachineType)
|
Friend Sub UpdateColumns(nMachType As MachineType)
|
||||||
|
' aggiorno la visibilità delle colonne
|
||||||
|
For Each col In PartInRawPartColumns
|
||||||
|
If col.Name = COL_MATERIAL Then
|
||||||
|
col.Visible = GetMainPrivateProfileInt(S_WAREHOUSE, K_SHOWWAREHOUSEMATERIAL, 0) = 0
|
||||||
|
ElseIf col.Name = COL_WAREHOUSEMATERIAL Then
|
||||||
|
col.Visible = GetMainPrivateProfileInt(S_WAREHOUSE, K_SHOWWAREHOUSEMATERIAL, 0) > 0
|
||||||
|
Else
|
||||||
|
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
If nMachType = MachineType.BEAM Then
|
If nMachType = MachineType.BEAM Then
|
||||||
If Not IsNothing(m_colPartInRawPart_Offset) Then
|
If Not IsNothing(m_colPartInRawPart_Offset) Then
|
||||||
m_colPartInRawPart_Offset.ColumnVisibility = Visibility.Visible
|
m_colPartInRawPart_Offset.ColumnVisibility = Visibility.Visible
|
||||||
End If
|
End If
|
||||||
' aggiorno la visibilità delle colonne
|
|
||||||
For Each col In PartInRawPartColumns
|
|
||||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
|
||||||
Next
|
|
||||||
If Not IsNothing(colPartInRawPart_Redo) Then
|
If Not IsNothing(colPartInRawPart_Redo) Then
|
||||||
colPartInRawPart_Redo.ColumnVisibility = Visibility.Collapsed
|
colPartInRawPart_Redo.ColumnVisibility = Visibility.Collapsed
|
||||||
End If
|
End If
|
||||||
@@ -193,10 +196,6 @@ Public Class PartInRawPartListVM
|
|||||||
If Not IsNothing(m_colPartInRawPart_PosY) Then
|
If Not IsNothing(m_colPartInRawPart_PosY) Then
|
||||||
m_colPartInRawPart_PosY.ColumnVisibility = Visibility.Visible
|
m_colPartInRawPart_PosY.ColumnVisibility = Visibility.Visible
|
||||||
End If
|
End If
|
||||||
' aggiorno la visibilità delle colonne
|
|
||||||
For Each col In PartInRawPartColumns
|
|
||||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
|
||||||
Next
|
|
||||||
If Not IsNothing(colPartInRawPart_Redo) Then
|
If Not IsNothing(colPartInRawPart_Redo) Then
|
||||||
colPartInRawPart_Redo.ColumnVisibility = Visibility.Collapsed
|
colPartInRawPart_Redo.ColumnVisibility = Visibility.Collapsed
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -98,6 +98,13 @@
|
|||||||
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
|
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
|
||||||
</DataGridTextColumn.Header>
|
</DataGridTextColumn.Header>
|
||||||
</DataGridTextColumn>
|
</DataGridTextColumn>
|
||||||
|
<!--WAREHOUSEMAT - Warehouse Materiale-->
|
||||||
|
<DataGridTextColumn x:Key="colWAREHOUSEMATERIAL" Binding="{Binding sWAREHOUSEMATERIAL}">
|
||||||
|
<DataGridTextColumn.Header>
|
||||||
|
<TextBlock Text="{Binding Path=DataContext.Material_Msg,
|
||||||
|
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
|
||||||
|
</DataGridTextColumn.Header>
|
||||||
|
</DataGridTextColumn>
|
||||||
<!--% - % utilizzo-->
|
<!--% - % utilizzo-->
|
||||||
<DataGridTextColumn x:Key="colUSAGE" Binding="{Binding sUsage}" SortMemberPath="dUsage">
|
<DataGridTextColumn x:Key="colUSAGE" Binding="{Binding sUsage}" SortMemberPath="dUsage">
|
||||||
<DataGridTextColumn.Header>
|
<DataGridTextColumn.Header>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
Imports System.Collections.ObjectModel
|
Imports System.Collections.ObjectModel
|
||||||
Imports EgtBEAMWALL.Core
|
Imports EgtBEAMWALL.Core
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
|
Imports EgtWPFLib5
|
||||||
|
|
||||||
Public Class RawPartListVM
|
Public Class RawPartListVM
|
||||||
|
|
||||||
@@ -116,11 +117,17 @@ Public Class RawPartListVM
|
|||||||
#End Region ' CONSTRUCTOR
|
#End Region ' CONSTRUCTOR
|
||||||
|
|
||||||
Friend Sub UpdateColumns(nMachType As MachineType)
|
Friend Sub UpdateColumns(nMachType As MachineType)
|
||||||
If nMachType = MachineType.BEAM Then
|
' aggiorno la visibilità delle colonne
|
||||||
' aggiorno la visibilità delle colonne
|
For Each col In RawPartColumns
|
||||||
For Each col In RawPartColumns
|
If col.Name = COL_MATERIAL Then
|
||||||
|
col.Visible = GetMainPrivateProfileInt(S_WAREHOUSE, K_SHOWWAREHOUSEMATERIAL, 0) = 0
|
||||||
|
ElseIf col.Name = COL_WAREHOUSEMATERIAL Then
|
||||||
|
col.Visible = GetMainPrivateProfileInt(S_WAREHOUSE, K_SHOWWAREHOUSEMATERIAL, 0) > 0
|
||||||
|
Else
|
||||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||||
Next
|
End If
|
||||||
|
Next
|
||||||
|
If nMachType = MachineType.BEAM Then
|
||||||
If Not IsNothing(m_colRawPart_StartCut) Then
|
If Not IsNothing(m_colRawPart_StartCut) Then
|
||||||
m_colRawPart_StartCut.ColumnVisibility = Visibility.Visible
|
m_colRawPart_StartCut.ColumnVisibility = Visibility.Visible
|
||||||
End If
|
End If
|
||||||
@@ -130,10 +137,6 @@ Public Class RawPartListVM
|
|||||||
'RawPartColumns.Clear()
|
'RawPartColumns.Clear()
|
||||||
'GetPrivateProfileColumns(S_RAWPARTLIST_BEAM, RawPartColumns)
|
'GetPrivateProfileColumns(S_RAWPARTLIST_BEAM, RawPartColumns)
|
||||||
ElseIf nMachType = MachineType.WALL Then
|
ElseIf nMachType = MachineType.WALL Then
|
||||||
' aggiorno la visibilità delle colonne
|
|
||||||
For Each col In RawPartColumns
|
|
||||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
|
||||||
Next
|
|
||||||
If Not IsNothing(m_colRawPart_StartCut) Then
|
If Not IsNothing(m_colRawPart_StartCut) Then
|
||||||
m_colRawPart_StartCut.ColumnVisibility = Visibility.Collapsed
|
m_colRawPart_StartCut.ColumnVisibility = Visibility.Collapsed
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -558,6 +558,7 @@ Public Class LeftPanelVM
|
|||||||
Dim Part As PartVM = SelMachGroup.PartVMList(PartIndex)
|
Dim Part As PartVM = SelMachGroup.PartVMList(PartIndex)
|
||||||
SetDonePart(SelMachGroup, Part)
|
SetDonePart(SelMachGroup, Part)
|
||||||
Next
|
Next
|
||||||
|
|
||||||
' riseleziono il gruppo
|
' riseleziono il gruppo
|
||||||
Map.refSupervisorMachGroupPanelVM.SelectedMachGroup = SelMachGroup
|
Map.refSupervisorMachGroupPanelVM.SelectedMachGroup = SelMachGroup
|
||||||
' aggiorno bottoni
|
' aggiorno bottoni
|
||||||
@@ -870,6 +871,25 @@ Public Class LeftPanelVM
|
|||||||
Part.nProduction_State = ItemState.Produced
|
Part.nProduction_State = ItemState.Produced
|
||||||
' scrivo evento fine pezzo su DB
|
' scrivo evento fine pezzo su DB
|
||||||
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(Time, Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, 2, DbControllers.SupervisorId))
|
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(Time, Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, 2, DbControllers.SupervisorId))
|
||||||
|
' se attivo magazzino web, e primo pezzo della barra, aggiorno utilizzo barra da magazzino
|
||||||
|
If GetMainPrivateProfileInt(S_WAREHOUSE, K_NETWAREHOUSE, 0) = 1 AndAlso MachGroup.PartVMList(0).nPartId = Part.nPartId AndAlso MachGroup.nProduction_State <> ItemState.Scrapped Then
|
||||||
|
' Dim nMaterialId As Integer
|
||||||
|
'If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||||
|
' ' nMaterialId = DbControllers.m_MaterialsController.Insert(New MaterialM(MachGroup.dW, MachGroup.dH, 0, MachGroup.sMATERIAL, MachGroup.sWAREHOUSEMATERIAL))
|
||||||
|
' nMaterialId = DbControllers.m_MaterialsController.Insert(MachGroup.RawPartM.Material)
|
||||||
|
'ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||||
|
' nMaterialId = DbControllers.m_MaterialsController.Insert(New MaterialM(0, MachGroup.dH, 0, MachGroup.sMATERIAL, MachGroup.sWAREHOUSEMATERIAL))
|
||||||
|
'End If
|
||||||
|
'Dim RawPartList = DbControllers.m_RawItemsController.GetFilt(nMaterialId)
|
||||||
|
'Dim RawPart As RawPartM = RawPartList.FirstOrDefault(Function(x) x.dL = MachGroup.dL AndAlso x.Material.dW = MachGroup.dW AndAlso x.Material.dH = MachGroup.dH AndAlso x.Material.sWarehouseMaterial = MachGroup.sWAREHOUSEMATERIAL)
|
||||||
|
'Dim RawDictionary As New Dictionary(Of Integer, Integer)
|
||||||
|
'RawDictionary.Add(RawPart.nId, 1)
|
||||||
|
Dim RawDictionary As New Dictionary(Of Integer, Integer)
|
||||||
|
RawDictionary.Add(MachGroup.MyMachGroupM.RawPartM.nId, 1)
|
||||||
|
' forzo aggiornamento eventuali dati non inviati su Db
|
||||||
|
DbControllers.m_MagmanController.ForceSyncroSend()
|
||||||
|
DbControllers.m_MagmanController.ResourceSendCons(Map.refSupervisorManagerVM.CurrProd.ProdFileM.nProjCloudId, RawDictionary)
|
||||||
|
End If
|
||||||
If MachGroup.PartVMList.All(Function(x) x.nProduction_State >= ItemState.Produced) Then
|
If MachGroup.PartVMList.All(Function(x) x.nProduction_State >= ItemState.Produced) Then
|
||||||
'aggiorno anche fine MachGroup
|
'aggiorno anche fine MachGroup
|
||||||
DbControllers.m_MachGroupController.UpdateEnd(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Time)
|
DbControllers.m_MachGroupController.UpdateEnd(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Time)
|
||||||
@@ -1042,7 +1062,7 @@ Public Class LeftPanelVM
|
|||||||
sFileText.Add("Var1=$PRODID$," & Map.refSupervisorManagerVM.CurrProd.sProdId)
|
sFileText.Add("Var1=$PRODID$," & Map.refSupervisorManagerVM.CurrProd.sProdId)
|
||||||
sFileText.Add("Var2=$MACHGROUPID$," & SelMachGroup.nName)
|
sFileText.Add("Var2=$MACHGROUPID$," & SelMachGroup.nName)
|
||||||
sFileText.Add("Var3=$PARTID$," & SelPart.nPDN)
|
sFileText.Add("Var3=$PARTID$," & SelPart.nPDN)
|
||||||
sFileText.Add("Var4=$MATERIAL$," & SelPart.sMATERIAL)
|
sFileText.Add("Var4=$MATERIAL$," & SelPart.MaterialM.sMaterial)
|
||||||
bOk = EgtGetInfo(nBtlInfoId, BTL_GEN_PROJNUM, sInfo)
|
bOk = EgtGetInfo(nBtlInfoId, BTL_GEN_PROJNUM, sInfo)
|
||||||
sFileText.Add("Var5=$PROJECTNUMBER$," & If(bOk, sInfo, ""))
|
sFileText.Add("Var5=$PROJECTNUMBER$," & If(bOk, sInfo, ""))
|
||||||
bOk = EgtGetInfo(nBtlInfoId, BTL_GEN_PROJNAME, sInfo)
|
bOk = EgtGetInfo(nBtlInfoId, BTL_GEN_PROJNAME, sInfo)
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ Public Class MyMachGroupPanelVM
|
|||||||
|
|
||||||
#Region "FIELDS & PROPERTIES"
|
#Region "FIELDS & PROPERTIES"
|
||||||
|
|
||||||
|
' lista dei RawPart presenti su db
|
||||||
|
Private m_RawPartDbList As New List(Of RawPartM)
|
||||||
|
|
||||||
Public Shadows Property SelectedMachGroup As MachGroupVM
|
Public Shadows Property SelectedMachGroup As MachGroupVM
|
||||||
Get
|
Get
|
||||||
Return m_SelectedMachGroup
|
Return m_SelectedMachGroup
|
||||||
@@ -48,6 +51,7 @@ Public Class MyMachGroupPanelVM
|
|||||||
MachGroup.UpdateUsage()
|
MachGroup.UpdateUsage()
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
ReadAllRawPartFromDb()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region ' CONSTRUCTOR
|
#End Region ' CONSTRUCTOR
|
||||||
@@ -129,6 +133,93 @@ Public Class MyMachGroupPanelVM
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub ReadAllRawPartFromDb()
|
||||||
|
m_RawPartDbList.Clear()
|
||||||
|
' aggiornamento materiale
|
||||||
|
For Each MachGroup As MyMachGroupVM In Map.refMachGroupPanelVM.m_MachGroupVMList
|
||||||
|
If IsNothing(MachGroup.MyMachGroupM.RawPartM) OrElse MachGroup.MyMachGroupM.RawPartM.nId = 0 OrElse MachGroup.MyMachGroupM.RawPartM.Material.nId = 0 OrElse String.IsNullOrWhiteSpace(MachGroup.MyMachGroupM.RawPartM.Material.sWarehouseMaterial) Then
|
||||||
|
ReadRawPartFromDb(MachGroup, True)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
m_RawPartDbList.Clear()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub ReadRawPartFromDb(MachGroup As MyMachGroupVM, Optional bUseList As Boolean = False)
|
||||||
|
If Not IsNothing(MachGroup.MyMachGroupM.RawPartM) AndAlso MachGroup.MyMachGroupM.RawPartM.nId > 0 AndAlso MachGroup.MyMachGroupM.RawPartM.Material.nId > 0 AndAlso Not String.IsNullOrWhiteSpace(MachGroup.MyMachGroupM.RawPartM.Material.sWarehouseMaterial) Then Return
|
||||||
|
' aggiornamento materiale
|
||||||
|
Dim RawPart As RawPartM = Nothing
|
||||||
|
If bUseList Then
|
||||||
|
RawPart = m_RawPartDbList.FirstOrDefault(Function(x) x.Material.sMaterial = MachGroup.RawPartM.Material.sMaterial AndAlso x.Material.dW = MachGroup.dW AndAlso x.Material.dH = MachGroup.dH AndAlso x.Material.dL = MachGroup.dL)
|
||||||
|
End If
|
||||||
|
If Not IsNothing(RawPart) Then
|
||||||
|
MachGroup.MyMachGroupM.RawPartM.Material.SetId(RawPart.Material.nId)
|
||||||
|
MachGroup.MyMachGroupM.RawPartM.Material.SetWarehouseMaterial(RawPart.Material.sWarehouseMaterial)
|
||||||
|
MachGroup.MyMachGroupM.RawPartM.SetId(RawPart.nId)
|
||||||
|
For Each Part In MachGroup.PartVMList
|
||||||
|
Part.MaterialM.SetId(RawPart.Material.nId)
|
||||||
|
Part.MaterialM.SetWarehouseMaterial(RawPart.Material.sWarehouseMaterial)
|
||||||
|
Next
|
||||||
|
Else
|
||||||
|
Dim Material As MaterialM = Nothing
|
||||||
|
Dim SearchMaterial As DataLayer.Controllers.MaterialsController.SearchResult = DbControllers.m_MaterialsController.SearchFilt(MachGroup.RawPartM.Material.sMaterial)
|
||||||
|
Select Case SearchMaterial.Tipo
|
||||||
|
Case DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.ALIAS, DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.MATERIAL
|
||||||
|
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||||
|
Material = SearchMaterial.Result.FirstOrDefault(Function(x) x.dW = MachGroup.dW AndAlso x.dH = MachGroup.dH)
|
||||||
|
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||||
|
Material = SearchMaterial.Result.FirstOrDefault(Function(x) x.dH = MachGroup.dH)
|
||||||
|
End If
|
||||||
|
Case Else
|
||||||
|
EgtOutLog("Error! MachGroup material not found!!")
|
||||||
|
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||||
|
Material = New MaterialM(MachGroup.dW, MachGroup.dH, 0, 0, MachGroup.sMATERIAL)
|
||||||
|
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||||
|
Material = New MaterialM(0, MachGroup.dH, 0, 0, MachGroup.sMATERIAL)
|
||||||
|
End If
|
||||||
|
End Select
|
||||||
|
Dim SearchRawPart As List(Of RawPartM) = DbControllers.m_RawItemsController.GetFilt(Material.nId)
|
||||||
|
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||||
|
RawPart = SearchRawPart.FirstOrDefault(Function(x) x.Material.dW = MachGroup.dW AndAlso x.Material.dH = MachGroup.dH AndAlso x.dL = MachGroup.dL)
|
||||||
|
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||||
|
RawPart = SearchRawPart.FirstOrDefault(Function(x) x.dW = MachGroup.dW AndAlso x.Material.dH = MachGroup.dH AndAlso x.Material.dL = MachGroup.dL)
|
||||||
|
End If
|
||||||
|
If Not IsNothing(RawPart) Then
|
||||||
|
MachGroup.MyMachGroupM.RawPartM.Material.SetId(RawPart.Material.nId)
|
||||||
|
MachGroup.MyMachGroupM.RawPartM.Material.SetWarehouseMaterial(RawPart.Material.sWarehouseMaterial)
|
||||||
|
MachGroup.MyMachGroupM.RawPartM.SetId(RawPart.nId)
|
||||||
|
For Each Part In MachGroup.PartVMList
|
||||||
|
Part.MaterialM.SetId(RawPart.Material.nId)
|
||||||
|
Part.MaterialM.SetWarehouseMaterial(RawPart.Material.sWarehouseMaterial)
|
||||||
|
Next
|
||||||
|
Else
|
||||||
|
Dim nRawPartId As Integer = DbControllers.m_RawItemsController.Upsert(New RawPartM(Material, MachGroup.dW, MachGroup.dL, 0, False))
|
||||||
|
If nRawPartId > 0 Then
|
||||||
|
SearchRawPart = DbControllers.m_RawItemsController.GetFilt(Material.nId)
|
||||||
|
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||||
|
RawPart = SearchRawPart.FirstOrDefault(Function(x) x.Material.dW = MachGroup.dW AndAlso x.Material.dH = MachGroup.dH AndAlso x.dL = MachGroup.dL)
|
||||||
|
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||||
|
RawPart = SearchRawPart.FirstOrDefault(Function(x) x.dW = MachGroup.dW AndAlso x.Material.dH = MachGroup.dH AndAlso x.dL = MachGroup.dL)
|
||||||
|
End If
|
||||||
|
If IsNothing(RawPart) Then
|
||||||
|
EgtOutLog("Error! MachGroup material not found!!")
|
||||||
|
RawPart = New RawPartM(Material, MachGroup.dW, MachGroup.dL, 0, False)
|
||||||
|
End If
|
||||||
|
MachGroup.MyMachGroupM.RawPartM.Material.SetId(RawPart.Material.nId)
|
||||||
|
MachGroup.MyMachGroupM.RawPartM.Material.SetWarehouseMaterial(RawPart.Material.sWarehouseMaterial)
|
||||||
|
MachGroup.MyMachGroupM.RawPartM.SetId(RawPart.nId)
|
||||||
|
For Each Part In MachGroup.PartVMList
|
||||||
|
Part.MaterialM.SetId(RawPart.Material.nId)
|
||||||
|
Part.MaterialM.SetWarehouseMaterial(RawPart.Material.sWarehouseMaterial)
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
If bUseList Then
|
||||||
|
m_RawPartDbList.AddRange(SearchRawPart)
|
||||||
|
m_RawPartDbList = m_RawPartDbList.Distinct().ToList()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
#End Region ' METHODS
|
#End Region ' METHODS
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -85,6 +85,12 @@ Public Class MyMachGroupVM
|
|||||||
|
|
||||||
Sub New(MyMachGroupM As MyMachGroupM)
|
Sub New(MyMachGroupM As MyMachGroupM)
|
||||||
MyBase.New(MyMachGroupM)
|
MyBase.New(MyMachGroupM)
|
||||||
|
' aggiungo RawPartM
|
||||||
|
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||||
|
MyMachGroupM.RawPartM = New RawPartM(New MaterialM(Math.Min(MyMachGroupM.dW, MyMachGroupM.dH), Math.Max(MyMachGroupM.dW, MyMachGroupM.dH), 0, MyMachGroupM.sMATERIAL), 0, MyMachGroupM.dL)
|
||||||
|
Else
|
||||||
|
MyMachGroupM.RawPartM = New RawPartM(New MaterialM(0, MyMachGroupM.dH, 0, MyMachGroupM.sMATERIAL), MyMachGroupM.dW, MyMachGroupM.dL)
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region ' CONSTRUCTORS
|
#End Region ' CONSTRUCTORS
|
||||||
|
|||||||
@@ -49,6 +49,12 @@ Public Class PartVM
|
|||||||
|
|
||||||
Sub New(PartM As PartM, ParentMachGroupVM As MyMachGroupVM)
|
Sub New(PartM As PartM, ParentMachGroupVM As MyMachGroupVM)
|
||||||
MyBase.New(PartM, ParentMachGroupVM)
|
MyBase.New(PartM, ParentMachGroupVM)
|
||||||
|
' aggiungo MaterialM
|
||||||
|
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||||
|
PartM.MaterialM = New MaterialM(Math.Min(dW, dH), Math.Max(dW, dH), 0, PartM.sMATERIAL)
|
||||||
|
Else
|
||||||
|
PartM.MaterialM = New MaterialM(0, dH, 0, PartM.sMATERIAL)
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region ' CONSTRUCTOR
|
#End Region ' CONSTRUCTOR
|
||||||
@@ -76,7 +82,6 @@ Public Class PartVM
|
|||||||
|
|
||||||
#Region "EVENTS"
|
#Region "EVENTS"
|
||||||
|
|
||||||
|
|
||||||
Protected Overrides Sub OnBTLFeatureVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
Protected Overrides Sub OnBTLFeatureVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
|
||||||
Select Case e.PropertyName
|
Select Case e.PropertyName
|
||||||
Case NameOf(sender.bDO)
|
Case NameOf(sender.bDO)
|
||||||
|
|||||||
@@ -685,6 +685,22 @@ Public Class MachManaging
|
|||||||
' azzero variabile per far ripartire macchina
|
' azzero variabile per far ripartire macchina
|
||||||
StateVariable.sValue = "0"
|
StateVariable.sValue = "0"
|
||||||
End If
|
End If
|
||||||
|
' aggiorno utilizzo barra da magazzino
|
||||||
|
If GetMainPrivateProfileInt(S_WAREHOUSE, K_NETWAREHOUSE, 0) = 1 AndAlso MachGroup.PartVMList(0).nPartId = nP_Part AndAlso MachGroup.nProduction_State <> ItemState.Scrapped Then
|
||||||
|
Dim nMaterialId As Integer
|
||||||
|
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||||
|
nMaterialId = DbControllers.m_MaterialsController.Insert(New MaterialM(MachGroup.dW, MachGroup.dH, 0, MachGroup.sMATERIAL, MachGroup.sWAREHOUSEMATERIAL))
|
||||||
|
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||||
|
nMaterialId = DbControllers.m_MaterialsController.Insert(New MaterialM(0, MachGroup.dH, 0, MachGroup.sMATERIAL, MachGroup.sWAREHOUSEMATERIAL))
|
||||||
|
End If
|
||||||
|
Dim RawPartList = DbControllers.m_RawItemsController.GetFilt(nMaterialId)
|
||||||
|
Dim RawPart As RawPartM = RawPartList.FirstOrDefault(Function(x) x.dL = MachGroup.dL AndAlso x.Material.dW = MachGroup.dW AndAlso x.Material.dH = MachGroup.dH AndAlso x.Material.sWarehouseMaterial = MachGroup.sWAREHOUSEMATERIAL)
|
||||||
|
Dim RawDictionary As New Dictionary(Of Integer, Integer)
|
||||||
|
RawDictionary.Add(RawPart.nId, 1)
|
||||||
|
' forzo aggiornamento eventuali dati non inviati su Db
|
||||||
|
DbControllers.m_MagmanController.ForceSyncroSend()
|
||||||
|
DbControllers.m_MagmanController.ResourceSendCons(Map.refSupervisorManagerVM.CurrProd.ProdFileM.nProjCloudId, RawDictionary)
|
||||||
|
End If
|
||||||
' se pezzo = -1 stampo etichette di tutti i pezzi del MachGroup
|
' se pezzo = -1 stampo etichette di tutti i pezzi del MachGroup
|
||||||
If nP_Part = -1 Then
|
If nP_Part = -1 Then
|
||||||
If Not IsNothing(MachGroup) Then
|
If Not IsNothing(MachGroup) Then
|
||||||
|
|||||||
@@ -149,6 +149,17 @@ Public Class MainWindowVM
|
|||||||
LogProc.Kill()
|
LogProc.Kill()
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
' se collegato a magazzino web
|
||||||
|
If GetMainPrivateProfileInt(S_WAREHOUSE, K_NETWAREHOUSE, 0) > 0 Then
|
||||||
|
' loggo apertura programma
|
||||||
|
DbControllers.m_LogMachineController.Create(LogEvent.CreateSoftwareOnOffLog(True, DbControllers.m_SupervisorId))
|
||||||
|
' forzo aggiornamento eventuali dati non inviati su Db
|
||||||
|
DbControllers.m_MagmanController.ForceSyncroSend()
|
||||||
|
' sincronizzo tutti i progetti
|
||||||
|
DbControllers.m_MagmanController.ProjAllSyncro()
|
||||||
|
' sincronizzo log macchina
|
||||||
|
'DbControllers.m_MagmanController.CloudLogMaccSyncro(100, 5000, True)
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Function ProcessCommandLine(ByRef nCommandType As Integer, ByRef nProdId As Integer) As Boolean
|
Friend Function ProcessCommandLine(ByRef nCommandType As Integer, ByRef nProdId As Integer) As Boolean
|
||||||
@@ -239,6 +250,13 @@ Public Class MainWindowVM
|
|||||||
ViewerOptimizerCommThread.StopThread()
|
ViewerOptimizerCommThread.StopThread()
|
||||||
' Verifico modifica parametri in Configurazione e chiedo il salvataggio
|
' Verifico modifica parametri in Configurazione e chiedo il salvataggio
|
||||||
If Map.refMainMenuVM.SelPage = Pages.CONFIG Then Map.refConfigurationPageVM.VerifyConfigPageModification()
|
If Map.refMainMenuVM.SelPage = Pages.CONFIG Then Map.refConfigurationPageVM.VerifyConfigPageModification()
|
||||||
|
' se collegato a magazzino web
|
||||||
|
If GetMainPrivateProfileInt(S_WAREHOUSE, K_NETWAREHOUSE, 0) > 0 Then
|
||||||
|
' loggo chiusura programma
|
||||||
|
DbControllers.m_LogMachineController.Create(LogEvent.CreateSoftwareOnOffLog(False, DbControllers.m_SupervisorId))
|
||||||
|
' sincronizzo
|
||||||
|
' DbControllers.m_MagmanController.CloudLogMaccSyncro(100, 5000, True)
|
||||||
|
End If
|
||||||
' Termino il Model
|
' Termino il Model
|
||||||
MainWindowM.Close()
|
MainWindowM.Close()
|
||||||
' Chiudo la finestra principale del programma
|
' Chiudo la finestra principale del programma
|
||||||
|
|||||||
@@ -11,13 +11,14 @@ Public Class OpenProjectFileDialogVM
|
|||||||
|
|
||||||
Public Overrides Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
|
Public Overrides Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
|
||||||
m_ProjectType = ProjectType
|
m_ProjectType = ProjectType
|
||||||
|
m_GoToProd = GoToProd
|
||||||
' carico colonne
|
' carico colonne
|
||||||
LoadColumns(m_ProjectType)
|
LoadColumns(m_ProjectType)
|
||||||
NotifyPropertyChanged(NameOf(FilterTypeList))
|
NotifyPropertyChanged(NameOf(FilterTypeList))
|
||||||
m_SelFilterType = m_FilterTypeList(0)
|
m_SelFilterType = m_FilterTypeList(0)
|
||||||
' carico lista progetti
|
' carico lista progetti
|
||||||
If IsNothing(CurrProjectList) OrElse CurrProjectList.Count = 0 Then
|
If IsNothing(CurrProjectList) OrElse CurrProjectList.Count = 0 Then
|
||||||
RefreshProjectList(GoToProd)
|
RefreshProjectList()
|
||||||
Else
|
Else
|
||||||
m_ProjectList = New ObservableCollection(Of ProjectFileVM)(CurrProjectList)
|
m_ProjectList = New ObservableCollection(Of ProjectFileVM)(CurrProjectList)
|
||||||
NotifyPropertyChanged(NameOf(ProjectList))
|
NotifyPropertyChanged(NameOf(ProjectList))
|
||||||
@@ -26,7 +27,7 @@ Public Class OpenProjectFileDialogVM
|
|||||||
m_ProjectList_View.Filter = AddressOf ProjectFilter
|
m_ProjectList_View.Filter = AddressOf ProjectFilter
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Overrides Sub RefreshProjectList(Optional GoToProd As Boolean = False)
|
Public Overrides Sub RefreshProjectList()
|
||||||
m_ProjectList.Clear()
|
m_ProjectList.Clear()
|
||||||
' calcolo periodo e righe
|
' calcolo periodo e righe
|
||||||
Dim dtStart As DateTime
|
Dim dtStart As DateTime
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user