⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmphyewuin.frm

📁 这是用Visual Basic6开发的大型喷绘业务管理系统,数据库采用Access数据库
💻 FRM
📖 第 1 页 / 共 2 页
字号:
       KeyAscii = 0
       SendKeys "{tab}"
    End If
End Sub

Private Sub Combo2_KeyPress(KeyAscii As Integer)
   If KeyAscii = 13 Then
       KeyAscii = 0
       SendKeys "{tab}"
    End If
End Sub

Private Sub Combo3_KeyPress(KeyAscii As Integer)
   If KeyAscii = 13 Then
       KeyAscii = 0
       SendKeys "{tab}"
    End If
End Sub

Private Sub Combo4_KeyPress(KeyAscii As Integer)
   If KeyAscii = 13 Then
       KeyAscii = 0
       SendKeys "{tab}"
    End If
End Sub

Private Sub Form_Load()
   rgn1 = 0
   n = 0
   Dim Ma As Dat
   Show
   Open App.Path & "\customin.dat" For Random As #1 Len = Len(Ma)
   Do While Not EOF(1)
      n = n + 1
      Get #1, n, Ma
      If rgn1 = 0 Then rgn1 = CreateRectRgn(Ma.sx, Ma.sy, Ma.ex, Ma.ey)
      If rgn1 <> 0 Then
            rgn2 = CreateRectRgn(Ma.sx, Ma.sy, Ma.ex, Ma.ey)
            CombineRgn rgn1, rgn1, rgn2, 2
                  '释放系统资源
            DeleteObject rgn2
      End If
  Loop
'关闭文件
    Close #1
    SetWindowRgn hwnd, rgn1, True
    DeleteObject rgn1
      ''''''''''连接远程数据库SQL SERVER''''
    On Error GoTo errmsg
'    Set env = rdoEnvironments(0)
'    env.CursorDriver = rdUseOdbc
'    d_conn = "uid=sa;pwd=;driver={SQL SERVER};SERVER=ntserver;database=phdatabase;"
'    Set cn = env.OpenConnection(dsname:="odbc_api_demo", Prompt:="rdodriverprompt", ReadOnly:=False, Connect:=d_conn)
    MSFlex1.BackColorBkg = RGB(238, 236, 218)
    MSFlex1.BackColorFixed = RGB(238, 236, 218)
    MSFlex1.FormatString = "^  文件序列  |^  画面规格(宽*高)  "
    ''''''''''''
     sql = "select * from  customtable" '  order by  客户编号"
     Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
     If result.RowCount <> 0 Then
        Do While Not result.EOF()
           Combo1.AddItem Trim(result("客户名称"))
           result.MoveNext
        Loop
     End If
     sql = "select * from  worktable  where  类别='业务员' order by  类别"
     Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
     If result.RowCount <> 0 Then
        Do While Not result.EOF()
           Combo2.AddItem Trim(result("姓名"))
           result.MoveNext
        Loop
     End If
     '''''''''
     sql = "select * from  worktable  where  类别='签单人' order by  类别"
     Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
     If result.RowCount <> 0 Then
        Do While Not result.EOF()
           Combo3.AddItem Trim(result("姓名"))
           result.MoveNext
        Loop
     End If
     '''''''''
     Text1.Text = GoodsTree
     Mask1.Text = Format(Now, "yyyymmdd")
     ''''''''
     If YWFlagh = 2 Then
        Mask1.Text = YWPRtableText(0)
        Text1.Text = YWPRtableText(1)
        Combo1.Text = YWPRtableText(2)
        Text2.Text = YWPRtableText(3)
        Text3.Text = YWPRtableText(4)
        Text4.Text = YWPRtableText(5)
        Text5.Text = YWPRtableText(6)
        Text6.Text = YWPRtableText(7)
        Combo2.Text = YWPRtableText(8)
        Combo3.Text = YWPRtableText(9)
        Combo4.Text = YWPRtableText(10)
        MSFlex1.Rows = YWSErows + 1
        For i = 1 To YWSErows
            MSFlex1.TextArray(i * MSFlex1.Cols) = YWSEtableText1(i)
            MSFlex1.TextArray(i * MSFlex1.Cols + 1) = YWSEtableText2(i)
        Next i
     End If
