VERSION 5.00
Begin VB.Form frmDPC_ConfigSpc 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "#Product configuration"
   ClientHeight    =   11025
   ClientLeft      =   45
   ClientTop       =   375
   ClientWidth     =   15210
   ControlBox      =   0   'False
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   11025
   ScaleWidth      =   15210
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Visible         =   0   'False
   Begin Project1.DPC_ConfigSpc DPC_ConfigSpc 
      Height          =   11070
      Left            =   -15
      TabIndex        =   0
      Top             =   -45
      Width           =   15240
      _ExtentX        =   26882
      _ExtentY        =   19526
   End
End
Attribute VB_Name = "frmDPC_ConfigSpc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Const SEP = "®©"
Private Const C_SEP As String = "@@"
Private Const SEP1 As String = "®"
Private Const SEP2 As String = "©"
Private Const SCREEN_NAME As String = "frmDPC_ConfigSpc"

Private mo_Tools As DPC_Tools
Private mo_Db As Object
Private ml_U_Code As Long

Property Let U_Code(al_Code As Long)
On Error GoTo ErrHandler

  DPC_ConfigSpc.U_Code = al_Code
  ml_U_Code = al_Code
  Exit Property
ErrHandler:
  Call ErrorMessage("U_Code.Let")
End Property

Property Let Language_Code(AString As String)
On Error GoTo ErrHandler

  DPC_ConfigSpc.Language_Code = AString
  Exit Property
ErrHandler:
  Call ErrorMessage("Language_Code.Let")
End Property

Property Let COF_Lang(as_Value As String)
On Error GoTo ErrHandler

  DPC_ConfigSpc.COF_Lang = as_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("COF_Lang.Let")
End Property

Public Property Set Tools(ByRef ao_Tools As Object)
On Error GoTo ErrorHandler

  Set DPC_ConfigSpc.Tools = ao_Tools
  Set mo_Tools = ao_Tools
  Exit Property
ErrorHandler:
  Call ErrorHandler("Tools.Set")
End Property

Public Property Set ArmDb(ByRef lo_ArmDb As Object)
On Error GoTo ErrHandler
        
  Set DPC_ConfigSpc.ArmDb = lo_ArmDb
  Set mo_Db = lo_ArmDb
  Exit Property
ErrHandler:
  Call ErrorMessage("ArmDb.Set")
End Property

Property Let CURR_Code(as_Value As String)
On Error GoTo ErrHandler

  DPC_ConfigSpc.CURR_Code = as_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("CURR_Code.Let")
End Property
              
Property Let CT_Code(as_Value As String)
On Error GoTo ErrHandler

  DPC_ConfigSpc.CT_Code = as_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("CT_Code.Let")
End Property
         
Property Let ValidityDate(ad_Value As Date)
On Error GoTo ErrHandler

  DPC_ConfigSpc.ValidityDate = ad_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("ValidityDate.Let")
End Property
         
Property Let OFD_Pos(al_Value As Long)
On Error GoTo ErrHandler

  DPC_ConfigSpc.OFD_Pos = al_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("OFD_Pos.Let")
End Property

Property Get OFD_Pos() As Long
On Error GoTo ErrHandler

  OFD_Pos = DPC_ConfigSpc.OFD_Pos
  Exit Property
ErrHandler:
  Call ErrorMessage("OFD_Pos.Get")
End Property

Property Let COF_Id(as_Value As String)
On Error GoTo ErrHandler

  DPC_ConfigSpc.COF_Id = as_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("COF_Id.Let")
End Property

Public Property Let LEN_Id(ByVal as_Value As Long)
On Error GoTo ErrHandler
  
  DPC_ConfigSpc.LEN_Id = as_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("LEN_Id.Let")
End Property

Public Property Let OFD_WshDat(ByVal ad_Value As Date)
On Error GoTo ErrHandler
  
  DPC_ConfigSpc.OFD_WshDat = ad_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("OFD_WshDat.Let")
End Property

Public Property Get OFD_WshDat() As Date
On Error GoTo ErrHandler
  
  OFD_WshDat = DPC_ConfigSpc.OFD_WshDat
  Exit Property
ErrHandler:
  Call ErrorMessage("OFD_WshDat.Get")
End Property

Public Property Let OFD_ShpDat(ByVal ad_Value As Date)
On Error GoTo ErrHandler
  
  DPC_ConfigSpc.OFD_ShpDat = ad_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("OFD_ShpDat.Let")
End Property

Public Property Get OFD_ShpDat() As Date
On Error GoTo ErrHandler
  
  OFD_ShpDat = DPC_ConfigSpc.OFD_ShpDat
  Exit Property
ErrHandler:
  Call ErrorMessage("OFD_ShpDat.Get")
End Property

Public Property Let OFD_DelDat(ByVal ad_Value As Date)
On Error GoTo ErrHandler
  
  DPC_ConfigSpc.OFD_DelDat = ad_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("OFD_DelDat.Let")
End Property

Public Property Get OFD_DelDat() As Date
On Error GoTo ErrHandler
  
  OFD_DelDat = DPC_ConfigSpc.OFD_DelDat
  Exit Property
ErrHandler:
  Call ErrorMessage("OFD_DelDat.Get")
End Property

Public Property Let IsProduction(ByVal ab_Value As Boolean)
On Error GoTo ErrHandler

  DPC_ConfigSpc.IsProduction = ab_Value
  Exit Property
ErrHandler:
  Call ErrorHandler("IsProduction.Let")
End Property

