Compare commits

..

21 Commits

Author SHA1 Message Date
Emmanuele Sassi 0fc7d826a8 Modifiche per campo Description 2023-07-27 12:45:16 +02:00
Emmanuele Sassi 8b6c9b38cc Merge remote-tracking branch 'gitlab.seriate/DataLayer' into feature/ModificheDaDB 2023-06-16 15:06:30 +02:00
Emmanuele Sassi 3133c1d78c - Aggiunto parametro Description a ProjFileVM
- Modificati filtri apertura file
2023-06-16 15:06:18 +02:00
Samuele Locatelli 2ae08165f4 PROD:
- Aggiunta metodo recupero dati filtrati periodo e attivi
2023-06-16 13:23:50 +02:00
Samuele Locatelli f77ea8309c Modifica migration x valore default IsActive 2023-06-16 13:23:34 +02:00
Samuele Locatelli 3a9e8651e7 DataLayer / ProjController:
- Aggiunto metodo x recupero dati per export date
2023-06-16 09:30:50 +02:00
Emmanuele Sassi eddd7b93ca Merge remote-tracking branch 'gitlab.seriate/DataLayer' into feature/ModificheDaDB 2023-06-15 13:00:10 +02:00
Samuele Locatelli 1d9182f96d Merge remote-tracking branch 'origin/feature/ModificheDaDB' into DataLayer 2023-06-15 12:58:53 +02:00
Samuele Locatelli c3916dcf41 Aggiunta metodo filtro periodo progetti 2023-06-15 12:58:47 +02:00
Emmanuele Sassi 15bfc1bc15 Merge remote-tracking branch 'gitlab.seriate/DataLayer' into feature/ModificheDaDB 2023-06-15 10:27:00 +02:00
Emmanuele Sassi cee4375ea3 - correzione isreadonly su PosZ 2023-06-15 10:20:19 +02:00
Emmanuele Sassi 5b04080f35 EgtBEAMWALL 2.5f2 :
- aggiornamento versioni
2023-06-13 12:21:08 +02:00
Emmanuele Sassi 0d7cc99a2d Merge branch 'fix/UpdatePriorityInProd' 2023-06-13 12:15:16 +02:00
Emmanuele Sassi d48deed9e0 - gestione presenza Priority da flag su WallData 2023-06-12 12:50:26 +02:00
DarioS 4d8f0d6411 EgtBeamWall :
- aggiornata libreria esterna EgtUILib.dll.
2023-06-12 10:37:54 +02:00
Emmanuele Sassi df3b6ae657 - gestito update del priority su pezzi in ottimizzazione
- resettato stato calc su modifica priority
2023-06-08 19:32:22 +02:00
Samuele Locatelli 668a37c6da update lettura ultimi Proj 2023-06-08 18:06:43 +02:00
Samuele Locatelli f4b18d962d Update readme 2023-06-08 17:18:35 +02:00
Samuele Locatelli eaa43c6209 Fix gestione cancellazione logica x ricerche 2023-06-08 17:17:15 +02:00
Samuele Locatelli 99dd1b6807 Update conversioni + metodi x NUOVI campi:
- Projdescription (modificabile)
- IsActive (per cancellazione logica)
2023-06-08 17:10:39 +02:00
Samuele Locatelli 5b6f719349 Update modello dati + migrazioni 2023-06-08 17:10:17 +02:00
36 changed files with 2777 additions and 1971 deletions
+2
View File
@@ -127,6 +127,8 @@ Public Module ConstIni
Public Const K_STARTDATE As String = "StartDate"
Public Const K_ENDDATE As String = "EndDate"
Public Const S_OPENFILEDIALOG As String = "OpenFileDialog"
'Public Const S_NEST As String = "Nest"
Public Const K_NESTEXEC As String = "NestExec"
Public Const K_FLIPROT As String = "FlipRot"
@@ -438,6 +438,9 @@ Public Class EgtDataGridColumn
End If
End Set
End Property
Public Sub ResetToOrigIsReadOnly()
IsReadOnly = m_OrigIsReadOnly
End Sub
Friend OldCanUserReorder As Boolean?
Private m_CanUserReorder As Boolean
+2 -2
View File
@@ -35,5 +35,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.6.1")>
<Assembly: AssemblyFileVersion("2.5.6.1")>
<Assembly: AssemblyVersion("2.5.6.2")>
<Assembly: AssemblyFileVersion("2.5.6.2")>
@@ -5,9 +5,9 @@
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core"
Title="{Binding Title}"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="True"
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
Height="500" Width="500" Topmost="True"
MinHeight="500" MinWidth="500" Topmost="True"
DataContext="{Binding RelativeSource={RelativeSource Self}}">
<EgtWPFLib5:EgtCustomWindow.Resources>
@@ -21,42 +21,105 @@
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<StackPanel>
<Grid Grid.Row="0" Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="1*" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<GroupBox Header="Filters"
Margin="5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<ComboBox ItemsSource="{Binding BTLDateTypeList}"
SelectedIndex="{Binding SelBTLDateType}"
Width="105"
Margin="5"
Style="{StaticResource FeatureComboBox}"/>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<ComboBox ItemsSource="{Binding DayTypeList}"
SelectedIndex="{Binding SelDayType}"
Width="105"
Margin="0,0,2.5,0"
Style="{StaticResource PartParam_ComboBox}"/>
<StackPanel Orientation="Horizontal" Visibility="{Binding Date_Visibility}">
<TextBlock Text="{Binding From_Msg}"
Style="{StaticResource Filter_TextBlock}"/>
<DatePicker SelectedDate="{Binding dtStartDate}"
Style="{StaticResource Filter_DatePicker}"/>
<TextBlock Text="{Binding To_Msg}"
Style="{StaticResource Filter_TextBlock}"/>
<DatePicker SelectedDate="{Binding dtEndDate}"
Style="{StaticResource Filter_DatePicker}"/>
</StackPanel>
</StackPanel>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ComboBox ItemsSource="{Binding FilterTypeList}"
SelectedItem="{Binding SelFilterType}"
Width="105"
Margin="5"
Style="{StaticResource FeatureComboBox}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding SearchText}"
Margin="5"
Visibility="{Binding SearchText_Visibility}"/>
<StackPanel Grid.Column="2"
Orientation="Horizontal">
<TextBlock Text="Rows"
Style="{StaticResource OptionTextBlock}"/>
<ComboBox ItemsSource="{Binding RowQuantityList}"
SelectedIndex="{Binding SelRowQuantity}"
Style="{StaticResource FeatureComboBox}"/>
</StackPanel>
</Grid>
</Grid>
</GroupBox>
<TextBlock Text="{Binding FilterType_Msg}"
<!--<StackPanel>
<Grid Grid.Row="0" Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="1*" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding FilterType_Msg}"
Grid.Row="0" Grid.Column="0"
Style="{StaticResource OptionTextBlock}"/>
<ComboBox ItemsSource="{Binding SearchColumnList}"
<ComboBox ItemsSource="{Binding SearchColumnList}"
SelectedItem="{Binding SelSearchColumn}"
Width="Auto"
Margin="5"
Grid.Row="0" Grid.Column="1"
Style="{StaticResource FeatureComboBox}"/>
<TextBlock Text="{Binding Search_Msg}"
<TextBlock Text="{Binding Search_Msg}"
Margin="0,5,0,0"
Grid.Row="1" Grid.Column="0"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding SearchText}"
<EgtWPFLib5:EgtTextBox Text="{Binding SearchText}"
Margin="5"
Grid.Row="1" Grid.Column="1"
Visibility="{Binding SearchText_Visibility}"/>
<Calendar SelectedDatesChanged="Calendar_SelectedDatesChanged"
<Calendar SelectedDatesChanged="Calendar_SelectedDatesChanged"
SelectionMode="MultipleRange"
Grid.Row="1" Grid.Column="1"
Visibility="{Binding SearchDate_Visibility}"/>
</Grid>
</StackPanel>
</Grid>
</StackPanel>-->
<EgtBEAMWALL:EgtDataGrid Grid.Row="1"
<EgtBEAMWALL:EgtDataGrid Grid.Row="1"
ItemsSource="{Binding ProjectList}"
SelectedItem="{Binding SelProject}"
CanUserAddRows="False"
@@ -85,6 +148,14 @@
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!-- Project Name -->
<DataGridTextColumn x:Key="colPROJNAME" Binding="{Binding sDescription}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.BTLFileName_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!-- BTL FileName -->
<DataGridTextColumn x:Key="colBTLNAME" Binding="{Binding sBTLFileName}">
<DataGridTextColumn.HeaderTemplate>
@@ -5,6 +5,8 @@ Imports System.Windows.Controls
Imports System.Windows.Input
Imports EgtBEAMWALL.Core.ConstBeam
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL
Public Class OpenProjectFileDialogV
@@ -19,6 +21,8 @@ Public Class OpenProjectFileDialogV
Me.DataContext = OpenProjFileDialogVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_OpenProjFileDialogVM = OpenProjFileDialogVM
AddHandler Me.Loaded, AddressOf OpenProjectFileDialog_Loaded
AddHandler Me.Closing, AddressOf OpenProjectFileDialog_Closing
End Sub
#End Region ' CONSTRUCTOR
@@ -42,6 +46,20 @@ Public Class OpenProjectFileDialogV
Return Me.ShowDialog()
End Function
Private Sub OpenProjectFileDialog_Loaded(sender As Object, e As RoutedEventArgs)
' Carico e imposto posizione finestra
WinPosFromIniToWindow(S_OPENFILEDIALOG, K_VIEWOPTIMWINPLACE, Me)
End Sub
Private Sub OpenProjectFileDialog_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs)
If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
e.Cancel = True
Return
End If
' Salvo posizione finestra (se non minimizzata)
WinPosFromWindowToIni(Me, S_OPENFILEDIALOG, K_VIEWOPTIMWINPLACE)
End Sub
#End Region ' METHODS
#Region "EVENTS"
@@ -60,10 +78,4 @@ Public Class OpenProjectFileDialogV
Me.DialogResult = bDialogResult
End Sub
Private Sub Calendar_SelectedDatesChanged(sender As Object, e As SelectionChangedEventArgs)
Dim cal As System.Windows.Controls.Calendar = sender
m_OpenProjFileDialogVM.m_SearchDate = cal.SelectedDates
m_OpenProjFileDialogVM.m_ProjectList_View.Refresh()
End Sub
End Class
@@ -14,6 +14,32 @@ Public MustInherit Class OpenProjectFileDialogVM
#Region "FIELDS & PROPERTIES"
Public Enum BTLDateTypes As Integer
CREATEDATE = 0
EXPORTDATE = 1
End Enum
Private Enum FilterTypes As Integer
NULL = 0
ID = 1
BTLFILENAME = 2
LISTNAME = 3
MACHINE = 4
End Enum
Public Enum DayTypes As Integer
LASTMONTH = 0
LAST3MONTHS = 1
LAST6MONTHS = 2
PERIOD = 3
End Enum
Public Enum RowQuantities As Integer
FIFTY = 0
HUNDRED = 1
HUNDREDANDFIFTY = 2
End Enum
Friend Event m_CloseWindow(bDialogResult As Boolean)
Protected m_ProjectColumns As New ObservableCollection(Of EgtDataGridColumn)
@@ -83,18 +109,131 @@ Public MustInherit Class OpenProjectFileDialogVM
End Set
End Property
' lista campi per ricerca testuale e con datepicker
Protected m_SearchColumnList As New ObservableCollection(Of IdNameStruct)
Public ReadOnly Property SearchColumnList As ObservableCollection(Of IdNameStruct)
Protected m_BTLDateTypeList As New List(Of String)
Public ReadOnly Property BTLDateTypeList As List(Of String)
Get
Return m_SearchColumnList
Return m_BTLDateTypeList
End Get
End Property
Protected m_SelSearchColumn As IdNameStruct = Nothing
Public Property SelSearchColumn As IdNameStruct
Protected m_SelBTLDateType As BTLDateTypes = Nothing
Public Property SelBTLDateType As Integer
Get
Return m_SelSearchColumn
Return m_SelBTLDateType
End Get
Set(value As Integer)
' aggiorno lista da Db
RefreshProjectList()
m_ProjectList_View.Refresh()
End Set
End Property
Private m_DayTypeList As New List(Of String)({"Last Month", "Last 3 Months", "Last 6 Months", EgtMsg(62531)})
Public ReadOnly Property DayTypeList As List(Of String)
Get
Return m_DayTypeList
End Get
End Property
Protected m_SelDayType As DayTypes = DayTypes.LASTMONTH
Public Property SelDayType As Integer
Get
Return m_SelDayType
End Get
Set(value As Integer)
Dim PrevSelDayType As DayTypes = m_SelDayType
m_SelDayType = value
WriteMainPrivateProfileString(S_OPENFILEDIALOG, K_DAYTYPE, Convert.ToInt32(m_SelDayType))
m_Date_Visibility = If(m_SelDayType = DayTypes.PERIOD, Visibility.Visible, Visibility.Collapsed)
If m_SelDayType = DayTypes.PERIOD Then
Select Case PrevSelDayType
Case DayTypes.LASTMONTH
m_dtStartDate = DateTime.Today + TimeSpan.FromDays(1)
m_dtEndDate = m_dtStartDate - TimeSpan.FromDays(31)
Case DayTypes.LAST3MONTHS
Case DayTypes.LAST6MONTHS
End Select
NotifyPropertyChanged(NameOf(dtStartDate))
NotifyPropertyChanged(NameOf(dtEndDate))
End If
NotifyPropertyChanged(NameOf(Date_Visibility))
' aggiorno lista da Db
RefreshProjectList()
m_ProjectList_View.Refresh()
End Set
End Property
Private m_dtStartDate As DateTime = DateTime.Today
Public Property dtStartDate As DateTime
Get
Return m_dtStartDate
End Get
Set(value As DateTime)
m_dtStartDate = value
Dim lStartDate As Long = m_dtStartDate.ToFileTimeUtc()
WriteMainPrivateProfileString(S_MACHINELOGFILTER, K_STARTDATE, lStartDate.ToString())
' aggiorno lista da Db
RefreshProjectList()
m_ProjectList_View.Refresh()
End Set
End Property
Private m_dtEndDate As DateTime = DateTime.Today
Public Property dtEndDate As DateTime
Get
Return m_dtEndDate
End Get
Set(value As DateTime)
m_dtEndDate = value
Dim lEndDate As Long = m_dtEndDate.ToFileTimeUtc()
WriteMainPrivateProfileString(S_MACHINELOGFILTER, K_ENDDATE, lEndDate.ToString())
' aggiorno lista da Db
RefreshProjectList()
m_ProjectList_View.Refresh()
End Set
End Property
Private m_Date_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property Date_Visibility As Visibility
Get
Return m_Date_Visibility
End Get
End Property
Private m_RowQuantityList As New List(Of String)({50, 100, 150})
Public ReadOnly Property RowQuantityList As List(Of String)
Get
Return m_RowQuantityList
End Get
End Property
Private m_SelRowQuantity As RowQuantities
Public Property SelRowQuantity As Integer
Get
Return m_SelRowQuantity
End Get
Set(value As Integer)
m_SelRowQuantity = value
RefreshProjectList()
m_ProjectList_View.Refresh()
End Set
End Property
' lista campi per ricerca testuale e con datepicker
Protected m_FilterTypeList As New ObservableCollection(Of IdNameStruct)
Public ReadOnly Property FilterTypeList As ObservableCollection(Of IdNameStruct)
Get
Return m_FilterTypeList
End Get
End Property
Protected m_SelFilterType As IdNameStruct = Nothing
Public Property SelFilterType As IdNameStruct
Get
Return m_SelFilterType
End Get
Set(value As IdNameStruct)
' resetto il contenuto della barra di ricerca testuale
@@ -103,15 +242,15 @@ Public MustInherit Class OpenProjectFileDialogVM
' resetto le selezioni sul calendario
If Not IsNothing(SearchDate) Then SearchDate.Clear()
' setto il Tipo Filtro a NULL e refresho la lista dei progetti (in modo da averli visibili tutti)
m_SelSearchColumn = m_SearchColumnList(0)
m_SelFilterType = m_FilterTypeList(0)
m_ProjectList_View.Refresh()
' ora setto il valore scelto come Tipo Filtro
m_SelSearchColumn = value
Select Case m_SelSearchColumn.Id
Case OpenProjFileColumn.ID, OpenProjFileColumn.BTLFILENAME, OpenProjFileColumn.LISTNAME, OpenProjFileColumn.MACHINE
m_SelFilterType = value
Select Case m_SelFilterType.Id
Case FilterTypes.ID, FilterTypes.BTLFILENAME, FilterTypes.LISTNAME, FilterTypes.MACHINE
SearchText_Visibility = Visibility.Visible
SearchDate_Visibility = Visibility.Collapsed
Case OpenProjFileColumn.EXPORTDATE, OpenProjFileColumn.CREATEDATE
Case BTLDateTypes.EXPORTDATE, BTLDateTypes.CREATEDATE
SearchText_Visibility = Visibility.Collapsed
SearchDate_Visibility = Visibility.Visible
Case Else
@@ -161,18 +300,13 @@ Public MustInherit Class OpenProjectFileDialogVM
End Set
End Property
Public Enum OpenProjFileColumn As Integer
NULL = 0
ID = 1
BTLFILENAME = 2
LISTNAME = 3
EXPORTDATE = 4
CREATEDATE = 5
MACHINE = 6
End Enum
#Region "Messages"
Public ReadOnly Property Title As String
Get
Return "Open Project"
End Get
End Property
Public ReadOnly Property FilterType_Msg As String
Get
Return EgtMsg(61836)
@@ -236,6 +370,18 @@ Public MustInherit Class OpenProjectFileDialogVM
End Get
End Property
Public ReadOnly Property From_Msg As String
Get
Return EgtMsg(62523)
End Get
End Property
Public ReadOnly Property To_Msg As String
Get
Return EgtMsg(62524)
End Get
End Property
#End Region
' Definizione comandi
@@ -244,31 +390,45 @@ Public MustInherit Class OpenProjectFileDialogVM
#End Region ' FIELDS & PROPERTIES
Sub New()
End Sub
#Region "METHODS"
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)
End Sub
Protected Sub LoadColumns(ProjectType As ProjectType)
If ProjectType = ProjectType.PROJ Then
' carico le colonne della datagrid
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROJ, ProjectColumns)
' carico campi su cui eseguire il filtro di ricerca
m_SearchColumnList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(OpenProjFileColumn.NULL, ""),
New IdNameStruct(OpenProjFileColumn.ID, Id_Msg),
New IdNameStruct(OpenProjFileColumn.BTLFILENAME, BTLFileName_Msg),
New IdNameStruct(OpenProjFileColumn.LISTNAME, ListName_Msg),
New IdNameStruct(OpenProjFileColumn.EXPORTDATE, ExportDate_Msg),
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg),
New IdNameStruct(OpenProjFileColumn.MACHINE, Machine_Msg)})
m_BTLDateTypeList = New List(Of String)({CreateDate_Msg, ExportDate_Msg})
m_SelBTLDateType = BTLDateTypes.CREATEDATE
NotifyPropertyChanged(NameOf(BTLDateTypeList))
NotifyPropertyChanged(NameOf(SelBTLDateType))
m_FilterTypeList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(FilterTypes.NULL, ""),
New IdNameStruct(FilterTypes.ID, Id_Msg),
New IdNameStruct(FilterTypes.BTLFILENAME, BTLFileName_Msg),
New IdNameStruct(FilterTypes.LISTNAME, ListName_Msg),
New IdNameStruct(FilterTypes.MACHINE, Machine_Msg)})
m_SelFilterType = m_FilterTypeList.FirstOrDefault(Function(x) x.Id = FilterTypes.NULL)
NotifyPropertyChanged(NameOf(SelFilterType))
ElseIf ProjectType = ProjectType.PROD Then
' carico le colonne della datagrid
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROD, ProjectColumns)
' carico campi su cui eseguire il filtro di ricerca
m_SearchColumnList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(OpenProjFileColumn.NULL, ""),
New IdNameStruct(OpenProjFileColumn.ID, Id_Msg),
New IdNameStruct(OpenProjFileColumn.BTLFILENAME, BTLFileName_Msg),
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg),
New IdNameStruct(OpenProjFileColumn.MACHINE, Machine_Msg)})
m_BTLDateTypeList = New List(Of String)({CreateDate_Msg})
m_SelBTLDateType = BTLDateTypes.CREATEDATE
NotifyPropertyChanged(NameOf(BTLDateTypeList))
NotifyPropertyChanged(NameOf(SelBTLDateType))
m_FilterTypeList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(FilterTypes.NULL, ""),
New IdNameStruct(FilterTypes.ID, Id_Msg),
New IdNameStruct(FilterTypes.BTLFILENAME, BTLFileName_Msg),
New IdNameStruct(FilterTypes.MACHINE, Machine_Msg)})
m_SelFilterType = m_FilterTypeList.FirstOrDefault(Function(x) x.Id = FilterTypes.NULL)
NotifyPropertyChanged(NameOf(SelFilterType))
End If
' setto la visibilità delle colonne delle EgtDataGrid
For Each col In ProjectColumns
@@ -301,22 +461,22 @@ Public MustInherit Class OpenProjectFileDialogVM
Dim bProjectOk As Boolean = True
If m_ProjectType = ProjectType.PROJ Then
Dim CurrProj As ProjFileVM = DirectCast(Proj, ProjFileVM)
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso (
(m_SelSearchColumn.Id = OpenProjFileColumn.EXPORTDATE AndAlso Not SearchDate.Contains(CurrProj.dtExportDate.Date)) OrElse
(m_SelSearchColumn.Id = OpenProjFileColumn.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso m_SearchText <> String.Empty AndAlso (
(m_SelSearchColumn.Id = OpenProjFileColumn.ID AndAlso CurrProj.sProjId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
(m_SelSearchColumn.Id = OpenProjFileColumn.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
(m_SelSearchColumn.Id = OpenProjFileColumn.LISTNAME AndAlso CurrProj.sListName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
(m_SelSearchColumn.Id = OpenProjFileColumn.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso (
(m_SelFilterType.Id = BTLDateTypes.EXPORTDATE AndAlso Not SearchDate.Contains(CurrProj.dtExportDate.Date)) OrElse
(m_SelFilterType.Id = BTLDateTypes.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso m_SearchText <> String.Empty AndAlso (
(m_SelFilterType.Id = FilterTypes.ID AndAlso CurrProj.sProjId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
(m_SelFilterType.Id = FilterTypes.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
(m_SelFilterType.Id = FilterTypes.LISTNAME AndAlso CurrProj.sListName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
(m_SelFilterType.Id = FilterTypes.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
ElseIf m_ProjectType = ProjectType.PROD Then
Dim CurrProj As ProdFileVM = DirectCast(Proj, ProdFileVM)
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso (
(m_SelSearchColumn.Id = OpenProjFileColumn.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso m_SearchText <> String.Empty AndAlso (
(m_SelSearchColumn.Id = OpenProjFileColumn.ID AndAlso CurrProj.sProdId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
(m_SelSearchColumn.Id = OpenProjFileColumn.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
(m_SelSearchColumn.Id = OpenProjFileColumn.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso (
(m_SelFilterType.Id = BTLDateTypes.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
If m_SelFilterType.Id <> FilterTypes.NULL AndAlso m_SearchText <> String.Empty AndAlso (
(m_SelFilterType.Id = FilterTypes.ID AndAlso CurrProj.sProdId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
(m_SelFilterType.Id = FilterTypes.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
(m_SelFilterType.Id = FilterTypes.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
End If
Return bProjectOk
End Function
+34 -24
View File
@@ -19,39 +19,49 @@ Public Class ProjFileM
End Property
Protected m_sBTLFileName As String = String.Empty
Public Property sBTLFileName As String
Get
Return m_sBTLFileName
End Get
Set(value As String)
m_sBTLFileName = value
End Set
End Property
Public Property sBTLFileName As String
Get
Return m_sBTLFileName
End Get
Set(value As String)
m_sBTLFileName = value
End Set
End Property
Protected m_sDescription As String = String.Empty
Public Property sDescription As String
Get
Return m_sDescription
End Get
Set(value As String)
m_sDescription = value
End Set
End Property
#Region "CONSTRUCTORS"
Protected Sub New()
Protected Sub New()
End Sub
Public Shared Function CreateNewProjFileM() As ProjFileM
Return New ProjFileM
End Function
Public Shared Function CreateProjFileM(nProjId As Integer, nProdId As Integer, dtCreateProjDate As DateTime, dtExportDate As DateTime, sListName As String,
sBTLFileName As String, IsNew As Boolean, IsLocked As Boolean, nType As BWType, sMachine As String) As ProjFileM
Dim NewProjectFileM As New ProjFileM
NewProjectFileM.m_nProjId = nProjId
NewProjectFileM.m_nProdId = nProdId
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
NewProjectFileM.m_dtExportDate = dtExportDate
NewProjectFileM.m_sListName = sListName
NewProjectFileM.m_sBTLFileName = sBTLFileName
NewProjectFileM.m_bIsNew = IsNew
NewProjectFileM.m_bIsLocked = IsLocked
NewProjectFileM.m_nType = nType
NewProjectFileM.m_sMachine = sMachine
Return NewProjectFileM
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) As ProjFileM
Dim NewProjectFileM As New ProjFileM
NewProjectFileM.m_nProjId = nProjId
NewProjectFileM.m_nProdId = nProdId
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
NewProjectFileM.m_dtExportDate = dtExportDate
NewProjectFileM.m_sListName = sListName
NewProjectFileM.m_sBTLFileName = sBTLFileName
NewProjectFileM.m_sDescription = sDescription
NewProjectFileM.m_bIsNew = IsNew
NewProjectFileM.m_bIsLocked = IsLocked
NewProjectFileM.m_nType = nType
NewProjectFileM.m_sMachine = sMachine
Return NewProjectFileM
End Function
#End Region ' CONSTRUCTORS
@@ -68,6 +68,12 @@ Public Class ProjFileVM
End Get
End Property
Public ReadOnly Property sDescription As String
Get
Return ProjFileM.sDescription
End Get
End Property
Public ReadOnly Property sListName As String
Get
Return ProjFileM.sListName
@@ -1,6 +1,5 @@
using EgtBEAMWALL.DataLayer.DatabaseModels;
using NLog;
using NLog.LayoutRenderers;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -174,14 +173,75 @@ namespace EgtBEAMWALL.DataLayer.Controllers
}
/// <summary>
/// Elenco progetti
/// Elenco prod
/// </summary>
/// <param name="numRecord"></param>
/// <param name="numRecord">Num max record da recuperare</param>
/// <param name="OnlyActive">Solo con ALMENO 1 PROJ attivo (senza cancellazione logica)</param>
/// <returns></returns>
public List<Core.ProdFileM> GetLastDesc(int numRecord)
public List<Core.ProdFileM> GetLastDesc(int numRecord, bool OnlyActive)
{
List<Core.ProdFileM> result = new List<Core.ProdFileM>();
var dbResult = GetLastDbModelDesc(numRecord);
//List<ProdModel> dbResult = GetLastDbModelDesc(numRecord);
List<ProdModel> dbResult = new List<ProdModel>();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// se numRecord = 0 --> passo tutti
if (numRecord == 0)
{
numRecord = localDbCtx.ProdList.Count();
}
// retrieve
dbResult = localDbCtx
.ProdList
// condizione join sui PROJ
.Join(localDbCtx.ProjList.Where(x=> x.IsActive || !OnlyActive),
p => p.ProdDbId,
e=> e.ProdDbId,
(p,e) => p)
.OrderByDescending(x => x.ProdId)
.Take(numRecord)
.ToList();
}
// 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)).ToList();
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>
/// <returns></returns>
public List<Core.ProdFileM> GetLastDesc(DateTime dtStart, DateTime dtEnd, int numRecord, bool OnlyActive)
{
List<Core.ProdFileM> result = new List<Core.ProdFileM>();
//List<ProdModel> dbResult = GetLastDbModelDesc(numRecord);
List<ProdModel> dbResult = new List<ProdModel>();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// se numRecord = 0 --> passo tutti
if (numRecord == 0)
{
numRecord = localDbCtx.ProdList.Count();
}
// retrieve
dbResult = localDbCtx
.ProdList
.Where(x => x.DtCreated >= dtStart && x.DtCreated <= dtEnd)
// condizione join sui PROJ
.Join(localDbCtx.ProjList.Where(x => x.IsActive || !OnlyActive),
p => p.ProdDbId,
e => e.ProdDbId,
(p, e) => p)
.OrderByDescending(x => x.ProdId)
.Take(numRecord)
.ToList();
}
// 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)).ToList();
return result;
@@ -408,7 +468,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.OrderBy(n => n.PartCount);
// controllo: nell'elenco delle barre MachGroupList NON devono esserci duplicati per
// l'ID (esterno) che deve essere univoco...
// l'ID (esterno) che deve essere univoco...
testOk = listaCheck.Where(x => x.PartCount > 1).Count() == 0;
if (testOk)
{
@@ -716,6 +776,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
return answ;
}
#if false
/// <summary>
/// Get LAST paginated data from DB (DESC ordered)
/// </summary>
@@ -737,7 +798,8 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.Take(numRecord)
.ToList();
}
}
}
#endif
protected List<int> ProjIdByProd(int ProdId)
{
@@ -45,11 +45,12 @@ namespace EgtBEAMWALL.DataLayer.Controllers
}
/// <summary>
/// Delete Proj on DB by ProjId
/// Delete Proj logically / on DB by ProjId
/// </summary>
/// <param name="ProjId"></param>
/// <param name="IsLogical"></param>
/// <returns></returns>
public bool DeleteProj(int ProjId)
public bool DeleteProj(int ProjId, bool IsLogical)
{
bool done = false;
@@ -59,25 +60,45 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.ProjList
.Where(x => x.ProjId == ProjId)
.SingleOrDefault();
// sel delle BTLParts da proj
var parts2del = localDbCtx
.BTLPartList
.Where(x => x.ProjDbId == currProj.ProjDbId);
try
if (IsLogical)
{
// remove from database
localDbCtx.BTLPartList.RemoveRange(parts2del);
localDbCtx.ProjList.Remove(currProj);
// Commit changes
localDbCtx.SaveChanges();
done = true;
try
{
currProj.IsActive = false;
// Commit changes
localDbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Proj.DeleteProj (logical only): {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
else
{
string errMessage = $"EXCEPTION on Proj.DeleteProj: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
// sel delle BTLParts da proj
var parts2del = localDbCtx
.BTLPartList
.Where(x => x.ProjDbId == currProj.ProjDbId);
try
{
// remove from database
localDbCtx.BTLPartList.RemoveRange(parts2del);
localDbCtx.ProjList.Remove(currProj);
// Commit changes
localDbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Proj.DeleteProj (on DB): {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
}
return done;
@@ -91,8 +112,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// Get records filtered by BtlPartName matching regexp BtlFileName[_number]
/// </summary>
/// <param name="BtlFileName">Base name to search for (=starts by BtlFileName%)</param>
/// <param name="OnlyActive">Solo i record attivi (senza cancellazione logica)</param>
/// <returns></returns>
public List<ProjModel> FindByBtlFileName(string BtlFileName)
public List<ProjModel> FindByBtlFileName(string BtlFileName, bool OnlyActive)
{
List<ProjModel> searchResult = new List<ProjModel>();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
@@ -100,7 +122,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
// in primi cerco il record "parent" generale, se non ci fosse inutile proseguire...
ProjModel parentRec = localDbCtx
.ProjList
.Where(x => x.BTLFileName == BtlFileName)
.Where(x => x.BTLFileName == BtlFileName && (!OnlyActive || x.IsActive))
.FirstOrDefault();
if (parentRec != null && parentRec.ProjId > 0)
{
@@ -109,7 +131,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
// cerco eventuali dati "child" puliti
var childRec = localDbCtx
.ProjList
.Where(x => x.BTLFileName.StartsWith(BtlFileName + "_"))
.Where(x => x.BTLFileName.StartsWith(BtlFileName + "_") && (!OnlyActive || x.IsActive))
.ToList();
// faccio filtro con ricerca regexp x scartare "falsi positivi" come BtlFileName_nonNumero...
if (childRec.Count > 0)
@@ -180,7 +202,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <summary>
/// Get filtered data by ProdId (ASC ordered)
/// </summary>
/// <param name="ProdDbId"></param>
/// <param name="ProdId"></param>
/// <returns></returns>
public List<Core.ProjFileM> GetByProdAsc(int ProdId)
{
@@ -280,9 +302,12 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <summary>
/// Elenco progetti
/// </summary>
/// <param name="numRecord"></param>
/// <param name="dtStart">Inizio periodo estrazione (per export date)</param>
/// <param name="dtEnd">Fine periodo estrazione (per export date)</param>
/// <param name="numRecord">Num max record da recuperare</param>
/// <param name="OnlyActive">Solo i record attivi (senza cancellazione logica)</param>
/// <returns></returns>
public List<Core.ProjFileM> GetLastDesc(int numRecord)
public List<Core.ProjFileM> GetLastByExpDesc(DateTime dtStart, DateTime dtEnd, int numRecord, bool OnlyActive)
{
List<Core.ProjFileM> answ = new List<Core.ProjFileM>();
@@ -296,6 +321,69 @@ namespace EgtBEAMWALL.DataLayer.Controllers
// retrieve
var dbRes = localDbCtx
.ProjList
.Where(x => (x.DtExported >= dtStart && x.DtExported <= dtEnd) && (!OnlyActive || x.IsActive))
.OrderByDescending(x => x.ProjId)
.Take(numRecord)
.ToList();
// conversione
answ = dbRes.Select(x => coreConv(x)).ToList();
}
return answ;
}
/// <summary>
/// Elenco progetti
/// </summary>
/// <param name="numRecord">Num max record da recuperare</param>
/// <param name="OnlyActive">Solo i record attivi (senza cancellazione logica)</param>
/// <returns></returns>
public List<Core.ProjFileM> GetLastDesc(int numRecord, bool OnlyActive)
{
List<Core.ProjFileM> answ = new List<Core.ProjFileM>();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// se numRecord = 0 --> passo tutti
if (numRecord == 0)
{
numRecord = localDbCtx.ProjList.Count();
}
// retrieve
var dbRes = localDbCtx
.ProjList
.Where(x => (!OnlyActive || x.IsActive))
.OrderByDescending(x => x.ProjId)
.Take(numRecord)
.ToList();
// conversione
answ = dbRes.Select(x => coreConv(x)).ToList();
}
return answ;
}
/// <summary>
/// Elenco progetti
/// </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 i record attivi (senza cancellazione logica)</param>
/// <returns></returns>
public List<Core.ProjFileM> GetLastDesc(DateTime dtStart, DateTime dtEnd, int numRecord, bool OnlyActive)
{
List<Core.ProjFileM> answ = new List<Core.ProjFileM>();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// se numRecord = 0 --> passo tutti
if (numRecord == 0)
{
numRecord = localDbCtx.ProjList.Count();
}
// retrieve
var dbRes = localDbCtx
.ProjList
.Where(x => (x.DtCreated >= dtStart && x.DtCreated <= dtEnd) && (!OnlyActive || x.IsActive))
.OrderByDescending(x => x.ProjId)
.Take(numRecord)
.ToList();
@@ -341,6 +429,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
{
ProjId = nextId,
BTLFileName = "",
ProjDescription = "",
IsNew = true,
Locked = true,
LockedBy = UserKey,
@@ -577,15 +666,62 @@ namespace EgtBEAMWALL.DataLayer.Controllers
return currData;
}
/// <summary>
/// Update record su DB x Description
/// </summary>
/// <param name="ProjId"></param>
/// <param name="Description"></param>
/// <returns></returns>
public Core.ProjFileM UpdateDescription(int ProjId, string Description)
{
// cerco specifico Proj
ProjModel currData;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
currData = localDbCtx
.ProjList
.Where(x => x.ProjId == ProjId)
.SingleOrDefault();
if (currData != null)
{
try
{
// aggiorno valore BTL
currData.ProjDescription = Description;
// Commit changes
localDbCtx.SaveChanges();
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Part.UpdateDescription:{Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
else
{
string errMessage = $"ERROR on Proj.UpdateDescription: req item was not found | ProjId {ProjId} | Description {Description}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return coreConv(currData);
}
/// <summary>
/// Update record su DB x nomeBTL, ListName, ExportDate
/// </summary>
/// <param name="ProjId"></param>
/// <param name="BTLFileName"></param>
/// <param name="Description"></param>
/// <param name="ListName"></param>
/// <param name="DtExported"></param>
/// <param name="PType"></param>
/// <param name="Machine"></param>
/// <returns></returns>
public Core.ProjFileM UpdateInfo(int ProjId, string BTLFileName, string ListName, DateTime DtExported, BWType PType, string Machine)
public Core.ProjFileM UpdateInfo(int ProjId, string BTLFileName, string Description, string ListName, DateTime DtExported, BWType PType, string Machine)
{
// cerco specifico Proj
ProjModel currData;
@@ -600,8 +736,10 @@ namespace EgtBEAMWALL.DataLayer.Controllers
try
{
// 2022.01.24: verifico UNIVOCITA' nel nome del file: SE fosse duplicato -->
// nuovo nome, nel formato nomeOriginale_idx, dove idx è il contatore libero successivo
var duplicateList = FindByBtlFileName(BTLFileName);
// nuovo nome, nel formato nomeOriginale_idx, dove idx è il contatore libero
// successivo 2023.06.08: lasciato come prima, anche NON attivi
// (cancellazione logica)
var duplicateList = FindByBtlFileName(BTLFileName, false);
// devo verificare SOLO SE la lista non è vuota
if (duplicateList != null && duplicateList.Count > 0)
{
@@ -635,6 +773,8 @@ namespace EgtBEAMWALL.DataLayer.Controllers
// aggiorno valore BTL
currData.BTLFileName = BTLFileName;
// aggiorno il resto
currData.ProjDescription = Description;
currData.DtExported = DtExported;
currData.ListName = ListName;
currData.PType = PType;
@@ -652,7 +792,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
}
else
{
string errMessage = $"ERROR on Proj.UpdateInfo: req item was not found | ProjId {ProjId} | BTLFileName {BTLFileName} | ListName {ListName} | DtExported {DtExported} | PType {PType} | Machine {Machine}";
string errMessage = $"ERROR on Proj.UpdateInfo: req item was not found | ProjId {ProjId} | Description {BTLFileName} | ListName {ListName} | DtExported {DtExported} | PType {PType} | Machine {Machine}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
@@ -760,7 +900,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
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.IsNew, currProj.Locked, currProj.PType, currProj.Machine);
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);
}
return answ;
}
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static EgtBEAMWALL.Core.ConstBeam;
@@ -31,6 +28,12 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
[Column("DtExported")]
public DateTime DtExported { get; set; }
/// <summary>
/// Record attivo (se false == cancellazione logica)
/// </summary>
[Column("IsActive")]
public bool IsActive { get; set; } = true;
/// <summary>
/// Stato NEW = creato ma NON salvato
/// </summary>
@@ -43,6 +46,13 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
[Column("ListName")]
public string ListName { get; set; } = "";
/// <summary>
/// DataOra ultima operazione di Lock (o di rimozione di lock), quando aperto da un
/// dispositivo in rete
/// </summary>
[Column("LockDate")]
public DateTime LockDate { get; set; } = DateTime.MinValue;
/// <summary>
/// Stato locked (quando aperto da un dispositivo in rete)
/// </summary>
@@ -55,12 +65,6 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
[Column("LockedBy")]
public string LockedBy { get; set; } = "";
/// <summary>
/// DataOra ultima operazione di Lock (o di rimozione di lock), quando aperto da un dispositivo in rete
/// </summary>
[Column("LockDate")]
public DateTime LockDate { get; set; } = DateTime.MinValue;
/// <summary>
/// Macchina
/// </summary>
@@ -76,6 +80,12 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
[Key, Column("ProjDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int ProjDbId { get; set; }
/// <summary>
/// Descrizione progetto (copiata da BTLFileName inizialmente)
/// </summary>
[Column("ProjDescription")]
public string ProjDescription { get; set; } = "";
[Column("Id")]
public int ProjId { get; set; }
+1 -1
View File
@@ -29,7 +29,7 @@ namespace EgtBEAMWALL.DataLayer
public static string ADMIN_CONNECTION_STRING { get; set; } = "";
/// <summary>
/// DB Connection string
/// DB Connection string, per effettuare migration riportare valore connessione admin cablato
/// </summary>
public static string CONNECTION_STRING { get; set; } = "";
@@ -172,6 +172,10 @@
<Compile Include="Migrations\202207051703296_UpgradeLockModel.designer.cs">
<DependentUpon>202207051703296_UpgradeLockModel.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\202306081452095_UpdateProjModel.cs" />
<Compile Include="Migrations\202306081452095_UpdateProjModel.designer.cs">
<DependentUpon>202306081452095_UpdateProjModel.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Utils.cs" />
@@ -211,6 +215,9 @@
<EmbeddedResource Include="Migrations\202207051703296_UpgradeLockModel.resx">
<DependentUpon>202207051703296_UpgradeLockModel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\202306081452095_UpdateProjModel.resx">
<DependentUpon>202306081452095_UpdateProjModel.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
@@ -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 UpdateProjModel : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(UpdateProjModel));
string IMigrationMetadata.Id
{
get { return "202306081452095_UpdateProjModel"; }
}
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 UpdateProjModel : DbMigration
{
public override void Up()
{
AddColumn("dbo.ProjList", "IsActive", c => c.Boolean(nullable: false, defaultValueSql: "1"));
AddColumn("dbo.ProjList", "ProjDescription", c => c.String(unicode: false));
}
public override void Down()
{
DropColumn("dbo.ProjList", "ProjDescription");
DropColumn("dbo.ProjList", "IsActive");
}
}
}
File diff suppressed because one or more lines are too long
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.5.6.1")]
[assembly: AssemblyFileVersion("2.5.6.1")]
[assembly: AssemblyVersion("2.5.6.2")]
[assembly: AssemblyFileVersion("2.5.6.2")]
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.6.1")>
<Assembly: AssemblyFileVersion("2.5.6.1")>
<Assembly: AssemblyVersion("2.5.6.2")>
<Assembly: AssemblyFileVersion("2.5.6.2")>
@@ -12,19 +12,12 @@ Public Class OpenProjectFileDialogVM
Public Overrides Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
m_ProjectType = ProjectType
' carico colonne
LoadColumns(ProjectType)
NotifyPropertyChanged(NameOf(SearchColumnList))
m_SelSearchColumn = m_SearchColumnList(0)
LoadColumns(m_ProjectType)
NotifyPropertyChanged(NameOf(FilterTypeList))
m_SelFilterType = m_FilterTypeList(0)
' carico lista progetti
If IsNothing(CurrProjectList) OrElse CurrProjectList.Count = 0 Then
' leggo da db
If ProjectType = ProjectType.PROD Then
Dim DbProjectList As New List(Of ProdFileM)
DbProjectList = DbControllers.m_ProdController.GetLastDesc(50)
For Each Project In DbProjectList
m_ProjectList.Add(New ProdFileVM(Project))
Next
End If
RefreshProjectList(GoToProd)
Else
m_ProjectList = New ObservableCollection(Of ProjectFileVM)(CurrProjectList)
NotifyPropertyChanged(NameOf(ProjectList))
@@ -33,6 +26,45 @@ Public Class OpenProjectFileDialogVM
m_ProjectList_View.Filter = AddressOf ProjectFilter
End Function
Public Overrides Sub RefreshProjectList(Optional GoToProd As Boolean = False)
m_ProjectList.Clear()
' calcolo periodo e righe
Dim dtStart As DateTime
Dim dtEnd As DateTime
Dim nRowQuantity As Integer = 20
Select Case SelRowQuantity
Case RowQuantities.FIFTY
nRowQuantity = 50
Case RowQuantities.HUNDRED
nRowQuantity = 100
Case RowQuantities.HUNDREDANDFIFTY
nRowQuantity = 150
End Select
Select Case m_SelDayType
Case DayTypes.LASTMONTH
dtEnd = DateTime.Today + TimeSpan.FromDays(1)
dtStart = dtEnd - TimeSpan.FromDays(31)
Case DayTypes.LAST3MONTHS
dtEnd = DateTime.Today + TimeSpan.FromDays(1)
dtStart = dtEnd - TimeSpan.FromDays(31 * 3)
Case DayTypes.LAST6MONTHS
dtEnd = DateTime.Today + TimeSpan.FromDays(1)
dtStart = dtEnd - TimeSpan.FromDays(31 * 6)
Case DayTypes.PERIOD
dtStart = dtStartDate + TimeSpan.FromDays(1)
dtEnd = dtEndDate
End Select
' leggo da db
If m_ProjectType = ProjectType.PROD Then
Dim DbProjectList As New List(Of ProdFileM)
DbProjectList = DbControllers.m_ProdController.GetLastDesc(dtStart, dtEnd, nRowQuantity, True)
For Each Project In DbProjectList
m_ProjectList.Add(New ProdFileVM(Project))
Next
End If
End Sub
#End Region ' METHODS
End Class
@@ -348,6 +348,11 @@
<Setter Property="Margin" Value="5,0,5,0"/>
</Style>
<Style x:Key="Filter_TextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="2.5,0,2.5,0"/>
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- TextBox -->
@@ -733,5 +738,14 @@
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- DatePicker -->
<Style x:Key="Filter_DatePicker" TargetType="{x:Type DatePicker}">
<Setter Property="Height" Value="22" />
<Setter Property="Width" Value="100" />
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ -->
</ResourceDictionary>
@@ -120,9 +120,17 @@ Public Class BTLFeatureVM
End Get
Set(value As String)
Dim nTemp As Integer = 0
If Integer.TryParse(value, nTemp) Then
m_BTLFeatureM.nPriority = nTemp
EgtSetInfo( nFeatureId, BTL_FTR_PRIORITY, m_BTLFeatureM.nPriority)
If Integer.TryParse(value, nTemp) Then
If EgtSetInfo(nFeatureId, BTL_FTR_PRIORITY, nTemp) Then
m_BTLFeatureM.nPriority = nTemp
' setto feature da ricalcolare
ResetCalcFeature()
' se in View
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
' imposto modificato per copie
EgtDuploSetModified(m_BTLPartM.nPartId)
End If
End If
End If
NotifyPropertyChanged(NameOf(sPriority))
End Set
@@ -2164,7 +2164,7 @@ Public Class BTLPartVM
' imposto path disegno da mostrare in BottomPanel
Dim SelPBTLParam As BTLParamVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.SelPBTLParam
If Not IsNothing(SelPBTLParam) Then Map.refBottomPanelVM.SetCurrDraw(SelPBTLParam.sDrawPath)
Case NameOf(sender.bDO)
Case NameOf(sender.bDO), NameOf(sender.sPriority)
NotifyPropertyChanged(NameOf(bDOALL))
' setto pezzo da ricalcolare
'ResetCalcTotalPart()
@@ -29,7 +29,7 @@ Public Class FeatureManagerVM
Public ReadOnly Property Priority_Visibility As Visibility
Get
Return if(CurrentMachine.nType = Core.ConstBeam.MachineType.WALL, Visibility.Visible, Visibility.Collapsed)
Return If(CurrentMachine.nType = Core.ConstBeam.MachineType.WALL AndAlso CurrentMachine.bIsEnabledPriority, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
@@ -62,7 +62,7 @@ Public Class FeatureInPartInRawPartListVM
Friend Sub UpdateColumns(nMachType As MachineType)
If Not IsNothing(m_colFeatureInPartInRawPart_Priority) Then
m_colFeatureInPartInRawPart_Priority.Visible = (nMachType=MachineType.WALL)
m_colFeatureInPartInRawPart_Priority.Visible = (nMachType = MachineType.WALL AndAlso CurrentMachine.bIsEnabledPriority)
End If
End Sub
@@ -27,6 +27,13 @@ Public Class RawPartListVM
End Get
End Property
Private m_colRawPart_PosZ As EgtDataGridColumn
Public ReadOnly Property colRawPart_PosZ As EgtDataGridColumn
Get
Return m_colRawPart_PosZ
End Get
End Property
Private m_RawPartColumns As New ObservableCollection(Of EgtDataGridColumn)
Public Property RawPartColumns As ObservableCollection(Of EgtDataGridColumn)
Get
@@ -120,6 +127,7 @@ Public Class RawPartListVM
m_colRawPart_StartCut = RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_STARTCUT)
m_colRawPart_W = RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_W)
m_colRawPart_L = RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_L)
m_colRawPart_PosZ = RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSZ)
' aggiorno la visibilità delle colonne
For Each col In RawPartColumns
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.6.1")>
<Assembly: AssemblyFileVersion("2.5.6.1")>
<Assembly: AssemblyVersion("2.5.6.2")>
<Assembly: AssemblyFileVersion("2.5.6.2")>
@@ -14,57 +14,11 @@ Public Class OpenProjectFileDialogVM
m_ProjectType = ProjectType
' carico colonne
LoadColumns(ProjectType)
NotifyPropertyChanged(NameOf(SearchColumnList))
m_SelSearchColumn = m_SearchColumnList(0)
NotifyPropertyChanged(NameOf(FilterTypeList))
m_SelFilterType = m_FilterTypeList(0)
' carico lista progetti
If IsNothing(CurrProjectList) OrElse CurrProjectList.Count = 0 Then
' leggo da db
If ProjectType = ProjectType.PROJ Then
Dim DbProjectList As New List(Of ProjFileM)
DbProjectList = DbControllers.m_ProjController.GetLastDesc(5000)
For Each Project In DbProjectList
' recupero path per verificare esista
If IsNothing(Project.nProjId) OrElse Project.nProjId = 0 Then Continue For
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProjsDir & "\" & Project.nProjId.ToString("0000") & "\" & Project.nProjId.ToString("0000") & ".nge"
If File.Exists(sPath) Then
m_ProjectList.Add(New ProjFileVM(Project))
Else
DbControllers.m_ProjController.DeleteProj(Project.nProjId)
EgtOutLog("Found project on Db without the folder and erased it! Proj number " & Project.nProjId.ToString("0000"))
End If
Next
ElseIf ProjectType = ProjectType.PROD Then
Dim DbProjectList As New List(Of ProdFileM)
DbProjectList = DbControllers.m_ProdController.GetLastDesc(5000)
If GoToProd Then
For Each Project In DbProjectList
' recupero path per verificare esista
If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge"
If Project.sMachine = Map.refProjManagerVM.CurrProj.sMachine AndAlso
Project.nType = Map.refProjManagerVM.CurrProj.nType Then
If File.Exists(sPath) Then
m_ProjectList.Add(New ProdFileVM(Project))
Else
DbControllers.m_ProdController.DeleteProd(Project.nProdId)
EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000"))
End If
End If
Next
Else
For Each Project In DbProjectList
' recupero path per verificare esista
If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge"
If File.Exists(sPath) Then
m_ProjectList.Add(New ProdFileVM(Project))
Else
DbControllers.m_ProdController.DeleteProd(Project.nProdId)
EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000"))
End If
Next
End If
End If
RefreshProjectList(GoToProd)
Else
m_ProjectList = New ObservableCollection(Of ProjectFileVM)(CurrProjectList)
NotifyPropertyChanged(NameOf(ProjectList))
@@ -73,6 +27,89 @@ Public Class OpenProjectFileDialogVM
m_ProjectList_View.Filter = AddressOf ProjectFilter
End Function
Public Overrides Sub RefreshProjectList(Optional GoToProd As Boolean = False)
m_ProjectList.Clear()
' calcolo periodo e righe
Dim dtStart As DateTime
Dim dtEnd As DateTime
Dim nRowQuantity As Integer = 20
Select Case SelRowQuantity
Case RowQuantities.FIFTY
nRowQuantity = 50
Case RowQuantities.HUNDRED
nRowQuantity = 100
Case RowQuantities.HUNDREDANDFIFTY
nRowQuantity = 150
End Select
Select Case m_SelDayType
Case DayTypes.LASTMONTH
dtEnd = DateTime.Today + TimeSpan.FromDays(1)
dtStart = dtEnd - TimeSpan.FromDays(31)
Case DayTypes.LAST3MONTHS
dtEnd = DateTime.Today + TimeSpan.FromDays(1)
dtStart = dtEnd - TimeSpan.FromDays(31 * 3)
Case DayTypes.LAST6MONTHS
dtEnd = DateTime.Today + TimeSpan.FromDays(1)
dtStart = dtEnd - TimeSpan.FromDays(31 * 6)
Case DayTypes.PERIOD
dtStart = dtStartDate + TimeSpan.FromDays(1)
dtEnd = dtEndDate
End Select
' leggo da db
If m_ProjectType = ProjectType.PROJ Then
Dim DbProjectList As New List(Of ProjFileM)
' CheckMe: lasciato come prima, anche NON attivi (cancellazione logica)
If m_SelBTLDateType = BTLDateTypes.CREATEDATE Then
DbProjectList = DbControllers.m_ProjController.GetLastDesc(dtStart, dtEnd, nRowQuantity, True)
Else
DbProjectList = DbControllers.m_ProjController.GetLastByExpDesc(dtStart, dtEnd, nRowQuantity, False)
End If
For Each Project In DbProjectList
' recupero path per verificare esista
If IsNothing(Project.nProjId) OrElse Project.nProjId = 0 Then Continue For
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProjsDir & "\" & Project.nProjId.ToString("0000") & "\" & Project.nProjId.ToString("0000") & ".nge"
If File.Exists(sPath) Then
m_ProjectList.Add(New ProjFileVM(Project))
Else
' CheckMe impostata come cancellazione FISICA dal DB...
DbControllers.m_ProjController.DeleteProj(Project.nProjId, False)
EgtOutLog("Found project on Db without the folder and erased it! Proj number " & Project.nProjId.ToString("0000"))
End If
Next
ElseIf m_ProjectType = ProjectType.PROD Then
Dim DbProjectList As New List(Of ProdFileM)
DbProjectList = DbControllers.m_ProdController.GetLastDesc(dtStart, dtEnd, nRowQuantity, True)
If GoToProd Then
For Each Project In DbProjectList
' recupero path per verificare esista
If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge"
If Project.sMachine = Map.refProjManagerVM.CurrProj.sMachine AndAlso
Project.nType = Map.refProjManagerVM.CurrProj.nType Then
If File.Exists(sPath) Then
m_ProjectList.Add(New ProdFileVM(Project))
Else
DbControllers.m_ProdController.DeleteProd(Project.nProdId)
EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000"))
End If
End If
Next
Else
For Each Project In DbProjectList
' recupero path per verificare esista
If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge"
If File.Exists(sPath) Then
m_ProjectList.Add(New ProdFileVM(Project))
Else
DbControllers.m_ProdController.DeleteProd(Project.nProdId)
EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000"))
End If
Next
End If
End If
End Sub
Public Overrides Sub Delete()
If IsNothing(SelProject) Then Return
' recupero indice per riselezionare
@@ -91,7 +128,8 @@ Public Class OpenProjectFileDialogVM
Map.refProjManagerVM.m_MruFiles.Remove(SelProject.sProjPath)
Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.MruFileNames))
' cancello progetto
DbControllers.m_ProjController.DeleteProj(SelProject.nProjId)
' CheckMe impostata come cancellazione FISICA dal DB...
DbControllers.m_ProjController.DeleteProj(SelProject.nProjId, False)
' cancello cartella del Proj
Try
Directory.Delete(SelProject.sProjDirPath, True)
@@ -101,7 +139,7 @@ Public Class OpenProjectFileDialogVM
' aggiorno lista progetti
m_ProjectList.Clear()
Dim DbProjectList As New List(Of ProjFileM)
DbProjectList = DbControllers.m_ProjController.GetLastDesc(50)
DbProjectList = DbControllers.m_ProjController.GetLastDesc(50, False)
For Each Project In DbProjectList
m_ProjectList.Add(New ProjFileVM(Project))
Next
@@ -179,7 +217,7 @@ Public Class OpenProjectFileDialogVM
' aggiorno lista progetti
m_ProjectList.Clear()
Dim DbProjectList As New List(Of ProdFileM)
DbProjectList = DbControllers.m_ProdController.GetLastDesc(50)
DbProjectList = DbControllers.m_ProdController.GetLastDesc(50, False)
For Each Project In DbProjectList
m_ProjectList.Add(New ProdFileVM(Project))
Next
File diff suppressed because it is too large Load Diff
@@ -267,6 +267,9 @@ Public Class ProjectVM
If Not IsNothing(Map.refRawPartListVM.colRawPart_L) Then
Map.refRawPartListVM.colRawPart_L.IsReadOnly = True
End If
If Not IsNothing(Map.refRawPartListVM.colRawPart_PosZ) Then
Map.refRawPartListVM.colRawPart_PosZ.IsReadOnly = True
End If
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Offset) Then
Map.refPartInRawPartListVM.colPartInRawPart_Offset.IsReadOnly = True
End If
@@ -285,58 +288,55 @@ Public Class ProjectVM
If Not IsNothing(Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do) Then
Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do.IsReadOnly = True
End If
If Not IsNothing(Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Priority) Then
Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Priority.IsReadOnly = True
End If
m_bLockUX = True
' se calcolo finito
Else
ManageIsEnabled(True)
' aggiungere gestione colonne editabili delle tabelle
If Not IsNothing(Map.refPartListVM.colPart_Do) Then
Map.refPartListVM.colPart_Do.IsReadOnly = False
Map.refPartListVM.colPart_Do.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refFeatureListVM.colFeature_Do) Then
Map.refFeatureListVM.colFeature_Do.IsReadOnly = False
Map.refFeatureListVM.colFeature_Do.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refPParameterListVM.colPParam_Value) Then
Map.refPParameterListVM.colPParam_Value.IsReadOnly = False
Map.refPParameterListVM.colPParam_Value.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refQParameterListVM.colQParam_Value) Then
Map.refQParameterListVM.colQParam_Value.IsReadOnly = False
Map.refQParameterListVM.colQParam_Value.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refQParameterListVM.colQParam_Custom) Then
Map.refQParameterListVM.colQParam_Custom.IsReadOnly = False
Map.refQParameterListVM.colQParam_Custom.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refRawPartListVM.colRawPart_StartCut) Then
Map.refRawPartListVM.colRawPart_StartCut.IsReadOnly = False
Map.refRawPartListVM.colRawPart_StartCut.ResetToOrigIsReadOnly()
End If
If m_BTLStructureVM.nPROJTYPE <> BWType.BEAM AndAlso Not IsNothing(Map.refRawPartListVM.colRawPart_W) Then
Map.refRawPartListVM.colRawPart_W.IsReadOnly = False
Map.refRawPartListVM.colRawPart_W.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refRawPartListVM.colRawPart_L) Then
Map.refRawPartListVM.colRawPart_L.IsReadOnly = False
Map.refRawPartListVM.colRawPart_L.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refRawPartListVM.colRawPart_PosZ) Then
Map.refRawPartListVM.colRawPart_PosZ.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Offset) Then
Map.refPartInRawPartListVM.colPartInRawPart_Offset.IsReadOnly = False
Map.refPartInRawPartListVM.colPartInRawPart_Offset.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Rot) Then
Map.refPartInRawPartListVM.colPartInRawPart_Rot.IsReadOnly = False
Map.refPartInRawPartListVM.colPartInRawPart_Rot.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_Flip) Then
Map.refPartInRawPartListVM.colPartInRawPart_Flip.IsReadOnly = False
Map.refPartInRawPartListVM.colPartInRawPart_Flip.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosX) Then
Map.refPartInRawPartListVM.colPartInRawPart_PosX.IsReadOnly = False
Map.refPartInRawPartListVM.colPartInRawPart_PosX.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refPartInRawPartListVM.colPartInRawPart_PosY) Then
Map.refPartInRawPartListVM.colPartInRawPart_PosY.IsReadOnly = False
Map.refPartInRawPartListVM.colPartInRawPart_PosY.ResetToOrigIsReadOnly()
End If
If Not IsNothing(Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do) Then
Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do.IsReadOnly = False
End If
If Not IsNothing(Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Priority) Then
Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Priority.IsReadOnly = False
Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do.ResetToOrigIsReadOnly()
End If
' fermo il timer
If Not m_bCalcRunning Then
@@ -15,6 +15,11 @@ Public Class ProjFileVM
Sub New(ProjectFileM As ProjFileM)
MyBase.New(ProjectFileM)
' verifico valore description
If Not IsNothing(ProjectFileM) AndAlso String.IsNullOrWhiteSpace(ProjectFileM.sDescription) Then
DbControllers.m_ProjController.UpdateDescription(ProjectFileM.nProjId, ProjectFileM.sBTLFileName)
ProjectFileM.sDescription = ProjectFileM.sBTLFileName
End If
End Sub
#End Region ' CONSTRUCTORS
@@ -137,9 +142,11 @@ Public Class ProjFileVM
Directory.Delete(sProjectDirPath, True)
End If
Map.refProjManagerVM.m_MruFiles.Remove(CurrProject.sProjPath)
Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.MruFileNames))
DbControllers.m_ProjController.DeleteProj(CurrProject.nProjId)
Map.refProjManagerVM.CurrProj = Nothing
Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.MruFileNames))
' CheckMe impostata come cancellazione FISICA dal DB...
DbControllers.m_ProjController.DeleteProj(CurrProject.nProjId, False)
Map.refProjManagerVM.CurrProj = Nothing
EgtResetModified()
Return True
End If
@@ -87,6 +87,13 @@ Public Module CurrentMachine
Return m_dMinOffset
End Get
End Property
' Attivazione Priority pareti
Private m_bIsEnabledPriority As Boolean = 0
Public ReadOnly Property bIsEnabledPriority As Boolean
Get
Return m_bIsEnabledPriority
End Get
End Property
#Region "Proprietà che leggono e scrivono i valori anche da o su file ini"
@@ -300,6 +307,11 @@ Public Module CurrentMachine
End Select
EgtLuaGetGlobNumVar("GWD.MIN_HEIGHT", m_dMinRawH)
EgtLuaGetGlobNumVar("GWD.MAX_HEIGHT", m_dMaxRawH)
If EgtLuaGetGlobNumVar("GWD.BTL_PRIORITY", nTemp) Then
m_bIsEnabledPriority = nTemp > 0
Else
m_bIsEnabledPriority = False
End If
Else
m_nViewDir = VT.ISO_SW
m_OrigCorner = MCH_CR.BR
@@ -308,6 +320,7 @@ Public Module CurrentMachine
m_NestingCorner = MCH_CR.BR
m_dMinRawH = 5
m_dMaxRawH = 500
m_bIsEnabledPriority = False
End If
' Cancello tavola globale
EgtLuaResetGlobVar("GWD")
@@ -346,6 +346,11 @@
<Setter Property="Margin" Value="10,0,10,0"/>
</Style>
<Style x:Key="Filter_TextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="2.5,0,2.5,0"/>
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- TextBox -->
@@ -802,4 +807,13 @@
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- DatePicker -->
<Style x:Key="Filter_DatePicker" TargetType="{x:Type DatePicker}">
<Setter Property="Height" Value="22" />
<Setter Property="Width" Value="100" />
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ -->
</ResourceDictionary>
Binary file not shown.
Binary file not shown.
+5 -4
View File
@@ -78,7 +78,8 @@ END
vers | data | note
---------|----------|---------
?? | 2021.04.12 | Riconciliazione su ramo TotalRebuild
?? | 2021.04.03 | Upgrade versione con DataLayer EF 6.4.4
?? | 2021.03.06 | Versione con StressTest WinForm x DataLayer EF 6.0
?? | 2021.03.05 | Prima versione con DataLayer EF 6.0
2.5.X | 2023.06.08 | Aggiunta cancellazione logica + descrizione Proj editabile
1.0.0 | 2021.04.12 | Riconciliazione su ramo TotalRebuild
0.9.0 | 2021.04.03 | Upgrade versione con DataLayer EF 6.4.4
0.8.0 | 2021.03.06 | Versione con StressTest WinForm x DataLayer EF 6.0
0.7.0 | 2021.03.05 | Prima versione con DataLayer EF 6.0
BIN
View File
Binary file not shown.