errmsg:
     If YWFlagh = 3 Then
        Mask1.Text = YWPRtableText(0)
        Text1.Text = YWPRtableText(1)
        Combo1.Text = YWPRtableText(2)
        Text2.Text = YWPRtableText(3)
        Text3.Text = YWPRtableText(4)
        Text4.Text = YWPRtableText(5)
        Text5.Text = YWPRtableText(6)
        Text6.Text = YWPRtableText(7)
        Combo2.Text = YWPRtableText(8)
        Combo3.Text = YWPRtableText(9)
        Combo4.Text = YWPRtableText(10)
        MSFlex1.Rows = YWSErows + 1
        For i = 1 To YWSErows
            MSFlex1.TextArray(i * MSFlex1.Cols) = YWSEtableText1(i)
            MSFlex1.TextArray(i * MSFlex1.Cols + 1) = YWSEtableText2(i)
        Next i
     End If
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 1 Then
       mX = X
       mY = Y
    End If
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 1 Then
       frmPHYeWuIn.Move frmPHYeWuIn.Left - mX + X, frmPHYeWuIn.Top - mY + Y
    End If
    Picture1.Cls
    Picture2.Cls
    
End Sub

Private Sub Form_Paint()
       '''''商品编号'''
    jframe.danum = 3
    jframe.rtop = 50
    jframe.rleft = 35
    jframe.rright = 409
    jframe.rbottom = 380
    jframe.ddraw frmPHYeWuIn
End Sub

Private Sub Image1_Click()
   Unload Me
End Sub

Private Sub Image2_Click()
   frmPHYeWuIn.WindowState = 1
End Sub

Private Sub Mask1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
       KeyAscii = 0
       SendKeys "{tab}"
    End If
End Sub

