chore: 首次簽入 Thinkyu ASP.NET 專案

- 加入 Visual Studio / ASP.NET .gitignore
- 排除建置輸出、IDE 設定、NuGet packages、大型 MSI 安裝檔
This commit is contained in:
2026-09-10 09:42:37 +08:00
commit 577060bc78
2496 changed files with 501389 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
-$A8
-$B-
-$C+
-$D+
-$E-
-$F-
-$G+
-$H+
-$I+
-$J-
-$K-
-$L+
-$M-
-$N+
-$O+
-$P+
-$Q-
-$R-
-$S-
-$T-
-$U-
-$V+
-$W-
-$X+
-$YD
-$Z1
-cg
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
-H+
-W+
-M
-$M16384,1048576
-K$00400000
-LE"c:\program files (x86)\borland\delphi7\Projects\Bpl"
-LN"c:\program files (x86)\borland\delphi7\Projects\Bpl"
-w-UNSAFE_TYPE
-w-UNSAFE_CODE
-w-UNSAFE_CAST
+136
View File
@@ -0,0 +1,136 @@
[FileVersion]
Version=7.0
[Compiler]
A=8
B=0
C=1
D=1
E=0
F=0
G=1
H=1
I=1
J=0
K=0
L=1
M=0
N=1
O=1
P=1
Q=0
R=0
S=0
T=0
U=0
V=1
W=0
X=1
Y=1
Z=1
ShowHints=1
ShowWarnings=1
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
NamespacePrefix=
SymbolDeprecated=1
SymbolLibrary=1
SymbolPlatform=1
UnitLibrary=1
UnitPlatform=1
UnitDeprecated=1
HResultCompat=1
HidingMember=1
HiddenVirtual=1
Garbage=1
BoundsError=1
ZeroNilCompat=1
StringConstTruncated=1
ForLoopVarVarPar=1
TypedConstVarPar=1
AsgToTypedConst=1
CaseLabelRange=1
ForVariable=1
ConstructingAbstract=1
ComparisonFalse=1
ComparisonTrue=1
ComparingSignedUnsigned=1
CombiningSignedUnsigned=1
UnsupportedConstruct=1
FileOpen=1
FileOpenUnitSrc=1
BadGlobalSymbol=1
DuplicateConstructorDestructor=1
InvalidDirective=1
PackageNoLink=1
PackageThreadVar=1
ImplicitImport=1
HPPEMITIgnored=1
NoRetVal=1
UseBeforeDef=1
ForLoopVarUndef=1
UnitNameMismatch=1
NoCFGFileFound=1
MessageDirective=1
ImplicitVariants=1
UnicodeToLocale=1
LocaleToUnicode=1
ImagebaseMultiple=1
SuspiciousTypecast=1
PrivatePropAccessor=1
UnsafeType=0
UnsafeCode=0
UnsafeCast=0
[Linker]
MapFile=0
OutputObjs=0
ConsoleApp=1
DebugInfo=0
RemoteSymbols=0
MinStackSize=16384
MaxStackSize=1048576
ImageBase=4194304
ExeDescription=
[Directories]
OutputDir=
UnitOutputDir=
PackageDLLOutputDir=
PackageDCPOutputDir=
SearchPath=
Packages=
Conditionals=
DebugSourceDirs=
UsePackages=0
[Parameters]
RunParams=
HostApplication=
Launcher=
UseLauncher=0
DebugCWD=
[Language]
ActiveLang=
ProjectLang=
RootDir=
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1028
CodePage=950
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
+13
View File
@@ -0,0 +1,13 @@
program YearOpen;
uses
Forms,
unYearOpen in 'unYearOpen.pas' {Form1};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
+100
View File
@@ -0,0 +1,100 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{B1D3CE93-F4A5-40AD-B286-162C14456CC1}</ProjectGuid>
<MainSource>YearOpen.dpr</MainSource>
<Config Condition="'$(Config)'==''">Debug</Config>
<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
<ProjectVersion>12.0</ProjectVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_DependencyCheckOutputName>YearOpen.exe</DCC_DependencyCheckOutputName>
<DCC_ImageBase>00400000</DCC_ImageBase>
<DCC_Platform>x86</DCC_Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_DebugInformation>false</DCC_DebugInformation>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="YearOpen.dpr">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="unYearOpen.pas">
<Form>Form1</Form>
</DCCReference>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType>VCLApplication</Borland.ProjectType>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">YearOpen.dpr</Source>
</Source>
<Parameters>
<Parameters Name="UseLauncher">False</Parameters>
<Parameters Name="LoadAllSymbols">True</Parameters>
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
</Parameters>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1028</VersionInfo>
<VersionInfo Name="CodePage">950</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
</VersionInfoKeys>
</Delphi.Personality>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
</Project>
+99
View File
@@ -0,0 +1,99 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{B1D3CE93-F4A5-40AD-B286-162C14456CC1}</ProjectGuid>
<MainSource>YearOpen.dpr</MainSource>
<Config Condition="'$(Config)'==''">Debug</Config>
<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_DependencyCheckOutputName>YearOpen.exe</DCC_DependencyCheckOutputName>
<DCC_ImageBase>00400000</DCC_ImageBase>
<DCC_Platform>x86</DCC_Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_DebugInformation>false</DCC_DebugInformation>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="YearOpen.dpr">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="unYearOpen.pas">
<Form>Form1</Form>
</DCCReference>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType>VCLApplication</Borland.ProjectType>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">YearOpen.dpr</Source>
</Source>
<Parameters>
<Parameters Name="UseLauncher">False</Parameters>
<Parameters Name="LoadAllSymbols">True</Parameters>
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
</Parameters>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1028</VersionInfo>
<VersionInfo Name="CodePage">950</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
</VersionInfoKeys>
</Delphi.Personality>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
</Project>
+2
View File
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<BorlandProject/>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+612
View File
@@ -0,0 +1,612 @@
object Form1: TForm1
Left = 229
Top = 50
Caption = #24180#24230#38283#24115#20316#26989
ClientHeight = 626
ClientWidth = 816
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poDesigned
OnActivate = FormActivate
OnClose = FormClose
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 19
object spl1: TSplitter
Left = 0
Top = 369
Width = 816
Height = 5
Cursor = crVSplit
Align = alTop
ExplicitTop = 305
end
object WDBGRID1: WDBGRID
Left = 0
Top = 40
Width = 816
Height = 329
Align = alTop
DataSource = DSBPAA
TabOrder = 0
TitleFont.Charset = DEFAULT_CHARSET
TitleFont.Color = clWindowText
TitleFont.Height = -16
TitleFont.Name = 'Tahoma'
TitleFont.Style = []
IsTwoColor = True
TwoColor = 12648447
TwoFontColor = clWindowText
AllowAppend = False
AllowDelete = False
IsVerScrollBar = True
MenuShow = [msWDGM, msExcel, msDBF, msDB, msTXT, msMDB]
Columns = <
item
Expanded = False
Width = 0
Visible = True
ValueChecked = 'T'
ValueUnchecked = 'F'
EditType = etEdit
TwoColor = 12648447
TwoFontColor = clWindowText
end
item
Expanded = False
FieldName = 'CHECKED'
Title.Caption = #36984#21462
Width = 36
Visible = True
Check = True
ValueChecked = 'Y'
ValueUnchecked = 'N'
EditType = etEdit
TwoColor = 12648447
TwoFontColor = clWindowText
end
item
Expanded = False
FieldName = 'BPPNM'
Title.Caption = #35336#30059#20195#34399
Width = 70
Visible = True
ValueChecked = 'T'
ValueUnchecked = 'F'
EditType = etEdit
TwoColor = 12648447
TwoFontColor = clWindowText
end
item
Expanded = False
FieldName = 'BPPME'
Title.Caption = #35336#30059#21517#31281
Width = 257
Visible = True
ValueChecked = 'T'
ValueUnchecked = 'F'
EditType = etEdit
TwoColor = 12648447
TwoFontColor = clWindowText
end
item
Expanded = False
FieldName = 'BPPYN'
Title.Caption = #21407#24180#24230#35336#30059#20195#34399
Width = 118
Visible = True
ValueChecked = 'T'
ValueUnchecked = 'F'
EditType = etEdit
TwoColor = 12648447
TwoFontColor = clWindowText
end
item
Expanded = False
FieldName = 'NEW_BPPNM'
Title.Caption = #26032#35336#30059#20195#34399
Width = 84
Visible = True
ValueChecked = 'T'
ValueUnchecked = 'F'
EditType = etEdit
TwoColor = 12648447
TwoFontColor = clWindowText
end>
end
object Panel1: TPanel
Left = 0
Top = 0
Width = 816
Height = 40
Align = alTop
BevelOuter = bvNone
TabOrder = 1
object Label1: TLabel
Left = 8
Top = 10
Width = 112
Height = 19
Caption = #35201#35079#35069#30340#24180#24230#65306
end
object eYY: TEdit
Left = 120
Top = 7
Width = 65
Height = 27
TabOrder = 0
end
object btnYYOk: TButton
Left = 191
Top = 8
Width = 65
Height = 25
Caption = #26597#35426
TabOrder = 1
OnClick = btnYYOkClick
end
end
object Panel2: TPanel
Left = 0
Top = 374
Width = 816
Height = 64
Align = alTop
BevelOuter = bvNone
TabOrder = 2
object Label2: TLabel
Left = 8
Top = 9
Width = 64
Height = 19
Caption = #26032#24180#24230#65306
end
object btnOpenYear: TButton
Left = 146
Top = 7
Width = 154
Height = 25
Caption = #30906#23450#35079#35069#33267#26032#24180#24230
TabOrder = 1
OnClick = btnOpenYearClick
end
object eNewYY: TEdit
Left = 74
Top = 6
Width = 65
Height = 27
TabOrder = 0
end
object cbInsertBPAA: TCheckBox
Left = 145
Top = 38
Width = 120
Height = 20
Caption = #26032#22686#24180#24230#25509#21934
Checked = True
State = cbChecked
TabOrder = 3
end
object cbInsertBPJA: TCheckBox
Left = 385
Top = 38
Width = 89
Height = 20
Caption = #26032#22686#32887#31281
Checked = True
State = cbChecked
TabOrder = 5
end
object cbInsertBPJB: TCheckBox
Left = 481
Top = 38
Width = 121
Height = 20
Caption = #26032#22686#32887#31281#31561#32026
Checked = True
State = cbChecked
TabOrder = 6
end
object cbInsertRASN: TCheckBox
Left = 610
Top = 38
Width = 136
Height = 20
Caption = #36681#20154#21729#27966#36963#36039#26009
Checked = True
State = cbChecked
TabOrder = 7
end
object cbInsertBPAB: TCheckBox
Left = 273
Top = 38
Width = 105
Height = 20
Caption = #36681#26371#35336#31185#30446
Checked = True
State = cbChecked
TabOrder = 4
end
object cbClearFirst: TCheckBox
Left = 306
Top = 9
Width = 154
Height = 21
Caption = #20808#28165#38500#20877#35079#35069#36039#26009
TabOrder = 2
end
end
object Memo1: TMemo
Left = 0
Top = 438
Width = 816
Height = 188
Align = alClient
TabOrder = 3
ExplicitTop = 410
ExplicitHeight = 116
end
object Conn: TADOConnection
LoginPrompt = False
Provider = 'SQLNCLI.1'
Left = 48
Top = 112
end
object QBPAA: TADODataSet
Connection = Conn
CursorType = ctStatic
CommandText =
' SELECT '#39'N'#39' AS CHECKED, A.BPPNM, A.BPYER, A.BPPYN, A.BPPYM, B.BP' +
'PME, '#39#39' AS NEW_BPPNM, '#39#39' AS NEW_BPPYN'#13#10' FROM BPAA A INNER JOIN B' +
'PRJ B ON A.BPPNM=B.BPPNM'#13#10' WHERE A.BPYER=:BPYER AND A.BPPNM<>'#39'00' +
'0001'#39#13#10
Parameters = <
item
Name = 'BPYER'
Attributes = [paSigned]
DataType = ftInteger
Precision = 10
Size = 4
Value = Null
end>
Left = 96
Top = 112
object QBPAACHECKED: TStringField
FieldName = 'CHECKED'
ProviderFlags = []
Size = 1
end
object QBPAABPPNM: TWideStringField
FieldName = 'BPPNM'
Size = 10
end
object QBPAABPYER: TIntegerField
FieldName = 'BPYER'
end
object QBPAABPPYN: TWideStringField
FieldName = 'BPPYN'
Size = 10
end
object QBPAABPPYM: TWideStringField
FieldName = 'BPPYM'
Size = 50
end
object QBPAABPPME: TWideStringField
FieldName = 'BPPME'
Size = 30
end
object QBPAANEW_BPPNM: TStringField
DisplayLabel = #26032#35336#30059#20195#34399
DisplayWidth = 10
FieldName = 'NEW_BPPNM'
ProviderFlags = []
Size = 10
end
end
object DSBPAA: TDataSource
DataSet = CDSBPAA
Left = 256
Top = 112
end
object InsertBPAA: TADOCommand
CommandText =
'INSERT INTO BPAA '#13#10' (BPPNM, BPYER, BPPYN, BPPYM, BPBGT, BPCSD, ' +
'BPMSD, BPS01, BPS02, BPS03, '#13#10' BPS04, BPS05, BPS06, BPS07, BPS' +
'08, BPS09, BPS10, BPS11, BPS12, BPS13, '#13#10' BPS14, BPS15, BPS16,' +
' BPS17, BPS18, BPS19, BPS20, BPS21, BPS22, BPS23, '#13#10' BPS24, BP' +
'S25, BPS26, BPS27, BPS28, BPS29, BPS30, BPFED, APPNO, TRDAT, '#13#10' ' +
' TRMOD, TRUSR)'#13#10'SELECT '#13#10' :BPPNM, :BPYER, :BPPYN, :BPPYM, BPB' +
'GT, BPCSD, BPMSD, BPS01, BPS02, BPS03, '#13#10' BPS04, BPS05, BPS06,' +
' BPS07, BPS08, BPS09, BPS10, BPS11, BPS12, BPS13, '#13#10' BPS14, BP' +
'S15, BPS16, BPS17, BPS18, BPS19, BPS20, BPS21, BPS22, BPS23, '#13#10' ' +
' BPS24, BPS25, BPS26, BPS27, BPS28, BPS29, BPS30, BPFED, 1, :TR' +
'DAT, '#13#10' '#39'INSERT'#39', TRUSR'#13#10'FROM BPAA'#13#10'WHERE BPPYN=:OLD_BPPYN'#13#10
Connection = Conn
Parameters = <
item
Name = 'BPPNM'
DataType = ftWideString
Size = 10
Value = Null
end
item
Name = 'BPYER'
DataType = ftInteger
Size = -1
Value = Null
end
item
Name = 'BPPYN'
DataType = ftWideString
Size = 12
Value = Null
end
item
Name = 'BPPYM'
DataType = ftWideString
Size = 50
Value = Null
end
item
Name = 'TRDAT'
DataType = ftDateTime
Size = -1
Value = Null
end
item
Name = 'OLD_BPPYN'
DataType = ftWideString
Size = 12
Value = Null
end>
Left = 48
Top = 168
end
object InsertBPAB: TADOCommand
CommandText =
'INSERT INTO BPAB'#13#10' (BPPYN, BPACC, BPAME, BPBGT, BPCLS, BPORD, ' +
'BPDOC, APPNO, TRDAT, TRMOD, TRUSR) '#13#10'SELECT'#13#10' :BPPYN, BPACC, B' +
'PAME, BPBGT, BPCLS, BPORD, BPDOC, APPNO, :TRDAT, '#39'INSERT'#39', TRUSR' +
#13#10'FROM BPAB'#13#10'WHERE BPPYN=:OLD_BPPYN'#13#10
Connection = Conn
Parameters = <
item
Name = 'BPPYN'
DataType = ftWideString
Size = 12
Value = Null
end
item
Name = 'TRDAT'
DataType = ftDateTime
Size = -1
Value = Null
end
item
Name = 'OLD_BPPYN'
DataType = ftWideString
Size = 12
Value = Null
end>
Left = 112
Top = 168
end
object InsertBPJA: TADOCommand
CommandText =
'INSERT INTO BPJA'#13#10' (BPPYN, BPJNO, BPJME, BPQTY, APPNO, TRDAT, ' +
'TRMOD, TRUSR) '#13#10'SELECT'#13#10' :BPPYN, BPJNO, BPJME, BPQTY, APPNO, :' +
'TRDAT, '#39'INSERT'#39', TRUSR'#13#10'FROM BPJA'#13#10'WHERE BPPYN=:OLD_BPPYN'#13#10
Connection = Conn
Parameters = <
item
Name = 'BPPYN'
DataType = ftWideString
Size = 12
Value = Null
end
item
Name = 'TRDAT'
DataType = ftDateTime
Size = -1
Value = Null
end
item
Name = 'OLD_BPPYN'
DataType = ftWideString
Size = 12
Value = Null
end>
Left = 176
Top = 168
end
object InsertBPJB: TADOCommand
CommandText =
'INSERT INTO BPJB'#13#10' (BPPYN, BPJNO, BPCNO, BPCME, BPSRM, BPSRD, ' +
'BPP01, BPP02, BPP03, BPP04, BPP05, APPNO, TRDAT, TRMOD, TRUSR) '#13 +
#10'SELECT'#13#10' :BPPYN, BPJNO, BPCNO, BPCME, BPSRM, BPSRD, BPP01, BP' +
'P02, BPP03, BPP04, BPP05, APPNO, :TRDAT, '#39'INSERT'#39', TRUSR'#13#10'FROM B' +
'PJB'#13#10'WHERE BPPYN=:OLD_BPPYN'#13#10
Connection = Conn
Parameters = <
item
Name = 'BPPYN'
DataType = ftWideString
Size = 12
Value = Null
end
item
Name = 'TRDAT'
DataType = ftDateTime
Size = -1
Value = Null
end
item
Name = 'OLD_BPPYN'
DataType = ftWideString
Size = 12
Value = Null
end>
Left = 240
Top = 168
end
object InsertRASN: TADOCommand
CommandText =
'INSERT INTO dbo.RASN'#13#10' (RANUM, RAITM, RACNM, RAPYN, RASDT, RAE' +
'DT, RAJNO, RACNO, RABRH, RAS01, APPNO, TRDAT, TRMOD, TRUSR) '#13#10'SE' +
'LECT'#13#10' A.RANUM, (SELECT MAX(B.RAITM) + 1 FROM RASN B WHERE B.' +
'RANUM=A.RANUM) RAITM, A.RACNM, '#13#10' :BPPYN, :RASDT, NULL, A.RAJ' +
'NO, A.RACNO, A.RABRH, A.RAS01, A.APPNO, :TRDAT, '#39'INSERT'#39', TRUSR'#13 +
#10'FROM RASN A'#13#10'WHERE RAPYN=:OLD_BPPYN AND A.RAEDT IS NULL'#13#10
Connection = Conn
Parameters = <
item
Name = 'BPPYN'
DataType = ftWideString
Size = 12
Value = Null
end
item
Name = 'RASDT'
DataType = ftDateTime
Size = -1
Value = Null
end
item
Name = 'TRDAT'
DataType = ftDateTime
Size = -1
Value = Null
end
item
Name = 'OLD_BPPYN'
DataType = ftWideString
Size = 12
Value = Null
end>
Left = 304
Top = 168
end
object EndOldRASN: TADOCommand
CommandText =
'UPDATE RASN SET RAEDT=:RAEDT WHERE RAPYN=:OLD_RAPYN AND RAEDT IS' +
' NULL '
Connection = Conn
Parameters = <
item
Name = 'RAEDT'
Attributes = [paNullable]
DataType = ftDateTime
NumericScale = 3
Precision = 23
Size = 16
Value = Null
end
item
Name = 'OLD_RAPYN'
Attributes = [paNullable]
DataType = ftWideString
NumericScale = 255
Precision = 255
Size = 10
Value = Null
end>
Left = 368
Top = 168
end
object DSPBPAA: TDataSetProvider
DataSet = QBPAA
ResolveToDataSet = True
Options = [poAllowCommandText, poUseQuoteChar]
Left = 144
Top = 112
end
object CDSBPAA: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DSPBPAA'
Left = 200
Top = 112
end
object DeleteBPAA: TADOCommand
CommandText = 'DELETE FROM BPAA '#13#10'WHERE BPPYN=:BPPYN'#13#10
Connection = Conn
Parameters = <
item
Name = 'BPPYN'
Attributes = [paNullable]
DataType = ftWideString
NumericScale = 255
Precision = 255
Size = 10
Value = Null
end>
Left = 48
Top = 232
end
object DeleteBPAB: TADOCommand
CommandText = 'DELETE FROM BPAB'#13#10'WHERE BPPYN=:BPPYN'#13#10
Connection = Conn
Parameters = <
item
Name = 'BPPYN'
DataType = ftWideString
NumericScale = 255
Precision = 255
Size = 10
Value = Null
end>
Left = 112
Top = 232
end
object DeleteBPJA: TADOCommand
CommandText = 'DELETE FROM BPJA'#13#10'WHERE BPPYN=:BPPYN'#13#10
Connection = Conn
Parameters = <
item
Name = 'BPPYN'
DataType = ftWideString
NumericScale = 255
Precision = 255
Size = 10
Value = Null
end>
Left = 176
Top = 232
end
object DeleteBPJB: TADOCommand
CommandText = 'DELETE FROM BPJB'#13#10'WHERE BPPYN=:BPPYN'#13#10
Connection = Conn
Parameters = <
item
Name = 'BPPYN'
DataType = ftWideString
NumericScale = 255
Precision = 255
Size = 10
Value = Null
end>
Left = 240
Top = 232
end
object DeleteRASN: TADOCommand
CommandText = 'DELETE FROM RASN'#13#10'WHERE RAPYN=:BPPYN'
Connection = Conn
Parameters = <
item
Name = 'BPPYN'
Attributes = [paNullable]
DataType = ftWideString
NumericScale = 255
Precision = 255
Size = 10
Value = Null
end>
Left = 304
Top = 232
end
end
+285
View File
@@ -0,0 +1,285 @@
unit unYearOpen;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ADODB, DB, StdCtrls, ExtCtrls, Grids, DBGrids, wdbreg, DBClient,
Provider;
type
TForm1 = class(TForm)
Conn: TADOConnection;
QBPAA: TADODataSet;
DSBPAA: TDataSource;
InsertBPAA: TADOCommand;
WDBGRID1: WDBGRID;
Panel1: TPanel;
Label1: TLabel;
eYY: TEdit;
btnYYOk: TButton;
Panel2: TPanel;
btnOpenYear: TButton;
InsertBPAB: TADOCommand;
InsertBPJA: TADOCommand;
InsertBPJB: TADOCommand;
InsertRASN: TADOCommand;
EndOldRASN: TADOCommand;
DSPBPAA: TDataSetProvider;
CDSBPAA: TClientDataSet;
Memo1: TMemo;
QBPAACHECKED: TStringField;
QBPAABPPNM: TWideStringField;
QBPAABPYER: TIntegerField;
QBPAABPPYN: TWideStringField;
QBPAABPPYM: TWideStringField;
QBPAABPPME: TWideStringField;
QBPAANEW_BPPNM: TStringField;
spl1: TSplitter;
Label2: TLabel;
eNewYY: TEdit;
cbInsertBPAA: TCheckBox;
cbInsertBPJA: TCheckBox;
cbInsertBPJB: TCheckBox;
cbInsertRASN: TCheckBox;
cbInsertBPAB: TCheckBox;
cbClearFirst: TCheckBox;
DeleteBPAA: TADOCommand;
DeleteBPAB: TADOCommand;
DeleteBPJA: TADOCommand;
DeleteBPJB: TADOCommand;
DeleteRASN: TADOCommand;
procedure btnYYOkClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure btnOpenYearClick(Sender: TObject);
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
oldYY, newYY: integer;
procedure DoOpenYear;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses WGUARD1;
{$R *.dfm}
procedure TForm1.btnYYOkClick(Sender: TObject);
begin
oldYY := StrToIntDef(eYY.Text, -1);
if (oldYY < 0) then
begin
Application.MessageBox('年度不合理,請重新輸入', '錯誤', MB_ICONERROR);
eYY.SetFocus;
exit;
end;
CDSBPAA.Close;
CDSBPAA.Params.ParamValues['BPYER'] := oldYY;
CDSBPAA.Open;
CDSBPAA.FieldByName('CHECKED').ReadOnly := False;
CDSBPAA.FieldByName('NEW_BPPNM').ReadOnly := False;
end;
procedure TForm1.DoOpenYear;
var newBPPYN, oldBPPYN, newBPPYM: string;
begin
CDSBPAA.First;
CDSBPAA.DisableControls;
while not CDSBPAA.Eof do
begin
if CDSBPAA.FieldByName('CHECKED').Value = 'N' then
begin
CDSBPAA.MoveBy(1);
continue;
end;
newBPPYN := FormatFloat('000', newYY) + CDSBPAA.FieldByName('NEW_BPPNM').AsString;
oldBPPYN := CDSBPAA.FieldByName('BPPYN').AsString;
newBPPYM := WNTSA(newYY, '', '2') + '年' + CDSBPAA.FieldByName('BPPME').AsString;
Conn.BeginTrans;
try
if cbInsertBPAA.Checked then
begin
if cbClearFirst.Checked then
begin
DeleteBPAA.Parameters.ParamValues['BPPYN'] := newBPPYN;
DeleteBPAA.Execute;
end;
InsertBPAA.Parameters.ParamValues['BPPNM'] := CDSBPAA.FieldByName('NEW_BPPNM').AsString;
InsertBPAA.Parameters.ParamValues['BPYER'] := newYY;
InsertBPAA.Parameters.ParamValues['BPPYN'] := newBPPYN;
InsertBPAA.Parameters.ParamValues['BPPYM'] := newBPPYM;
InsertBPAA.Parameters.ParamValues['TRDAT'] := Date;
InsertBPAA.Parameters.ParamValues['OLD_BPPYN'] := oldBPPYN;
InsertBPAA.Execute;
end;
if cbInsertBPAB.Checked then
begin
if cbClearFirst.Checked then
begin
DeleteBPAB.Parameters.ParamValues['BPPYN'] := newBPPYN;
DeleteBPAB.Execute;
end;
InsertBPAB.Parameters.ParamValues['BPPYN'] := newBPPYN;
InsertBPAB.Parameters.ParamValues['TRDAT'] := Date;
InsertBPAB.Parameters.ParamValues['OLD_BPPYN'] := oldBPPYN;
InsertBPAB.Execute;
end;
if cbInsertBPJA.Checked then
begin
if cbClearFirst.Checked then
begin
DeleteBPJA.Parameters.ParamValues['BPPYN'] := newBPPYN;
DeleteBPJA.Execute;
end;
InsertBPJA.Parameters.ParamValues['BPPYN'] := newBPPYN;
InsertBPJA.Parameters.ParamValues['TRDAT'] := Date;
InsertBPJA.Parameters.ParamValues['OLD_BPPYN'] := oldBPPYN;
InsertBPJA.Execute;
end;
if cbInsertBPJB.Checked then
begin
if cbClearFirst.Checked then
begin
DeleteBPJB.Parameters.ParamValues['BPPYN'] := newBPPYN;
DeleteBPJB.Execute;
end;
InsertBPJB.Parameters.ParamValues['BPPYN'] := newBPPYN;
InsertBPJB.Parameters.ParamValues['TRDAT'] := Date;
InsertBPJB.Parameters.ParamValues['OLD_BPPYN'] := oldBPPYN;
InsertBPJB.Execute;
end;
if cbInsertRASN.Checked then
begin
if cbClearFirst.Checked then
begin
DeleteRASN.Parameters.ParamValues['BPPYN'] := newBPPYN;
DeleteRASN.Execute;
end;
InsertRASN.Parameters.ParamValues['BPPYN'] := newBPPYN;
InsertRASN.Parameters.ParamValues['RASDT'] := EncodeDate(newYY + 1911, 1, 1);
InsertRASN.Parameters.ParamValues['TRDAT'] := Date;
InsertRASN.Parameters.ParamValues['OLD_BPPYN'] := oldBPPYN;
InsertRASN.Execute;
EndOldRASN.Parameters.ParamValues['RAEDT'] := EncodeDate(oldYY + 1911, 12, 31);
EndOldRASN.Parameters.ParamValues['OLD_RAPYN'] := oldBPPYN;
EndOldRASN.Execute;
end;
Conn.CommitTrans;
Memo1.Lines.Add(newBPPYN + '年度開帳成功');
except
on E: Exception do
begin
Conn.RollbackTrans;
Memo1.Lines.Add(newBPPYN + '年度開帳失敗!原因為:'#10 + E.Message);
end;
end;
CDSBPAA.MoveBy(1);
end;
CDSBPAA.EnableControls;
end;
procedure TForm1.btnOpenYearClick(Sender: TObject);
var valid: Boolean;
selected: Boolean;
begin
if CDSBPAA.IsEmpty then
begin
Application.MessageBox('請先查詢要複製的年度專案資料後再處理', '錯誤', MB_ICONERROR);
eNewYY.SetFocus;
exit;
end;
valid := True;
selected := False;
CDSBPAA.First;
CDSBPAA.DisableControls;
while not CDSBPAA.Eof do
begin
if CDSBPAA.FieldByName('CHECKED').Value = 'Y' then
begin
selected := True;
valid := valid and (CDSBPAA.FieldByName('NEW_BPPNM').AsString <> '');
end;
CDSBPAA.MoveBy(1);
end;
CDSBPAA.First;
CDSBPAA.EnableControls;
if not selected then
begin
Application.MessageBox('請選擇要開帳的計畫', '錯誤', MB_ICONERROR);
exit;
end;
if not valid then
begin
Application.MessageBox('新計畫代號未輸入,請重新輸入', '錯誤', MB_ICONERROR);
exit;
end;
newYY := StrToIntDef(eNewYY.Text, -1);
if (newYY < 0) then
begin
Application.MessageBox('新年度不合理,請重新輸入', '錯誤', MB_ICONERROR);
eNewYY.SetFocus;
exit;
end;
if (newYY < oldYY) then
begin
Application.MessageBox('新年度不可小於原年度,請重新輸入', '錯誤', MB_ICONERROR);
eNewYY.SetFocus;
exit;
end;
DoOpenYear;
end;
procedure TForm1.FormActivate(Sender: TObject);
begin
eYY.SetFocus;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
CDSBPAA.Close;
Conn.Connected := False;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Conn.Connected := False;
Conn.ConnectionString := Format('FILE NAME=%sYearOpen.udl;', [ExtractFilepath(Application.ExeName)]);
Conn.Connected := True;
CDSBPAA.CommandText :=
' SELECT ''N'' AS CHECKED, A.BPPNM, A.BPYER, A.BPPYN, A.BPPYM, B.BPPME, A.BPPNM AS NEW_BPPNM '
+ ' FROM BPAA A INNER JOIN BPRJ B ON A.BPPNM=B.BPPNM '
+ ' WHERE A.BPYER=:BPYER AND A.BPPNM<>''000001'' ';
CDSBPAA.Params.ParamByName('BPYER').DataType := ftInteger;
end;
end.