First create solution

This commit is contained in:
2017-03-08 11:21:27 +01:00
commit a2fb86bacf
5508 changed files with 1082238 additions and 0 deletions
@@ -0,0 +1,45 @@
Imports System
Imports System.ComponentModel
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Imports DevExpress.ExpressApp
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Persistent.Validation
<DefaultClassOptions()> _
<NonPersistent()> _
<NavigationItem(False), CreatableItem(False)> _
Public Class RecipeExecutionSimplePopupFrom
Inherits BaseObject
Property RecipeFrom As RecipeFrom
Property StorageComputed As StorageComputed
Property QTTNeed As Double
Property QTTDifferent As Double
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
End Sub
End Class
<DefaultClassOptions()> _
<NonPersistent()> _
<NavigationItem(False), CreatableItem(False)> _
Public Class RecipeExecutionSimplePopupTo
Inherits BaseObject
Property RecipeTo As RecipeTo
Property StorageComputed As StorageComputed
Property QTTNeed As Double
Property QTTDifferent As Double
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
End Sub
End Class
@@ -0,0 +1,28 @@
Imports System
Imports System.ComponentModel
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Imports DevExpress.ExpressApp
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Persistent.Validation
<DefaultClassOptions()> _
<NonPersistent()> _
<NavigationItem(False), CreatableItem(False)> _
Public Class RecipePopup
Inherits BaseObject
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
End Sub
Property RowGroup1 As String 'Szöveges csoportosítás (nem kötelezõ)
Property Change_RowGroup1 As Boolean = False
Property RowGroup2 As String 'Szöveges másodlagos csoportosítás (nem kötelezõ)
Property Change_RowGroup2 As Boolean = False
End Class
@@ -0,0 +1,137 @@
Imports System
Imports System.ComponentModel
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Imports DevExpress.ExpressApp
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Persistent.Validation
Imports DevExpress.ExpressApp.ConditionalAppearance
<DefaultClassOptions()> _
<NavigationItem("BusinessStocks")> _
<Appearance("Recipe - Disable DocumentNumber", AppearanceItemType.ViewItem, "1=1", TargetItems:="DocumentNumber", Enabled:=False)> _
<Appearance("Recipe - Disable UserCreated", AppearanceItemType.ViewItem, "1=1", TargetItems:="UserCreated", Enabled:=False)> _
<Appearance("Recipe - Disable ObjectCreated", AppearanceItemType.ViewItem, "1=1", TargetItems:="ObjectCreated", Enabled:=False)> _
Public Class Recipe 'Gygártási receptek
Inherits BaseObject
Private _RecipeType As RecipeType
Private _CustomersFrom As CustomersFrom 'Saját cég
Private _DocumentNumber As String 'Recept sorszáma
Private _ShortName As String 'Recept megnevezése
Private _Description As String 'Recept leírása
Private _UserCreated As User
Private _ObjectCreated As Date
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
End Sub
Protected Overrides Sub OnSaving()
MyBase.OnSaving()
If Session.IsNewObject(Me) Then
ObjectCreated = GetSQLTime(Session)
UserCreated = Session.GetObjectByKey(Of User)(Session.GetKeyValue(SecuritySystem.CurrentUser))
End If
If String.IsNullOrEmpty(DocumentNumber) Then
If RecipeType IsNot Nothing Then
If RecipeType.NumberGenerator IsNot Nothing Then
DocumentNumber = RecipeType.NumberGenerator.GetNewNumber(RecipeType.NumberGenerator)
End If
End If
End If
End Sub
<ImmediatePostData()> _
<RuleRequiredField("Recipe-RecipeType", DefaultContexts.Save)> _
Property RecipeType As RecipeType
Get
Return _RecipeType
End Get
Set(value As RecipeType)
SetPropertyValue("RecipeType", _RecipeType, value)
End Set
End Property
Property CustomersFrom As CustomersFrom
Get
Return _CustomersFrom
End Get
Set(value As CustomersFrom)
SetPropertyValue("CustomersFrom", _CustomersFrom, value)
End Set
End Property
Property DocumentNumber As String
Get
Return _DocumentNumber
End Get
Set(value As String)
SetPropertyValue("DocumentNumber", _DocumentNumber, value)
End Set
End Property
<RuleRequiredField("Recipe-ShortName", DefaultContexts.Save)> _
Property ShortName As String
Get
Return _ShortName
End Get
Set(value As String)
SetPropertyValue("ShortName", _ShortName, value)
End Set
End Property
Property Description As String
Get
Return _Description
End Get
Set(value As String)
SetPropertyValue("Description", _Description, value)
End Set
End Property
<NonCloneable> _
Property UserCreated As User
Get
Return _UserCreated
End Get
Set(value As User)
SetPropertyValue("UserCreated", _UserCreated, value)
End Set
End Property
<NonCloneable> _
Property ObjectCreated As Date
Get
Return _ObjectCreated
End Get
Set(value As Date)
SetPropertyValue("ObjectCreated", _ObjectCreated, value)
End Set
End Property
<VisibleInListView(False)> _
<Association("Recipe-RecipeFrom", GetType(RecipeFrom))> _
ReadOnly Property RecipeFrom As XPCollection(Of RecipeFrom)
Get
Return GetCollection(Of RecipeFrom)("RecipeFrom")
End Get
End Property
<VisibleInListView(False)> _
<Association("Recipe-RecipeFromOther", GetType(RecipeFromOther))> _
ReadOnly Property RecipeFromOther As XPCollection(Of RecipeFromOther)
Get
Return GetCollection(Of RecipeFromOther)("RecipeFromOther")
End Get
End Property
<VisibleInListView(False)> _
<Association("Recipe-RecipeTo", GetType(RecipeTo))> _
ReadOnly Property RecipeTo As XPCollection(Of RecipeTo)
Get
Return GetCollection(Of RecipeTo)("RecipeTo")
End Get
End Property
<VisibleInListView(False)> _
<Association("Recipe-RecipeToOther", GetType(RecipeToOther))> _
ReadOnly Property RecipeToOther As XPCollection(Of RecipeToOther)
Get
Return GetCollection(Of RecipeToOther)("RecipeToOther")
End Get
End Property
End Class
@@ -0,0 +1,219 @@
Imports System
Imports System.ComponentModel
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Imports DevExpress.ExpressApp
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Persistent.Validation
Imports DevExpress.ExpressApp.ConditionalAppearance
<DefaultClassOptions()> _
<CreatableItem(False)> _
<NavigationItem("BusinessTransactions")> _
<Appearance("RecipeExecutionSimple - Disable DocumentNumber", AppearanceItemType.ViewItem, "1=1", TargetItems:="DocumentNumber", Enabled:=False)> _
<Appearance("RecipeExecutionSimple - Disable UserCreated", AppearanceItemType.ViewItem, "1=1", TargetItems:="UserCreated", Enabled:=False)> _
<Appearance("RecipeExecutionSimple - Disable ObjectCreated", AppearanceItemType.ViewItem, "1=1", TargetItems:="ObjectCreated", Enabled:=False)> _
Public Class RecipeExecutionSimple
Inherits BaseObject
Private _RecipeExecutionSimpleType As RecipeExecutionSimpleType
Private _CustomersFrom As CustomersFrom
Private _DocumentNumber As String
Private _ShortName As String
Private _Recipe As Recipe
Private _QTT As Double
Private _IsEditable As Boolean = True
Private _IsStorno As Boolean = False
Private _UserCreated As User
Private _ObjectCreated As Date
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
End Sub
Protected Overrides Sub OnSaving()
MyBase.OnSaving()
If Session.IsNewObject(Me) Then
ObjectCreated = GetSQLTime(Session)
UserCreated = Session.GetObjectByKey(Of User)(Session.GetKeyValue(SecuritySystem.CurrentUser))
End If
If String.IsNullOrEmpty(Me.DocumentNumber) Then
DocumentNumber = RecipeExecutionSimpleType.NumberGenerator.GetNewNumber(RecipeExecutionSimpleType.NumberGenerator)
End If
End Sub
Property RecipeExecutionSimpleType As RecipeExecutionSimpleType
Get
Return _RecipeExecutionSimpleType
End Get
Set(value As RecipeExecutionSimpleType)
SetPropertyValue("RecipeExecutionSimpleType", _RecipeExecutionSimpleType, value)
End Set
End Property
Property CustomersFrom As CustomersFrom
Get
Return _CustomersFrom
End Get
Set(value As CustomersFrom)
SetPropertyValue("CustomersFrom", _CustomersFrom, value)
End Set
End Property
Property DocumentNumber As String
Get
Return _DocumentNumber
End Get
Set(value As String)
SetPropertyValue("DocumentNumber", _DocumentNumber, value)
End Set
End Property
Property ShortName As String
Get
Return _ShortName
End Get
Set(value As String)
SetPropertyValue("ShortName", _ShortName, value)
End Set
End Property
<ImmediatePostData()> _
Property Recipe As Recipe
Get
Return _Recipe
End Get
Set(value As Recipe)
SetPropertyValue("Recipe", _Recipe, value)
If Not Session.IsObjectsLoading And Not Session.IsObjectsSaving Then
If value IsNot Nothing Then
ListPriceControls(value)
End If
End If
End Set
End Property
Property QTT As Double
Get
Return _QTT
End Get
Set(value As Double)
SetPropertyValue("QTT", _QTT, value)
End Set
End Property
Property IsEditable As Boolean
Get
Return _IsEditable
End Get
Set(value As Boolean)
SetPropertyValue("IsEditable", _IsEditable, value)
End Set
End Property
Property IsStorno As Boolean
Get
Return _IsStorno
End Get
Set(value As Boolean)
SetPropertyValue("IsStorno", _IsStorno, value)
End Set
End Property
<NonCloneable> _
Property UserCreated As User
Get
Return _UserCreated
End Get
Set(value As User)
SetPropertyValue("UserCreated", _UserCreated, value)
End Set
End Property
<NonCloneable> _
Property ObjectCreated As Date
Get
Return _ObjectCreated
End Get
Set(value As Date)
SetPropertyValue("ObjectCreated", _ObjectCreated, value)
End Set
End Property
Private Sub ListPriceControls(ByVal _Recipe As Recipe)
Dim _RecipeFrom As RecipeFrom
Dim _RecipeTo As RecipeTo
Dim _RecipeFrom_other As RecipeFromOther
Dim _RecipeTo_other As RecipeToOther
Dim _check_From_HUF As Double = 0
Dim _check_To_HUF As Double = 0
Dim _check_From_DEV As Double = 0
Dim _check_To_DEV As Double = 0
Dim _check_From_HUF_other As Double = 0
Dim _check_To_HUF_other As Double = 0
Dim _check_From_DEV_other As Double = 0
Dim _check_To_DEV_other As Double = 0
Dim _i As Integer = 0
Dim Products_from As Products
Dim Products_to As Products
'-------- Normál gyártás --------------
For Each _RecipeFrom In _Recipe.RecipeFrom
If _RecipeFrom IsNot Nothing Then
Products_from = TryCast(_RecipeFrom.Products, Products)
_i += 1
_check_From_HUF += _RecipeFrom.QTT * _RecipeFrom.ListPriceHUF
_check_From_DEV += _RecipeFrom.QTT * _RecipeFrom.ListPriceDEV
End If
Next
For Each _RecipeTo In _Recipe.RecipeTo
If _RecipeTo IsNot Nothing Then
Products_to = TryCast(_RecipeTo.Products, Products)
_check_To_HUF += _RecipeTo.QTT * _RecipeTo.ListPriceHUF
_check_To_DEV += _RecipeTo.QTT * _RecipeTo.ListPriceDEV
End If
Next
If Not _check_From_HUF < _check_To_HUF And Not _check_From_HUF = _check_To_HUF Then
MsgBox("Az összesített listaár 'HUF' értékek nem egyeznek!", MsgBoxStyle.OkOnly, "Figyelem, ellenõrzés!")
End If
If Not _check_From_DEV < _check_To_DEV And Not _check_From_DEV = _check_To_DEV Then
MsgBox("Az összesített listaár 'DEV' értékek nem egyeznek!", MsgBoxStyle.OkOnly, "Figyelem, ellenõrzés!")
End If
'-------- Egyéb gyártás --------------
For Each _RecipeFrom_other In _Recipe.RecipeFromOther
If _RecipeFrom_other IsNot Nothing Then
_check_From_HUF_other += _RecipeFrom_other.QTT * _RecipeFrom_other.ListPriceHUF
_check_From_DEV_other += _RecipeFrom_other.QTT * _RecipeFrom_other.ListPriceDEV
End If
Next
For Each _RecipeTo_other In _Recipe.RecipeToOther
If _RecipeTo_other IsNot Nothing Then
_check_To_HUF_other += _RecipeTo_other.QTT * _RecipeTo_other.ListPriceHUF
_check_To_DEV_other += _RecipeTo_other.QTT * _RecipeTo_other.ListPriceDEV
End If
Next
If Not _check_From_HUF_other < _check_To_HUF_other And Not _check_From_HUF_other = _check_To_HUF_other Then
MsgBox("Az 'Egyéb temékek' összesített listaár 'HUF' értékek nem egyeznek!", MsgBoxStyle.OkOnly, "Figyelem, ellenõrzés!")
End If
If Not _check_From_DEV_other < _check_To_DEV_other And Not _check_From_DEV_other = _check_To_DEV_other Then
MsgBox("Az 'Egyéb temékek' összesített listaár 'DEV' értékek nem egyeznek!", MsgBoxStyle.OkOnly, "Figyelem, ellenõrzés!")
End If
_check_From_HUF = 0
_check_To_HUF = 0
_check_From_DEV = 0
_check_To_DEV = 0
'------------------
_check_From_HUF_other = 0
_check_To_HUF_other = 0
_check_From_DEV_other = 0
_check_To_DEV_other = 0
End Sub
End Class
@@ -0,0 +1,73 @@
Imports System
Imports System.ComponentModel
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Imports DevExpress.ExpressApp
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Persistent.Validation
<DefaultClassOptions()> _
<NavigationItem("BusinessStocks")> _
Public Class RecipeExecutionSimpleType
Inherits BaseObject
Private _CustomersFrom As CustomersFrom
Private _ShortName As String
Private _Description As String
Private _NumberGenerator As NumberGenerator
Private _StorageMoveType As StorageMoveType
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
End Sub
<RuleRequiredField("RecipeExecutionSimpleType - CustomersFrom", DefaultContexts.Save)> _
Property CustomersFrom As CustomersFrom
Get
Return _CustomersFrom
End Get
Set(value As CustomersFrom)
SetPropertyValue("CustomersFrom", _CustomersFrom, value)
End Set
End Property
Property ShortName As String
Get
Return _ShortName
End Get
Set(value As String)
SetPropertyValue("ShortName", _ShortName, value)
End Set
End Property
Property Description As String
Get
Return _Description
End Get
Set(value As String)
SetPropertyValue("Description", _Description, value)
End Set
End Property
<RuleRequiredField("RecipeExecutionSimpleType - NumberGenerator", DefaultContexts.Save)> _
Property NumberGenerator As NumberGenerator
Get
Return _NumberGenerator
End Get
Set(value As NumberGenerator)
SetPropertyValue("NumberGenerator", _NumberGenerator, value)
End Set
End Property
<ImmediatePostData(True), DataSourceCriteria("MoveType=5 and MoveDirection=1")>
Property StorageMoveType As StorageMoveType
Get
Return _StorageMoveType
End Get
Set(value As StorageMoveType)
SetPropertyValue("StorageMoveType", _StorageMoveType, value)
End Set
End Property
End Class
@@ -0,0 +1,57 @@
Partial Class RecipeExecutionSimpleVC
<System.Diagnostics.DebuggerNonUserCode()> _
Public Sub New(ByVal Container As System.ComponentModel.IContainer)
MyClass.New()
'Required for Windows.Forms Class Composition Designer support
Container.Add(Me)
End Sub
'Component overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Component Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Component Designer
'It can be modified using the Component Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.aRecipeExecutionFrom = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
Me.aRecipeExecutionTo = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
'
'aRecipeExecutionFrom
'
Me.aRecipeExecutionFrom.AcceptButtonCaption = Nothing
Me.aRecipeExecutionFrom.CancelButtonCaption = Nothing
Me.aRecipeExecutionFrom.Caption = "Recipe Execution From"
Me.aRecipeExecutionFrom.Category = "ObjectsCreation"
Me.aRecipeExecutionFrom.Id = "aRecipeExecutionFrom"
Me.aRecipeExecutionFrom.TargetViewId = "RecipeExecutionSimple_DetailView"
Me.aRecipeExecutionFrom.ToolTip = Nothing
'
'aRecipeExecutionTo
'
Me.aRecipeExecutionTo.AcceptButtonCaption = Nothing
Me.aRecipeExecutionTo.CancelButtonCaption = Nothing
Me.aRecipeExecutionTo.Caption = "aRecipeExecutionTo"
Me.aRecipeExecutionTo.Category = "ObjectsCreation"
Me.aRecipeExecutionTo.Id = "aRecipeExecutionTo"
Me.aRecipeExecutionTo.TargetViewId = "RecipeExecutionSimple_DetailView"
Me.aRecipeExecutionTo.ToolTip = Nothing
End Sub
Friend WithEvents aRecipeExecutionFrom As DevExpress.ExpressApp.Actions.PopupWindowShowAction
Friend WithEvents aRecipeExecutionTo As DevExpress.ExpressApp.Actions.PopupWindowShowAction
End Class
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="aRecipeExecutionFrom.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 56</value>
</metadata>
<metadata name="aRecipeExecutionTo.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>221, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
@@ -0,0 +1,703 @@
Imports System
Imports System.ComponentModel
Imports System.Collections.Generic
Imports System.Diagnostics
Imports System.Text
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Actions
Imports DevExpress.Persistent.Base
Imports DevExpress.Data.Filtering
Imports DevExpress.Xpo
Imports DevExpress.ExpressApp.Utils
Imports DevExpress.Persistent.BaseImpl
Public Class RecipeExecutionSimpleVC
Inherits DevExpress.ExpressApp.ViewController
Dim _RecipeExecutionFrom_Collection As New ArrayList
Dim _RecipeExecutionTo_Collection As New ArrayList
Dim _VaildData As Boolean = True
Public Sub New()
MyBase.New()
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
If View.Id = "RecipeTo_ListView" Then
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", False)
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", False)
End If
If View.Id = "RecipeFrom_ListView" Then
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", False)
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", False)
End If
End Sub
Protected Overrides Sub OnDeactivated()
MyBase.OnDeactivated()
If View.Id = "RecipeTo_ListView" Then
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", True)
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", True)
End If
If View.Id = "RecipeFrom_ListView" Then
Frame.GetController(Of DevExpress.ExpressApp.SystemModule.LinkUnlinkController)().Active.SetItemValue("", True)
Frame.GetController(Of DevExpress.ExpressApp.CloneObject.CloneObjectViewController)().Active.SetItemValue("", True)
End If
End Sub
Private Sub aRecipeExecutionFrom_CustomizePopupWindowParams(sender As System.Object, e As DevExpress.ExpressApp.Actions.CustomizePopupWindowParamsEventArgs) Handles aRecipeExecutionFrom.CustomizePopupWindowParams
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _RecipeExecutionSimple As RecipeExecutionSimple = TryCast(View.SelectedObjects(0), RecipeExecutionSimple)
Dim _CS As CollectionSource = New CollectionSource(_onew, GetType(RecipeExecutionSimplePopupFrom))
_RecipeExecutionFrom_Collection.Clear()
Dim _RecipeExecutionSimplePopupFrom As RecipeExecutionSimplePopupFrom
For Each _RecipeFrom In _RecipeExecutionSimple.Recipe.RecipeFrom
_RecipeExecutionSimplePopupFrom = _onew.CreateObject(Of RecipeExecutionSimplePopupFrom)()
_RecipeExecutionSimplePopupFrom.RecipeFrom = _onew.GetObject(_RecipeFrom)
_RecipeExecutionSimplePopupFrom.StorageComputed = _onew.FindObject(Of StorageComputed) _
(CriteriaOperator.Parse("Products=? And Storage=?", _onew.GetObject(_RecipeFrom.Products), _onew.GetObject(_RecipeFrom.Storage)))
If _RecipeExecutionSimplePopupFrom.StorageComputed Is Nothing Then
_VaildData = False
Else
_RecipeExecutionSimplePopupFrom.QTTNeed = _RecipeExecutionSimple.QTT * _RecipeFrom.QTT
_RecipeExecutionSimplePopupFrom.QTTDifferent = _RecipeExecutionSimplePopupFrom.StorageComputed.QTTFree - _RecipeExecutionSimplePopupFrom.QTTNeed
If _RecipeExecutionSimplePopupFrom.QTTDifferent < 0 Then
_VaildData = False
End If
_RecipeExecutionFrom_Collection.Add(_RecipeExecutionSimplePopupFrom)
_CS.Add(_RecipeExecutionSimplePopupFrom)
End If
Next
e.View = Application.CreateListView("RecipeExecutionSimplePopupFrom_ListView", _CS, False)
End Sub
Private Sub aRecipeExecutionFrom_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.PopupWindowShowActionExecuteEventArgs) Handles aRecipeExecutionFrom.Execute
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _uow_lock As New UnitOfWork(_onew.Session.DataLayer)
Dim _User As User = _onew.GetObject(TryCast(SecuritySystem.CurrentUser, User))
Try
If _VaildData = False Then Throw New UserFriendlyException("Nem kivitelezhetõ a gyártás, mert egy vagy több alapanyag nem áll rendelkezésre!")
'--==Zárolás==--
'____________________________________________________________________________________________________________________
If Not LockingModule.LockObject(_uow_lock, GetType(StorageComputed), "-", _User) Then
Dim _LockingObject As LockingObject = _onew.FindObject(Of LockingObject)(CriteriaOperator.Parse("TableName=?", GetType(StorageComputed).Name + "-" + "-"))
Dim _Prompt As String = DevExpress.ExpressApp.Utils.CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions\StorageComputed", "CanNotStorageInByLocking")
Dim _Title As String = DevExpress.ExpressApp.Utils.CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxError")
MsgBox(String.Format(_Prompt, _LockingObject.User.FullName, _LockingObject.ObjectCreated), MsgBoxStyle.Information + MsgBoxStyle.OkOnly, _Title)
Exit Sub
Else
Dim _RecipeExecutionSimple As RecipeExecutionSimple = TryCast(View.SelectedObjects(0), RecipeExecutionSimple)
'----------------------------------------------------------
'Raktárak feltérképezése, kitárolási fejléc(ek) összerakása
'----------------------------------------------------------
Dim _StorageOutHeader_Collection As New ArrayList '<== Kitároláso fejlécEK kollekciója, annyi kitárolási fejléc, AHÁNY KÜLÖNBÖZÕ raktár van!!!
For Each _RecipeFrom As RecipeFrom In _RecipeExecutionSimple.Recipe.RecipeFrom
If _StorageOutHeader_Collection.Count = 0 Then
Dim _StorageOutHeader As New StorageOutHeader(_ocur.Session)
With _StorageOutHeader
.Storage = _ocur.GetObjectByKey(Of Storage)(_RecipeFrom.Storage.Oid)
.CustomersFrom = _ocur.GetObjectByKey(Of CustomersFrom)(_RecipeExecutionSimple.CustomersFrom.Oid)
.RecipeExecutionSimple = _RecipeExecutionSimple
.Customers = _ocur.GetObjectByKey(Of Customers)(TryCast(.Storage.CustomersFrom, Customers).Oid)
.StorageMoveType = _ocur.GetObject(_RecipeExecutionSimple.RecipeExecutionSimpleType.StorageMoveType)
End With
_StorageOutHeader_Collection.Add(_StorageOutHeader)
Else
For Each _StorageOutHeaderExist As StorageOutHeader In _StorageOutHeader_Collection
Dim _NewStorage As Boolean = False
If _StorageOutHeaderExist.Storage.Oid <> _RecipeFrom.Storage.Oid Then
_NewStorage = True
End If
If _NewStorage Then
Dim _StorageOutHeader As New StorageOutHeader(_ocur.Session)
With _StorageOutHeader
.Storage = _ocur.GetObjectByKey(Of Storage)(_RecipeFrom.Storage.Oid)
.Customers = _ocur.GetObjectByKey(Of CustomersFrom)(_RecipeExecutionSimple.CustomersFrom.Oid)
.RecipeExecutionSimple = _RecipeExecutionSimple
.Customers = _ocur.GetObjectByKey(Of Customers)(TryCast(.Storage.CustomersFrom, Customers))
.StorageMoveType = _ocur.GetObject(_RecipeExecutionSimple.RecipeExecutionSimpleType.StorageMoveType)
End With
_StorageOutHeader_Collection.Add(_StorageOutHeader)
End If
Exit For
Next
End If
Next
'----------------------------------------------------------
'Kitárolási sorok kitárolási fejlécekzeh rendelése, StorageComputed toszingálás
'----------------------------------------------------------
For Each _StorageOutHeader As StorageOutHeader In _StorageOutHeader_Collection
For Each _RecipeFrom As RecipeFrom In _RecipeExecutionSimple.Recipe.RecipeFrom
If _RecipeFrom.Storage.Oid = _StorageOutHeader.Storage.Oid Then
Dim _StorageOutRows As New StorageOutRows(_ocur.Session)
With _StorageOutRows
.StorageOutHeader = _StorageOutHeader
.RowIndex = _StorageOutHeader.StorageOutRows.Count
.Products = _ocur.GetObjectByKey(Of Products)(_RecipeFrom.Products.Oid)
End With
Dim _StorageInRows_Collection As New XPCollection(Of StorageInRows)(PersistentCriteriaEvaluationBehavior.InTransaction, _ocur.Session, _
CriteriaOperator.Parse("StorageInHeader.Storage=? and StorageInHeader.IsEditable=False and StorageInHeader.IsStorno=False and Products=?", _
_StorageOutHeader.Storage, _ocur.GetObjectByKey(Of Products)(_RecipeFrom.Products.Oid)))
_StorageInRows_Collection.Sorting.Add(New SortProperty("StorageInHeader.CreateDate", DB.SortingDirection.Ascending))
Dim _QTT_Mod As Double = _RecipeFrom.QTT * _RecipeExecutionSimple.QTT
For Each _StorageInRows As StorageInRows In _StorageInRows_Collection
Dim _QTT_Free As Double = _StorageInRows.QTT - _StorageInRows.QTT_Out - _StorageInRows.QTT_Out_Will
If _QTT_Free > 0 Then
If _QTT_Free < _QTT_Mod Then
_StorageInRows.QTT_Out_Will += _QTT_Free
_StorageOutRows.QTT_Will += _QTT_Free
_QTT_Mod -= _QTT_Free
'------- FIFO sor beszúrása
Dim _StorageOutRowsInRows As StorageOutRowsInRows = _ocur.FindObject(Of StorageOutRowsInRows)(CriteriaOperator.Parse("StorageInRows=? and StorageOutRows=?", _
_StorageInRows, _StorageOutRows), True)
If _StorageOutRowsInRows IsNot Nothing Then
_StorageOutRowsInRows.QTT += _QTT_Free
Else
_StorageOutRowsInRows = New StorageOutRowsInRows(_ocur.Session)
_StorageOutRowsInRows.StorageInRows = _StorageInRows
_StorageOutRowsInRows.StorageOutRows = _StorageOutRows
_StorageOutRowsInRows.QTT = _QTT_Free
End If
Else
_StorageInRows.QTT_Out_Will += _QTT_Mod
_StorageOutRows.QTT_Will += _QTT_Mod
'------- FIFO sor beszúrása
Dim _StorageOutRowsInRows As StorageOutRowsInRows = _ocur.FindObject(Of StorageOutRowsInRows)(CriteriaOperator.Parse("StorageInRows=? and StorageOutRows=?", _
_StorageInRows, _StorageOutRows), True)
If _StorageOutRowsInRows IsNot Nothing Then
_StorageOutRowsInRows.QTT += _QTT_Mod
Else
_StorageOutRowsInRows = New StorageOutRowsInRows(_ocur.Session)
_StorageOutRowsInRows.StorageInRows = _StorageInRows
_StorageOutRowsInRows.StorageOutRows = _StorageOutRows
_StorageOutRowsInRows.QTT = _QTT_Mod
End If
Exit For
End If
End If
Next
Dim _StorageComputed As StorageComputed = _ocur.FindObject(Of StorageComputed)(CriteriaOperator.Parse("Storage=? and Products=?", _
_StorageOutHeader.Storage, _ocur.GetObjectByKey(Of Products)(_RecipeFrom.Products.Oid)), True)
Dim _QTT_ReservedOut As Double = _StorageComputed.QTTReservedOut
Dim _QTT_Will_Out As Double = 0
Dim _StorageOutRows_Collection_R As New XPCollection(Of StorageOutRows)(PersistentCriteriaEvaluationBehavior.InTransaction, _ocur.Session, _
CriteriaOperator.Parse("QTT_Will>0 and StorageOutHeader.Storage=? and Products=?", _StorageOutHeader.Storage, _ocur.GetObjectByKey(Of Products)(_RecipeFrom.Products.Oid)))
For Each _StorageOutRows_R In _StorageOutRows_Collection_R
_QTT_Will_Out += _StorageOutRows_R.QTT_Will
Next
_StorageComputed.QTTFree = _StorageComputed.QTTFree - (_QTT_Will_Out - _QTT_ReservedOut)
_StorageComputed.QTTReservedOut = _QTT_Will_Out
End If
Next
Next
'----------------------------------------------------------
'Kitárolás(ok) véglegesítése, mozgástábla, StorageComputed baszogatás
'----------------------------------------------------------
For Each _StorageOutHeader As StorageOutHeader In _StorageOutHeader_Collection
_StorageOutHeader.IsEditable = False
_StorageOutHeader.IsFinalized = True
For Each _StorageOutRows As StorageOutRows In _StorageOutHeader.StorageOutRows
Dim _StorageOutRowsInRows_Collection As New XPCollection(Of StorageOutRowsInRows)(PersistentCriteriaEvaluationBehavior.InTransaction, _ocur.Session, _
CriteriaOperator.Parse("StorageOutRows=?", _StorageOutRows))
For Each _StorageOutRowsInRows In _StorageOutRowsInRows_Collection
If _StorageOutRowsInRows.QTT > 0 Then
Dim _StorageMoveEvents_Collection As New XPCollection(Of StorageMoveEvents)(PersistentCriteriaEvaluationBehavior.InTransaction, _ocur.Session, _
CriteriaOperator.Parse("StorageInRows=?", _StorageOutRowsInRows.StorageInRows))
_StorageMoveEvents_Collection.Sorting.Add(New SortProperty("ObjectCreated", DB.SortingDirection.Descending))
_StorageOutRowsInRows.StorageInRows.QTT_Out += _StorageOutRowsInRows.QTT
_StorageOutRowsInRows.StorageInRows.QTT_Out_Will -= _StorageOutRowsInRows.QTT
Dim _StorageMoveEvents As New StorageMoveEvents(_ocur.Session)
_StorageMoveEvents.StorageInRows = _StorageOutRowsInRows.StorageInRows
_StorageMoveEvents.StorageOutRows = _StorageOutRowsInRows.StorageOutRows
If _StorageMoveEvents_Collection.Count > 0 Then
_StorageMoveEvents.QTT_Free_Before = _StorageMoveEvents_Collection(0).QTT_Free_After
Else
_StorageMoveEvents.QTT_Free_Before = 0
End If
_StorageMoveEvents.QTT = (-1) * _StorageOutRowsInRows.QTT
_StorageMoveEvents.QTT_Free_After = _StorageMoveEvents.QTT_Free_Before + _StorageMoveEvents.QTT
_StorageMoveEvents.MoveEventsType = eMoveEventsType.StorageOutFinal
_StorageMoveEvents.ExecutionDate = _StorageOutRowsInRows.StorageOutRows.StorageOutHeader.CreateDate
End If
Next
_StorageOutRows.QTT += _StorageOutRows.QTT_Will
Dim _StorageComputed As StorageComputed = _ocur.FindObject(Of StorageComputed)(CriteriaOperator.Parse("Products=? and Storage=?", _
_StorageOutRows.Products, _StorageOutRows.StorageOutHeader.Storage), True)
_StorageComputed.QTTReservedOut -= _StorageOutRows.QTT_Will
_StorageOutRows.QTT_Will = 0
Next
Next
'----------------------------------------------------------
'Betárolás raktár(ak)ba
'----------------------------------------------------------
Dim _StorageInHeader_Collection As New ArrayList
For Each _RecipeTo As RecipeTo In _RecipeExecutionSimple.Recipe.RecipeTo
If _StorageInHeader_Collection.Count = 0 Then
Dim _StorageInHeader As New StorageInHeader(_ocur.Session)
With _StorageInHeader
.Storage = _ocur.GetObjectByKey(Of Storage)(_RecipeTo.Storage.Oid)
.RecipeExecutionSimple = _RecipeExecutionSimple
.IsEditable = False
.StorageMoveType = _ocur.GetObject(_RecipeExecutionSimple.RecipeExecutionSimpleType.StorageMoveType)
End With
_StorageInHeader_Collection.Add(_StorageInHeader)
Else
For Each _StorageInHeaderExist As StorageInHeader In _StorageInHeader_Collection
Dim _NewStorage As Boolean = False
If _StorageInHeaderExist.Storage.Oid <> _RecipeTo.Storage.Oid Then
_NewStorage = True
End If
If _NewStorage Then
Dim _StorageInHeader As New StorageInHeader(_ocur.Session)
With _StorageInHeader
.Storage = _onew.GetObjectByKey(Of Storage)(_RecipeTo.Storage.Oid)
.RecipeExecutionSimple = _RecipeExecutionSimple
.IsEditable = False
.StorageMoveType = _ocur.GetObject(_RecipeExecutionSimple.RecipeExecutionSimpleType.StorageMoveType)
End With
_StorageInHeader_Collection.Add(_StorageInHeader)
Exit For
End If
Next
End If
Next
For Each _RecipeTo As RecipeTo In _RecipeExecutionSimple.Recipe.RecipeTo
For Each _StorageInHeader As StorageInHeader In _StorageInHeader_Collection
If _RecipeTo.Storage.Oid = _StorageInHeader.Storage.Oid Then
Dim _StorageInRows As New StorageInRows(_ocur.Session)
With _StorageInRows
.StorageInHeader = _StorageInHeader
.Products = _RecipeTo.Products
.QTT_Will = _RecipeTo.QTT * _RecipeExecutionSimple.QTT
.RowIndex = _StorageInHeader.StorageInRows.Count
.AveragePriceInHUF = _RecipeTo.ListPriceHUF
End With
Dim _StorageComputed As StorageComputed = _ocur.FindObject(Of StorageComputed)(CriteriaOperator.Parse("Products=? and Storage=?", _
_RecipeTo.Products, _StorageInHeader.Storage))
If _StorageComputed Is Nothing Then
_StorageComputed = New StorageComputed(_ocur.Session)
With _StorageComputed
.Storage = _StorageInHeader.Storage
.Products = _RecipeTo.Products
.QTTReservedIn = _RecipeTo.QTT * _RecipeExecutionSimple.QTT
End With
Else
_StorageComputed.QTTReservedIn += _RecipeTo.QTT * _RecipeExecutionSimple.QTT
End If
End If
Next
Next
'----------------------------------------------------------
'Betárolás(ok) véglegeítése
'----------------------------------------------------------
For Each _StorageInHeader As StorageInHeader In _StorageInHeader_Collection
_StorageInHeader.IsEditable = False
_StorageInHeader.IsFinalized = True
For Each _StorageInRows As StorageInRows In _StorageInHeader.StorageInRows
Dim _StorageComputed As StorageComputed = _ocur.FindObject(Of StorageComputed)(CriteriaOperator.Parse("Products=? and Storage=?", _
_ocur.GetObject(_StorageInRows.Products), _ocur.GetObject(_StorageInHeader.Storage)))
Dim _StorageMoveEvents As New StorageMoveEvents(_ocur.Session)
If _StorageInRows.QTT_Will > 0 Then
_StorageInRows.QTT = _StorageInRows.QTT_Will
_StorageComputed.QTTFree += _StorageInRows.QTT_Will
_StorageComputed.QTTReservedIn -= _StorageInRows.QTT_Will
_StorageMoveEvents.StorageInRows = _ocur.GetObject(_StorageInRows)
_StorageMoveEvents.QTT = _StorageInRows.QTT_Will
_StorageMoveEvents.QTT_Free_After = _StorageComputed.QTTFree
_StorageMoveEvents.QTT_Free_Before = _StorageMoveEvents.QTT_Free_After - _StorageMoveEvents.QTT
_StorageMoveEvents.MoveEventsType = eMoveEventsType.StorageInFinal
_StorageMoveEvents.ExecutionDate = _StorageInRows.StorageInHeader.CreateDate
_StorageInRows.QTT_Will = 0
End If
Next
Next
_ocur.CommitChanges()
'----------------------------------------------------------
'Nyomtatványok
'----------------------------------------------------------
For Each _StorageOutHeader As StorageOutHeader In _StorageOutHeader_Collection
Dim _ReportData As ReportData = _onew.FindObject(Of ReportData)(CriteriaOperator.Parse("Oid=?", _StorageOutHeader.Storage.ReportOut.Oid), True)
If _ReportData IsNot Nothing Then
Frame.GetController(Of Reports.ReportServiceController).ShowPreview(_ReportData, CriteriaOperator.Parse("StorageOutRows.StorageOutHeader.DocumentNumber=?", _StorageOutHeader.DocumentNumber), True)
End If
Next
For Each _StorageInHeader As StorageInHeader In _StorageInHeader_Collection
Dim _ReportData As ReportData = _onew.FindObject(Of ReportData)(CriteriaOperator.Parse("Oid=?", _StorageInHeader.Storage.ReportIn.Oid), True)
If _ReportData IsNot Nothing Then
Frame.GetController(Of Reports.ReportServiceController).ShowPreview(_ReportData, CriteriaOperator.Parse("StorageInHeader.DocumentNumber =?", _StorageInHeader.DocumentNumber), True)
End If
Next
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
Finally
LockingModule.UnLockObject(_uow_lock, GetType(StorageComputed), "-", _User)
End Try
End Sub
Private Sub aRecipeExecutionTo_CustomizePopupWindowParams(sender As Object, e As CustomizePopupWindowParamsEventArgs) Handles aRecipeExecutionTo.CustomizePopupWindowParams
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _RecipeExecutionSimple As RecipeExecutionSimple = TryCast(View.SelectedObjects(0), RecipeExecutionSimple)
Dim _CS As CollectionSource = New CollectionSource(_onew, GetType(RecipeExecutionSimplePopupTo))
_RecipeExecutionTo_Collection.Clear()
Dim _RecipeExecutionSimplePopupTo As RecipeExecutionSimplePopupTo
For Each _RecipeTo In _RecipeExecutionSimple.Recipe.RecipeTo
_RecipeExecutionSimplePopupTo = _onew.CreateObject(Of RecipeExecutionSimplePopupTo)()
_RecipeExecutionSimplePopupTo.RecipeTo = _onew.GetObject(_RecipeTo)
_RecipeExecutionSimplePopupTo.StorageComputed = _onew.FindObject(Of StorageComputed) _
(CriteriaOperator.Parse("Products=? And Storage=?", _onew.GetObject(_RecipeTo.Products), _onew.GetObject(_RecipeTo.Storage)))
_RecipeExecutionSimplePopupTo.QTTNeed = _RecipeExecutionSimple.QTT * _RecipeTo.QTT
_RecipeExecutionSimplePopupTo.QTTDifferent = _RecipeExecutionSimplePopupTo.StorageComputed.QTTFree - _RecipeExecutionSimplePopupTo.QTTNeed
If _RecipeExecutionSimplePopupTo.QTTDifferent < 0 Then
_VaildData = False
End If
_RecipeExecutionTo_Collection.Add(_RecipeExecutionSimplePopupTo)
_CS.Add(_RecipeExecutionSimplePopupTo)
Next
e.View = Application.CreateListView("RecipeExecutionSimplePopupTo_ListView", _CS, False)
End Sub
Private Sub aRecipeExecutionTo_Execute(sender As Object, e As PopupWindowShowActionExecuteEventArgs) Handles aRecipeExecutionTo.Execute
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _uow_lock As New UnitOfWork(_onew.Session.DataLayer)
Dim _User As User = _onew.GetObject(TryCast(SecuritySystem.CurrentUser, User))
Try
If _VaildData = False Then Throw New UserFriendlyException("Nem kivitelezhetõ a gyártás, mert egy vagy több alapanyag nem áll rendelkezésre!")
'--==Zárolás==--
'____________________________________________________________________________________________________________________
If Not LockingModule.LockObject(_uow_lock, GetType(StorageComputed), "-", _User) Then
Dim _LockingObject As LockingObject = _onew.FindObject(Of LockingObject)(CriteriaOperator.Parse("TableName=?", GetType(StorageComputed).Name + "-" + "-"))
Dim _Prompt As String = DevExpress.ExpressApp.Utils.CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions\StorageComputed", "CanNotStorageInByLocking")
Dim _Title As String = DevExpress.ExpressApp.Utils.CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxError")
MsgBox(String.Format(_Prompt, _LockingObject.User.FullName, _LockingObject.ObjectCreated), MsgBoxStyle.Information + MsgBoxStyle.OkOnly, _Title)
Exit Sub
Else
Dim _RecipeExecutionSimple As RecipeExecutionSimple = TryCast(View.SelectedObjects(0), RecipeExecutionSimple)
'----------------------------------------------------------
'Raktárak feltérképezése, kitárolási fejléc(ek) összerakása
'----------------------------------------------------------
Dim _StorageOutHeader_Collection As New ArrayList '<== Kitároláso fejlécEK kollekciója, annyi kitárolási fejléc, AHÁNY KÜLÖNBÖZÕ raktár van!!!
For Each _RecipeTo As RecipeTo In _RecipeExecutionSimple.Recipe.RecipeTo
If _StorageOutHeader_Collection.Count = 0 Then
Dim _StorageOutHeader As New StorageOutHeader(_ocur.Session)
With _StorageOutHeader
.Storage = _ocur.GetObjectByKey(Of Storage)(_RecipeTo.Storage.Oid)
.CustomersFrom = _ocur.GetObjectByKey(Of CustomersFrom)(_RecipeExecutionSimple.CustomersFrom.Oid)
.RecipeExecutionSimple = _RecipeExecutionSimple
.Customers = _ocur.GetObjectByKey(Of Customers)(TryCast(.Storage.CustomersFrom, Customers).Oid)
.StorageMoveType = _ocur.GetObject(_RecipeExecutionSimple.RecipeExecutionSimpleType.StorageMoveType)
End With
_StorageOutHeader_Collection.Add(_StorageOutHeader)
Else
For Each _StorageOutHeaderExist As StorageOutHeader In _StorageOutHeader_Collection
Dim _NewStorage As Boolean = False
If _StorageOutHeaderExist.Storage.Oid <> _RecipeTo.Storage.Oid Then
_NewStorage = True
End If
If _NewStorage Then
Dim _StorageOutHeader As New StorageOutHeader(_ocur.Session)
With _StorageOutHeader
.Storage = _ocur.GetObjectByKey(Of Storage)(_RecipeTo.Storage.Oid)
.Customers = _ocur.GetObjectByKey(Of CustomersFrom)(_RecipeExecutionSimple.CustomersFrom.Oid)
.RecipeExecutionSimple = _RecipeExecutionSimple
.Customers = _ocur.GetObjectByKey(Of Customers)(TryCast(.Storage.CustomersFrom, Customers))
.StorageMoveType = _ocur.GetObject(_RecipeExecutionSimple.RecipeExecutionSimpleType.StorageMoveType)
End With
_StorageOutHeader_Collection.Add(_StorageOutHeader)
End If
Exit For
Next
End If
Next
'----------------------------------------------------------
'Kitárolási sorok kitárolási fejlécekzeh rendelése, StorageComputed toszingálás
'----------------------------------------------------------
For Each _StorageOutHeader As StorageOutHeader In _StorageOutHeader_Collection
For Each _RecipeTo As RecipeTo In _RecipeExecutionSimple.Recipe.RecipeTo
If _RecipeTo.Storage.Oid = _StorageOutHeader.Storage.Oid Then
Dim _StorageOutRows As New StorageOutRows(_ocur.Session)
With _StorageOutRows
.StorageOutHeader = _StorageOutHeader
.RowIndex = _StorageOutHeader.StorageOutRows.Count
.Products = _ocur.GetObjectByKey(Of Products)(_RecipeTo.Products.Oid)
End With
Dim _StorageInRows_Collection As New XPCollection(Of StorageInRows)(PersistentCriteriaEvaluationBehavior.InTransaction, _ocur.Session, _
CriteriaOperator.Parse("StorageInHeader.Storage=? and StorageInHeader.IsEditable=False and StorageInHeader.IsStorno=False and Products=?", _
_StorageOutHeader.Storage, _ocur.GetObjectByKey(Of Products)(_RecipeTo.Products.Oid)))
_StorageInRows_Collection.Sorting.Add(New SortProperty("StorageInHeader.CreateDate", DB.SortingDirection.Ascending))
Dim _QTT_Mod As Double = _RecipeTo.QTT * _RecipeExecutionSimple.QTT
For Each _StorageInRows As StorageInRows In _StorageInRows_Collection
Dim _QTT_Free As Double = _StorageInRows.QTT - _StorageInRows.QTT_Out - _StorageInRows.QTT_Out_Will
If _QTT_Free > 0 Then
If _QTT_Free < _QTT_Mod Then
_StorageInRows.QTT_Out_Will += _QTT_Free
_StorageOutRows.QTT_Will += _QTT_Free
_QTT_Mod -= _QTT_Free
'------- FIFO sor beszúrása
Dim _StorageOutRowsInRows As StorageOutRowsInRows = _ocur.FindObject(Of StorageOutRowsInRows)(CriteriaOperator.Parse("StorageInRows=? and StorageOutRows=?", _
_StorageInRows, _StorageOutRows), True)
If _StorageOutRowsInRows IsNot Nothing Then
_StorageOutRowsInRows.QTT += _QTT_Free
Else
_StorageOutRowsInRows = New StorageOutRowsInRows(_ocur.Session)
_StorageOutRowsInRows.StorageInRows = _StorageInRows
_StorageOutRowsInRows.StorageOutRows = _StorageOutRows
_StorageOutRowsInRows.QTT = _QTT_Free
End If
Else
_StorageInRows.QTT_Out_Will += _QTT_Mod
_StorageOutRows.QTT_Will += _QTT_Mod
'------- FIFO sor beszúrása
Dim _StorageOutRowsInRows As StorageOutRowsInRows = _ocur.FindObject(Of StorageOutRowsInRows)(CriteriaOperator.Parse("StorageInRows=? and StorageOutRows=?", _
_StorageInRows, _StorageOutRows), True)
If _StorageOutRowsInRows IsNot Nothing Then
_StorageOutRowsInRows.QTT += _QTT_Mod
Else
_StorageOutRowsInRows = New StorageOutRowsInRows(_ocur.Session)
_StorageOutRowsInRows.StorageInRows = _StorageInRows
_StorageOutRowsInRows.StorageOutRows = _StorageOutRows
_StorageOutRowsInRows.QTT = _QTT_Mod
End If
Exit For
End If
End If
Next
Dim _StorageComputed As StorageComputed = _ocur.FindObject(Of StorageComputed)(CriteriaOperator.Parse("Storage=? and Products=?", _
_StorageOutHeader.Storage, _ocur.GetObjectByKey(Of Products)(_RecipeTo.Products.Oid)), True)
Dim _QTT_ReservedOut As Double = _StorageComputed.QTTReservedOut
Dim _QTT_Will_Out As Double = 0
Dim _StorageOutRows_Collection_R As New XPCollection(Of StorageOutRows)(PersistentCriteriaEvaluationBehavior.InTransaction, _ocur.Session, _
CriteriaOperator.Parse("QTT_Will>0 and StorageOutHeader.Storage=? and Products=?", _StorageOutHeader.Storage, _ocur.GetObjectByKey(Of Products)(_RecipeTo.Products.Oid)))
For Each _StorageOutRows_R In _StorageOutRows_Collection_R
_QTT_Will_Out += _StorageOutRows_R.QTT_Will
Next
_StorageComputed.QTTFree = _StorageComputed.QTTFree - (_QTT_Will_Out - _QTT_ReservedOut)
_StorageComputed.QTTReservedOut = _QTT_Will_Out
End If
Next
Next
'----------------------------------------------------------
'Kitárolás(ok) véglegesítése, mozgástábla, StorageComputed baszogatás
'----------------------------------------------------------
For Each _StorageOutHeader As StorageOutHeader In _StorageOutHeader_Collection
_StorageOutHeader.IsEditable = False
_StorageOutHeader.IsFinalized = True
For Each _StorageOutRows As StorageOutRows In _StorageOutHeader.StorageOutRows
Dim _StorageOutRowsInRows_Collection As New XPCollection(Of StorageOutRowsInRows)(PersistentCriteriaEvaluationBehavior.InTransaction, _ocur.Session, _
CriteriaOperator.Parse("StorageOutRows=?", _StorageOutRows))
For Each _StorageOutRowsInRows In _StorageOutRowsInRows_Collection
If _StorageOutRowsInRows.QTT > 0 Then
Dim _StorageMoveEvents_Collection As New XPCollection(Of StorageMoveEvents)(PersistentCriteriaEvaluationBehavior.InTransaction, _ocur.Session, _
CriteriaOperator.Parse("StorageInRows=?", _StorageOutRowsInRows.StorageInRows))
_StorageMoveEvents_Collection.Sorting.Add(New SortProperty("ObjectCreated", DB.SortingDirection.Descending))
_StorageOutRowsInRows.StorageInRows.QTT_Out += _StorageOutRowsInRows.QTT
_StorageOutRowsInRows.StorageInRows.QTT_Out_Will -= _StorageOutRowsInRows.QTT
Dim _StorageMoveEvents As New StorageMoveEvents(_ocur.Session)
_StorageMoveEvents.StorageInRows = _StorageOutRowsInRows.StorageInRows
_StorageMoveEvents.StorageOutRows = _StorageOutRowsInRows.StorageOutRows
If _StorageMoveEvents_Collection.Count > 0 Then
_StorageMoveEvents.QTT_Free_Before = _StorageMoveEvents_Collection(0).QTT_Free_After
Else
_StorageMoveEvents.QTT_Free_Before = 0
End If
_StorageMoveEvents.QTT = (-1) * _StorageOutRowsInRows.QTT
_StorageMoveEvents.QTT_Free_After = _StorageMoveEvents.QTT_Free_Before + _StorageMoveEvents.QTT
_StorageMoveEvents.MoveEventsType = eMoveEventsType.StorageOutFinal
_StorageMoveEvents.ExecutionDate = _StorageOutRowsInRows.StorageOutRows.StorageOutHeader.CreateDate
End If
Next
_StorageOutRows.QTT += _StorageOutRows.QTT_Will
Dim _StorageComputed As StorageComputed = _ocur.FindObject(Of StorageComputed)(CriteriaOperator.Parse("Products=? and Storage=?", _
_StorageOutRows.Products, _StorageOutRows.StorageOutHeader.Storage), True)
_StorageComputed.QTTReservedOut -= _StorageOutRows.QTT_Will
_StorageOutRows.QTT_Will = 0
Next
Next
'----------------------------------------------------------
'Betárolás raktár(ak)ba
'----------------------------------------------------------
Dim _StorageInHeader_Collection As New ArrayList
For Each _RecipeFrom As RecipeFrom In _RecipeExecutionSimple.Recipe.RecipeFrom
If _StorageInHeader_Collection.Count = 0 Then
Dim _StorageInHeader As New StorageInHeader(_ocur.Session)
With _StorageInHeader
.Storage = _ocur.GetObjectByKey(Of Storage)(_RecipeFrom.Storage.Oid)
.RecipeExecutionSimple = _RecipeExecutionSimple
.IsEditable = False
.StorageMoveType = _ocur.GetObject(_RecipeExecutionSimple.RecipeExecutionSimpleType.StorageMoveType)
End With
_StorageInHeader_Collection.Add(_StorageInHeader)
Else
For Each _StorageInHeaderExist As StorageInHeader In _StorageInHeader_Collection
Dim _NewStorage As Boolean = False
If _StorageInHeaderExist.Storage.Oid <> _RecipeFrom.Storage.Oid Then
_NewStorage = True
End If
If _NewStorage Then
Dim _StorageInHeader As New StorageInHeader(_ocur.Session)
With _StorageInHeader
.Storage = _onew.GetObjectByKey(Of Storage)(_RecipeFrom.Storage.Oid)
.RecipeExecutionSimple = _RecipeExecutionSimple
.IsEditable = False
.StorageMoveType = _ocur.GetObject(_RecipeExecutionSimple.RecipeExecutionSimpleType.StorageMoveType)
End With
_StorageInHeader_Collection.Add(_StorageInHeader)
Exit For
End If
Next
End If
Next
For Each _RecipeFrom As RecipeFrom In _RecipeExecutionSimple.Recipe.RecipeFrom
For Each _StorageInHeader As StorageInHeader In _StorageInHeader_Collection
If _RecipeFrom.Storage.Oid = _StorageInHeader.Storage.Oid Then
Dim _StorageInRows As New StorageInRows(_ocur.Session)
With _StorageInRows
.StorageInHeader = _StorageInHeader
.Products = _RecipeFrom.Products
.QTT_Will = _RecipeFrom.QTT * _RecipeExecutionSimple.QTT
.RowIndex = _StorageInHeader.StorageInRows.Count
.AveragePriceInHUF = _RecipeFrom.ListPriceHUF
End With
Dim _StorageComputed As StorageComputed = _ocur.FindObject(Of StorageComputed)(CriteriaOperator.Parse("Products=? and Storage=?", _
_RecipeFrom.Products, _StorageInHeader.Storage))
If _StorageComputed Is Nothing Then
_StorageComputed = New StorageComputed(_ocur.Session)
With _StorageComputed
.Storage = _StorageInHeader.Storage
.Products = _RecipeFrom.Products
.QTTReservedIn = _RecipeFrom.QTT * _RecipeExecutionSimple.QTT
End With
Else
_StorageComputed.QTTReservedIn += _RecipeFrom.QTT * _RecipeExecutionSimple.QTT
End If
End If
Next
Next
'----------------------------------------------------------
'Betárolás(ok) véglegeítése
'----------------------------------------------------------
For Each _StorageInHeader As StorageInHeader In _StorageInHeader_Collection
_StorageInHeader.IsEditable = False
_StorageInHeader.IsFinalized = True
For Each _StorageInRows As StorageInRows In _StorageInHeader.StorageInRows
Dim _StorageComputed As StorageComputed = _ocur.FindObject(Of StorageComputed)(CriteriaOperator.Parse("Products=? and Storage=?", _
_ocur.GetObject(_StorageInRows.Products), _ocur.GetObject(_StorageInHeader.Storage)))
Dim _StorageMoveEvents As New StorageMoveEvents(_ocur.Session)
If _StorageInRows.QTT_Will > 0 Then
_StorageInRows.QTT = _StorageInRows.QTT_Will
_StorageComputed.QTTFree += _StorageInRows.QTT_Will
_StorageComputed.QTTReservedIn -= _StorageInRows.QTT_Will
_StorageMoveEvents.StorageInRows = _ocur.GetObject(_StorageInRows)
_StorageMoveEvents.QTT = _StorageInRows.QTT_Will
_StorageMoveEvents.QTT_Free_After = _StorageComputed.QTTFree
_StorageMoveEvents.QTT_Free_Before = _StorageMoveEvents.QTT_Free_After - _StorageMoveEvents.QTT
_StorageMoveEvents.MoveEventsType = eMoveEventsType.StorageInFinal
_StorageMoveEvents.ExecutionDate = _StorageInRows.StorageInHeader.CreateDate
_StorageInRows.QTT_Will = 0
End If
Next
Next
_ocur.CommitChanges()
'----------------------------------------------------------
'Nyomtatványok
'----------------------------------------------------------
For Each _StorageOutHeader As StorageOutHeader In _StorageOutHeader_Collection
Dim _ReportData As ReportData = _onew.FindObject(Of ReportData)(CriteriaOperator.Parse("Oid=?", _StorageOutHeader.Storage.ReportOut.Oid), True)
If _ReportData IsNot Nothing Then
Frame.GetController(Of Reports.ReportServiceController).ShowPreview(_ReportData, CriteriaOperator.Parse("StorageOutRows.StorageOutHeader.DocumentNumber=?", _StorageOutHeader.DocumentNumber), True)
End If
Next
For Each _StorageInHeader As StorageInHeader In _StorageInHeader_Collection
Dim _ReportData As ReportData = _onew.FindObject(Of ReportData)(CriteriaOperator.Parse("Oid=?", _StorageInHeader.Storage.ReportIn.Oid), True)
If _ReportData IsNot Nothing Then
Frame.GetController(Of Reports.ReportServiceController).ShowPreview(_ReportData, CriteriaOperator.Parse("StorageInHeader.DocumentNumber =?", _StorageInHeader.DocumentNumber), True)
End If
Next
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
Finally
LockingModule.UnLockObject(_uow_lock, GetType(StorageComputed), "-", _User)
End Try
End Sub
End Class
@@ -0,0 +1,110 @@
Imports System
Imports System.ComponentModel
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Imports DevExpress.ExpressApp
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Persistent.Validation
<DefaultClassOptions()> _
<NavigationItem(False), CreatableItem(False)> _
Public Class RecipeFrom
Inherits BaseObject
Private _Recipe As Recipe 'Recept
Private _RowGroup1 As String 'Szöveges csoportosítás (nem kötelezõ)
Private _RowGroup2 As String 'Szöveges másodlagos csoportosítás (nem kötelezõ)
Private _Products As Products 'Termék
Private _Storage As Storage 'Raktár
Private _QTT As Double 'Mennyiség
Private _ListPriceHUF As Double
Private _ListPriceDEV As Double
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
End Sub
<Association("Recipe-RecipeFrom", GetType(Recipe))> _
Property Recipe As Recipe
Get
Return _Recipe
End Get
Set(value As Recipe)
SetPropertyValue("Recipe", _Recipe, value)
End Set
End Property
Property RowGroup1 As String
Get
Return _RowGroup1
End Get
Set(value As String)
SetPropertyValue("RowGroup1", _RowGroup1, value)
End Set
End Property
Property RowGroup2 As String
Get
Return _RowGroup2
End Get
Set(value As String)
SetPropertyValue("RowGroup2", _RowGroup2, value)
End Set
End Property
<ImmediatePostData(True)> _
Property Products As Products
Get
Return _Products
End Get
Set(value As Products)
SetPropertyValue("Products", _Products, value)
If Not Session.IsObjectsLoading And Not Session.IsObjectsSaving Then
If value IsNot Nothing Then
If Me.ListPriceHUF = 0 Then
Me.ListPriceHUF = value.ListPriceOutHUF
End If
If Me.ListPriceDEV = 0 Then
Me.ListPriceDEV = value.ListPriceOutDEV
End If
End If
End If
End Set
End Property
Property Storage As Storage
Get
Return _Storage
End Get
Set(value As Storage)
SetPropertyValue("Storage", _Storage, value)
End Set
End Property
Property QTT As Double
Get
Return _QTT
End Get
Set(value As Double)
SetPropertyValue("QTT", _QTT, value)
End Set
End Property
<RuleRange(DefaultContexts.Save, 5, Double.MaxValue, TargetCriteria:="ListPriceDEV=0")> _
Property ListPriceHUF As Double
Get
Return _ListPriceHUF
End Get
Set(value As Double)
SetPropertyValue("ListPriceHUF", _ListPriceHUF, value)
End Set
End Property
<RuleRange(DefaultContexts.Save, 0.0001, Double.MaxValue, TargetCriteria:="ListPriceHUF=0")> _
Property ListPriceDEV As Double
Get
Return _ListPriceDEV
End Get
Set(value As Double)
SetPropertyValue("ListPriceDEV", _ListPriceDEV, value)
End Set
End Property
End Class
@@ -0,0 +1,104 @@
Imports System
Imports System.ComponentModel
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Imports DevExpress.ExpressApp
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Persistent.Validation
<DefaultClassOptions()> _
<NavigationItem(False), CreatableItem(False)> _
Public Class RecipeFromOther
Inherits BaseObject
Private _Recipe As Recipe 'Recept
Private _RowGroup1 As String 'Szöveges csoportosítás (nem kötelezõ)
Private _RowGroup2 As String 'Szöveges másodlagos csoportosítás (nem kötelezõ)
Private _ShortName As String
Private _Description As String
Private _QTT As Double 'Mennyiség
Private _Units As Units
Private _ListPriceHUF As Double
Private _ListPriceDEV As Double
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
End Sub
<Association("Recipe-RecipeFromOther", GetType(Recipe))> _
Property Recipe As Recipe
Get
Return _Recipe
End Get
Set(value As Recipe)
SetPropertyValue("Recipe", _Recipe, value)
End Set
End Property
Property RowGroup1 As String
Get
Return _RowGroup1
End Get
Set(value As String)
SetPropertyValue("RowGroup1", _RowGroup1, value)
End Set
End Property
Property RowGroup2 As String
Get
Return _RowGroup2
End Get
Set(value As String)
SetPropertyValue("RowGroup2", _RowGroup2, value)
End Set
End Property
Property ShortName As String
Get
Return _ShortName
End Get
Set(value As String)
SetPropertyValue("ShortName", _ShortName, value)
End Set
End Property
Property Description As String
Get
Return _Description
End Get
Set(value As String)
SetPropertyValue("Description", _Description, value)
End Set
End Property
Property QTT As Double
Get
Return _QTT
End Get
Set(value As Double)
SetPropertyValue("QTT", _QTT, value)
End Set
End Property
Property Units As Units
Get
Return _Units
End Get
Set(value As Units)
SetPropertyValue("Units", _Units, value)
End Set
End Property
Property ListPriceHUF As Double
Get
Return _ListPriceHUF
End Get
Set(value As Double)
SetPropertyValue("ListPriceHUF", _ListPriceHUF, value)
End Set
End Property
Property ListPriceDEV As Double
Get
Return _ListPriceDEV
End Get
Set(value As Double)
SetPropertyValue("ListPriceDEV", _ListPriceDEV, value)
End Set
End Property
End Class
@@ -0,0 +1,108 @@
Imports System
Imports System.ComponentModel
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Imports DevExpress.ExpressApp
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Persistent.Validation
<DefaultClassOptions()> _
<NavigationItem(False), CreatableItem(False)> _
Public Class RecipeTo
Inherits BaseObject
Private _Recipe As Recipe 'Recept
Private _RowGroup1 As String 'Szöveges csoportosítás (nem kötelezõ)
Private _RowGroup2 As String 'Szöveges másodlagos csoportosítás (nem kötelezõ)
Private _Products As Products 'Termék
Private _Storage As Storage 'Raktár
Private _QTT As Double 'Mennyiség
Private _ListPriceHUF As Double
Private _ListPriceDEV As Double
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
End Sub
<Association("Recipe-RecipeTo", GetType(Recipe))> _
Property Recipe As Recipe
Get
Return _Recipe
End Get
Set(value As Recipe)
SetPropertyValue("Recipe", _Recipe, value)
End Set
End Property
Property RowGroup1 As String
Get
Return _RowGroup1
End Get
Set(value As String)
SetPropertyValue("RowGroup1", _RowGroup1, value)
End Set
End Property
Property RowGroup2 As String
Get
Return _RowGroup2
End Get
Set(value As String)
SetPropertyValue("RowGroup2", _RowGroup2, value)
End Set
End Property
Property Products As Products
Get
Return _Products
End Get
Set(value As Products)
SetPropertyValue("Products", _Products, value)
If Not Session.IsObjectsLoading And Not Session.IsObjectsSaving Then
If value IsNot Nothing Then
If Me.ListPriceHUF = 0 Then
Me.ListPriceHUF = value.ListPriceOutHUF
End If
If Me.ListPriceDEV = 0 Then
Me.ListPriceDEV = value.ListPriceOutDEV
End If
End If
End If
End Set
End Property
Property Storage As Storage
Get
Return _Storage
End Get
Set(value As Storage)
SetPropertyValue("Storage", _Storage, value)
End Set
End Property
Property QTT As Double
Get
Return _QTT
End Get
Set(value As Double)
SetPropertyValue("QTT", _QTT, value)
End Set
End Property
<RuleRange(DefaultContexts.Save, 5, Double.MaxValue, TargetCriteria:="ListPriceDEV=0")> _
Property ListPriceHUF As Double
Get
Return _ListPriceHUF
End Get
Set(value As Double)
SetPropertyValue("ListPriceHUF", _ListPriceHUF, value)
End Set
End Property
<RuleRange(DefaultContexts.Save, 0.0001, Double.MaxValue, TargetCriteria:="ListPriceHUF=0")> _
Property ListPriceDEV As Double
Get
Return _ListPriceDEV
End Get
Set(value As Double)
SetPropertyValue("ListPriceDEV", _ListPriceDEV, value)
End Set
End Property
End Class
@@ -0,0 +1,104 @@
Imports System
Imports System.ComponentModel
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Imports DevExpress.ExpressApp
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Persistent.Validation
<DefaultClassOptions()> _
<NavigationItem(False), CreatableItem(False)> _
Public Class RecipeToOther
Inherits BaseObject
Private _Recipe As Recipe 'Recept
Private _RowGroup1 As String 'Szöveges csoportosítás (nem kötelezõ)
Private _RowGroup2 As String 'Szöveges másodlagos csoportosítás (nem kötelezõ)
Private _ShortName As String
Private _Description As String
Private _QTT As Double 'Mennyiség
Private _Units As Units
Private _ListPriceHUF As Double
Private _ListPriceDEV As Double
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
End Sub
<Association("Recipe-RecipeToOther", GetType(Recipe))> _
Property Recipe As Recipe
Get
Return _Recipe
End Get
Set(value As Recipe)
SetPropertyValue("Recipe", _Recipe, value)
End Set
End Property
Property RowGroup1 As String
Get
Return _RowGroup1
End Get
Set(value As String)
SetPropertyValue("RowGroup1", _RowGroup1, value)
End Set
End Property
Property RowGroup2 As String
Get
Return _RowGroup2
End Get
Set(value As String)
SetPropertyValue("RowGroup2", _RowGroup2, value)
End Set
End Property
Property ShortName As String
Get
Return _ShortName
End Get
Set(value As String)
SetPropertyValue("ShortName", _ShortName, value)
End Set
End Property
Property Description As String
Get
Return _Description
End Get
Set(value As String)
SetPropertyValue("Description", _Description, value)
End Set
End Property
Property QTT As Double
Get
Return _QTT
End Get
Set(value As Double)
SetPropertyValue("QTT", _QTT, value)
End Set
End Property
Property Units As Units
Get
Return _Units
End Get
Set(value As Units)
SetPropertyValue("Units", _Units, value)
End Set
End Property
Property ListPriceHUF As Double
Get
Return _ListPriceHUF
End Get
Set(value As Double)
SetPropertyValue("ListPriceHUF", _ListPriceHUF, value)
End Set
End Property
Property ListPriceDEV As Double
Get
Return _ListPriceDEV
End Get
Set(value As Double)
SetPropertyValue("ListPriceDEV", _ListPriceDEV, value)
End Set
End Property
End Class
@@ -0,0 +1,93 @@
Imports System
Imports System.ComponentModel
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Imports DevExpress.ExpressApp
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Persistent.Validation
<DefaultClassOptions()> _
<NavigationItem("BusinessStocks")> _
Public Class RecipeType
Inherits BaseObject
Private _Group1 As String
Private _Group2 As String
Private _ShortName As String 'Recept megnevezése
Private _Description As String 'Recept leírása
Private _NumberGenerator As NumberGenerator
Private _UserCreated As User
Private _ObjectCreated As Date
Public Sub New(ByVal session As Session)
MyBase.New(session)
End Sub
Public Overrides Sub AfterConstruction()
MyBase.AfterConstruction()
End Sub
Protected Overrides Sub OnSaving()
MyBase.OnSaving()
If Session.IsNewObject(Me) Then
ObjectCreated = GetSQLTime(Session)
UserCreated = Session.GetObjectByKey(Of User)(Session.GetKeyValue(SecuritySystem.CurrentUser))
End If
End Sub
Property Group1 As String
Get
Return _Group1
End Get
Set(value As String)
SetPropertyValue("Group1", _Group1, value)
End Set
End Property
Property Group2 As String
Get
Return _Group2
End Get
Set(value As String)
SetPropertyValue("Group2", _Group2, value)
End Set
End Property
Property ShortName As String
Get
Return _ShortName
End Get
Set(value As String)
SetPropertyValue("ShortName", _ShortName, value)
End Set
End Property
Property Description As String
Get
Return _Description
End Get
Set(value As String)
SetPropertyValue("Description", _Description, value)
End Set
End Property
<RuleRequiredField("RecipeType-NumberGenerator", DefaultContexts.Save)> _
Property NumberGenerator As NumberGenerator
Get
Return _NumberGenerator
End Get
Set(value As NumberGenerator)
SetPropertyValue("NumberGenerator", _NumberGenerator, value)
End Set
End Property
Property UserCreated As User
Get
Return _UserCreated
End Get
Set(value As User)
SetPropertyValue("UserCreated", _UserCreated, value)
End Set
End Property
Property ObjectCreated As Date
Get
Return _ObjectCreated
End Get
Set(value As Date)
SetPropertyValue("ObjectCreated", _ObjectCreated, value)
End Set
End Property
End Class
@@ -0,0 +1,67 @@
Partial Class RecipeVC
<System.Diagnostics.DebuggerNonUserCode()> _
Public Sub New(ByVal Container As System.ComponentModel.IContainer)
MyClass.New()
'Required for Windows.Forms Class Composition Designer support
Container.Add(Me)
End Sub
'Component overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Component Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Component Designer
'It can be modified using the Component Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.aRecipe_ChangeRowGroups = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
Me.aInsertServicesToRecipe = New DevExpress.ExpressApp.Actions.PopupWindowShowAction(Me.components)
'
'aRecipe_ChangeRowGroups
'
Me.aRecipe_ChangeRowGroups.AcceptButtonCaption = Nothing
Me.aRecipe_ChangeRowGroups.CancelButtonCaption = Nothing
Me.aRecipe_ChangeRowGroups.Caption = "Recipe Change RowGroups"
Me.aRecipe_ChangeRowGroups.ConfirmationMessage = Nothing
Me.aRecipe_ChangeRowGroups.Id = "aRecipe_ChangeRowGroups"
Me.aRecipe_ChangeRowGroups.ImageName = Nothing
Me.aRecipe_ChangeRowGroups.Shortcut = Nothing
Me.aRecipe_ChangeRowGroups.Tag = Nothing
Me.aRecipe_ChangeRowGroups.TargetObjectsCriteria = Nothing
Me.aRecipe_ChangeRowGroups.TargetViewId = Nothing
Me.aRecipe_ChangeRowGroups.ToolTip = Nothing
Me.aRecipe_ChangeRowGroups.TypeOfView = Nothing
'
'aInsertServicesToRecipe
'
Me.aInsertServicesToRecipe.AcceptButtonCaption = Nothing
Me.aInsertServicesToRecipe.CancelButtonCaption = Nothing
Me.aInsertServicesToRecipe.Caption = "Insert Services To Recipe"
Me.aInsertServicesToRecipe.ConfirmationMessage = Nothing
Me.aInsertServicesToRecipe.Id = "aInsertServicesToRecipe"
Me.aInsertServicesToRecipe.ImageName = Nothing
Me.aInsertServicesToRecipe.Shortcut = Nothing
Me.aInsertServicesToRecipe.Tag = Nothing
Me.aInsertServicesToRecipe.TargetObjectsCriteria = Nothing
Me.aInsertServicesToRecipe.TargetViewId = Nothing
Me.aInsertServicesToRecipe.ToolTip = Nothing
Me.aInsertServicesToRecipe.TypeOfView = Nothing
End Sub
Friend WithEvents aRecipe_ChangeRowGroups As DevExpress.ExpressApp.Actions.PopupWindowShowAction
Friend WithEvents aInsertServicesToRecipe As DevExpress.ExpressApp.Actions.PopupWindowShowAction
End Class
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="aRecipe_ChangeRowGroups.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="aInsertServicesToRecipe.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>221, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>
@@ -0,0 +1,172 @@
Imports System
Imports System.ComponentModel
Imports System.Collections.Generic
Imports System.Diagnostics
Imports System.Text
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Actions
Imports DevExpress.Persistent.Base
Public Class RecipeVC
Inherits DevExpress.ExpressApp.ViewController
Protected _selection As New ArrayList
Protected _noselect As Boolean = False
Public Sub New()
MyBase.New()
InitializeComponent()
RegisterActions(components)
End Sub
Protected Overrides Sub OnActivated()
MyBase.OnActivated()
Frame.GetController(Of RecipeVC).aRecipe_ChangeRowGroups.Active.SetItemValue("", False)
Frame.GetController(Of RecipeVC).aInsertServicesToRecipe.Active.SetItemValue("", False)
If View.Id = "Recipe_RecipeTo_ListView" Then
Frame.GetController(Of RecipeVC).aRecipe_ChangeRowGroups.Active.SetItemValue("", True)
AddHandler View.SelectionChanged, AddressOf RecipeLines_SelectionChange
End If
If View.Id = "Recipe_RecipeToOther_ListView" Then
Frame.GetController(Of RecipeVC).aInsertServicesToRecipe.Active.SetItemValue("", True)
Frame.GetController(Of RecipeVC).aRecipe_ChangeRowGroups.Active.SetItemValue("", True)
AddHandler View.SelectionChanged, AddressOf RecipeLines_SelectionChange
End If
If View.Id = "Recipe_RecipeFrom_ListView" Then
Frame.GetController(Of RecipeVC).aRecipe_ChangeRowGroups.Active.SetItemValue("", True)
AddHandler View.SelectionChanged, AddressOf RecipeLines_SelectionChange
End If
If View.Id = "Recipe_RecipeFromOther_ListView" Then
Frame.GetController(Of RecipeVC).aRecipe_ChangeRowGroups.Active.SetItemValue("", True)
AddHandler View.SelectionChanged, AddressOf RecipeLines_SelectionChange
End If
End Sub
Protected Overrides Sub OnDeactivated()
MyBase.OnDeactivated()
If View.Id = "Recipe_RecipeTo_ListView" Then
Frame.GetController(Of RecipeVC).aRecipe_ChangeRowGroups.Active.SetItemValue("", False)
RemoveHandler View.SelectionChanged, AddressOf RecipeLines_SelectionChange
End If
If View.Id = "Recipe_RecipeToOther_ListView" Then
Frame.GetController(Of RecipeVC).aRecipe_ChangeRowGroups.Active.SetItemValue("", False)
RemoveHandler View.SelectionChanged, AddressOf RecipeLines_SelectionChange
End If
If View.Id = "Recipe_RecipeFrom_ListView" Then
Frame.GetController(Of RecipeVC).aRecipe_ChangeRowGroups.Active.SetItemValue("", False)
RemoveHandler View.SelectionChanged, AddressOf RecipeLines_SelectionChange
End If
If View.Id = "Recipe_RecipeFromOther_ListView" Then
Frame.GetController(Of RecipeVC).aRecipe_ChangeRowGroups.Active.SetItemValue("", False)
RemoveHandler View.SelectionChanged, AddressOf RecipeLines_SelectionChange
End If
End Sub
Private Sub RecipeLines_SelectionChange(ByVal sender As Object, ByVal e As System.EventArgs)
If View Is Nothing Then Exit Sub
If View.SelectedObjects.Count > 0 Then
If _noselect = False Then
_selection.Clear()
For Each _SelectedLines In View.SelectedObjects
_selection.Add(_SelectedLines)
Next
End If
End If
End Sub
Private Sub aRecipe_ChangeRowGroups_Cancel(sender As Object, e As System.EventArgs) Handles aRecipe_ChangeRowGroups.Cancel
_noselect = False
End Sub
Private Sub aRecipe_ChangeRowGroups_CustomizePopupWindowParams(sender As System.Object, e As DevExpress.ExpressApp.Actions.CustomizePopupWindowParamsEventArgs) Handles aRecipe_ChangeRowGroups.CustomizePopupWindowParams
_noselect = True
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _RecipePopup As RecipePopup = _onew.CreateObject(Of RecipePopup)()
If View.SelectedObjects.Count > 0 Then
e.View = Application.CreateDetailView(_onew, "RecipePopup_DetailView", False, _RecipePopup)
Else
Throw New UserFriendlyException("Nincs kijelölt elem!")
End If
End Sub
Private Sub aRecipe_ChangeRowGroups_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.PopupWindowShowActionExecuteEventArgs) Handles aRecipe_ChangeRowGroups.Execute
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _RecipePopup As RecipePopup = TryCast(e.PopupWindow.View.SelectedObjects(0), RecipePopup)
If View.Id = "Recipe_RecipeFrom_ListView" Then
Dim _RecipeFrom As RecipeFrom
For Each _RecipeFrom In _selection
If _RecipePopup.Change_RowGroup1 Then
_RecipeFrom.RowGroup1 = _RecipePopup.RowGroup1
End If
If _RecipePopup.Change_RowGroup2 Then
_RecipeFrom.RowGroup2 = _RecipePopup.RowGroup2
End If
_RecipeFrom.Save()
Next
End If
If View.Id = "Recipe_RecipeFromOther_ListView" Then
Dim _RecipeFromOther As RecipeFromOther
For Each _RecipeFromOther In _selection
If _RecipePopup.Change_RowGroup1 Then
_RecipeFromOther.RowGroup1 = _RecipePopup.RowGroup1
End If
If _RecipePopup.Change_RowGroup2 Then
_RecipeFromOther.RowGroup2 = _RecipePopup.RowGroup2
End If
_RecipeFromOther.Save()
Next
End If
If View.Id = "Recipe_RecipeTo_ListView" Then
Dim _RecipeTo As RecipeTo
For Each _RecipeTo In _selection
If _RecipePopup.Change_RowGroup1 Then
_RecipeTo.RowGroup1 = _RecipePopup.RowGroup1
End If
If _RecipePopup.Change_RowGroup2 Then
_RecipeTo.RowGroup2 = _RecipePopup.RowGroup2
End If
_RecipeTo.Save()
Next
End If
If View.Id = "Recipe_RecipeToOther_ListView" Then
Dim _RecipeToOther As RecipeToOther
For Each _RecipeToOther In _selection
If _RecipePopup.Change_RowGroup1 Then
_RecipeToOther.RowGroup1 = _RecipePopup.RowGroup1
End If
If _RecipePopup.Change_RowGroup2 Then
_RecipeToOther.RowGroup2 = _RecipePopup.RowGroup2
End If
_RecipeToOther.Save()
Next
End If
_ocur.CommitChanges()
_noselect = False
End Sub
Private Sub aInsertServicesToRecipe_CustomizePopupWindowParams(sender As Object, e As DevExpress.ExpressApp.Actions.CustomizePopupWindowParamsEventArgs) Handles aInsertServicesToRecipe.CustomizePopupWindowParams
' Az akció a szolgáltatások listview-ját hozza fel.
Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace
Dim _CollectionSource As CollectionSource = New CollectionSource(_onew, GetType(Services))
e.View = Application.CreateListView("Services_ListView_Browse", _CollectionSource, False)
End Sub
Private Sub aInsertServicesToRecipe_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.PopupWindowShowActionExecuteEventArgs) Handles aInsertServicesToRecipe.Execute
'A popup-on kiválasztott szolgáltatásokból létrehoz a receptre szolgáltatás sorokat
Dim _ocur As Xpo.XPObjectSpace = TryCast(View.ObjectSpace, Xpo.XPObjectSpace)
Dim _Recipe As Recipe = TryCast(TryCast(TryCast(View, ListView).CollectionSource, PropertyCollectionSource).MasterObject, Recipe)
Dim _Services As Services
Dim _RecipeToOther_New As RecipeToOther
For Each _Services In e.PopupWindow.View.SelectedObjects
_RecipeToOther_New = _ocur.CreateObject(Of RecipeToOther)()
_RecipeToOther_New.Recipe = _ocur.GetObject(_Recipe)
_RecipeToOther_New.ShortName = _Services.ShortName
_RecipeToOther_New.Description = _Services.Description
_RecipeToOther_New.Units = _ocur.GetObject(_Services.Units)
_RecipeToOther_New.QTT = 1
_RecipeToOther_New.RowGroup1 = _Services.RowGroup1
_RecipeToOther_New.RowGroup2 = _Services.RowGroup2
_RecipeToOther_New.Save()
Next
_ocur.CommitChanges()
End Sub
End Class