VERSION 5.00
Begin VB.Form Quot_SalesProject_View 
   BorderStyle     =   3  'Fixed Dialog
   ClientHeight    =   7545
   ClientLeft      =   240
   ClientTop       =   495
   ClientWidth     =   8160
   ClipControls    =   0   'False
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   7545
   ScaleWidth      =   8160
   ShowInTaskbar   =   0   'False
   Begin VB.Frame Frame2 
      Height          =   6555
      Left            =   20
      TabIndex        =   15
      Top             =   660
      Width           =   7335
      Begin VB.TextBox txt_Comment 
         Height          =   1575
         Left            =   180
         Locked          =   -1  'True
         MultiLine       =   -1  'True
         TabIndex        =   33
         Top             =   4560
         Width           =   6855
      End
      Begin VB.TextBox txt_ZIP 
         Height          =   315
         Left            =   5100
         Locked          =   -1  'True
         TabIndex        =   24
         Top             =   3000
         Width           =   1935
      End
      Begin VB.TextBox txt_Address2 
         Height          =   315
         Left            =   1440
         Locked          =   -1  'True
         TabIndex        =   23
         Top             =   2340
         Width           =   5595
      End
      Begin VB.TextBox txt_Address1 
         Height          =   315
         Left            =   1440
         Locked          =   -1  'True
         TabIndex        =   22
         Top             =   1920
         Width           =   5595
      End
      Begin VB.TextBox txt_Size 
         Height          =   315
         Left            =   4860
         Locked          =   -1  'True
         TabIndex        =   21
         Top             =   900
         Width           =   2175
      End
      Begin VB.TextBox txt_startdate 
         Height          =   315
         Left            =   1440
         Locked          =   -1  'True
         TabIndex        =   20
         Top             =   900
         Width           =   1395
      End
      Begin VB.TextBox txt_desc 
         Height          =   315
         Left            =   1440
         Locked          =   -1  'True
         TabIndex        =   19
         Top             =   300
         Width           =   5595
      End
      Begin VB.TextBox txt_Town 
         Height          =   315
         Left            =   1440
         Locked          =   -1  'True
         TabIndex        =   18
         Top             =   3000
         Width           =   2535
      End
      Begin VB.TextBox txt_UnitOfMeasure 
         Height          =   315
         Left            =   4860
         Locked          =   -1  'True
         TabIndex        =   17
         Top             =   1320
         Width           =   2175
      End
      Begin VB.TextBox txt_Country 
         Height          =   315
         Left            =   1440
         Locked          =   -1  'True
         TabIndex        =   16
         Top             =   3540
         Width           =   2535
      End
      Begin VB.Label lbl_Comment 
         Caption         =   "Comments"
         Height          =   315
         Left            =   180
         TabIndex        =   34
         Top             =   4200
         Width           =   4695
      End
      Begin VB.Label lbl_Zip 
         Caption         =   "ZIP"
         Height          =   435
         Left            =   4320
         TabIndex        =   32
         Top             =   3000
         Width           =   795
      End
      Begin VB.Label lbl_Country 
         Caption         =   "Country"
         Height          =   435
         Left            =   180
         TabIndex        =   31
         Top             =   3540
         Width           =   1275
      End
      Begin VB.Label lbl_Town 
         Caption         =   "Town"
         Height          =   435
         Left            =   180
         TabIndex        =   30
         Top             =   3000
         Width           =   1275
      End
      Begin VB.Label lbl_Address 
         Caption         =   "Address"
         Height          =   435
         Left            =   180
         TabIndex        =   29
         Top             =   1920
         Width           =   1275
      End
      Begin VB.Label lbl_UnitOfMeasure 
         Caption         =   "Unit of measure"
         Height          =   435
         Left            =   3660
         TabIndex        =   28
         Top             =   1320
         Width           =   1215
      End
      Begin VB.Label lbl_Size 
         Caption         =   "Size"
         Height          =   435
         Left            =   3660
         TabIndex        =   27
         Top             =   900
         Width           =   1215
      End
      Begin VB.Label lbl_StartDate 
         Caption         =   "Start date"
         Height          =   435
         Left            =   180
         TabIndex        =   26
         Top             =   900
         Width           =   1275
      End
      Begin VB.Label lbl_Name 
         Caption         =   "Name"
         Height          =   435
         Left            =   180
         TabIndex        =   25
         Top             =   300
         Width           =   1275
      End
   End
   Begin VB.TextBox txt_Status 
      Height          =   315
      Left            =   5220
      Locked          =   -1  'True
      TabIndex        =   11
      TabStop         =   0   'False
      Top             =   0
      Width           =   2775
   End
   Begin VB.Frame Frame1 
      Height          =   75
      Left            =   0
      TabIndex        =   10
      Top             =   420
      Width           =   8115
   End
   Begin VB.ComboBox cbo_Version 
      Height          =   315
      Left            =   3660
      Style           =   2  'Dropdown List
      TabIndex        =   9
      Top             =   0
      Width           =   615
   End
   Begin VB.TextBox txt_QuotCode 
      Height          =   315
      Left            =   720
      Locked          =   -1  'True
      TabIndex        =   8
      TabStop         =   0   'False
      Top             =   0
      Width           =   1935
   End
   Begin VB.PictureBox ButtonBox 
      Appearance      =   0  'Flat
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H80000005&
      ClipControls    =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   6495
      Left            =   7450
      ScaleHeight     =   6465
      ScaleWidth      =   630
      TabIndex        =   0
      Top             =   720
      Width           =   665
      Begin VB.PictureBox pic_help 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   384
         Left            =   8640
         ScaleHeight     =   390
         ScaleWidth      =   390
         TabIndex        =   6
         Top             =   120
         Width           =   384
      End
      Begin VB.PictureBox pic_quit 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   60
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   3
         Top             =   4200
         Width           =   480
      End
      Begin VB.PictureBox pic_search 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   384
         Left            =   1920
         ScaleHeight     =   390
         ScaleWidth      =   390
         TabIndex        =   2
         Top             =   120
         Width           =   384
      End
      Begin VB.PictureBox pic_print 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   60
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   5
         Top             =   3000
         Width           =   480
      End
      Begin VB.PictureBox pic_log 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   60
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   4
         Top             =   2400
         Width           =   480
      End
      Begin VB.PictureBox pic_refresh 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DrawStyle       =   5  'Transparent
         Height          =   480
         Left            =   60
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   1
         Top             =   3600
         Width           =   480
      End
   End
   Begin VB.Label lbl_Code 
      Caption         =   "Code"
      Height          =   315
      Left            =   120
      TabIndex        =   14
      Top             =   60
      Width           =   615
   End
   Begin VB.Label lbl_Status 
      Caption         =   "Status"
      Height          =   315
      Left            =   4500
      TabIndex        =   13
      Top             =   60
      Width           =   615
   End
   Begin VB.Label lbl_Version 
      Caption         =   "Version"
      Height          =   315
      Left            =   2940
      TabIndex        =   12
      Top             =   60
      Width           =   735
   End
   Begin VB.Label lbl_MessageCount 
      Height          =   312
      Left            =   8640
      TabIndex        =   7
      Top             =   5820
      Visible         =   0   'False
      Width           =   552
   End
