VERSION 5.00
Begin VB.Form frmMain 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "frmMain"
   ClientHeight    =   1965
   ClientLeft      =   45
   ClientTop       =   345
   ClientWidth     =   5025
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1965
   ScaleWidth      =   5025
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton btnStart 
      Caption         =   ""
      Height          =   615
      Left            =   1080
      TabIndex        =   1
      Top             =   240
      Width           =   2895
   End
   Begin VB.CommandButton btnShowProperties 
      Caption         =   " "
      Height          =   615
      Left            =   1080
      TabIndex        =   0
      Top             =   1080
      Width           =   2895
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private ECR As Object

Private Sub Demo()
'  
  ECR.DeviceEnabled = True
  If ECR.ResultCode <> 0 Then
    Exit Sub
  End If

'   
  If ECR.GetStatus <> 0 Then
    Exit Sub
  End If

'       
  If ECR.Fiscal Then
    If MsgBox(" !    ?", vbICONEXCLAMATION + vbYesNo) = vbNo Then
      Exit Sub
    End If
  End If

'    ,   
  If ECR.CheckState <> 0 Then
    If ECR.CancelCheck <> 0 Then
      Exit Sub
    End If
  End If

'     Z-
  If ECR.SessionOpened Then
    '     
    ECR.Password = "30"
    '      
    ECR.Mode = 3
    If ECR.SetMode <> 0 Then
      Exit Sub
    End If
    '  
    ECR.ReportType = 1
    If ECR.Report <> 0 Then
      Exit Sub
    End If
  End If

'    
  '   
  ECR.Password = "1"
  '    
  ECR.Mode = 1
  If ECR.SetMode <> 0 Then
    Exit Sub
  End If

'   
  '  
  ECR.Name = ""
  ECR.Price = 10.45
  ECR.Quantity = 1
  ECR.Department = 2
  If ECR.Registration <> 0 Then
    Exit Sub
  End If
  '     
  ECR.Percents = 10
  ECR.Destination = 1
  If ECR.PercentsDiscount <> 0 Then
    Exit Sub
  End If
  '  
  ECR.Name = ""
  ECR.Price = 25
  ECR.Quantity = 5
  ECR.Department = 1
  If ECR.Registration <> 0 Then
    Exit Sub
  End If
  '     
  ECR.Summ = 10.4
  ECR.Destination = 0
  If ECR.SummDiscount <> 0 Then
    Exit Sub
  End If
  '         
  ECR.TypeClose = 0
  If ECR.CloseCheck <> 0 Then
    Exit Sub
  End If

'   
  '  
  ECR.Name = ""
  ECR.Price = 10.45
  ECR.Quantity = 1
  ECR.Department = 2
  If ECR.Registration <> 0 Then
    Exit Sub
  End If
  '  
  ECR.Name = "-"
  ECR.Price = 25
  ECR.Quantity = 5
  ECR.Department = 1
  If ECR.Registration <> 0 Then
    Exit Sub
  End If
  '   
  If ECR.Storno <> 0 Then
    Exit Sub
  End If
  '  
  ECR.Name = ""
  ECR.Price = 25
  ECR.Quantity = 5
  ECR.Department = 1
  If ECR.Registration <> 0 Then
    Exit Sub
  End If
  '     
  ECR.Summ = 50
  ECR.Destination = 0
  If ECR.SummDiscount <> 0 Then
    Exit Sub
  End If
  '         
  ECR.Summ = 100
  ECR.TypeClose = 0
  If ECR.Delivery <> 0 Then
    Exit Sub
  End If

' 
  '  
  ECR.Name = "Dirol"
  ECR.Price = 7
  ECR.Quantity = 1
  If ECR.Annulate <> 0 Then
    Exit Sub
  End If
  '  
  ECR.Name = "Orbit"
  ECR.Price = 8
  ECR.Quantity = 2
  If ECR.Annulate <> 0 Then
    Exit Sub
  End If
  '  
  ECR.TypeClose = 0
  If ECR.CloseCheck <> 0 Then
    Exit Sub
  End If

' 
  '  
  ECR.Name = ""
  ECR.Price = 10.45
  ECR.Quantity = 1
  If ECR.Return <> 0 Then
    Exit Sub
  End If
  '  
  ECR.Name = ""
  ECR.Price = 99.99
  ECR.Quantity = 1.235
  If ECR.Return <> 0 Then
    Exit Sub
  End If
  '     
  ECR.Summ = 50
  ECR.Destination = 0
  If ECR.SummDiscount <> 0 Then
    Exit Sub
  End If
  '  
  ECR.TypeClose = 0
  If ECR.CloseCheck <> 0 Then
    Exit Sub
  End If

'  
  ECR.Summ = 400.5
  If ECR.CashIncome <> 0 Then
    Exit Sub
  End If

'  
  ECR.Summ = 121.34
  If ECR.CashOutcome <> 0 Then
    Exit Sub
  End If

' X - 
  '    
  ECR.Password = "29"
  '      
  ECR.Mode = 2
  If ECR.SetMode <> 0 Then
    Exit Sub
  End If
  '  
  ECR.ReportType = 2
  If ECR.Report <> 0 Then
    Exit Sub
  End If

' Z - 
  '     
  ECR.Password = "30"
  '      
  ECR.Mode = 3
  If ECR.SetMode <> 0 Then
    Exit Sub
  End If
  '  
  ECR.ReportType = 1
  If ECR.Report <> 0 Then
    Exit Sub
  End If

'    ,  -        
  If ECR.ResetMode <> 0 Then
    Exit Sub
  End If

'  
  ECR.DeviceEnabled = False
  If ECR.ResultCode <> 0 Then
    Exit Sub
  End If

  A = MsgBox("   .", vbInformation + vbOKOnly)
End Sub

Private Sub btnShowProperties_Click()
    A = ECR.ShowProperties
End Sub

Private Sub btnStart_Click()
    btnStart.Enabled = False
    btnShowProperties.Enabled = False
    
    Demo
    If ECR.ResultCode <> 0 Then
        A = MsgBox(" : " + ECR.ResultDescription + "!", vbCritical + vbOKOnly)
    End If
    
    btnStart.Enabled = True
    btnShowProperties.Enabled = True
End Sub

Private Sub Form_Load()
    On Error GoTo NotOLE
'     
'       ,     
    Set ECR = CreateObject("AddIn.FprnM45")
    Exit Sub
NotOLE: '    OLE-
    A = MsgBox("    AddIn.FprnM45", vbCritical + vbOKOnly)
    Unload Me
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Set ECR = Nothing
End Sub
