VERSION 5.00
Begin VB.Form BaseItemDesc_mtnc 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Data Translation"
   ClientHeight    =   6045
   ClientLeft      =   660
   ClientTop       =   495
   ClientWidth     =   8250
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   6045
   ScaleWidth      =   8250
   Begin VB.CommandButton spp_save 
      Default         =   -1  'True
      Height          =   615
      Left            =   6840
      Style           =   1  'Graphical
      TabIndex        =   8
      Top             =   5280
      Width           =   615
   End
   Begin VB.CommandButton ssp_quit 
      Height          =   615
      Left            =   7560
      Style           =   1  'Graphical
      TabIndex        =   9
      Top             =   5280
      Width           =   615
   End
   Begin VB.Frame Frame2 
      Height          =   2532
      Left            =   120
      TabIndex        =   12
      Top             =   2640
      Width           =   8052
      Begin VB.TextBox txt_Language4 
         ForeColor       =   &H00000000&
         Height          =   1152
         Left            =   960
         MaxLength       =   240
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   7
         Top             =   1200
         Visible         =   0   'False
         Width           =   6972
      End
      Begin VB.TextBox txt_Language3 
         ForeColor       =   &H00000000&
         Height          =   288
         Left            =   960
         MaxLength       =   80
         TabIndex        =   5
         Top             =   720
         Visible         =   0   'False
         Width           =   3372
      End
      Begin VB.TextBox txt_Language 
         ForeColor       =   &H00000000&
         Height          =   288
         Left            =   960
         MaxLength       =   80
         TabIndex        =   4
         Top             =   240
         Visible         =   0   'False
         Width           =   6700
      End
      Begin VB.PictureBox pic_Language 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00C0C0C0&
         BorderStyle     =   0  'None
         DragIcon        =   "BI_DESC.frx":0000
         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            =   240
         ScaleHeight     =   390
         ScaleWidth      =   390
         TabIndex        =   13
         Top             =   180
         Width           =   384
      End
      Begin VB.TextBox txt_Language2 
         ForeColor       =   &H00000000&
         Height          =   288
         Left            =   4560
         MaxLength       =   80
         TabIndex        =   6
         Top             =   720
         Visible         =   0   'False
         Width           =   3372
      End
   End
   Begin VB.Frame Frame1 
      Height          =   2532
      Left            =   120
      TabIndex        =   10
      Top             =   0
      Width           =   8052
      Begin VB.TextBox txt_English4 
         ForeColor       =   &H00000000&
         Height          =   1152
         Left            =   960
         MaxLength       =   240
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   3
         Top             =   1200
         Visible         =   0   'False
         Width           =   6972
      End
      Begin VB.TextBox txt_English3 
         ForeColor       =   &H00000000&
         Height          =   288
         Left            =   960
         Locked          =   -1  'True
         TabIndex        =   1
         Top             =   720
         Visible         =   0   'False
         Width           =   3372
      End
      Begin VB.TextBox txt_English2 
         ForeColor       =   &H00000000&
         Height          =   288
         Left            =   4560
         Locked          =   -1  'True
         TabIndex        =   2
         Top             =   720
         Visible         =   0   'False
         Width           =   3372
      End
      Begin VB.TextBox txt_English 
         ForeColor       =   &H00000000&
         Height          =   288
         Left            =   960
         Locked          =   -1  'True
         MaxLength       =   150
         TabIndex        =   0
         Top             =   240
         Visible         =   0   'False
         Width           =   6700
      End
      Begin VB.PictureBox pic_English 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00C0C0C0&
         BorderStyle     =   0  'None
         DragIcon        =   "BI_DESC.frx":030A
         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            =   240
         ScaleHeight     =   390
         ScaleWidth      =   390
         TabIndex        =   11
         Top             =   180
         Width           =   384
      End
   End
End
Attribute VB_Name = "BaseItemDesc_mtnc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub GetTransDesc()
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_Req As String

    On Error GoTo GetTransDesc_Err
    
    ls_Req = "EXEC Base_Item_Desc_t_sel '" _
        & gs_SAPCode & "','" & gut_Param.Str2 & "'"
    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
            txt_Language = ODBCData(ll_Statement, 1)
        End If
    Loop
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    Exit Sub
    