End
Attribute VB_Name = "Quot_SalesProject_View"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public mi_TopForm As Integer
Public mi_LeftForm As Integer


Private Sub cbo_Version_Click()
    MouseOff
    If Quotation_UpdateCommonInformation(Txt_Status, cbo_Version) = OK Then
        FillValue
    End If
    MouseOn
End Sub

Private Sub Form_Load()
    On Error GoTo suite
    MouseOff
    
    If gl_CodePage <> 1252 And gl_CodePage <> 0 Then ChangeCharSet Me

    Me.Left = mi_LeftForm
    Me.Top = mi_TopForm
    pic_Print.Visible = KO
    pic_Log.Picture = LoadResPicture(RES_LOG, 1)
    pic_Print.Picture = LoadResPicture(RES_PRINT, 1)
    pic_quit.Picture = LoadResPicture(RES_QUIT, 1)
    pic_refresh.Picture = LoadResPicture(RES_REFRESH, 1)
   
    GetCaptions
    InitFields
    FillValue
    cbo_Version.Tag = UNLOADED
    Exit Sub
    
suite:
    StdError
End Sub

Private Sub GetCaptions()
Dim ls_Field As String
Dim ls_Text As String
Dim ll_statement As Long
Dim li_status As Integer
Dim ls_req As String

    On Error GoTo suite
    ls_req = "EXEC Screen_Csts 'Mtnc_Sales_Proj', '" & gut_LangLogin.Code & "'"
    If SQLSubmit(gl_Environment, gl_Database, ll_statement, ls_req) Then
        li_status = SQL_SUCCESS
    Else
        li_status = SQL_ERROR
    End If
    Do While li_status = SQL_SUCCESS Or li_status = SQL_SUCCESS_WITH_INFO
        li_status = SQLFetch(ll_statement)
        If li_status = SQL_SUCCESS Or li_status = SQL_SUCCESS_WITH_INFO Then
            ls_Field = ODBCData(ll_statement, 1)
            ls_Text = ODBCData(ll_statement, 2)
            Select Case ls_Field
                Case "lbl_code": lbl_Code.Caption = ls_Text
                Case "lbl_version": lbl_Version.Caption = ls_Text
                Case "lbl_status": lbl_Status.Caption = ls_Text
                Case "lbl_Name": lbl_Name.Caption = ls_Text
                Case "lbl_StartDate": lbl_StartDate.Caption = ls_Text
                Case "lbl_Size": lbl_Size.Caption = ls_Text
                Case "lbl_UnitOfMeasure": lbl_UnitOfMeasure.Caption = ls_Text
                Case "lbl_Address": lbl_Address.Caption = ls_Text
                Case "lbl_Town": lbl_Town.Caption = ls_Text
                Case "lbl_Country": lbl_Country.Caption = ls_Text
                Case "lbl_Zip": lbl_Zip.Caption = ls_Text
                Case "lbl_Comment": lbl_Comment.Caption = ls_Text
            End Select
        End If
    Loop
    li_status = SQLFreeStatement(ll_statement, SQL_DROP)
    Exit Sub