Private Sub Mask1_LostFocus()
    If Text1.Text <> "" Then
       sql = "select  *  from  FileSerial  where  合同级别='" & Trim(Text1.Text) & "'"
        Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
        If result.RowCount <> 0 Then
           result.MoveLast
           MSFlex1.Rows = result.RowCount + 1
           result.MoveFirst
        Else
           MSFlex1.Rows = 2
        End If
        i = 1
        If result.RowCount <> 0 Then
           For i = 1 To MSFlex1.Rows - 1
               '''''''''''i''
                Select Case i
                Case 1
                    Alpha = "a"
                Case 2
                    Alpha = "b"
                Case 3
                    Alpha = "c"
                Case 4
                    Alpha = "d"
                Case 5
                    Alpha = "e"
                Case 6
                    Alpha = "f"
                Case 7
                    Alpha = "g"
                Case 8
                    Alpha = "h"
                Case 9
                    Alpha = "i"
                Case 10
                    Alpha = "j"
                Case 11
                    Alpha = "k"
                Case 12
                    Alpha = "l"
                Case 13
                    Alpha = "m"
                Case 14
                    Alpha = "n"
                Case 15
                    Alpha = "o"
                Case 16
                    Alpha = "p"
                Case 17
                    Alpha = "q"
                Case 18
                    Alpha = "r"
                Case 19
                    Alpha = "s"
                Case 20
                    Alpha = "t"
                Case 21
                    Alpha = "u"
                Case 22
                    Alpha = "v"
                Case 23
                    Alpha = "w"
                Case 24
                    Alpha = "x"
                Case 25
                    Alpha = "y"
                Case 26
                    Alpha = "z"
                End Select
               MSFlex1.TextArray(i * MSFlex1.Cols) = Trim(Text1.Text) & Trim(Alpha)
           Next i
        Else
           MSFlex1.TextArray(1 * MSFlex1.Cols) = Trim(Text1.Text) & "a"
        End If
    End If
    
End Sub

Private Sub Maskl1_Change()
    
       MSFlex1.Text = Maskl1.Text
End Sub

Private Sub Maskl1_LostFocus()
    Maskl1.Visible = False
End Sub

Private Sub MSFlex1_Click()
         If MSFlex1.Col = 1 Then
            Maskl1.Visible = True
            Maskl1.Top = MSFlex1.Top + MSFlex1.CellTop - 10
            Maskl1.Left = MSFlex1.Left + MSFlex1.CellLeft  'MSFlex1.ColWidth(1) ' + frmTSjhd.MSFlex1.ColWidth(2) + frmTSjhd.MSFlex1.ColWidth(3)
            Maskl1.width = MSFlex1.CellWidth
            'Maskl1.height = MSFlex1.CellHeight
            Maskl1.SetFocus
            Maskl1.Text = MSFlex1.Text
            Maskl1.SelStart = 0
            Maskl1.SelLength = Len(Maskl1.Text)
         End If
End Sub

Private Sub MSFlex1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
       KeyAscii = 0
       SendKeys "{tab}"
    End If
End Sub

Private Sub Picture1_Click()
    On Error GoTo errmsg
    Dim datel As String
    datel = Mid(Mask1.Text, 1, 4) & "年" & Trim(Mid(Mask1.Text, 5, 2)) & "月" & Trim(Mid(Mask1.Text, 7, 2)) & "日"
    If YWFlagh = 1 Then
        If Text1.Text <> "" Then
           sql = "select  *  from  YWPRtable  where  合同号='" & Trim(Text1.Text) & "'"
           Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
           sql1 = "select  *  from  YWSEtable  where  合同号='" & Trim(Text1.Text) & "'"
           Set result1 = cn.OpenResultset(sql1, rdOpenDynamic, rdConcurRowVer)
           If result.RowCount <> 0 And result1.RowCount <> 0 Then
              MsgBox "此合同号已经存在..."
           Else
              ''''插入主表''''
              sql = "insert into  YWPRtable(日期,合同号,客户名称,单价,总面积,应收款额,已收款额,未收款额,业务员,签单人,欠款审核) values('" & Trim(datel) & "','" & Trim(Text1.Text) & "','" & Trim(Combo1.Text) & "'," & Val(Trim(Text2.Text)) & "," & Val(Trim(Text3.Text)) & "," & Val(Trim(Text4.Text)) & "," & Val(Trim(Text5.Text)) & "," & Val(Trim(Text6.Text)) & ",'" & Trim(Combo2.Text) & "','" & Trim(Combo3.Text) & "','" & Trim(Combo4.Text) & "')"
              Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
              '''''''插入细表'''
              For i = 1 To MSFlex1.Rows - 1
                  sql = "insert into  YWSEtable(日期,合同号,文件序列,画面规格) values('" & Trim(datel) & "','" & Trim(Text1.Text) & "','" & Trim(MSFlex1.TextArray(i * MSFlex1.Cols)) & "','" & Trim(MSFlex1.TextArray(i * MSFlex1.Cols + 1)) & "')"
                  Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
              Next i
              MsgBox "存盘结束..."
           End If
        End If
    End If
    If YWFlagh = 2 Then
       sql = "update  YWPRtable  set  日期='" & Trim(datel) & "',合同号='" & Trim(Text1.Text) & "',客户名称='" & Trim(Combo1.Text) & "',单价=" & Val(Trim(Text2.Text)) & ",总面积=" & Val(Trim(Text3.Text)) & ",应收款额=" & Val(Trim(Text4.Text)) & ",已收款额=" & Val(Trim(Text5.Text)) & ",未收款额=" & Val(Trim(Text6.Text)) & ",业务员='" & Trim(Combo2.Text) & "',签单人='" & Trim(Combo3.Text) & "',欠款审核='" & Trim(Combo4.Text) & "'  where  日期='" & Trim(YWPRtableText(0)) & "' and  合同号='" & Trim(YWPRtableText(1)) & "'"
       'MsgBox sql
       Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
       For i = 1 To MSFlex1.Rows - 1
           sql = "update  YWSEtable  set  日期='" & Trim(datel) & "',合同号='" & Trim(Text1.Text) & "',文件序列='" & Trim(MSFlex1.TextArray(i * MSFlex1.Cols)) & "',画面规格='" & Trim(MSFlex1.TextArray(i * MSFlex1.Cols + 1)) & "' where  日期='" & Trim(YWPRtableText(0)) & "' and  合同号='" & Trim(YWPRtableText(1)) & "'  and  文件序列='" & Trim(YWSEtableText1(i)) & "'  and  画面规格='" & Trim(YWSEtableText2(i)) & "'"
           Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
       Next i
       MsgBox "编辑结束..."
    End If
