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

📄 frmpopurchaseitemedit.frm

📁 这是一个利用VB编写的中小企业ERP。功能比较全
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         EndProperty
      End
      Begin VB.Label Label2 
         Caption         =   "选择的产品是:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   3720
         TabIndex        =   7
         Top             =   480
         Width           =   1695
      End
   End
   Begin MSComCtl2.DTPicker DTConsignmentDate 
      Height          =   375
      Left            =   6000
      TabIndex        =   3
      Top             =   3600
      Width           =   2655
      _ExtentX        =   4683
      _ExtentY        =   661
      _Version        =   393216
      Format          =   23658497
      CurrentDate     =   38204
   End
   Begin VB.TextBox TxtPOItemID 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3240
      TabIndex        =   0
      Top             =   360
      Width           =   2895
   End
   Begin VB.Image Image4 
      Height          =   300
      Left            =   5160
      Picture         =   "FrmPOPurchaseItemEdit.frx":0CCA
      Top             =   5160
      Width           =   300
   End
   Begin VB.Label LblCancel 
      BackStyle       =   0  'Transparent
      Caption         =   "取 消"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   5760
      MouseIcon       =   "FrmPOPurchaseItemEdit.frx":10E6
      MousePointer    =   99  'Custom
      TabIndex        =   13
      Top             =   5160
      Width           =   855
   End
   Begin VB.Image Image3 
      Height          =   300
      Left            =   2760
      Picture         =   "FrmPOPurchaseItemEdit.frx":13F0
      Top             =   5160
      Width           =   300
   End
   Begin VB.Label LblOK 
      BackStyle       =   0  'Transparent
      Caption         =   "确 定"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3360
      MouseIcon       =   "FrmPOPurchaseItemEdit.frx":180C
      MousePointer    =   99  'Custom
      TabIndex        =   12
      Top             =   5160
      Width           =   735
   End
   Begin VB.Label Label5 
      Caption         =   "完成"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   2760
      TabIndex        =   10
      Top             =   4320
      Width           =   1095
   End
   Begin VB.Label Label3 
      Caption         =   "采购量"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   480
      TabIndex        =   8
      Top             =   3600
      Width           =   1095
   End
   Begin VB.Label Label1 
      Caption         =   "交货期"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   4920
      TabIndex        =   2
      Top             =   3600
      Width           =   1095
   End
   Begin VB.Label Label4 
      Caption         =   "PO项目ID"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   2040
      TabIndex        =   1
      Top             =   360
      Width           =   1095
   End
End
Attribute VB_Name = "FrmPOPurchaseItemEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public OriPOID As String
Public OriPODate As String
Public OriBusinessmanID As String
Public OriDeliverID As String
Public OriPOItemID As String
Public OriPurchaseItemID As String
Public Modify As Boolean
Private Sub DataGrid1_Click()
    If Adodc1.Recordset.RecordCount <> 0 Then
        TxtPurchaseItemID.Text = Adodc1.Recordset.Fields(0)
    End If
    
End Sub

Private Sub Form_Load()
    '填充"完成"List单
    CmbIsComplete.List(0) = "NO   未完成"
    CmbIsComplete.List(1) = "YES  已完成"
    
    Adodc1.ConnectionString = "driver={SQL Server};server=" + Trim(Server) + ";uid=" + Trim(User) + ";pwd=" + Trim(Password) + ";database=ERP"
    Adodc1.RecordSource = "select * from PurchaseItem,Item where PurchaseItem.Item=Item.Item and PurchaseItem.BusinessmanID='" + Trim(OriBusinessmanID) + "'"
    Set DataGrid1.DataSource = Adodc1
    
End Sub

Private Sub LblCancel_Click()
    Unload Me
End Sub

Private Sub LblOK_Click()
    '判断要编辑信息是否完整
    If Check = False Then
        Exit Sub
    End If
    
    With MyPO
        .POID = OriPOID
        .PODate = OriPODate
        .POItemID = TxtPOItemID.Text
        .PurchaseItemID = TxtPurchaseItemID.Text
        .POQty = TxtPOQty.Text
        .ConsignmentDate = DTConsignmentDate.Value
        .IsComplete = CmbIsComplete.Text
        
        
        '判断操作是添加还是修改
        If Modify = False Then '判断为添加操作
            
            '判断销售员ID是否已经存在
            If .In_DBPOItemID(TxtPOItemID.Text) = True Then
                MsgBox "PO项目ID重复,请重新设置"
                TxtPOItemID.SetFocus
                TxtPOItemID.SelStart = 0
                TxtPOItemID.SelLength = Len(TxtPOItemID)
                Exit Sub
            Else
                .Insert '添加
                MsgBox "添加成功"
                FrmPOEdit.IsFirst = False
            End If
        Else '判断为修改操作
            .Update (OriPOItemID)
            MsgBox "修改成功"
        End If
    End With
    
    Unload Me
    
End Sub


Private Function Check() As Boolean
    If Trim(TxtPOItemID) = "" Then
        MsgBox "请输入PO项目ID"
        TxtPOItemID.SetFocus
        Check = False
        Exit Function
    End If
    If Trim(TxtPurchaseItemID) = "" Then
        MsgBox "请选择采购产品"
        Check = False
        Exit Function
    End If
    If Trim(TxtPOQty) = "" Then
        MsgBox "请输入采购量"
        TxtPOQty.SetFocus
        Check = False
        Exit Function
    End If
    If DTConsignmentDate.Value < FrmPOEdit.DTPODate Then
        MsgBox "交货期不应先于订货期,请重新选择"
        DTConsignmentDate.SetFocus
        Check = False
        Exit Function
    End If
    If Trim(CmbIsComplete) = "" Then
        MsgBox "请选择该订单是否完成"
        CmbIsComplete.SetFocus
        Check = False
        Exit Function
    End If
    
    Check = True
End Function


Private Sub TxtPOQty_KeyPress(KeyAscii As Integer)
    EnterTAB (KeyAscii)
    If In_Int(KeyAscii) = False Then
        KeyAscii = 0
    End If
End Sub

⌨️ 快捷键说明

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