suite:
    StdError
    li_status = SQLFreeStatement(ll_statement, SQL_DROP)
End Sub

Private Sub FillValue()
Dim ll_statement As Long
Dim li_status As Integer
Dim ls_req As String

    txt_Desc = ""
    txt_startdate = ""
    txt_Size = ""
    txt_UnitOfMeasure = ""
    txt_Address1 = ""
    txt_Address2 = ""
    txt_Town = ""
    txt_ZIP = ""
    txt_Country = ""
    txt_Comment = ""
    
    On Error GoTo FillValue_Err
    
    ls_req = "EXEC Sales_Project_Sel " & gi_QuotationCode & "," & gi_QuotationVersion & ",'" & gs_QuotationLanguageCode & "'"
    If SQLSubmit(gl_Environment, gl_Database, ll_statement, ls_req) Then
       li_status = SQLFetch(ll_statement)
       If li_status = SQL_SUCCESS Or li_status = SQL_SUCCESS_WITH_INFO Then
           txt_Desc = ODBCData(ll_statement, 1)
           txt_startdate = ODBCData(ll_statement, 2)
           txt_Size = ODBCData(ll_statement, 3)
           txt_UnitOfMeasure = ODBCData(ll_statement, 4)
           txt_Address1 = ODBCData(ll_statement, 5)
           txt_Address2 = ODBCData(ll_statement, 6)
           txt_Town = ODBCData(ll_statement, 7)
           txt_ZIP = ODBCData(ll_statement, 8)
           txt_Country = ODBCData(ll_statement, 9)
           txt_Comment = ODBCData(ll_statement, 10)
       End If
    Else
       li_status = SQL_ERROR
    End If
    li_status = SQLFreeStatement(ll_statement, SQL_DROP)
    Exit Sub
    
FillValue_Err:
    StdError
    li_status = SQLFreeStatement(ll_statement, SQL_DROP)
End Sub

Private Sub pic_log_Click()
On Error GoTo Histo_Err
    MouseOff
    Quotation_Historic
Exit Sub
Histo_Err:
    StdError
End Sub

Private Sub pic_refresh_Click()
    MouseOff
    FillValue
    MouseOn
End Sub
Private Sub pic_quit_Click()
    MouseOff
    Unload Me
    MouseOn
End Sub
Private Sub InitFields()
    Quotation_View_Load txt_QuotCode, Txt_Status, cbo_Version
End Sub

