VERSION 5.00
Begin VB.Form frmDPC_PriceMgr 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Form2"
   ClientHeight    =   10830
   ClientLeft      =   45
   ClientTop       =   375
   ClientWidth     =   15105
   ControlBox      =   0   'False
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   10830
   ScaleWidth      =   15105
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Visible         =   0   'False
   Begin Project1.DPC_PriceMgr DPC_PriceMgr 
      Height          =   10800
      Left            =   60
      TabIndex        =   0
      Top             =   45
      Width           =   15060
      _ExtentX        =   26564
      _ExtentY        =   19050
   End
End
Attribute VB_Name = "frmDPC_PriceMgr"
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 = "DPC_PriceMgr"

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_PriceMgr.U_Code = al_Code
  ml_U_Code = al_Code
  Exit Property
ErrHandler:
  Call ErrorMessage("U_Code.Let")
End Property

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

  DPC_PriceMgr.LoginName = AString
  Exit Property
ErrHandler:
  Call ErrorMessage("LoginName.Let")
End Property

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

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

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

  Set mo_Tools = ao_Tools
  Set DPC_PriceMgr.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_PriceMgr.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_PriceMgr.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_PriceMgr.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_PriceMgr.ValidityDate = ad_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("ValidityDate.Let")
End Property
              
Property Let COF_Id(as_Value As String)
On Error GoTo ErrHandler

  DPC_PriceMgr.COF_Id = as_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("COF_Id.Let")
End Property
              
Property Let SP_CapKey(as_Value As String)
On Error GoTo ErrHandler

  DPC_PriceMgr.SP_CapKey = as_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("SP_CapKey.Let")
End Property

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

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

Public Sub Load_A_COM()
On Error GoTo ErrHandler
  
  Call DPC_PriceMgr.Load_A_COM
  Caption = DPC_PriceMgr.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
  
  DPC_PriceMgr.Unload_A_COM
  Exit Sub
ErrHandler:
  Call ErrorHandler("Unload_A_Com")
End Sub

Private Sub DPC_PriceMgr_Quit()
On Error GoTo ErrHandler
  
  Hide
  Exit Sub
ErrHandler:
  Call ErrorMessage("DPC_Subconstruction_Quit")
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

Private Sub Form_Resize()

  Call DPC_PriceMgr.Move(0, 0, Me.Width, Me.Height)
  Call DPC_PriceMgr.Resize
End Sub

