|
Приложение А
//Загрузка программы
program DataBase;
uses
Forms,
UMain in 'UMain.pas' {MainForm},
UListSlush in 'UListSlush.pas' {ListSlushForm},
USlush in 'USlush.pas' {EditSlushForm},
UDataMod in 'UDataMod.pas' {DataModule1: TDataModule},
URecvizit in 'URecvizit.pas' {SetingForm},
USplash in 'USplash.pas' {SplashForm},
UAbout in 'UAbout.pas' {AboutForm},
USpecials in 'USpecials.pas' {ListSpecialsForm},
UEditSpecials in 'UEditSpecials.pas' {EditSpecialForm},
UFind in 'UFind.pas' {FindForm},
ULogin in 'ULogin.pas' {LoginForm},
UAboutKMRCPK in 'UAboutKMRCPK.pas' {AboutKMRCPKForm},
UCreateGroup in 'UCreateGroup.pas' {ListGroupForm};
{$R *.res}
{$R Bitmap.RES}
{$R xp_manifest.RES}
begin
Application.Initialize;
with TSplashForm.Create(nil) do
try
LoadingProgressBar.Max:=130;
Show;
Update;
Application.Title := 'ASF: Приемная комиссия';
Application.CreateForm(TMainForm, MainForm);
LoadingProgressBar.Position:=10;
InfoLabel.Caption:='Создание MainForm. Загрузка... 10%';
MainForm.Delay(50);
Application.CreateForm(TEditSpecialForm, EditSpecialForm);
LoadingProgressBar.Position:=20;
InfoLabel.Caption:='Создание EditSpecialForm. Загрузка... 20%';
MainForm.Delay(50);
Application.CreateForm(TAboutForm, AboutForm);
LoadingProgressBar.Position:=30;
InfoLabel.Caption:='Создание AboutForm. Загрузка... 30%';
MainForm.Delay(50);
Application.CreateForm(TEditSlushForm, EditSlushForm);
LoadingProgressBar.Position:=40;
InfoLabel.Caption:='Создание EditSlushForm. Загрузка... 40%';
MainForm.Delay(50);
Application.CreateForm(TDataModule1, DataModule1);
LoadingProgressBar.Position:=50;
InfoLabel.Caption:='Создание DataModule1. Загрузка... 50%';
MainForm.Delay(50);
Application.CreateForm(TSetingForm, SetingForm);
LoadingProgressBar.Position:=60;
InfoLabel.Caption:='Создание формы RekvizitForm. Загрузка... 60%';
MainForm.Delay(50);
Application.CreateForm(TFindForm, FindForm);
LoadingProgressBar.Position:=70;
InfoLabel.Caption:='Создание FindForm. Загрузка... 70%';
MainForm.Delay(50);
Application.CreateForm(TAboutKMRCPKForm, AboutKMRCPKForm);
LoadingProgressBar.Position:=50;
InfoLabel.Caption:='Создание ListGroupForm. Загрузка... 80%';
MainForm.Delay(50);
Application.CreateForm(TListGroupForm, ListGroupForm);
InfoLabel.Caption:='Создание AboutKMRCPKForm. Загрузка... 90%';
MainForm.Delay(50);
MainForm.ErrorBase;
LoadingProgressBar.Position:=90;
InfoLabel.Caption:='Проверка базы данных. Загрузка... 95%';
MainForm.Delay(50);
MainForm.WindowState:=wsMaximized;
LoadingProgressBar.Position:=100;
InfoLabel.Caption:='Расположение окна, загрузка настроек. Загрузка... 100%';
MainForm.Delay(50);
finally
Free;
end;
Application.Run;
end.
Приложение Б
//Перевод числа в строку (прописью)
function TMainForm.CurrencyToStr(Value: double): string;
const Hundreds: array [0..9] of string=('',' сто',' двести',' триста',' четыреста',' пятьсот',' шестьсот',' семьсот',' восемьсот',' девятьсот');
Tens: array [0..9] of string=('','',' двадцать',' тридцать',' сорок',' пятьдесят',' шестьдесят',' семьдесят',' восемьдесят',' девяносто');
Ones: array [0..19] of string=('','','',' три',' четыре',' пять',' шесть',' семь',' восемь',' девять',' десять',' одиннадцать',' двенадцать',' тринадцать',' четырнадцать',' пятнадцать',' шестнадцать',' семнадцать',' восемнадцать',' девятнадцать');
Razryad: array [0..6] of string=('',' тысяч',' миллион',' миллиард',' триллион',' квадриллион',' квинтиллион');
var s: string; i: integer; val: int64;
function shortNum(s: string; raz: integer): string;
begin
Result:=hundreds[StrToInt(s[1])]; if StrToInt(s)=0 then Exit;
if s[2]<>'1' then
begin
Result:=Result+tens[StrToInt(s[2])];
case StrToInt(s[3]) of
1: if raz=1 then Result:=Result+' одна' else Result:=Result+' один';
2: if raz=1 then Result:=Result+' две' else Result:=Result+' два';
else Result:=Result+ones[StrToInt(s[3])];
end;
Result:=Result+razryad[raz];
case StrToInt(s[3]) of
0,5,6,7,8,9: if raz>1 then Result:=Result+'ов';
1: if raz=1 then Result:=Result+'а';
2,3,4: if raz=1 then Result:=Result+'и' else if raz>1 then Result:=Result+'а';
end; end else
begin
Result:=Result+ones[StrToInt(Copy(s,2,2))];
Result:=Result+razryad[raz];
if raz>1 then Result:=Result+'ов';
end;
end;
begin
val:=Trunc(value);
if val=0 then
begin
Result:='ноль';
Exit;
end;
s:=IntToStr(val);
Result:='';
i:=0;
while Length(s)>0 do
begin
Result:=shortNum(Copy('00'+s,Length('00'+s)-2,3),i)+Result;
if Length(s)>3 then s:=Copy(s,1,Length(s)-3) else s:='';
inc(i);
end;
s:=IntToStr(Trunc((value-val)*100+0.5));
if s='0' then s:='00';
Result:=Result+' руб '+s+' коп';
if Copy(Result,0,1)=' ' then Delete(Result,0,2);
if Copy(Result,0,1)=' ' then Delete(Result,0,1);
if Copy(Result,Length(Result)-1,1)=' ' then Delete(Result,Length(Result)-1,1);
end;
Приложение В
procedure TEditSlushForm.CreateReport;
var FileName, S1, S2, S3: OLEVariant;
i, n: LongInt;
Whatr: OLEVariant;
Which: OLEVariant;
Count: OLEVariant;
FileDogovor, NameBookmakers: OLEVariant;
Temp: Variant;
begin
FileDogovor:=DataModule1.SpecialsTable.Fields.Fields[9].Text;
if (FileDogovor='') or (FileExists(FileDogovor)) then FileDogovor:=Path+'\Data\GeneralBlank.dot';
//Путь до файла с бланком
FileName:=FileDogovor;
if FileExists(FileName)=false then Application.MessageBox('Файл с бланком договора не найден. Возможно файл был переименован либо удален.'#13'Обратитесь к администратору для устранения ошибки.','Критическая ошибка',mb_Ok+mb_IconError) else
begin
MainForm.Label1.Caption:='0% ';
MainForm.ProgressBar1.Visible:=true;
MainForm.ProgressBar1.Max:=100;
MainForm.ProgressBar1.Position:=0;
try
WA.Connect;
WA.WindowState:=wdWindowStateMaximize;
WA.Documents.OpenOld(FileName, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam);
WA.ActiveWindow.ActivePane.View.Zoom.Percentage:=100;
Whatr:=wdGoToBookmark;
Which:=unAssigned;
Count:=unAssigned;
MainForm.ProgressBar1.Position:=MainForm.ProgressBar1.Position+1;
Страницы: 1, 2, 3, 4, 5, 6, 7, 8, 9
При использовании материалов активная ссылка на источник обязательна.