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

📄 frmpaoi.frm

📁 delphi 和ASP BS模式的程序
💻 FRM
📖 第 1 页 / 共 3 页
字号:
         BOFAction       =   0
         EOFAction       =   0
         ConnectStringType=   1
         Appearance      =   1
         BackColor       =   -2147483643
         ForeColor       =   -2147483640
         Orientation     =   0
         Enabled         =   -1
         Connect         =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
         OLEDBString     =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
         OLEDBFile       =   ""
         DataSourceName  =   ""
         OtherAttributes =   ""
         UserName        =   "sa"
         Password        =   ""
         RecordSource    =   ""
         Caption         =   "Adodc2"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         _Version        =   393216
      End
      Begin MSComCtl2.DTPicker DTPicker1 
         Height          =   300
         Left            =   2040
         TabIndex        =   1
         Top             =   360
         Width           =   1700
         _ExtentX        =   2990
         _ExtentY        =   529
         _Version        =   393216
         Format          =   23658497
         CurrentDate     =   37742
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "InvoiceExaminer:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Index           =   13
         Left            =   120
         TabIndex        =   10
         Top             =   840
         Width           =   1920
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "ApprovedBy:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Index           =   11
         Left            =   4440
         TabIndex        =   9
         Top             =   795
         Width           =   1320
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "Invoicemaker:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Index           =   12
         Left            =   4200
         TabIndex        =   8
         Top             =   360
         Width           =   1560
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "OutputDate:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Index           =   0
         Left            =   120
         TabIndex        =   7
         Top             =   360
         Width           =   1335
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "Warehouse:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   120
         TabIndex        =   6
         Top             =   1200
         Width           =   1200
      End
   End
   Begin MSComctlLib.Toolbar Toolbar1 
      Height          =   780
      Left            =   5040
      TabIndex        =   29
      Top             =   7200
      Width           =   3180
      _ExtentX        =   5609
      _ExtentY        =   1376
      ButtonWidth     =   1032
      ButtonHeight    =   1376
      Style           =   1
      ImageList       =   "ImageList1"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   5
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "Save"
            Key             =   "Save"
            ImageIndex      =   1
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "Cancel"
            Key             =   "Cancel"
            ImageIndex      =   2
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "Quit"
            Key             =   "Quit"
            ImageIndex      =   3
         EndProperty
      EndProperty
      Begin MSComctlLib.ImageList ImageList1 
         Left            =   2400
         Top             =   0
         _ExtentX        =   1005
         _ExtentY        =   1005
         BackColor       =   -2147483643
         ImageWidth      =   32
         ImageHeight     =   32
         MaskColor       =   12632256
         _Version        =   393216
         BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
            NumListImages   =   3
            BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmpaoi.frx":0781
               Key             =   "save"
            EndProperty
            BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmpaoi.frx":0A9B
               Key             =   "Cancel"
            EndProperty
            BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "frmpaoi.frx":0EED
               Key             =   "quit"
            EndProperty
         EndProperty
      End
   End
End
Attribute VB_Name = "frmpaoi"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
 Dim db As ADODB.Connection
 Set db = New ADODB.Connection
 Select Case Button.Key
       Case "Save"
            db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
                    "User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
            db.Execute "insert into POC select * from POCt where OutputID=" & _
            "'" & Trim(Adodc1.Recordset.Fields(0)) & "'"
            db.Close
            db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
                    "User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
            db.Execute "insert into POD select OutputID,OutputDate,Warehouse,OutputType,Client," & _
            "ProductID,ProductName,Unit,Quantity,UnitPrice,Total,Remarks from PODt " & _
            "where OutputID='" & Trim(Adodc1.Recordset.Fields(0)) & "'"
            db.Close
            db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
                    "User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
            db.Execute "update PODt set Isexamed='1' where OutputID=" & _
            "'" & Trim(Adodc1.Recordset.Fields(0)) & "'"
            db.Close
            '产品库存随之减少
            db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
                    "User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
            db.Execute "update PI set Total = Total-" & Trim(Text1(4).Text) & ",Quantity=Quantity-" & Trim(Text1(8).Text) & "where ProductID=" & _
            "'" & Trim(Adodc1.Recordset.Fields(5)) & "'"
            frmpinven.Adodc_pinven.Refresh
            db.Close
       
       Case "Cancel"
            db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
                    "User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
            db.Execute "delete from POC where OutputID='" & Trim(Adodc1.Recordset.Fields(0)) & "'"
            db.Close
            db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
                    "User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
            db.Execute "delete from POD where OutputID='" & Trim(Adodc1.Recordset.Fields(0)) & "'"
            db.Close
            Adodc_paoi.Refresh
            
       Case "Quit"
            db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
                    "User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
            db.Execute "delete from poct"
            db.Close
            db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
                    "User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
            db.Execute "delete from podt"
            db.Close
            Adodc_paoi.Refresh
            frmpoutput.Adodc_poc.Refresh
            frmpoutput.Adodc_pod.Refresh
            Unload Me
  End Select
  Adodc1.Refresh

