Skip to content

Commit

Permalink
PG-1260
Browse files Browse the repository at this point in the history
  -> renamed xaml files similarly as  delivered sample xaml files, so they are displayed right after the according ps script files in windows explorer
  • Loading branch information
coolOrange-Public committed Nov 30, 2022
1 parent c46cd0f commit 06f8233
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 21 deletions.
File renamed without changes.
8 changes: 3 additions & 5 deletions Files/powerEvents/Events/TransferERPBomViaFileTab.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Debugging
if((Get-Process -Id $PID).ProcessName -in @('powershell','powershell_ise')){
if((Get-Process -Id $PID).ProcessName -in @('powershell','powershell_ise') -and $host.Name.StartsWith('powerEvents') -eq $false){
Import-Module powerEvents

Open-VaultConnection -Server $env:Computername -Vault Vault -User Administrator -Password ""
Expand All @@ -25,7 +25,6 @@ if((Get-Process -Id $PID).ProcessName -in @('powershell','powershell_ise')){
$debugERPTab_window.ShowDialog()
}


Import-Module powergate
Connect-ERP -Service 'http://localhost:8080/PGS/ErpServices'
}
Expand All @@ -43,7 +42,7 @@ Set-LogFilePath -Path $logPath
Add-VaultTab -Name 'ERP BOM' -EntityType 'File' -Action {
param($selectedFile)

$erpBomTab_control = [Windows.Markup.XamlReader]::Load([System.Xml.XmlNodeReader]::new([xml](Get-Content "$PSScriptRoot\ERPBOM_Tab.xaml")))
$erpBomTab_control = [Windows.Markup.XamlReader]::Load([System.Xml.XmlNodeReader]::new([xml](Get-Content "$PSScriptRoot\TransferERPBomTab.xaml")))

$statusMessage_label = $erpItemTab_control.FindName('lblStatusMessage')
$erpServices = Get-ERPServices -Available
Expand All @@ -62,8 +61,7 @@ Add-VaultTab -Name 'ERP BOM' -EntityType 'File' -Action {

$erpItemTab_GoToBOMButton = $erpItemTab_control.FindName('GoToBomButton')

$number = GetEntityNumber -entity $selectedFile
$erpBomHeader = Get-ERPObject -EntitySet "BomHeaders" -Keys @{Number = $number } -Expand "BomRows"
$erpBomHeader = Get-ERPObject -EntitySet "BomHeaders" -Keys @{Number = $selectedFile._PartNumber } -Expand "BomRows"
if(-not $?) {
$statusMessage_label.Content = $Error[0]
$statusMessage_label.Foreground = "Red"
Expand Down
8 changes: 3 additions & 5 deletions Files/powerEvents/Events/TransferERPBomViaItemTab.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Debugging
if((Get-Process -Id $PID).ProcessName -in @('powershell','powershell_ise')){
if((Get-Process -Id $PID).ProcessName -in @('powershell','powershell_ise') -and $host.Name.StartsWith('powerEvents') -eq $false){
Import-Module powerEvents

Open-VaultConnection -Server $env:Computername -Vault Vault -User Administrator -Password ""
Expand All @@ -25,7 +25,6 @@ if((Get-Process -Id $PID).ProcessName -in @('powershell','powershell_ise')){
$debugERPTab_window.ShowDialog()
}


Import-Module powergate
Connect-ERP -Service 'http://localhost:8080/PGS/ErpServices'
}
Expand All @@ -43,7 +42,7 @@ Set-LogFilePath -Path $logPath
Add-VaultTab -Name 'ERP BOM' -EntityType 'Item' -Action {
param($selectedItem)

$erpBomTab_control = [Windows.Markup.XamlReader]::Load([System.Xml.XmlNodeReader]::new([xml](Get-Content "$PSScriptRoot\ERPBOM_Tab.xaml")))
$erpBomTab_control = [Windows.Markup.XamlReader]::Load([System.Xml.XmlNodeReader]::new([xml](Get-Content "$PSScriptRoot\TransferERPBomTab.xaml")))

$statusMessage_label = $erpItemTab_control.FindName('lblStatusMessage')
$erpServices = Get-ERPServices -Available
Expand All @@ -62,8 +61,7 @@ Add-VaultTab -Name 'ERP BOM' -EntityType 'Item' -Action {

$erpItemTab_GoToBOMButton = $erpItemTab_control.FindName('GoToBomButton')

$number = GetEntityNumber -entity $selectedFile
$erpBomHeader = Get-ERPObject -EntitySet "BomHeaders" -Keys @{Number = $number } -Expand "BomRows"
$erpBomHeader = Get-ERPObject -EntitySet "BomHeaders" -Keys @{Number = $selectedItem._Number } -Expand "BomRows"
if(-not $?) {
$statusMessage_label.Content = $Error[0]
$statusMessage_label.Foreground = "Red"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<ComboBox x:Name="MaterialTypeList" SelectedValue="{Binding Type}" DisplayMemberPath="Value" SelectedValuePath="Key" Grid.Column="4" Grid.Row="1" />

<Label Content="Base Unit of Measure" Grid.Column="3" Grid.Row="0" />
<ComboBox Name="UomList" SelectedValue="{Binding UnitOfMeasure}" SelectedValuePath="Key" DisplayMemberPath="Value" SelectedValuePath="Key" Grid.Column="4" Grid.Row="0" />
<ComboBox Name="UomList" SelectedValue="{Binding UnitOfMeasure}" DisplayMemberPath="Value" SelectedValuePath="Key" Grid.Column="4" Grid.Row="0" />

<Label x:Name="ModifiedDateLabel" Content="Last Modified Date" Grid.Column="3" Grid.Row="2" />
<TextBox x:Name="ModifiedDateTextBox" Text="{Binding ModifiedDate}" Grid.Column="4" Grid.Row="2" IsEnabled="False" />
Expand Down
8 changes: 3 additions & 5 deletions Files/powerEvents/Events/TransferERPItemViaFileTab.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Debugging
if((Get-Process -Id $PID).ProcessName -in @('powershell','powershell_ise')){
if((Get-Process -Id $PID).ProcessName -in @('powershell','powershell_ise') -and $host.Name.StartsWith('powerEvents') -eq $false){
Import-Module powerEvents

Open-VaultConnection -Server $env:Computername -Vault Vault -User Administrator -Password ""
Expand All @@ -25,7 +25,6 @@ if((Get-Process -Id $PID).ProcessName -in @('powershell','powershell_ise')){
$debugERPTab_window.ShowDialog()
}


Import-Module powergate
Connect-ERP -Service 'http://localhost:8080/PGS/ErpServices'
}
Expand All @@ -43,7 +42,7 @@ Set-LogFilePath -Path $logPath
Add-VaultTab -Name 'ERP Item' -EntityType 'File' -Action {
param($selectedFile)

$erpItemTab_control = [Windows.Markup.XamlReader]::Load([System.Xml.XmlNodeReader]::new([xml](Get-Content "$PSScriptRoot\ERPItem_Tab.xaml")))
$erpItemTab_control = [Windows.Markup.XamlReader]::Load([System.Xml.XmlNodeReader]::new([xml](Get-Content "$PSScriptRoot\TransferERPItemTab.xaml")))

$statusMessage_label = $erpItemTab_control.FindName('lblStatusMessage')
$erpServices = Get-ERPServices -Available
Expand All @@ -66,8 +65,7 @@ Add-VaultTab -Name 'ERP Item' -EntityType 'File' -Action {
$erpItemTab_CreateOrUpdateMaterialButton = $erpItemTab_control.FindName('CreateOrUpdateMaterialButton')
$erpItemTab_GoToMaterialButton = $erpItemTab_control.FindName('GoToMaterialButton')

$number = GetEntityNumber -entity $selectedFile
$erpMaterial = Get-ERPObject -EntitySet "Materials" -Keys @{ Number = $number }
$erpMaterial = Get-ERPObject -EntitySet "Materials" -Keys @{ Number = $selectedFile._PartNumber }
if(-not $?) {
$statusMessage_label.Content = $Error[0]
$statusMessage_label.Foreground = "Red"
Expand Down
8 changes: 3 additions & 5 deletions Files/powerEvents/Events/TransferERPItemViaItemTab.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#region Debugging
if((Get-Process -Id $PID).ProcessName -in @('powershell','powershell_ise')){
if((Get-Process -Id $PID).ProcessName -in @('powershell','powershell_ise') -and $host.Name.StartsWith('powerEvents') -eq $false){
Import-Module powerEvents

Open-VaultConnection -Server $env:Computername -Vault Vault -User Administrator -Password ""
Expand All @@ -25,7 +25,6 @@ if((Get-Process -Id $PID).ProcessName -in @('powershell','powershell_ise')){
$debugERPTab_window.ShowDialog()
}


Import-Module powergate
Connect-ERP -Service 'http://localhost:8080/PGS/ErpServices'
}
Expand All @@ -42,7 +41,7 @@ Set-LogFilePath -Path $logPath

Add-VaultTab -Name 'ERP Item' -EntityType 'Item' -Action {
param($selectedItem)
$erpItemTab_control = [Windows.Markup.XamlReader]::Load([System.Xml.XmlNodeReader]::new([xml](Get-Content "$PSScriptRoot\ERPItem_Tab.xaml")))
$erpItemTab_control = [Windows.Markup.XamlReader]::Load([System.Xml.XmlNodeReader]::new([xml](Get-Content "$PSScriptRoot\TransferERPItemTab.xaml")))

$statusMessage_label = $erpItemTab_control.FindName("lblStatusMessage")
$erpServices = Get-ERPServices -Available
Expand All @@ -65,8 +64,7 @@ Add-VaultTab -Name 'ERP Item' -EntityType 'Item' -Action {
$erpItemTab_CreateOrUpdateMaterialButton = $erpItemTab_control.FindName('CreateOrUpdateMaterialButton')
$erpItemTab_GoToMaterialButton = $erpItemTab_control.FindName('GoToMaterialButton')

$number = GetEntityNumber -entity $selectedItem
$erpMaterial = Get-ERPObject -EntitySet "Materials" -Keys @{ Number = $number }
$erpMaterial = Get-ERPObject -EntitySet "Materials" -Keys @{ Number = $selectedItem._Number }
if(-not $?) {
$statusMessage_label.Content = $Error[0]
$statusMessage_label.Foreground = "Red"
Expand Down

0 comments on commit 06f8233

Please sign in to comment.