www.pudn.com > vb-sql-server.rar > frmGET1.frm, change:2003-12-06,size:8187b


VERSION 5.00 
Begin VB.Form frmGET1  
   BorderStyle     =   3  'Fixed Dialog 
   Caption         =   "收款记账" 
   ClientHeight    =   4656 
   ClientLeft      =   48 
   ClientTop       =   336 
   ClientWidth     =   6372 
   LinkTopic       =   "Form1" 
   MaxButton       =   0   'False 
   MinButton       =   0   'False 
   ScaleHeight     =   4656 
   ScaleWidth      =   6372 
   ShowInTaskbar   =   0   'False 
   StartUpPosition =   1  'CenterOwner 
   Begin VB.Frame Frame1  
      Caption         =   "收款信息:" 
      Height          =   3732 
      Left            =   120 
      TabIndex        =   8 
      Top             =   120 
      Width           =   6012 
      Begin VB.TextBox txtItem  
         Height          =   1920 
         Index           =   5 
         Left            =   240 
         MaxLength       =   500 
         MultiLine       =   -1  'True 
         ScrollBars      =   2  'Vertical 
         TabIndex        =   5 
         Top             =   1680 
         Width           =   5532 
      End 
      Begin VB.TextBox txtItem  
         Height          =   270 
         Index           =   4 
         Left            =   1560 
         MaxLength       =   8 
         TabIndex        =   4 
         Top             =   1080 
         Width           =   1212 
      End 
      Begin VB.TextBox txtItem  
         Height          =   270 
         Index           =   3 
         Left            =   4560 
         MaxLength       =   20 
         TabIndex        =   3 
         Top             =   720 
         Width           =   1212 
      End 
      Begin VB.TextBox txtItem  
         Height          =   270 
         Index           =   2 
         Left            =   1560 
         MaxLength       =   20 
         TabIndex        =   2 
         Top             =   720 
         Width           =   1212 
      End 
      Begin VB.TextBox txtItem  
         Height          =   270 
         Index           =   0 
         Left            =   1560 
         MaxLength       =   200 
         TabIndex        =   0 
         Top             =   360 
         Width           =   1212 
      End 
      Begin VB.TextBox txtItem  
         Height          =   270 
         Index           =   1 
         Left            =   4560 
         MaxLength       =   20 
         TabIndex        =   1 
         Top             =   360 
         Width           =   1212 
      End 
      Begin VB.Label Label2  
         Caption         =   "销售清单:" 
         Height          =   252 
         Index           =   10 
         Left            =   240 
         TabIndex        =   14 
         Top             =   1440 
         Width           =   1092 
      End 
      Begin VB.Label Label2  
         Caption         =   "联系电话:" 
         Height          =   252 
         Index           =   7 
         Left            =   240 
         TabIndex        =   13 
         Top             =   1080 
         Width           =   1212 
      End 
      Begin VB.Label Label2  
         Caption         =   "客户姓名:" 
         Height          =   252 
         Index           =   6 
         Left            =   3360 
         TabIndex        =   12 
         Top             =   720 
         Width           =   1212 
      End 
      Begin VB.Label Label2  
         Caption         =   "业务员姓名:" 
         Height          =   252 
         Index           =   5 
         Left            =   240 
         TabIndex        =   11 
         Top             =   720 
         Width           =   1212 
      End 
      Begin VB.Label Label2  
         Caption         =   "销售单编号:" 
         Height          =   255 
         Index           =   0 
         Left            =   240 
         TabIndex        =   10 
         Top             =   360 
         Width           =   1335 
      End 
      Begin VB.Label Label2  
         Caption         =   "销售日期:" 
         Height          =   252 
         Index           =   1 
         Left            =   3360 
         TabIndex        =   9 
         Top             =   360 
         Width           =   1212 
      End 
   End 
   Begin VB.CommandButton cmdExit  
      Caption         =   "返回 (&X)" 
      Height          =   375 
      Left            =   3120 
      TabIndex        =   7 
      Top             =   4080 
      Width           =   1215 
   End 
   Begin VB.CommandButton cmdSave  
      Caption         =   "付清货款 (&S)" 
      Height          =   375 
      Left            =   1680 
      TabIndex        =   6 
      Top             =   4080 
      Width           =   1215 
   End 
