www.pudn.com > vb625557712344.rar > FrmType.frm, change:2005-05-23,size:8183b


VERSION 5.00 
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX" 
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX" 
Begin VB.Form FrmType  
   Caption         =   "类型设置" 
   ClientHeight    =   4845 
   ClientLeft      =   60 
   ClientTop       =   345 
   ClientWidth     =   5220 
   LinkTopic       =   "Form1" 
   Picture         =   "FrmType.frx":0000 
   ScaleHeight     =   4845 
   ScaleWidth      =   5220 
   StartUpPosition =   2  '屏幕中心 
   Begin MSDataListLib.DataList DataList1  
      Height          =   3210 
      Left            =   480 
      TabIndex        =   6 
      Top             =   840 
      Width           =   2535 
      _ExtentX        =   4471 
      _ExtentY        =   5662 
      _Version        =   393216 
      ListField       =   "" 
      BoundColumn     =   "" 
   End 
   Begin MSAdodcLib.Adodc Adodc1  
      Height          =   330 
      Left            =   3240 
      Top             =   4440 
      Visible         =   0   'False 
      Width           =   1575 
      _ExtentX        =   2778 
      _ExtentY        =   582 
      ConnectMode     =   0 
      CursorLocation  =   3 
      IsolationLevel  =   -1 
      ConnectionTimeout=   15 
      CommandTimeout  =   30 
      CursorType      =   3 
      LockType        =   3 
      CommandType     =   8 
      CursorOptions   =   0 
      CacheSize       =   50 
      MaxRecords      =   0 
      BOFAction       =   0 
      EOFAction       =   0 
      ConnectStringType=   1 
      Appearance      =   1 
      BackColor       =   -2147483643 
      ForeColor       =   -2147483640 
      Orientation     =   0 
      Enabled         =   -1 
      Connect         =   "" 
      OLEDBString     =   "" 
      OLEDBFile       =   "" 
      DataSourceName  =   "" 
      OtherAttributes =   "" 
      UserName        =   "" 
      Password        =   "" 
      RecordSource    =   "" 
      Caption         =   "Adodc1" 
      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 VB.OptionButton OptSel  
      Caption         =   "保险类型" 
      BeginProperty Font  
         Name            =   "华文行楷" 
         Size            =   12 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   375 
      Index           =   1 
      Left            =   1920 
      TabIndex        =   5 
      Top             =   240 
      Width           =   1335 
   End 
   Begin VB.OptionButton OptSel  
      Caption         =   "汽车类型" 
      BeginProperty Font  
         Name            =   "华文行楷" 
         Size            =   12 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   375 
      Index           =   0 
      Left            =   240 
      TabIndex        =   4 
      Top             =   240 
      Value           =   -1  'True 
      Width           =   1335 
   End 
   Begin VB.CommandButton Cmd_Add  
      BackColor       =   &H80000004& 
      Caption         =   "添 加" 
      Default         =   -1  'True 
      BeginProperty Font  
         Name            =   "华文行楷" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   400 
      Left            =   3480 
      MousePointer    =   99  'Custom 
      Style           =   1  'Graphical 
      TabIndex        =   3 
      Top             =   840 
      Width           =   1000 
   End 
   Begin VB.CommandButton Cmd_Modi  
      BackColor       =   &H80000004& 
      Caption         =   "修 改" 
      BeginProperty Font  
         Name            =   "华文行楷" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   400 
      Left            =   3480 
      MousePointer    =   99  'Custom 
      Style           =   1  'Graphical 
      TabIndex        =   2 
      Top             =   1680 
      Width           =   1000 
   End 
   Begin VB.CommandButton Cmd_Del  
      BackColor       =   &H80000004& 
      Caption         =   "删 除" 
      BeginProperty Font  
         Name            =   "华文行楷" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   400 
      Left            =   3480 
      MousePointer    =   99  'Custom 
      Style           =   1  'Graphical 
      TabIndex        =   1 
      Top             =   2520 
      Width           =   1000 
   End 
   Begin VB.CommandButton Cmd_Back  
      BackColor       =   &H80000004& 
      Cancel          =   -1  'True 
      Caption         =   "返 回" 
      BeginProperty Font  
         Name            =   "华文行楷" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   400 
      Left            =   3480 
      MousePointer    =   99  'Custom 
      Style           =   1  'Graphical 
      TabIndex        =   0 
      Top             =   3480 
      Width           =   1000 
   End 
End 
Attribute VB_Name = "FrmType" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Public nTypeId As Integer 
Private Bh As Integer 
 
Private Sub Cmd_Add_Click() 
  FrmTypeEdit.nTid = nTypeId 
  If nTypeId = 1 Then 
    FrmTypeEdit.lblTypeId = "汽车类型" 
  Else 
    FrmTypeEdit.lblTypeId = "保险类型" 
  End If 
  FrmTypeEdit.txtType = "" 
  FrmTypeEdit.txtDescribe = "" 
  FrmTypeEdit.Modify = False 
  FrmTypeEdit.Show 1 
End Sub 
 
Private Sub Cmd_Back_Click() 
  Unload Me 
End Sub 
 
Private Sub Cmd_Del_Click() 
  If Trim(DataList1.Text) = "" Then 
    Exit Sub 
  End If 
  If MsgBox("是否确定要删除 ", vbYesNo, "请确认") = vbNo Then 
    Exit Sub 
  End If 
  Call CurType.Delete(DataList1.BoundText) 
   MsgBox "成功", vbInformation 
  DataRefresh 
End Sub 
 
Private Sub Cmd_Modi_Click() 
  If Trim(DataList1.Text) = "" Then 
    Exit Sub 
  End If 
  FrmTypeEdit.nTid = nTypeId 
  If nTypeId = 1 Then 
    FrmTypeEdit.lblTypeId = "汽车类型" 
  Else 
    FrmTypeEdit.lblTypeId = "保险类型" 
  End If 
  Bh = DataList1.BoundText 
  FrmTypeEdit.nId = Bh 
  If MyType.GetInfo(Bh) Then 
    FrmTypeEdit.sTName = Trim(MyType.TypeName) 
    FrmTypeEdit.txtType = Trim(MyType.TypeName) 
    FrmTypeEdit.txtDescribe = Trim(MyType.Description) 
  End If 
  FrmTypeEdit.Modify = True 
 
  FrmTypeEdit.Show 1 
  DataRefresh 
End Sub 
 
Private Sub Form_Load() 
  OptSel(0).Value = True 
  nTypeId = 1 
  DataRefresh 
End Sub 
 
Private Sub DataRefresh() 
  Adodc1.ConnectionString = Conn 
  Adodc1.RecordSource = "SELECT * FROM Types WHERE TypeId=" + Trim(nTypeId) 
  Adodc1.Refresh 
  Set DataList1.RowSource = Adodc1 
  DataList1.ListField = "TypeName" 
  DataList1.BoundColumn = "Id" 
End Sub 
 
Private Sub OptSel_Click(Index As Integer) 
  nTypeId = Index + 1 
  DataRefresh 
End Sub