Public Property Get IsProduction() As Boolean
On Error GoTo ErrHandler

  IsProduction = DPC_ConfigSpc.IsProduction
  Exit Property
ErrHandler:
  Call ErrorHandler("IsProduction.Get")
End Property

Public Property Let IsTemplate(ByVal ab_Value As Boolean)
On Error GoTo ErrHandler

  DPC_ConfigSpc.IsTemplate = ab_Value
  Exit Property
ErrHandler:
  Call ErrorHandler("IsTemplate.Let")
End Property

Public Property Get IsTemplate() As Boolean
On Error GoTo ErrHandler

  IsTemplate = DPC_ConfigSpc.IsTemplate
  Exit Property
ErrHandler:
  Call ErrorHandler("IsTemplate.Get")
End Property

Public Property Get Result() As Boolean
On Error GoTo ErrHandler

  Result = DPC_ConfigSpc.Result
  Exit Property
ErrHandler:
  Call ErrorHandler("Result.Get")
End Property

Public Property Get product() As DPC_Product
On Error GoTo ErrHandler

  Set product = DPC_ConfigSpc.mo_PrdConfig
  Exit Property
ErrHandler:
  Call ErrorHandler("product.Get")
End Property

Public Sub Load_A_COM()
On Error GoTo ErrHandler
  
  Call DPC_ConfigSpc.Load_A_COM
  Caption = DPC_ConfigSpc.Caption
  Call mo_Tools.ChangeCharset(Me.Controls, gl_CodePage, gl_CodePage, Me)
  Exit Sub
ErrHandler:
  Call ErrorHandler("Load_A_Com")
End Sub

Public Sub Unload_A_COM()
On Error GoTo ErrHandler
  
  Call DPC_ConfigSpc.Unload_A_COM
  Exit Sub
ErrHandler:
  Call ErrorHandler("Unload_A_Com")
End Sub

Public Sub ItemAdd(ByVal as_PRD_Id As String)
On Error GoTo ErrHandler

  Call DPC_ConfigSpc.ItemAdd(as_PRD_Id)
  Exit Sub
ErrHandler:
  Call ErrorHandler("ItemAdd")
End Sub

Public Sub ItemNew(ByVal ae_CAT_Id As eDPCCategory, ByVal al_SYS_Id As Long)
On Error GoTo ErrHandler

  Call DPC_ConfigSpc.ItemNew(ae_CAT_Id, al_SYS_Id)
  Exit Sub
ErrHandler:
  Call ErrorHandler("ItemNew")
End Sub

Public Sub ItemUpdate(ByVal as_PRD_Id As String)
On Error GoTo ErrHandler

  Call DPC_ConfigSpc.ItemUpdate(as_PRD_Id)
  Exit Sub
ErrHandler:
  Call ErrorHandler("ItemUpdate")
End Sub

Public Sub LoadOffer(ByVal as_COF_Id As String, ByVal as_OFD_IdPar As String)
On Error GoTo ErrHandler

  Call DPC_ConfigSpc.LoadOffer(as_COF_Id, as_OFD_IdPar)
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadOffer")
End Sub

'Public Sub ApplyOffer(ByVal ao_OfferCollection As Collection)
'On Error GoTo ErrHandler
'
'  Call DPC_ConfigSpc.ApplyOffer(ao_OfferCollection)
'  Exit Sub
'ErrHandler:
'  Call ErrorHandler("ApplyOffer")
'End Sub

Public Sub ItemSave()
On Error GoTo ErrHandler

  Call DPC_ConfigSpc.ItemSave
  Exit Sub
ErrHandler:
  Call ErrorHandler("ItemSave")
End Sub

Public Function GenerateOfferDetail() As Collection
On Error GoTo ErrHandler

  Set GenerateOfferDetail = DPC_ConfigSpc.GenerateOfferDetail
  Exit Function
ErrHandler:
  Call ErrorHandler("GenerateOfferDetail")
End Function

Private Sub DPC_ConfigSpc_Quit()
On Error GoTo ErrHandler
  
  Hide
  Exit Sub
ErrHandler:
  Call ErrorMessage("DPC_ConfigSpc_Quit")
End Sub

Private Sub Form_Activate()
On Error GoTo ErrHandler

  'Call DPC_ConfigSpc.SetFrameFocus
  Exit Sub
ErrHandler:
  Call ErrorMessage("Form_Activate")
End Sub

' display standard error message
Public Sub ErrorMessage(ByVal as_Fct As String)
    Dim ls_ErrSource As String
    Dim ls_errDescription As String
    Dim ls_Message As String
    
    ls_ErrSource = as_Fct & SEP1 & Err.Source
    ls_errDescription = Err.Description
    ls_Message = SCREEN_NAME & " exception. Nr:" & Err.Number & ",Desc: " & ls_errDescription & ",Src:" & ls_ErrSource & "@"
    Call mo_Tools.LogMessage(mo_Db, ml_U_Code, SCREEN_NAME, ls_Message, "E")
    Call MsgBox("Error occured, please contact IT. Application will now shutdown." & vbCrLf & ls_ErrSource & vbCrLf & "Description: " & ls_errDescription, vbCritical, App.Title & " " & App.Major & "." & App.Minor & "." & App.Revision)
    End
End Sub

' Standard error handler
Private Sub ErrorHandler(ByVal as_Fct As String)
  
    Call Err.Raise(Err.Number, Me.Name & "." & as_Fct & SEP1 & Err.Source, Err.Description)
End Sub


