Form_DateCoInfo.frm
资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:22k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{BEEECC20-4D5F-4F8B-BFDC-5D9B6FBDE09D}#1.0#0"; "vsflex8.ocx"
- Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
- Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
- Begin VB.Form Frm_DateCoInfo
- BorderStyle = 1 'Fixed Single
- Caption = "系统参数设置"
- ClientHeight = 4410
- ClientLeft = 2805
- ClientTop = 2895
- ClientWidth = 5430
- HelpContextID = 1013
- Icon = "Form_DateCoInfo.frx":0000
- LinkTopic = "Form1"
- LockControls = -1 'True
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 4410
- ScaleWidth = 5430
- Begin VB.CommandButton Command1
- Caption = "取消&C"
- Height = 315
- Index = 1
- Left = 4230
- TabIndex = 6
- Top = 3990
- Width = 1125
- End
- Begin VB.CommandButton Command1
- Caption = "确定&D"
- Height = 315
- Index = 0
- Left = 2880
- TabIndex = 5
- Top = 3990
- Width = 1125
- End
- Begin TabDlg.SSTab SSTab1
- Height = 3795
- Left = 30
- TabIndex = 0
- Top = 90
- Width = 5325
- _ExtentX = 9393
- _ExtentY = 6694
- _Version = 393216
- Style = 1
- Tab = 1
- TabHeight = 520
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- TabCaption(0) = "系统"
- TabPicture(0) = "Form_DateCoInfo.frx":038A
- Tab(0).ControlEnabled= 0 'False
- Tab(0).Control(0)= "Text1(2)"
- Tab(0).Control(1)= "Text1(1)"
- Tab(0).Control(2)= "Text1(0)"
- Tab(0).Control(3)= "Label1(2)"
- Tab(0).Control(4)= "Label1(1)"
- Tab(0).Control(5)= "Label1(0)"
- Tab(0).ControlCount= 6
- TabCaption(1) = "会计期间"
- TabPicture(1) = "Form_DateCoInfo.frx":03A6
- Tab(1).ControlEnabled= -1 'True
- Tab(1).Control(0)= "Label2"
- Tab(1).Control(0).Enabled= 0 'False
- Tab(1).Control(1)= "Label3"
- Tab(1).Control(1).Enabled= 0 'False
- Tab(1).Control(2)= "FlexGrid"
- Tab(1).Control(2).Enabled= 0 'False
- Tab(1).Control(3)= "Check1"
- Tab(1).Control(3).Enabled= 0 'False
- Tab(1).Control(4)= "Text2"
- Tab(1).Control(4).Enabled= 0 'False
- Tab(1).Control(5)= "UpDown1"
- Tab(1).Control(5).Enabled= 0 'False
- Tab(1).Control(6)= "Text3"
- Tab(1).Control(6).Enabled= 0 'False
- Tab(1).Control(7)= "UpDown2"
- Tab(1).Control(7).Enabled= 0 'False
- Tab(1).ControlCount= 8
- TabCaption(2) = "精度"
- TabPicture(2) = "Form_DateCoInfo.frx":03C2
- Tab(2).ControlEnabled= 0 'False
- Tab(2).Control(0)= "UpDown7"
- Tab(2).Control(1)= "UpDown5"
- Tab(2).Control(2)= "UpDown3"
- Tab(2).Control(3)= "SL_Text"
- Tab(2).Control(4)= "JE_Text"
- Tab(2).Control(5)= "DJ_Text"
- Tab(2).Control(6)= "Label8"
- Tab(2).Control(7)= "Label6"
- Tab(2).Control(8)= "Label4"
- Tab(2).ControlCount= 9
- Begin MSComCtl2.UpDown UpDown7
- Height = 315
- Left = -72465
- TabIndex = 26
- Top = 1830
- Width = 240
- _ExtentX = 476
- _ExtentY = 556
- _Version = 393216
- Value = 1
- BuddyControl = "SL_Text"
- BuddyDispid = 196610
- OrigLeft = 3030
- OrigTop = 2400
- OrigRight = 3270
- OrigBottom = 2685
- Max = 6
- Min = 1
- SyncBuddy = -1 'True
- BuddyProperty = 65547
- Enabled = -1 'True
- End
- Begin MSComCtl2.UpDown UpDown5
- Height = 315
- Left = -72465
- TabIndex = 25
- Top = 1350
- Width = 240
- _ExtentX = 476
- _ExtentY = 556
- _Version = 393216
- Value = 1
- BuddyControl = "JE_Text"
- BuddyDispid = 196611
- OrigLeft = 2880
- OrigTop = 1560
- OrigRight = 3120
- OrigBottom = 1815
- Max = 6
- Min = 1
- SyncBuddy = -1 'True
- BuddyProperty = 65547
- Enabled = -1 'True
- End
- Begin MSComCtl2.UpDown UpDown3
- Height = 315
- Left = -72465
- TabIndex = 24
- Top = 840
- Width = 240
- _ExtentX = 476
- _ExtentY = 556
- _Version = 393216
- Value = 1
- BuddyControl = "DJ_Text"
- BuddyDispid = 196612
- OrigLeft = 3000
- OrigTop = 540
- OrigRight = 3240
- OrigBottom = 885
- Max = 6
- Min = 1
- SyncBuddy = -1 'True
- BuddyProperty = 65547
- Enabled = -1 'True
- End
- Begin VB.TextBox SL_Text
- Enabled = 0 'False
- Height = 315
- Left = -72960
- TabIndex = 23
- Text = "1"
- Top = 1830
- Width = 525
- End
- Begin VB.TextBox JE_Text
- Enabled = 0 'False
- Height = 315
- Left = -72960
- TabIndex = 22
- Text = "1"
- Top = 1350
- Width = 525
- End
- Begin VB.TextBox DJ_Text
- Enabled = 0 'False
- Height = 315
- Left = -72960
- TabIndex = 21
- Text = "1"
- Top = 840
- Width = 525
- End
- Begin MSComCtl2.UpDown UpDown2
- Height = 315
- Left = 3765
- TabIndex = 14
- Top = 2190
- Width = 270
- _ExtentX = 476
- _ExtentY = 556
- _Version = 393216
- Value = 1
- AutoBuddy = -1 'True
- BuddyControl = "Text3"
- BuddyDispid = 196613
- OrigLeft = 4080
- OrigTop = 1890
- OrigRight = 4350
- OrigBottom = 2175
- Max = 12
- Min = 1
- SyncBuddy = -1 'True
- BuddyProperty = 0
- Enabled = -1 'True
- End
- Begin VB.TextBox Text3
- Enabled = 0 'False
- Height = 315
- Left = 2820
- Locked = -1 'True
- TabIndex = 13
- Text = "1"
- Top = 2190
- Width = 945
- End
- Begin MSComCtl2.UpDown UpDown1
- Height = 315
- Left = 4005
- TabIndex = 12
- Top = 1470
- Width = 270
- _ExtentX = 476
- _ExtentY = 556
- _Version = 393216
- Value = 1999
- BuddyControl = "Text2"
- BuddyDispid = 196614
- OrigLeft = 4320
- OrigTop = 1230
- OrigRight = 4590
- OrigBottom = 1605
- Max = 2050
- Min = 1997
- SyncBuddy = -1 'True
- BuddyProperty = 0
- Enabled = -1 'True
- End
- Begin VB.TextBox Text2
- Enabled = 0 'False
- Height = 315
- Left = 2820
- Locked = -1 'True
- TabIndex = 11
- Text = "2000"
- Top = 1470
- Width = 1185
- End
- Begin VB.CheckBox Check1
- Alignment = 1 'Right Justify
- Caption = "自然年度会计期间"
- Height = 255
- Left = 2760
- TabIndex = 10
- Top = 780
- Width = 1755
- End
- Begin VB.TextBox Text1
- Height = 285
- Index = 2
- Left = -73650
- MaxLength = 25
- TabIndex = 9
- Top = 1740
- Width = 3315
- End
- Begin VB.TextBox Text1
- Height = 285
- Index = 1
- Left = -73650
- MaxLength = 30
- TabIndex = 8
- Top = 1230
- Width = 3315
- End
- Begin VB.TextBox Text1
- Height = 285
- Index = 0
- Left = -73650
- MaxLength = 30
- TabIndex = 7
- Top = 750
- Width = 3315
- End
- Begin VSFlex8Ctl.VSFlexGrid FlexGrid
- Height = 3135
- Left = 180
- TabIndex = 1
- Top = 450
- Width = 2145
- _cx = 8326856
- _cy = 8328602
- Appearance = 1
- BorderStyle = 1
- Enabled = -1 'True
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- MousePointer = 1
- BackColor = -2147483643
- ForeColor = -2147483640
- BackColorFixed = -2147483633
- ForeColorFixed = -2147483630
- BackColorSel = -2147483635
- ForeColorSel = -2147483634
- BackColorBkg = -2147483636
- BackColorAlternate= -2147483643
- GridColor = -2147483633
- GridColorFixed = -2147483632
- TreeColor = -2147483632
- FloodColor = 192
- SheetBorder = -2147483642
- FocusRect = 1
- HighLight = 1
- AllowSelection = -1 'True
- AllowBigSelection= -1 'True
- AllowUserResizing= 1
- SelectionMode = 1
- GridLines = 1
- GridLinesFixed = 2
- GridLineWidth = 1
- Rows = 13
- Cols = 2
- FixedRows = 1
- FixedCols = 0
- RowHeightMin = 275
- RowHeightMax = 0
- ColWidthMin = 0
- ColWidthMax = 0
- ExtendLastCol = 0 'False
- FormatString = "<期间|开始日期 "
- ScrollTrack = 0 'False
- ScrollBars = 3
- ScrollTips = 0 'False
- MergeCells = 0
- MergeCompare = 0
- AutoResize = -1 'True
- AutoSizeMode = 0
- AutoSearch = 0
- AutoSearchDelay = 2
- MultiTotals = -1 'True
- SubtotalPosition= 1
- OutlineBar = 0
- OutlineCol = 0
- Ellipsis = 1
- ExplorerBar = 0
- PicturesOver = 0 'False
- FillStyle = 0
- RightToLeft = 0 'False
- PictureType = 0
- TabBehavior = 0
- OwnerDraw = 0
- Editable = 0
- ShowComboButton = 1
- WordWrap = 0 'False
- TextStyle = 0
- TextStyleFixed = 0
- OleDragMode = 0
- OleDropMode = 0
- DataMode = 0
- VirtualData = -1 'True
- DataMember = ""
- ComboSearch = 3
- AutoSizeMouse = -1 'True
- FrozenRows = 0
- FrozenCols = 0
- AllowUserFreezing= 0
- BackColorFrozen = 0
- ForeColorFrozen = 0
- WallPaperAlignment= 9
- AccessibleName = ""
- AccessibleDescription= ""
- AccessibleValue = ""
- AccessibleRole = 24
- Begin VB.TextBox Data_T
- BorderStyle = 0 'None
- Height = 225
- Left = 450
- TabIndex = 17
- Top = 270
- Visible = 0 'False
- Width = 1335
- End
- End
- Begin VB.Label Label8
- AutoSize = -1 'True
- Caption = "数量小数位数:"
- Height = 180
- Left = -74160
- TabIndex = 20
- Top = 1890
- Width = 1170
- End
- Begin VB.Label Label6
- AutoSize = -1 'True
- Caption = "金额小数位数:"
- Height = 180
- Left = -74160
- TabIndex = 19
- Top = 1410
- Width = 1170
- End
- Begin VB.Label Label4
- AutoSize = -1 'True
- Caption = "单价小数位数:"
- Height = 180
- Left = -74160
- TabIndex = 18
- Top = 870
- Width = 1170
- End
- Begin VB.Label Label3
- AutoSize = -1 'True
- Caption = "启用会计期间:"
- Height = 180
- Left = 2820
- TabIndex = 16
- Top = 1950
- Width = 1170
- End
- Begin VB.Label Label2
- AutoSize = -1 'True
- Caption = "当前会计年度:"
- Height = 180
- Left = 2820
- TabIndex = 15
- Top = 1230
- Width = 1170
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "电话:"
- Height = 180
- Index = 2
- Left = -74700
- TabIndex = 4
- Top = 1740
- Width = 450
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "地址:"
- Height = 180
- Index = 1
- Left = -74700
- TabIndex = 3
- Top = 1260
- Width = 450
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "公司名称:"
- Height = 180
- Index = 0
- Left = -74700
- TabIndex = 2
- Top = 810
- Width = 810
- End
- End
- End
- Attribute VB_Name = "Frm_DateCoInfo"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim Row_int As Integer, Col_int As Integer
- Private Sub Check1_Click()
- Dim I As Integer
- If Check1.Value = 1 Then
- For I = 1 To 12
- FlexGrid.TextMatrix(I, 0) = I
- FlexGrid.TextMatrix(I, 1) = Format(Text2.Text & "-" & I & "-1", "yyyy-mm-dd")
- Next I
- Data_T.Locked = True
- Else
- Data_T.Locked = False
- End If
- Data_T.Text = FlexGrid.TextMatrix(FlexGrid.Row, 1)
- End Sub
- Private Sub Command1_Click(Index As Integer)
- Dim Ssql As String
- Dim I As Integer
- Dim aDo_Date As New Recordset
- On Error GoTo error_exit
- If Index = 1 Then Unload Me: Exit Sub
- Ssql = "update HDSystem_DataBases set CoName='" & Trim(Text1(0).Text) & "'," _
- & "Address='" & Trim(Text1(1).Text) & "',Phone='" & Trim(Text1(2).Text) & "',qsqj=" & Val(Text3.Text) _
- & " WHERE DataBasesName='" & Trim(Text1(0).Tag) & "'"
- Conn_System.Execute Ssql
- Conn_System.Execute "delete " & Trim(Text1(0).Tag) & ".dbo.Gy_kjrlb"
- aDo_Date.Open "select * from " & Trim(Text1(0).Tag) & ".dbo.Gy_kjrlb", Conn_System, adOpenStatic, adLockBatchOptimistic
- With aDo_Date
- For I = 1 To 12
- .AddNew
- !KjYear = Trim(Text2.Text)
- !Period = FlexGrid.TextMatrix(I, 0)
- !qsrq = FlexGrid.TextMatrix(I, 1)
- If I < 12 Then
- !zzrq = DateAdd("d", -1, FlexGrid.TextMatrix(I + 1, 1))
- Else
- !zzrq = DateAdd("d", -1, DateAdd("m", 1, FlexGrid.TextMatrix(I, 1)))
- End If
- If Val(FlexGrid.TextMatrix(I, 0)) < Val(Text3.Text) Then
- !cwzzjzbz = 1: !Xsjzbz = 1
- !Gdzcjzbz = 1: !Kfjzbz = 1
- !chhsjzbz = 1: !PMjzbz = 1
- !CgJzbz = 1: !CaskJzbz = 1
- End If
- If Val(FlexGrid.TextMatrix(I, 0)) = Val(Text3.Text) Then
- !beginflag = 1
- End If
- .Update
- Next
- .UpdateBatch adAffectAllChapters
- .Close
- Set aDo_Date = Nothing
- End With
- Conn_System.Execute "update " & Text1(0).Tag & ".dbo.Gy_AccInformation set itemValue=" & DJ_Text.Text & " where systemcode='Cwzz' and itemcode='cwdjxsws'"
- Conn_System.Execute "update " & Text1(0).Tag & ".dbo.Gy_AccInformation set itemValue=" & JE_Text.Text & " where systemcode='Cwzz' and itemcode='cwjexsws'"
- Conn_System.Execute "update " & Text1(0).Tag & ".dbo.Gy_AccInformation set itemValue=" & SL_Text.Text & " where systemcode='Cwzz' and itemcode='cwslxsws'"
- Unload Me
- Exit Sub
- error_exit:
- MsgBox Err.Description, 16
- End Sub
- Private Sub Data_T_GotFocus()
- With FlexGrid
- If .Col = 1 Then
- Data_T.Text = .TextMatrix(.Row, 1)
- Data_T.SelLength = Len(Data_T.Text)
- Row_int = .Row
- Col_int = .Col
- End If
- End With
- End Sub
- Private Sub Data_T_LostFocus()
- Dim I As Integer
- Dim r As Integer
- Dim data_er As Date
- Dim New_date As String
- On Error Resume Next
- r = 1
- With FlexGrid
- If IsDate(Data_T.Text) = True Then
- New_date = .TextMatrix(Row_int, Col_int)
- .TextMatrix(Row_int, Col_int) = Format(Data_T.Text, "yyyy-mm-dd")
- If New_date <> Trim(Data_T.Text) Then
- For I = Row_int + 1 To 12
- data_er = CDate(Val(Mid(.TextMatrix(Row_int, Col_int), 1, 4)) & "-" _
- & Val(Mid(.TextMatrix(Row_int, 1), 6, 5)))
- .TextMatrix(I, 1) = DateAdd("m", r, data_er)
- r = r + 1
- Next
- End If
- Else
- Data_T.Text = .TextMatrix(Row_int, Col_int)
- End If
- End With
- End Sub
- Private Sub FlexGrid_AfterScroll(ByVal OldTopRow As Long, ByVal OldLeftCol As Long, ByVal NewTopRow As Long, ByVal NewLeftCol As Long)
- Data_T.Visible = False
- End Sub
- Private Sub FlexGrid_SelChange()
- With FlexGrid
- .Col = 1
- Data_T.Move .CellLeft, .CellTop, .CellWidth, .CellHeight - 10
- Data_T.Visible = True
- Data_T.SetFocus
- End With
- End Sub
- Private Sub Form_Activate()
- On Error GoTo error_exit
- Dim TF As Boolean
- Dim aDo_data As New Recordset
- Dim aDo_data1 As New Recordset
- TF = False
- Set aDo_data = Conn_System.Execute("select * from HDSystem_DataBases where DataBasesName='" & Text1(0).Tag & "'")
- If aDo_data.RecordCount > 0 Then
- Text1(0) = "" & aDo_data!CoName
- Text1(1) = "" & aDo_data!Address
- Text1(2) = "" & aDo_data!Phone
- Text3.Text = IIf(Val("" & aDo_data!qsqj) = 0, 1, aDo_data!qsqj)
- Text2.Text = Year(Date)
- If Trim(aDo_data!YNUse) = "1" Then
- Command1(0).Enabled = False
- End If
- End If
- aDo_data.Close
- Set aDo_data = Nothing
- Set aDo_data1 = Conn_System.Execute("select * from " & Text1(0).Tag & ".dbo.Gy_kjrlb order by Kjyear,Period")
- If aDo_data1.RecordCount <= 0 Then
- Check1.Value = 1
- Check1_Click
- Else
- Dim I As Integer
- For I = 1 To 12
- Text2.Text = aDo_data1!KjYear
- FlexGrid.TextMatrix(I, 0) = I
- FlexGrid.TextMatrix(I, 1) = aDo_data1!qsrq
- aDo_data1.MoveNext
- Next I
- End If
- aDo_data1.Close
- Set aDo_data1 = Conn_System.Execute("select * from " & Text1(0).Tag & ".dbo.Gy_AccInformation where systemcode='Cwzz'")
- With aDo_data1
- Do While Not .EOF
- Select Case Trim(!itemcode)
- Case "cwdjxsws"
- DJ_Text.Text = !itemValue
- Case "cwjexsws"
- JE_Text.Text = !itemValue
- Case "cwslxsws"
- SL_Text.Text = !itemValue
- End Select
- aDo_data1.MoveNext
- Loop
- aDo_data1.Close
- Set aDo_data1 = Nothing
- End With
- Exit Sub
- error_exit:
- MsgBox Err.Description, 16
- Unload Me
- End Sub
- Private Sub Text2_Change()
- Dim I As Integer
- For I = 1 To 12
- FlexGrid.TextMatrix(I, 1) = Format(Trim(Text2.Text) & "- " & I & "-01", "yyyy-mm-dd")
- Next I
- Data_T.Text = FlexGrid.TextMatrix(FlexGrid.Row, 1)
- End Sub