GetTransDesc_Err:
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Sub

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

    spp_save.Picture = LoadResPicture(RES_OK, 1)
    ssp_quit.Picture = LoadResPicture(RES_QUIT, 1)
    pic_English.Picture = LoadResPicture(RES_ENGLISH, 1)
    txt_English.Visible = OK
    txt_Language.Visible = OK
    Select Case gi_TranslateType
    Case 1
        Frame1.Height = 1212
        Frame2.Height = 1212
        Frame2.top = 1320
        spp_save.top = 2640
        ssp_quit.top = 2640
        Height = 3756
        top = 1548
    Case 2
        txt_English2.Visible = OK
        txt_Language2.Visible = OK
        Frame1.Height = 1212
        Frame2.Height = 1212
        Frame2.top = 1320
        spp_save.top = 2640
        ssp_quit.top = 2640
        Height = 3756
        top = 1548
    Case 3
        txt_English2.Visible = OK
        txt_Language2.Visible = OK
        txt_English3.Visible = OK
        txt_Language3.Visible = OK
        Frame1.Height = 1212
        Frame2.Height = 1212
        Frame2.top = 1320
        spp_save.top = 2640
        ssp_quit.top = 2640
        Height = 3756
        top = 1548
    Case 4
        txt_English4.Visible = OK
        txt_Language4.Visible = OK
    Case 5
        txt_English2.Visible = OK
        txt_Language2.Visible = OK
        txt_English4.Visible = OK
        txt_Language4.Visible = OK
    Case 6
        txt_English2.Visible = OK
        txt_Language2.Visible = OK
        txt_English3.Visible = OK
        txt_Language3.Visible = OK
        txt_English4.Visible = OK
        txt_Language4.Visible = OK
    End Select
    pic_Language.Picture = LoadResPicture(gut_LangWork.Icon, 1)
    txt_Language.Locked = OK
    If InStr(1, gs_TranslationRight, gut_LangWork.Code, 1) <> 0 Then
        txt_Language.Locked = 0
    End If
    GetEnglish
    GetTransDesc
    MouseOn
End Sub

Private Sub GetEnglish()
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_Req As String

    On Error GoTo GetEnglish_Err
    
    ls_Req = "EXEC Base_Item_Desc_sel '" & gs_SAPCode & "'"
    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
            txt_English = ODBCData(ll_Statement, 1)
            Select Case gi_TranslateType
            Case 2
                txt_English2 = ODBCData(ll_Statement, 2)
            Case 3
                txt_English = ODBCData(ll_Statement, 2)
                txt_English3 = ODBCData(ll_Statement, 3)
            Case 4
                txt_English4 = ODBCData(ll_Statement, 2)
            Case 5
                txt_English2 = ODBCData(ll_Statement, 2)
                txt_English4 = ODBCData(ll_Statement, 3)
            Case 6
                txt_English2 = ODBCData(ll_Statement, 2)
                txt_English3 = ODBCData(ll_Statement, 3)
                txt_English4 = ODBCData(ll_Statement, 4)
            End Select
        End If
    Loop
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    Exit Sub
    
GetEnglish_Err:
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Sub

Private Sub spp_save_Click()
Dim ls_Req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ll_lngrows As Long
Dim ls_Desc As String
Dim ls_Desc4 As String
Dim ls_Line As String

    On Error GoTo spp_save_Click_Err
    
    MouseOff
    gb_Return = OK
    If txt_Language = "" Then
        ls_Desc = "#" & txt_English
    Else
        ls_Desc = txt_Language
    End If
    If txt_Language4 = "" Then
        ls_Desc4 = "#" & txt_English4
    Else
        ls_Desc4 = txt_Language4
    End If
    ls_Req = "EXEC Base_Item_Desc_t_upd '" _
            & QuoteParam(gs_SAPCode) & "','" _
            & QuoteParam(ls_Desc) & "'," _
            & gi_BIConcurrency & ",'" _
            & gut_LangWork.Code & "'"
    If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
        li_Status = SQLRowCount(ll_Statement, ll_lngrows)
        If ll_lngrows = 0 Then
            li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
            SendMessage 2, "Another user change the record", gut_LangLogin.Code
        Else
            li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
            gut_Param.Str17 = ls_Desc
        End If
    Else
        li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
        SendMessage 3, "Update failed", gut_LangLogin.Code
    End If
    gb_Return = OK
    Unload Me
    MouseOn
    Exit Sub
    
spp_save_Click_Err:
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    StdError
End Sub

Private Sub ssp_quit_Click()
    MouseOff
    Unload Me
    MouseOn
End Sub