errmsg:
    If Err.Number <> 0 Then
       
    End If
End Sub

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Picture2.Cls
    jframe.danum = 5
    jframe.rtop = 1
    jframe.rleft = 1
    jframe.rright = 80
    jframe.rbottom = 23
    jframe.ddrawc Picture1
End Sub

Private Sub Picture2_Click()
    Unload Me
End Sub

Private Sub Picture2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Picture1.Cls
    jframe.danum = 5
    jframe.rtop = 1
    jframe.rleft = 1
    jframe.rright = 80
    jframe.rbottom = 23
    jframe.ddrawc Picture2
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
       KeyAscii = 0
       SendKeys "{tab}"
    End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
       KeyAscii = 0
       SendKeys "{tab}"
    End If
End Sub

Private Sub Text3_GotFocus()
    Dim Area As Single
    Area = 0
    For i = 1 To MSFlex1.Rows - 1
        Area = Area + Val(Mid(MSFlex1.TextArray(i * MSFlex1.Cols + 1), 1, InStr(MSFlex1.TextArray(i * MSFlex1.Cols + 1), "*") - 1)) * Val(Mid(MSFlex1.TextArray(i * MSFlex1.Cols + 1), InStr(MSFlex1.TextArray(i * MSFlex1.Cols + 1), "*") + 1, Len(MSFlex1.TextArray(i * MSFlex1.Cols + 1)) - InStr(MSFlex1.TextArray(i * MSFlex1.Cols + 1), "*")))
    Next i
    Text3.Text = Format(Area, "fixed")
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
       KeyAscii = 0
       SendKeys "{tab}"
    End If
End Sub

Private Sub Text4_GotFocus()
    Text4.Text = Val(Text2.Text) * Val(Text3.Text)
    Text4.Text = Format(Text4.Text, "fixed")
    Text4.SelStart = 0
    Text4.SelLength = Len(Text4.Text)
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)
     If KeyAscii = 13 Then
       KeyAscii = 0
       SendKeys "{tab}"
    End If
End Sub

Private Sub Text5_GotFocus()
    Text5.Text = Format(Text4.Text, "fixed")
    Text5.SelStart = 0
    Text5.SelLength = Len(Text5.Text)
End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)
   If KeyAscii = 13 Then
       KeyAscii = 0
       SendKeys "{tab}"
    End If
End Sub

Private Sub Text6_GotFocus()
    If Text4.Text <> "" Then
       Text6.Text = Val(Text4.Text) - Val(Text5.Text)
       Text6.Text = Format(Text6.Text, "fixed")
       Text6.SelStart = 0
       Text6.SelLength = Len(Text6.Text)
    End If
End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)
   If KeyAscii = 13 Then
       KeyAscii = 0
       SendKeys "{tab}"
    End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -