Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1033 lines
33 KiB

  1. VERSION 5.00
  2. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  3. Begin VB.Form frmupdate
  4. BorderStyle = 3 'Fixed Dialog
  5. Caption = "edit pop -"
  6. ClientHeight = 4230
  7. ClientLeft = 540
  8. ClientTop = 1590
  9. ClientWidth = 7305
  10. Icon = "popupd.frx":0000
  11. KeyPreview = -1 'True
  12. LinkTopic = "Form1"
  13. MaxButton = 0 'False
  14. MinButton = 0 'False
  15. PaletteMode = 1 'UseZOrder
  16. ScaleHeight = 4230
  17. ScaleWidth = 7305
  18. ShowInTaskbar = 0 'False
  19. WhatsThisButton = -1 'True
  20. WhatsThisHelp = -1 'True
  21. Begin VB.CommandButton cmbUpclose
  22. Cancel = -1 'True
  23. Caption = "cancel"
  24. Height = 375
  25. Left = 6135
  26. TabIndex = 35
  27. Top = 3780
  28. WhatsThisHelpID = 10040
  29. Width = 1035
  30. End
  31. Begin VB.CommandButton cbupdate
  32. Caption = "ok"
  33. Default = -1 'True
  34. Height = 375
  35. Left = 4890
  36. TabIndex = 34
  37. Top = 3780
  38. WhatsThisHelpID = 10030
  39. Width = 1035
  40. End
  41. Begin TabDlg.SSTab SSTab1
  42. Height = 3570
  43. HelpContextID = 10060
  44. Left = 90
  45. TabIndex = 36
  46. Top = 105
  47. WhatsThisHelpID = 10060
  48. Width = 7095
  49. _ExtentX = 12515
  50. _ExtentY = 6297
  51. _Version = 393216
  52. Style = 1
  53. Tab = 1
  54. TabHeight = 520
  55. BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
  56. Name = "MS Sans Serif"
  57. Size = 8.25
  58. Charset = 0
  59. Weight = 400
  60. Underline = 0 'False
  61. Italic = 0 'False
  62. Strikethrough = 0 'False
  63. EndProperty
  64. TabCaption(0) = "access"
  65. TabPicture(0) = "popupd.frx":000C
  66. Tab(0).ControlEnabled= 0 'False
  67. Tab(0).Control(0)= "picContainer(0)"
  68. Tab(0).Control(0).Enabled= 0 'False
  69. Tab(0).ControlCount= 1
  70. TabCaption(1) = "set"
  71. TabPicture(1) = "popupd.frx":0028
  72. Tab(1).ControlEnabled= -1 'True
  73. Tab(1).Control(0)= "picContainer(1)"
  74. Tab(1).Control(0).Enabled= 0 'False
  75. Tab(1).ControlCount= 1
  76. TabCaption(2) = "com"
  77. TabPicture(2) = "popupd.frx":0044
  78. Tab(2).ControlEnabled= 0 'False
  79. Tab(2).Control(0)= "picContainer(2)"
  80. Tab(2).Control(0).Enabled= 0 'False
  81. Tab(2).ControlCount= 1
  82. Begin VB.PictureBox picContainer
  83. BorderStyle = 0 'None
  84. Height = 2940
  85. Index = 2
  86. Left = -74835
  87. ScaleHeight = 2940
  88. ScaleWidth = 6690
  89. TabIndex = 33
  90. TabStop = 0 'False
  91. Top = 510
  92. Visible = 0 'False
  93. Width = 6690
  94. Begin VB.TextBox txtcomment
  95. ForeColor = &H00000000&
  96. Height = 2670
  97. Left = 210
  98. MaxLength = 256
  99. MultiLine = -1 'True
  100. ScrollBars = 2 'Vertical
  101. TabIndex = 0
  102. Top = 120
  103. WhatsThisHelpID = 50000
  104. Width = 6330
  105. End
  106. End
  107. Begin VB.PictureBox picContainer
  108. BorderStyle = 0 'None
  109. Height = 3060
  110. Index = 0
  111. Left = -74880
  112. ScaleHeight = 3060
  113. ScaleWidth = 6855
  114. TabIndex = 30
  115. TabStop = 0 'False
  116. Top = 375
  117. Width = 6855
  118. Begin VB.TextBox maskAccNo
  119. Height = 300
  120. Left = 4860
  121. MaxLength = 40
  122. TabIndex = 25
  123. Top = 1995
  124. WhatsThisHelpID = 30050
  125. Width = 1710
  126. End
  127. Begin VB.TextBox maskArea
  128. Height = 300
  129. Left = 1560
  130. MaxLength = 10
  131. TabIndex = 23
  132. Top = 1995
  133. WhatsThisHelpID = 30060
  134. Width = 1290
  135. End
  136. Begin VB.ComboBox dbCmbCty
  137. Height = 315
  138. Left = 1560
  139. Style = 2 'Dropdown List
  140. TabIndex = 19
  141. Top = 750
  142. WhatsThisHelpID = 30020
  143. Width = 3015
  144. End
  145. Begin VB.ComboBox cmbRegion
  146. Height = 315
  147. Left = 1560
  148. Style = 2 'Dropdown List
  149. TabIndex = 21
  150. Top = 1320
  151. WhatsThisHelpID = 30040
  152. Width = 3015
  153. End
  154. Begin VB.TextBox txtid
  155. BackColor = &H8000000F&
  156. ForeColor = &H00000000&
  157. Height = 285
  158. HelpContextID = 3000
  159. Left = 4725
  160. MaxLength = 25
  161. TabIndex = 31
  162. TabStop = 0 'False
  163. Top = 195
  164. Visible = 0 'False
  165. Width = 510
  166. End
  167. Begin VB.TextBox txtcity
  168. ForeColor = &H00000000&
  169. Height = 300
  170. Left = 1545
  171. MaxLength = 30
  172. TabIndex = 17
  173. Top = 180
  174. WhatsThisHelpID = 30010
  175. Width = 3000
  176. End
  177. Begin VB.ComboBox cmbstatus
  178. ForeColor = &H00000000&
  179. Height = 315
  180. ItemData = "popupd.frx":0060
  181. Left = 1560
  182. List = "popupd.frx":0062
  183. Style = 2 'Dropdown List
  184. TabIndex = 27
  185. Top = 2535
  186. WhatsThisHelpID = 30070
  187. Width = 1545
  188. End
  189. Begin VB.Label CountryLabel
  190. Alignment = 1 'Right Justify
  191. BackStyle = 0 'Transparent
  192. Caption = "&Country/ Dependency:"
  193. Height = 495
  194. Left = 45
  195. TabIndex = 18
  196. Top = 720
  197. WhatsThisHelpID = 30020
  198. Width = 1440
  199. End
  200. Begin VB.Label POPLabel
  201. Alignment = 1 'Right Justify
  202. BackStyle = 0 'Transparent
  203. Caption = "&POP name:"
  204. Height = 255
  205. Left = 0
  206. TabIndex = 16
  207. Top = 180
  208. WhatsThisHelpID = 30010
  209. Width = 1455
  210. End
  211. Begin VB.Label RegionLabel
  212. Alignment = 1 'Right Justify
  213. BackStyle = 0 'Transparent
  214. Caption = "&Region:"
  215. Height = 255
  216. Left = 15
  217. TabIndex = 20
  218. Top = 1335
  219. WhatsThisHelpID = 30040
  220. Width = 1440
  221. End
  222. Begin VB.Label AreaLabel
  223. Alignment = 1 'Right Justify
  224. BackStyle = 0 'Transparent
  225. Caption = "&Area code:"
  226. Height = 255
  227. Left = 30
  228. TabIndex = 22
  229. Top = 2055
  230. WhatsThisHelpID = 30060
  231. Width = 1455
  232. End
  233. Begin VB.Label AccessLabel
  234. Alignment = 1 'Right Justify
  235. BackStyle = 0 'Transparent
  236. Caption = "access num"
  237. Height = 255
  238. Left = 3180
  239. TabIndex = 24
  240. Top = 2055
  241. WhatsThisHelpID = 30050
  242. Width = 1590
  243. End
  244. Begin VB.Label StatusLabel
  245. Alignment = 1 'Right Justify
  246. BackStyle = 0 'Transparent
  247. Caption = "status"
  248. Height = 255
  249. Left = 30
  250. TabIndex = 26
  251. Top = 2595
  252. WhatsThisHelpID = 30070
  253. Width = 1440
  254. End
  255. Begin VB.Label Label3
  256. ForeColor = &H000000C0&
  257. Height = 255
  258. Left = 5265
  259. TabIndex = 32
  260. Top = 585
  261. Visible = 0 'False
  262. Width = 855
  263. End
  264. End
  265. Begin VB.PictureBox picContainer
  266. BorderStyle = 0 'None
  267. Height = 3045
  268. Index = 1
  269. Left = 120
  270. ScaleHeight = 3045
  271. ScaleWidth = 6855
  272. TabIndex = 29
  273. TabStop = 0 'False
  274. Top = 435
  275. Visible = 0 'False
  276. Width = 6855
  277. Begin VB.Frame FlagFrame
  278. Caption = "Service settings"
  279. Height = 3015
  280. Left = 165
  281. TabIndex = 15
  282. Top = 0
  283. WhatsThisHelpID = 40030
  284. Width = 2595
  285. Begin VB.CheckBox FlagCheck
  286. Caption = "cust 2"
  287. Height = 255
  288. Index = 7
  289. Left = 225
  290. TabIndex = 8
  291. Top = 2670
  292. WhatsThisHelpID = 40090
  293. Width = 2280
  294. End
  295. Begin VB.CheckBox FlagCheck
  296. Caption = "Sign on"
  297. Height = 255
  298. Index = 0
  299. Left = 240
  300. TabIndex = 1
  301. Top = 255
  302. WhatsThisHelpID = 40040
  303. Width = 2280
  304. End
  305. Begin VB.CheckBox FlagCheck
  306. Caption = "Sign up"
  307. Height = 255
  308. Index = 1
  309. Left = 240
  310. TabIndex = 2
  311. Top = 600
  312. WhatsThisHelpID = 40050
  313. Width = 2280
  314. End
  315. Begin VB.CheckBox FlagCheck
  316. Caption = "Modem"
  317. Height = 255
  318. Index = 2
  319. Left = 240
  320. TabIndex = 4
  321. Top = 1290
  322. WhatsThisHelpID = 40070
  323. Width = 2280
  324. End
  325. Begin VB.CheckBox FlagCheck
  326. Caption = "ISDN"
  327. Height = 255
  328. Index = 3
  329. Left = 240
  330. TabIndex = 5
  331. Top = 1635
  332. WhatsThisHelpID = 40080
  333. Width = 2280
  334. End
  335. Begin VB.CheckBox FlagCheck
  336. Caption = "cust 1"
  337. Height = 255
  338. Index = 4
  339. Left = 225
  340. TabIndex = 7
  341. Top = 2325
  342. WhatsThisHelpID = 40090
  343. Width = 2280
  344. End
  345. Begin VB.CheckBox FlagCheck
  346. Caption = "multi"
  347. Height = 255
  348. Index = 5
  349. Left = 240
  350. TabIndex = 6
  351. Top = 1980
  352. WhatsThisHelpID = 40100
  353. Width = 2280
  354. End
  355. Begin VB.CheckBox FlagCheck
  356. Caption = "surcrg"
  357. Height = 255
  358. Index = 6
  359. Left = 240
  360. TabIndex = 3
  361. Top = 945
  362. WhatsThisHelpID = 40060
  363. Width = 2280
  364. End
  365. End
  366. Begin VB.Frame AnalogFrame
  367. Caption = "Analog speed"
  368. Height = 1590
  369. Left = 3570
  370. TabIndex = 28
  371. Top = 1395
  372. Width = 3135
  373. Begin VB.ComboBox cmbmax
  374. ForeColor = &H00000000&
  375. Height = 315
  376. ItemData = "popupd.frx":0064
  377. Left = 1380
  378. List = "popupd.frx":0080
  379. TabIndex = 14
  380. Top = 1035
  381. WhatsThisHelpID = 40020
  382. Width = 1095
  383. End
  384. Begin VB.ComboBox cmbmin
  385. ForeColor = &H00000000&
  386. Height = 315
  387. ItemData = "popupd.frx":00BC
  388. Left = 1365
  389. List = "popupd.frx":00D8
  390. TabIndex = 12
  391. Top = 525
  392. WhatsThisHelpID = 40010
  393. Width = 1095
  394. End
  395. Begin VB.Label MaxLabel
  396. Alignment = 1 'Right Justify
  397. Caption = "M&ax:"
  398. Height = 255
  399. Left = 105
  400. TabIndex = 13
  401. Top = 1065
  402. WhatsThisHelpID = 40020
  403. Width = 1200
  404. End
  405. Begin VB.Label MinLabel
  406. Alignment = 1 'Right Justify
  407. Caption = "&Min:"
  408. Height = 255
  409. Left = 135
  410. TabIndex = 11
  411. Top = 555
  412. WhatsThisHelpID = 40010
  413. Width = 1155
  414. End
  415. End
  416. Begin VB.TextBox txtscript
  417. ForeColor = &H00000000&
  418. Height = 285
  419. Left = 3525
  420. MaxLength = 50
  421. TabIndex = 10
  422. Top = 630
  423. WhatsThisHelpID = 40000
  424. Width = 3135
  425. End
  426. Begin VB.Label DunLabel
  427. Caption = "&Dial-up networking script:"
  428. Height = 255
  429. Left = 3525
  430. TabIndex = 9
  431. Top = 345
  432. WhatsThisHelpID = 40000
  433. Width = 3165
  434. End
  435. End
  436. End
  437. End
  438. Attribute VB_Name = "frmupdate"
  439. Attribute VB_GlobalNameSpace = False
  440. Attribute VB_Creatable = False
  441. Attribute VB_PredeclaredId = True
  442. Attribute VB_Exposed = False
  443. Option Explicit
  444. Public ID As String
  445. Public status As String
  446. Private Sub cbupdate_Click()
  447. 'main POP save routine
  448. Dim response As Integer, deltnum As Integer, deltafind As Integer
  449. Dim Message As String, dialogtype As Long, title As String
  450. Dim i As Integer, deltasql As String
  451. Dim m As Integer
  452. Dim v As Long
  453. Dim n As Long
  454. Dim bool As Integer
  455. Dim mydesc As String
  456. ReDim bitvaluearray(10) As bitValues
  457. Dim sqlstm, countryname As String
  458. Dim itmX As ListItem
  459. Dim strTemp As String
  460. Dim strOldPOPName As String
  461. Dim bOutOfService As Boolean
  462. On Error GoTo ErrTrap
  463. If dbCmbCty.Text = "" Then
  464. MsgBox LoadResString(6044)
  465. SSTab1.Tab = 0
  466. dbCmbCty.SetFocus
  467. Exit Sub
  468. ElseIf txtcity.Text = "" Then
  469. MsgBox LoadResString(6045)
  470. SSTab1.Tab = 0
  471. txtcity.SetFocus
  472. Exit Sub
  473. ElseIf maskArea.Text = "" Then
  474. MsgBox LoadResString(6046)
  475. SSTab1.Tab = 0
  476. maskArea.SetFocus
  477. Exit Sub
  478. ElseIf maskAccNo.Text = "" Then
  479. MsgBox LoadResString(6047)
  480. SSTab1.Tab = 0
  481. maskAccNo.SetFocus
  482. Exit Sub
  483. End If
  484. Screen.MousePointer = 11
  485. If GsysDial!AccessNumberId = updateFound Then
  486. result = 0
  487. For m = 0 To 7
  488. Select Case m
  489. Case 0, 2, 3, 5 'handle idosyncrocies of flags
  490. result = result + (2 ^ m) * Abs(FlagCheck(m).Value - 1)
  491. Case Else
  492. result = result + (2 ^ m) * FlagCheck(m).Value
  493. End Select
  494. Next m
  495. bOutOfService = False
  496. If GsysDial!status = "1" And _
  497. cmbstatus.ItemData(cmbstatus.ListIndex) <> "1" Then _
  498. bOutOfService = True
  499. strOldPOPName = GsysDial!CityName
  500. GsysDial.Edit
  501. GsysDial!CityName = txtcity.Text
  502. GsysDial!CountryNumber = dbCmbCty.ItemData(dbCmbCty.ListIndex)
  503. GsysDial!RegionID = cmbRegion.ItemData(cmbRegion.ListIndex)
  504. GsysDial!AreaCode = maskArea.Text
  505. GsysDial!AccessNumber = maskAccNo.Text
  506. GsysDial!status = cmbstatus.ItemData(cmbstatus.ListIndex)
  507. 'If Label8.Caption <> "" Then GsysDial!StatusDate = Label8.Caption
  508. If Trim(cmbmin.Text) <> "" Or Val(cmbmin.Text) = 0 Then
  509. GsysDial!MinimumSpeed = Val(cmbmin.Text)
  510. Else
  511. GsysDial!MinimumSpeed = Null
  512. End If
  513. If Trim(cmbmax.Text) <> "" Or Val(cmbmax.Text) = 0 Then
  514. GsysDial!MaximumSpeed = Val(cmbmax.Text)
  515. Else
  516. GsysDial!MaximumSpeed = Null
  517. End If
  518. GsysDial!ScriptID = txtscript.Text
  519. GsysDial!FlipFactor = 0
  520. GsysDial!Flags = result
  521. GsysDial!Comments = txtcomment.Text
  522. GsysDial.Update
  523. If cmbstatus.ItemData(cmbstatus.ListIndex) = "1" Or bOutOfService Then
  524. 'insert the delta table
  525. Set GsysDelta = gsyspb.OpenRecordset("Select * from Delta order by DeltaNum", dbOpenDynaset)
  526. If GsysDelta.RecordCount = 0 Then
  527. deltnum = 1
  528. Else
  529. GsysDelta.MoveLast
  530. deltnum = GsysDelta!deltanum
  531. If deltnum > 6 Then
  532. deltnum = deltnum - 1
  533. End If
  534. End If
  535. For i = 1 To deltnum
  536. deltasql = "Select * from delta where DeltaNum = " & i% & _
  537. " AND AccessNumberId = '" & updateFound & "' " & _
  538. " order by DeltaNum"
  539. Set GsysDelta = gsyspb.OpenRecordset(deltasql, dbOpenDynaset)
  540. If Not (GsysDelta.BOF And GsysDelta.EOF) Then
  541. GsysDelta.Edit
  542. Else
  543. GsysDelta.AddNew
  544. GsysDelta!deltanum = i%
  545. GsysDelta!AccessNumberId = updateFound
  546. End If
  547. If Not bOutOfService Then
  548. GsysDelta!CountryNumber = dbCmbCty.ItemData(dbCmbCty.ListIndex)
  549. GsysDelta!AreaCode = maskArea.Text
  550. GsysDelta!AccessNumber = maskAccNo.Text
  551. If Trim(cmbmin.Text) <> "" Or Val(cmbmin.Text) = 0 Then
  552. GsysDelta!MinimumSpeed = Val(cmbmin.Text)
  553. Else
  554. GsysDelta!MinimumSpeed = Null
  555. End If
  556. If Trim(cmbmax.Text) <> "" Or Val(cmbmax.Text) = 0 Then
  557. GsysDelta!MaximumSpeed = Val(cmbmax.Text)
  558. Else
  559. GsysDelta!MaximumSpeed = Null
  560. End If
  561. GsysDelta!RegionID = cmbRegion.ItemData(cmbRegion.ListIndex)
  562. GsysDelta!CityName = txtcity.Text
  563. GsysDelta!ScriptID = txtscript.Text
  564. GsysDelta!Flags = result
  565. GsysDelta.Update
  566. Else ' insert a delete for the pop
  567. GsysDelta!CountryNumber = 0
  568. GsysDelta!AreaCode = 0
  569. GsysDelta!AccessNumber = 0
  570. GsysDelta!MinimumSpeed = 0
  571. GsysDelta!MaximumSpeed = 0
  572. GsysDelta!RegionID = 0
  573. GsysDelta!CityName = "0"
  574. GsysDelta!ScriptID = "0"
  575. GsysDelta!Flags = 0
  576. GsysDelta.Update
  577. End If
  578. Next i%
  579. End If
  580. Me.Hide
  581. frmMain.PopList.Sorted = False
  582. Set itmX = frmMain.PopList.SelectedItem
  583. With itmX
  584. .Text = txtcity.Text
  585. .SubItems(1) = maskArea.Text
  586. .SubItems(2) = maskAccNo.Text
  587. .SubItems(3) = dbCmbCty.Text
  588. .SubItems(4) = cmbRegion.Text
  589. .SubItems(5) = cmbstatus.Text
  590. End With
  591. frmMain.PopList.SelectedItem.EnsureVisible
  592. frmMain.PopList.SetFocus
  593. End If
  594. LogPOPEdit strOldPOPName, GsysDial
  595. GsysDial.Close
  596. GsysDelta.Close
  597. Set GsysDial = Nothing
  598. Set GsysDelta = Nothing
  599. Me.Hide
  600. Unload Me
  601. Screen.MousePointer = 0
  602. On Error GoTo 0
  603. Exit Sub
  604. ErrTrap:
  605. Screen.MousePointer = 0
  606. MsgBox LoadResString(6056) & Chr(13) & Chr(13) & Err.Description, vbExclamation
  607. Exit Sub
  608. 'If Err.Number = 3201 Then
  609. ' MsgBox "You must select country name, region description before save. Cannot continue.", 48
  610. ' Screen.MousePointer = 0
  611. ' Exit Sub
  612. 'ElseIf Err.Number = 3317 Then
  613. ' MsgBox "You must enter the area code and access number."
  614. ' Screen.MousePointer = 0
  615. '' Exit Sub
  616. 'End If
  617. 'Do While GsysDelta.EOF = False
  618. ' If GsysDelta!AccessNumberId = updateFound Then
  619. ' deltafind = 1
  620. ' Exit Do
  621. ' Else
  622. ' GsysDelta.MoveNext
  623. ' End If
  624. 'Loop
  625. 'GsysDelta!CountryNumber = dbCmbCty.ItemData(dbCmbCty.ListIndex)
  626. 'GsysDelta!AreaCode = maskarea.Text
  627. 'GsysDelta!AccessNumber = maskaccno.Text
  628. 'If Trim(cmbmin.Text) <> "" Or Val(cmbmin.Text) = 0 Then
  629. ' GsysDelta!MinimumSpeed = Val(cmbmin.Text)
  630. 'Else
  631. ' GsysDelta!MinimumSpeed = Null
  632. 'End If
  633. 'If Trim(cmbmax.Text) <> "" Or Val(cmbmax.Text) = 0 Then
  634. ' GsysDelta!MaximumSpeed = Val(cmbmax.Text)
  635. 'Else
  636. ' GsysDelta!MaximumSpeed = Null
  637. 'End If
  638. 'GsysDelta!regionID = cmbRegion.ItemData(cmbRegion.ListIndex)
  639. 'GsysDelta!CityName = txtcity.Text
  640. 'GsysDelta!ScriptID = txtscript.Text
  641. 'GsysDelta!Flags = result
  642. 'GsysDelta.Update
  643. End Sub
  644. Private Sub cmbmax_KeyPress(KeyAscii As Integer)
  645. KeyAscii = FilterNumberKey(KeyAscii)
  646. End Sub
  647. Private Sub cmbmin_KeyPress(KeyAscii As Integer)
  648. KeyAscii = FilterNumberKey(KeyAscii)
  649. End Sub
  650. 'Private Sub cmbstatus_Change()
  651. 'If cmbstatus.Text <> "" Then
  652. ' Label8.Caption = Date
  653. 'Else
  654. ' Label8.Caption = ""
  655. 'End If
  656. 'End Sub
  657. 'Private Sub cmbstatus_Click()
  658. ' If cmbstatus.Text <> "" Then
  659. ' Label8.Caption = Date
  660. ' Else
  661. ' Label8.Caption = ""
  662. ' End If
  663. 'End Sub
  664. Private Sub cmbUpclose_Click()
  665. On Error Resume Next
  666. Screen.MousePointer = 11
  667. Me.Hide
  668. Unload Me
  669. GsysDial.Close
  670. GsysDelta.Close
  671. Set GsysDial = Nothing
  672. Set GsysDelta = Nothing
  673. frmMain.PopList.SetFocus
  674. Screen.MousePointer = 0
  675. On Error GoTo 0
  676. End Sub
  677. Private Sub Form_Deactivate()
  678. Unload Me
  679. End Sub
  680. Function LoadPOPRes()
  681. Dim cRef As Integer
  682. On Error GoTo LoadErr
  683. cRef = 4000
  684. Me.Caption = LoadResString(cRef + 59) & " " & gsCurrentPB
  685. SSTab1.TabCaption(0) = LoadResString(cRef + 38)
  686. SSTab1.TabCaption(1) = LoadResString(cRef + 39)
  687. SSTab1.TabCaption(2) = LoadResString(cRef + 45)
  688. POPLabel.Caption = LoadResString(cRef + 46)
  689. CountryLabel.Caption = LoadResString(cRef + 47)
  690. RegionLabel.Caption = LoadResString(cRef + 48)
  691. AreaLabel.Caption = LoadResString(cRef + 49)
  692. AccessLabel.Caption = LoadResString(cRef + 50)
  693. StatusLabel.Caption = LoadResString(cRef + 51)
  694. ' status list
  695. With cmbstatus
  696. .AddItem gStatusText(1)
  697. .ItemData(.NewIndex) = 1
  698. .AddItem gStatusText(0)
  699. .ItemData(.NewIndex) = 0
  700. End With
  701. ' region list
  702. With cmbRegion
  703. .AddItem gRegionText(0), 0
  704. .ItemData(.NewIndex) = 0
  705. '.AddItem gRegionText(-1), 1
  706. '.ItemData(.NewIndex) = -1
  707. End With
  708. 'EditLabel.Caption = LoadResString(cRef + 57)
  709. FlagFrame.Caption = LoadResString(cRef + 52)
  710. dunLabel.Caption = LoadResString(cRef + 53)
  711. analogFrame.Caption = LoadResString(cRef + 54)
  712. MinLabel.Caption = LoadResString(cRef + 55)
  713. MaxLabel.Caption = LoadResString(cRef + 56)
  714. For cRef = 4080 To 4087
  715. FlagCheck(cRef - 4080).Caption = LoadResString(cRef)
  716. Next
  717. cbupdate.Caption = LoadResString(1002)
  718. cmbUpclose.Caption = LoadResString(1003)
  719. ' set fonts
  720. SetFonts Me
  721. SSTab1.Font.Charset = gfnt.Charset
  722. SSTab1.Font.Name = gfnt.Name
  723. SSTab1.Font.Size = gfnt.Size
  724. On Error GoTo 0
  725. Exit Function
  726. LoadErr:
  727. Exit Function
  728. End Function
  729. Private Sub Form_KeyPress(KeyAscii As Integer)
  730. CheckChar KeyAscii
  731. End Sub
  732. Private Sub Form_Load()
  733. Dim DBName As Variant
  734. Dim i As Integer
  735. Dim intX, intRegion As Integer
  736. Dim check As Integer
  737. Dim ID As Integer
  738. Dim n As Long
  739. Dim RS As Recordset
  740. Dim bool As Integer
  741. Dim mydesc As String
  742. Dim strTemp As String
  743. ReDim bitvaluearray(31) As bitValues
  744. On Error GoTo LoadErr
  745. Screen.MousePointer = 11
  746. LoadPOPRes
  747. check = 0 'Initialization
  748. Set GsysDial = gsyspb.OpenRecordset("Select * from DialUpPort where AccessNumberId=" & updateFound, dbOpenDynaset)
  749. Set GsysDelta = gsyspb.OpenRecordset("Select * from Delta order by DeltaNum", dbOpenDynaset)
  750. LoadList dbCmbCty, "Country", "CountryName", "CountryNumber"
  751. LoadList cmbRegion, "Region", "regiondesc", "regionid"
  752. ID = updateFound ' check this out - problems dbl clicking a pop
  753. 'strTemp = frmMain.PopList.SelectedItem.key
  754. 'ID = Val(Right$(strTemp, Len(strTemp) - 4))
  755. If GsysDial.RecordCount <> 0 Then
  756. GsysDial.MoveFirst
  757. 'Do While GsysDial.EOF = False
  758. ' If GsysDial!AccessNumberId = ID Then
  759. check = 1
  760. ' Exit Do
  761. ' Else
  762. ' GsysDial.MoveNext
  763. ' End If
  764. 'Loop
  765. End If
  766. If check = 1 Then
  767. txtid.Text = GsysDial!AccessNumberId
  768. Label3.Caption = GsysDial!CountryNumber
  769. maskArea.Text = GsysDial!AreaCode
  770. status = GsysDial!status
  771. 'Label8.Caption = GsysDial!StatusDate
  772. Select Case status
  773. Case 0
  774. cmbstatus = gStatusText(status)
  775. Case 1
  776. cmbstatus = gStatusText(status)
  777. Case Else
  778. cmbstatus = ""
  779. 'Label8.Caption = ""
  780. End Select
  781. maskAccNo = GsysDial!AccessNumber
  782. If IsNull(GsysDial!MinimumSpeed) Or GsysDial!MinimumSpeed = 0 Then
  783. cmbmin.Text = ""
  784. Else
  785. cmbmin.Text = GsysDial!MinimumSpeed
  786. End If
  787. If IsNull(GsysDial!MaximumSpeed) Or GsysDial!MaximumSpeed = 0 Then
  788. cmbmax.Text = ""
  789. Else
  790. cmbmax.Text = GsysDial!MaximumSpeed
  791. End If
  792. intRegion = GsysDial!RegionID
  793. If intRegion <> 0 Then
  794. For intX = 0 To cmbRegion.ListCount - 1
  795. If cmbRegion.ItemData(intX) = intRegion Then
  796. cmbRegion.ListIndex = intX
  797. End If
  798. Next
  799. Else
  800. cmbRegion.ListIndex = 0
  801. End If
  802. If IsNull(GsysDial!ScriptID) Then
  803. txtscript.Text = ""
  804. Else
  805. txtscript.Text = GsysDial!ScriptID
  806. End If
  807. If IsNull(GsysDial!Comments) Then
  808. txtcomment.Text = ""
  809. Else
  810. txtcomment.Text = GsysDial!Comments
  811. End If
  812. If IsNull(GsysDial!CityName) Then
  813. txtcity.Text = ""
  814. Else
  815. txtcity.Text = GsysDial!CityName
  816. End If
  817. n = GsysDial!Flags
  818. Set RS = gsyspb.OpenRecordset("select * from bitflag order by bit, value")
  819. RS.MoveFirst
  820. While Not RS.EOF
  821. bitvaluearray(RS!Bit).desc(RS!Value) = RS!desc
  822. RS.MoveNext
  823. Wend
  824. For i = 0 To 7
  825. bool = isBitSet(n, i)
  826. mydesc = bitvaluearray(i).desc(bool)
  827. 'handle the oddities that i introduced with the old
  828. ' list format, i.e. some flags are NOT by default.
  829. Select Case i
  830. Case 0, 2, 3, 5
  831. FlagCheck(i).Value = Abs(bool - 1)
  832. Case Else
  833. FlagCheck(i).Value = bool
  834. End Select
  835. Next i
  836. End If
  837. If check = 0 Then
  838. Screen.MousePointer = 0
  839. Exit Sub
  840. End If
  841. SSTab1.Tab = 0
  842. CenterForm Me, Screen
  843. Screen.MousePointer = 0
  844. Exit Sub
  845. LoadErr:
  846. Exit Sub
  847. End Sub
  848. Private Sub LoadList(list As Control, sTableName As String, sName As String, sID As String)
  849. Dim RS As Recordset
  850. 'list.Clear
  851. Set RS = gsyspb.OpenRecordset("SELECT " & sName & "," & sID & " FROM " & sTableName & " order by " & sName)
  852. While Not RS.EOF
  853. list.AddItem RS(sName)
  854. list.ItemData(list.NewIndex) = RS(sID)
  855. RS.MoveNext
  856. Wend
  857. RS.Close
  858. End Sub
  859. Private Sub Label3_Change()
  860. Dim temp
  861. Dim sqlstm As String
  862. Dim countryid As Long
  863. If Label3.Caption <> "" Then
  864. countryid = Val(Label3.Caption)
  865. sqlstm = "Select CountryName from Country where CountryNumber = " & countryid
  866. Set temp = gsyspb.OpenRecordset(sqlstm, dbOpenSnapshot)
  867. dbCmbCty.Text = temp!countryname
  868. End If
  869. End Sub
  870. Private Sub maskaccno_GotFocus()
  871. SelectText maskAccNo
  872. End Sub
  873. Private Sub maskaccno_KeyPress(KeyAscii As Integer)
  874. Select Case KeyAscii
  875. '0-9 A-Z a-z * # Bkspc Hyphen Space ctrl-C ctrl-V
  876. Case 48 To 57, 65 To 90, 97 To 122, 42, 35, 8, 45, 32, 3, 22
  877. Case Else
  878. KeyAscii = 0
  879. Beep
  880. End Select
  881. End Sub
  882. Private Sub maskarea_GotFocus()
  883. SelectText maskArea
  884. End Sub
  885. Private Sub maskarea_KeyPress(KeyAscii As Integer)
  886. Select Case KeyAscii
  887. '0-9 A-Z a-z * # Bkspc Hyphen Space ctrl-C ctrl-V
  888. Case 48 To 57, 65 To 90, 97 To 122, 42, 35, 8, 45, 32, 3, 22
  889. Case Else
  890. KeyAscii = 0
  891. Beep
  892. End Select
  893. End Sub
  894. Private Sub SSTab1_Click(PreviousTab As Integer)
  895. picContainer(PreviousTab).Visible = False
  896. picContainer(SSTab1.Tab).Visible = True
  897. End Sub
  898. Private Sub txtcity_GotFocus()
  899. SelectText txtcity
  900. End Sub
  901. Private Sub txtcity_KeyPress(KeyAscii As Integer)
  902. Select Case KeyAscii
  903. Case 44
  904. KeyAscii = 0
  905. Beep
  906. End Select
  907. End Sub
  908. Private Sub txtid_KeyDown(KeyCode As Integer, Shift As Integer)
  909. KeyCode = 0
  910. End Sub
  911. Private Sub txtid_KeyPress(KeyAscii As Integer)
  912. KeyAscii = 0
  913. End Sub
  914. Private Sub txtscript_GotFocus()
  915. SelectText txtscript
  916. End Sub
  917. Private Sub txtscript_KeyPress(KeyAscii As Integer)
  918. Select Case KeyAscii
  919. Case 44
  920. KeyAscii = 0
  921. Beep
  922. End Select
  923. End Sub