End 
Attribute VB_Name = "frmGET1" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Option Explicit 
'是否改动过记录,ture为改过 
Dim mblChange As Boolean 
Dim mrc As ADODB.Recordset 
Public txtSQL As String 
 
Private Sub cmdExit_Click() 
    If mblChange And cmdSave.Enabled Then 
        If MsgBox("保存当前记录的变化吗?", vbOKCancel + vbExclamation, "警告") = vbOK Then 
            '保存 
            Call cmdSave_Click 
        End If 
    End If 
    Unload Me 
End Sub 
 
Private Sub cmdSave_Click() 
    Dim intCount As Integer 
    Dim sMeg As String 
    Dim MsgText As String 
     
   
    
     
    '再加入新记录 
    txtSQL = "update outh set  jsfk='Y',yf='100' where outh_no = '" & Trim(txtItem(0)) & "'" 
    Set mrc = ExecuteSQL(txtSQL, MsgText) 
 
     
 
        MsgBox "付款登记成功!", vbOKOnly + vbExclamation, "付款登记" 
        For intCount = 0 To 5 
            txtItem(intCount) = "" 
        Next intCount 
         
 
        Unload frmGET 
        frmGET.txtSQL = "select outh.outh_no,outh.out_date,outh.khmc,dm_kh.mc,outh.wzdm,dm_wz.mc,outh.s_w,outh.sl,outh.out_danj,outh.o_zk,outh.o_zke,outh.jz,outh.yf,outh.bz from outh inner join dm_kh on outh.khmc = dm_kh.mc inner join dm_wz on outh.wzdm = dm_wz.dm where outh.jsfk <> 'Y'  and outh.s_w = '0'  union select outh.outh_no,outh.out_date,outh.khmc,dm_kh.mc,outh.wzdm,dm_service.mc,outh.s_w,outh.sl,outh.out_danj,outh.o_zk,outh.o_zke,outh.jz,outh.yf,outh.bz from outh inner join dm_kh on outh.khmc = dm_kh.mc inner join dm_service on outh.wzdm = dm_service.dm where outh.jsfk <> 'Y'  and outh.s_w = '1'" 
        frmGET.Show 0 
         
     
End Sub 
 
Private Sub Form_Load() 
    Dim intCount As Integer 
    Dim aa As Double 
    Dim MsgText As String 
    Dim i As Integer 
   
        Set mrc = ExecuteSQL(txtSQL, MsgText) 
         
        If mrc.EOF = False Then 
            With mrc 
                aa = 0 
                For intCount = 0 To 4 
                    txtItem(intCount) = .Fields(intCount) 
                    txtItem(intCount).Enabled = False 
                Next intCount 
                 
                MsgText = "    配件名称    配件型号    配件数量    出货单价    总金额" 
                MsgText = MsgText & "                                                " 
                                                 
                Do While Not .EOF 
                    For intCount = 5 To 9 
                        MsgText = MsgText & Trim(.Fields(intCount)) & "           " 
                    Next intCount 
                     
                    aa = aa + .Fields(9) 
                     
                    MsgText = MsgText & "                                                    " 
                    .MoveNext 
                Loop 
                 
                MsgText = MsgText & "______________________________________________" 
                MsgText = MsgText & "                                                 一共" & aa & "元" 
                
               txtItem(5) = MsgText 
                
            End With 
        End If 
End Sub 
 
Private Sub txtItem_Change(Index As Integer) 
    '有变化设置gblchange 
 
End Sub 
 
Private Sub txtItem_GotFocus(Index As Integer) 
    txtItem(Index).SelStart = 0 
    txtItem(Index).SelLength = Len(txtItem(Index)) 
End Sub 
 
Private Sub txtItem_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer) 
    EnterToTab KeyCode 
End Sub