End Sub

Private Sub Toolbar2_ButtonClick(ByVal Button As MSComctlLib.Button)
   On Error GoTo err
   Dim db As ADODB.Connection
   Set db = New ADODB.Connection
   Dim test As String
   Dim id As String

  Select Case Button.Key
         Case "Input"
                test = DTPicker1.Year
                If Len(DTPicker1.Month) = 1 Then
                   test = test & "0" & DTPicker1.Month
                Else
                   test = test & DTPicker1.Month
                End If
                If Len(DTPicker1.Day) = 1 Then
                   test = test & "0" & DTPicker1.Day
                Else
                   test = test & DTPicker1.Day
                End If
                   test = test & "01"
                With Adodc2
                     .RecordSource = "select OutputID from POC"
                     .Refresh
                End With
                If Adodc2.Recordset.EOF = True Or Adodc2.Recordset.BOF = True Then
                db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
                        "User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
                db.Execute "insert into POCt values('" & Trim(test) & "'," & _
                           "'" & Trim(DTPicker1.Value) & "','" & Trim(Combo2.Text) & "'," & _
                           "'" & Trim(Text1(2).Text) & "','" & Trim(Text1(0).Text) & "'," & _
                           "'" & Trim(Text1(1).Text) & "')"
                db.Close
                db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
                        "User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
                db.Execute "insert into PODt values('" & Trim(test) & "'," & _
                           "'" & Trim(DTPicker1.Value) & "','" & Trim(Combo2.Text) & "'," & _
                           "'" & Trim(Combo1(2).Text) & "','" & Trim(Text1(7).Text) & "'," & _
                           "'" & Trim(Text1(9).Text) & "','" & Trim(Text1(6).Text) & "'," & _
                           "'" & Trim(Text1(3).Text) & "','" & Trim(Text1(8).Text) & "'," & _
                           "'" & Trim(Text1(5).Text) & "','" & Trim(Text1(4).Text) & "','0'," & _
                           "'" & Trim(Text2.Text) & "')"
                db.Close
                Else
                
                Let id = Adodc2.Recordset.Fields(0)
                Do Until Adodc2.Recordset.EOF = True
                    If id < Adodc2.Recordset.Fields(0) Then
                        id = Adodc2.Recordset.Fields(0)
                    End If
                    Adodc2.Recordset.MoveNext
                Loop
                If test <= id Then
                   test = Left(id, 8) & (Right(id, 2) + 1)
                   If Len(test) = 9 Then
                      test = Left(test, 8) & "0" & Right(test, 1)
                   End If
                End If
                
                db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
                        "User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
                db.Execute "insert into POCt values('" & Trim(test) & "'," & _
                           "'" & Trim(DTPicker1.Value) & "','" & Trim(Combo2.Text) & "'," & _
                           "'" & Trim(Text1(2).Text) & "','" & Trim(Text1(0).Text) & "'," & _
                           "'" & Trim(Text1(1).Text) & "')"
                db.Close
                db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
                        "User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
                db.Execute "insert into PODt values('" & Trim(test) & "'," & _
                           "'" & Trim(DTPicker1.Value) & "','" & Trim(Combo2.Text) & "'," & _
                           "'" & Trim(Combo1(2).Text) & "','" & Trim(Text1(7).Text) & "'," & _
                           "'" & Trim(Text1(9).Text) & "','" & Trim(Text1(6).Text) & "'," & _
                           "'" & Trim(Text1(3).Text) & "','" & Trim(Text1(8).Text) & "'," & _
                           "'" & Trim(Text1(5).Text) & "','" & Trim(Text1(4).Text) & "','0'," & _
                           "'" & Trim(Text2.Text) & "')"
                db.Close
              End If
         Case "Cancel"
                db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
                        "User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
                db.Execute "delete  from poct where OutputId='" & Trim(Adodc1.Recordset.Fields(0)) & "'"
                db.Close
                db.Open "Provider=SQLOLEDB.1;Persist Security Info=False;" & _
                        "User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
                db.Execute "delete  from podt where OutputId='" & Trim(Adodc1.Recordset.Fields(0)) & "'"
                db.Close
                Adodc_paoi.Refresh
  End Select
  Adodc1.Refresh
err:
  Exit Sub
End Sub


⌨️ 快捷键说明

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