Анықтамалық ақпараттық жүйесін құру



бет82/84
Дата02.12.2022
өлшемі192.89 Kb.
#466270
1   ...   76   77   78   79   80   81   82   83   84
туризм диплом

Page 96


Ф-ОБ-001/033
97
Word.InsertFile(ExtractFilePath(ParamStr(0))+'doc.doc');
Word.Replace('_STRGOR_'
,QrySityName .AsString);
Word.Replace('_NAME_'
,QryName .AsString);
Word.Replace('_TRANSP_'
,QryTranspName .AsString);
Word.Replace('_HOTELNAME_' ,QryHotelName.AsString);
Word.Replace('_COST_' ,QryCost.AsString);
Word.Replace('_DAYS_'
,QryDays.AsString);
Word.Replace('_INFO_'
,Qryinfo.AsString);
word.Show;
//показать Word
word.Free;
//Освободить память
end;
end.
procedure Tdm.DataModuleCreate(Sender: TObject);
begin
ADOConnection1.Close;
ADOConnection1.Open;
end;
procedure Tdm.DataModuleDestroy(Sender: TObject);
begin
ADOConnection1.Connected := false;
end;
procedure Tdm.TblUsersNewRecord(DataSet: TDataSet);
begin
TblUserstp.Value := False;
end;
procedure Tdm.TblUserstpGetText(Sender: TField; var Text: String;
DisplayText: Boolean);
begin
Text:='Нет';
if Sender.IsNull then Exit;
if not Sender.AsBoolean then Exit;
Text:='Да';
end;
procedure Tdm.TblUserstpSetText(Sender: TField; const Text: String);
begin
Sender.AsBoolean := False;
if Text='' then Exit;
if Text[1] in ['N','n','0','F','f','Н','н'] then Exit;
Sender.AsBoolean := True;
end;
procedure TFrmEdit.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
var err:string;

Page 97


Ф-ОБ-001/033
98
begin
CanClose := True;
if ModalResult <> mrOk then Exit;
err := '';
if dm.TblTursHotelId.IsNull then err:='Нужно выбрать вид проживания';
if dm.TblTursTranspId.IsNull then err:='Нужно выбрать транспорт';
if dm.TblTursSityId.IsNull then err:='Нужно выбрать город';
if err<>'' then
MessageBox(0, PChar(err), 'Не заполнены данные', MB_ICONSTOP or
MB_OK);
CanClose := err='';
end;
end.
constructor TMSWord.Create(FileName: string='');
begin
DocFileName := FileName;
end;
Procedure TMSWord.InsertFile(FileName: string);
begin
word.InsertFile(FileName);
end;
//////////////////////////////////////////////////////////
Function TMSWord.Open: boolean;
begin
Result := True;
try
Word := CreateOleObject('Word.Basic');
{ Word.FileNew;
Word.FileSaveAs(DocFileName);}
except
Word.AppClose;
Result := False;
end;
end;
//////////////////////////////////////////////////////////
Procedure TMSWord.SaveAs(FileName:string);
begin
DocFileName:=FileName;
Word.FileSaveAs(FileName);
end;
//////////////////////////////////////////////////////////
Procedure TMSWord.Show;
begin



Достарыңызбен бөлісу:
1   ...   76   77   78   79   80   81   82   83   84




©dereksiz.org 2024
әкімшілігінің қараңыз

    Басты бет