www.pudn.com > vb625557712344.rar > FrmTypeEdit.frm, change:2005-06-03,size:4759b


VERSION 5.00 
Begin VB.Form FrmTypeEdit  
   BorderStyle     =   1  'Fixed Single 
   Caption         =   "编辑分类信息" 
   ClientHeight    =   3390 
   ClientLeft      =   45 
   ClientTop       =   330 
   ClientWidth     =   4815 
   LinkTopic       =   "Form1" 
   LockControls    =   -1  'True 
   MaxButton       =   0   'False 
   MinButton       =   0   'False 
   Picture         =   "FrmTypeEdit.frx":0000 
   ScaleHeight     =   3390 
   ScaleWidth      =   4815 
   StartUpPosition =   2  '屏幕中心 
   Begin VB.CommandButton Cmd_Cancel  
      Cancel          =   -1  'True 
      Caption         =   "取 消" 
      Height          =   400 
      Left            =   2493 
      MouseIcon       =   "FrmTypeEdit.frx":E2C4 
      MousePointer    =   99  'Custom 
      Style           =   1  'Graphical 
      TabIndex        =   3 
      Top             =   2640 
      Width           =   1300 
   End 
   Begin VB.CommandButton Cmd_Ok  
      Caption         =   "确 定" 
      Height          =   400 
      Left            =   888 
      MouseIcon       =   "FrmTypeEdit.frx":E5CE 
      MousePointer    =   99  'Custom 
      Style           =   1  'Graphical 
      TabIndex        =   2 
      Top             =   2640 
      Width           =   1300 
   End 
   Begin VB.Frame Frame1  
      BackColor       =   &H80000005& 
      Height          =   2295 
      Left            =   240 
      TabIndex        =   4 
      Top             =   120 
      Width           =   4215 
      Begin VB.TextBox txtDescribe  
         Height          =   855 
         Left            =   1080 
         MultiLine       =   -1  'True 
         ScrollBars      =   2  'Vertical 
         TabIndex        =   1 
         Top             =   1320 
         Width           =   2895 
      End 
      Begin VB.TextBox txtType  
         Height          =   270 
         Left            =   1080 
         MaxLength       =   20 
         TabIndex        =   0 
         Top             =   795 
         Width           =   2895 
      End 
      Begin VB.Label Label3  
         AutoSize        =   -1  'True 
         BackColor       =   &H00FFC0C0& 
         BackStyle       =   0  'Transparent 
         Caption         =   "具体描述" 
         Height          =   180 
         Left            =   120 
         TabIndex        =   8 
         Top             =   1320 
         Width           =   720 
      End 
      Begin VB.Label lblTypeId  
         AutoSize        =   -1  'True 
         BackColor       =   &H00FFC0C0& 
         BackStyle       =   0  'Transparent 
         Caption         =   "lblTypeId" 
         Height          =   180 
         Left            =   1080 
         TabIndex        =   7 
         Top             =   360 
         Width           =   810 
      End 
      Begin VB.Label Label1  
         AutoSize        =   -1  'True 
         BackColor       =   &H00FFC0C0& 
         BackStyle       =   0  'Transparent 
         Caption         =   "所属分类" 
         Height          =   180 
         Left            =   120 
         TabIndex        =   6 
         Top             =   360 
         Width           =   720 
      End 
      Begin VB.Label Label2  
         AutoSize        =   -1  'True 
         BackColor       =   &H00FFC0C0& 
         BackStyle       =   0  'Transparent 
         Caption         =   "分类名称" 
         Height          =   180 
         Left            =   120 
         TabIndex        =   5 
         Top             =   840 
         Width           =   720 
      End 
   End 
End 
Attribute VB_Name = "FrmTypeEdit" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Public Modify As Boolean 
Public nTid As Integer 
Public nId As Integer 
Public sTName As String 
 
Private Sub Cmd_OK_Click() 
  If Trim(txtType) = "" Then 
    MsgBox "请输入分类名称" 
    Exit Sub 
  End If 
  With MyType 
    .TypeName = MakeStr(txtType) 
    .Description = MakeStr(txtDescribe) 
    .TypeId = nTid 
    If Modify = False Then 
      
      If .In_DB(.TypeName, nTid) = True Then 
        MsgBox Trim(txtType) + " 已经存在" 
        Exit Sub 
      End If 
      .Insert 
    Else 
      If Trim(sTName) <> MakeStr(txtType) Then 
       
        If .In_DB(Trim(txtType), nTid) = True Then 
          MsgBox Trim(txtType) + " 已经存在" 
          Exit Sub 
        End If 
      End If 
      .Update (nId) 
    End If 
     MsgBox "成功", vbInformation 
  End With 
   
  FrmType.Adodc1.RecordSource = "SELECT * FROM Types WHERE TypeId=" + Trim(nTid) 
  FrmType.Adodc1.Refresh 
  FrmType.DataList1.ReFill 
 
  Unload Me 
End Sub 
 
Private Sub Cmd_Cancel_Click() 
  Unload Me 
End Sub