87
201.
Excel.Cells[27,7]:=DBedit15.Text;
202.
Excel.Cells[29,3]:=DBedit16.Text;
А қосымшасының жалғасы
203.
Excel.Cells[31,3]:=DBedit17.Text;
204.
Excel.Cells[33,3]:=DBedit18.Text;
205.
Excel.Cells[25,3]:=DBedit13.Text;
206.
Excel.Cells[45,8]:=DBedit3.Text;
207.
Excel.Cells[47,5]:=edit1.Text;
208.
Excel.Cells[47,5]:=edit1.Text;
209.
WorkBook := Excel.WorkBooks.Item[1];
210.
Sheet := Workbook.Sheets.Item[1];
211.
Excel.Visible := True;
212.
except
213.
Excel.Quit;
214.
end;
215.
end;
216.
procedure TForm3.BitBtn2Click(Sender: TObject);
217.
var Excel, WorkBook, Sheet: Variant;
218.
WorkbookName, WorkbookToSave: string;
219.
i,j: Integer;
220.
name:string ;
221.
begin
222.
//Шаблон накладной хранится в папке Шаблоны:
223.
WorkbookName := GetCurrentDir + '\Шаблоны\буйрык.xls';
224.
//Сформированный документ сохраняется во временную папку Документы:
225.
WorkbookToSave := GetCurrentDir + '\Шаблоны\,буйрык № '+dbgrid1.Fields[0].Text
+'.xls';
226.
Excel := CreateOleObject('Excel.Application');
227.
try
228.
Excel.Workbooks.Open(WorkbookName);
229.
adotable1.next;
230.
adotable1.Prior;
231.
Excel.Cells[7,7]:=DBedit7.Text;
232.
Excel.Cells[22,5]:=DBedit3.Text;
233.
Excel.Cells[22,8]:=DBedit2.Text;
234.
Excel.Cells[22,10]:=DBedit4.Text;
235.
Excel.Cells[21,2]:=DBedit6.Text;
236.
Excel.Cells[26,2]:=DBedit13.Text;
237.
Excel.Cells[27,2]:=DBedit1.Text;
238.
Excel.Cells[28,2]:=DBedit17.Text;
239.
Excel.Cells[53,6]:=edit1.Text;
240.
Excel.Cells[50,8]:=DBedit3.Text;
241.
Excel.Cells[45,8]:=DBedit13.Text;
242.
WorkBook := Excel.WorkBooks.Item[1];
243.
Sheet := Workbook.Sheets.Item[1];
244.
Excel.Visible := True;
245.
except
246.
Excel.Quit;
247.
end;
248.
end;
88
249.
procedure TForm3.SpeedButton20Click(Sender: TObject);
250.
begin
А қосымшасының жалғасы
251.
if openpicturedialog1.Execute then
252.
dbimage2.Picture.LoadFromFile(openpicturedialog1.FileName);
253.
dbimage2.CopyToClipboard;
254.
dbimage2.PasteFromClipboard;
255.
end;
256.
procedure TForm3.speedButton22Click(Sender: TObject);
257.
begin
258.
case Radiogroup1.itemindex of
259.
0: ADOTable1.Indexfieldnames :='Аты';
260.
1: ADOTable1.Indexfieldnames:='Теги';
261.
2: ADOTable1.Indexfieldnames :='Білімі';
262.
3: ADOTable1.Indexfieldnames :='Код';
263.
4: ADOTable1.Indexfieldnames :='Жынысы';
264.
5: ADOTable1.Indexfieldnames :='ЖСН';
265.
6: ADOTable1.Indexfieldnames :='РНН';
266.
end;
267.
case radiogroup2.ItemIndex of
268.
0: ADOTable1.indexdefs
269.
[Adotable1.IndexDefs.IndexOf(ADOTable1.Indexfieldnames)].options :=
270.
ADOTable1.indexdefs
271.
[ADOTable1.indexdefs.indexof(adotable1.Indexfieldnames)].options + [ixdescending];
272.
1:adotable1.indexdefs
273.
[adotable1.indexdefs.indexof(adotable1.Indexfieldnames)].options :=
274.
adotable1.indexdefs
275.
[adotable1.indexdefs.indexof(adotable1.Indexfieldnames)].options-
276.
[ixdescending]
277.
end;
278.
end;
279.
procedure TForm3.N7Click(Sender: TObject);
280.
begin
281.
form2.show;
282.
form3.Close;
283.
end;
284.
procedure TForm3.Y1Click(Sender: TObject);
285.
begin
286.
form4.Show;
287.
end;
288.
procedure TForm3.Edit2Change(Sender: TObject);
289.
begin
290.
if Length(Edit2.Text) > 0 then
291.
begin
292.
ADOTable1.Filtered:=false;
293.
ADOTable1.Filter:=Combobox1.Text + ' LIKE ' + #39 + Edit2.Text + '%' + #39;
294.
ADOTable1.Filtered:=true;
295.
end
296.
else ADOTable1.Filtered:=false;
297.
end;
89
298.
procedure TForm3.N5Click(Sender: TObject);
299.
begin
А қосымшасының жалғасы
300.
dbnavigator1.datasource:=datasource2;
301.
groupbox5.visible:=false;
302.
dbgrid1. height:=617;
303.
dbgrid1.width:=361;
304.
end;
305.
procedure TForm3.BitBtn3Click(Sender: TObject);
306.
begin
307.
groupbox6.visible:=true;
308.
end;
309.
procedure TForm3.Image4Click(Sender: TObject);
310.
begin
311.
groupbox6.visible:=false;
312.
end;
313.
procedure TForm3.N8Click(Sender: TObject);
314.
begin
315.
Form4.Show;
316.
end;
317.
procedure TForm3.N9Click(Sender: TObject);
318.
begin
319.
form6.show;
320.
form3.close;
321.
form6.mediaplayer1.Play;
322.
form6.mediaplayer2.Play;
323.
end;
324.
procedure TForm3.Timer1Timer(Sender: TObject);
325.
begin
326.
speedbutton34.Caption:=timetostr(time)
327.
end;
328.
procedure TForm3.BitBtn4Click(Sender: TObject);
329.
var Excel, WorkBook, Sheet: Variant;
330.
WorkbookName, WorkbookToSave: string;
331.
i,j: Integer;
332.
name:string ;
333.
begin
334.
//Шаблон накладной хранится в папке Шаблоны:
335.
WorkbookName := GetCurrentDir + '\Шаблоны\от.xls';
336.
//Сформированный документ сохраняется во временную папку Документы:
337.
WorkbookToSave := GetCurrentDir + '\Шаблоны\,от № '+dbgrid1.Fields[0].Text +'.xls';
338.
Excel := CreateOleObject('Excel.Application');
339.
try
340.
Excel.Workbooks.Open(WorkbookName);
341.
adotable1.next;
342.
adotable1.Prior;
343.
Excel.Cells[24,4]:=DBedit22.Text;
344.
Excel.Cells[19,2]:=edit3.text;
345.
Excel.Cells[24,7]:=edit6.text;
346.
Excel.Cells[21,3]:=edit4.text;
90
347.
Excel.Cells[21,6]:=edit6.text;
348.
Excel.Cells[26,4]:=edit5.text;
А қосымшасының жалғасы
349.
Excel.Cells[31,6]:=edit1.Text;
350.
Excel.Cells[27,6]:=DBedit20.Text;
351.
Excel.Cells[27,7]:=DBedit21.Text;
352.
Excel.Cells[31,4]:=speedbutton34.caption;
353.
WorkBook := Excel.WorkBooks.Item[1];
354.
Sheet := Workbook.Sheets.Item[1];
355.
Excel.Visible := True;
356.
except
357.
Excel.Quit;
358.
end;
359.
end;
360.
procedure TForm3.N10Click(Sender: TObject);
361.
begin
362.
dbgrid2.Visible:=false;
363.
groupbox5.Visible:=false;
364.
dbgrid1.Visible:=true;
365.
DBedit1.datasource:=datasource1;
366.
DBedit2.datasource:=datasource1;
367.
DBedit3.datasource:=datasource1;
368.
DBedit4.datasource:=datasource1;
369.
DBedit5.datasource:=datasource1;
370.
DBedit6.datasource:=datasource1;
371.
DBedit7.datasource:=datasource1;
372.
DBedit8.datasource:=datasource1;
373.
DBedit9.datasource:=datasource1;
374.
DBedit10.datasource:=datasource1;
375.
DBedit11.datasource:=datasource1;
376.
DBedit12.datasource:=datasource1;
377.
DBedit13.datasource:=datasource1;
378.
DBedit14.datasource:=datasource1;
379.
DBedit15.datasource:=datasource1;
380.
DBedit16.datasource:=datasource1;
381.
DBedit17.datasource:=datasource1;
382.
DBedit18.datasource:=datasource1;
383.
DBedit19.datasource:=datasource1;
384.
DBmemo1.datasource:=datasource1;
385.
Dbcombobox1.datasource:=datasource1;
386.
Dbimage1.datasource:=datasource1;
387.
Dbimage2.datasource:=datasource1;
388.
end;
389.
procedure TForm3.N6Click(Sender: TObject);
390.
begin
391.
dbgrid2.Visible:=true;
392.
groupbox5.Visible:=true;
393.
dbgrid1.Visible:=false;
394.
DBedit1.datasource:=datasource2;
395.
DBedit2.datasource:=datasource2;
91
396.
DBedit3.datasource:=datasource2;
397.
DBedit4.datasource:=datasource2;
А қосымшасының жалғасы
398.
DBedit5.datasource:=datasource2;
399.
DBedit6.datasource:=datasource2;
400.
DBedit7.datasource:=datasource2;
401.
DBedit8.datasource:=datasource2;
402.
DBedit9.datasource:=datasource2;
403.
DBedit10.datasource:=datasource2;
404.
DBedit11.datasource:=datasource2;
405.
DBedit12.datasource:=datasource2;
406.
DBedit13.datasource:=datasource2;
407.
DBedit14.datasource:=datasource2;
408.
DBedit15.datasource:=datasource2;
409.
DBedit16.datasource:=datasource2;
410.
DBedit17.datasource:=datasource2;
411.
DBedit18.datasource:=datasource2;
412.
DBedit19.datasource:=datasource2;
413.
DBmemo1.datasource:=datasource2;
414.
Dbcombobox1.datasource:=datasource2;
415.
Dbimage1.datasource:=datasource2;
416.
Dbimage2.datasource:=datasource2;
417.
end;
418.
procedure TForm3.N20Click(Sender: TObject);
419.
begin
420.
dbnavigator1.datasource:=datasource1;
421.
groupbox5.visible:=true;
422.
dbgrid1. height:=425;
423.
dbgrid1.width:=361;
424.
end;
425.
end.
1.
unit Unit4;
2.
interface
3.
uses
4.
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
5.
Dialogs, acPNG, ExtCtrls, Buttons, ComCtrls;
6.
type
7.
TForm4 = class(TForm)
8.
MonthCalendar1: TMonthCalendar;
9.
Timer1: TTimer;
10.
SpeedButton2: TSpeedButton;
11.
Image1: TImage;
12.
Image2: TImage;
13.
procedure Timer1Timer(Sender: TObject);
14.
private
15.
{ Private declarations }
16.
public
17.
{ Public declarations }
18.
end;
92
19.
var
20.
Form4: TForm4;
А қосымшасының жалғасы
21.
implementation
22.
{$R *.dfm}
23.
procedure TForm4.Timer1Timer(Sender: TObject);
24.
begin
25.
speedbutton2.Caption:=timetostr(time)
26.
end;
27.
end.
1.
unit Unit5;
2.
interface
3.
uses
4.
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
5.
Dialogs, MPlayer, ExtCtrls, StdCtrls, Buttons, jpeg;
6.
type
7.
TForm5 = class(TForm)
8.
Memo1: TMemo;
9.
Image1: TImage;
10.
Panel1: TPanel;
11.
MediaPlayer1: TMediaPlayer;
12.
Image3: TImage;
13.
Image2: TImage;
14.
procedure Image2Click(Sender: TObject);
15.
procedure Image2DblClick(Sender: TObject);
16.
procedure Panel1Click(Sender: TObject);
17.
procedure Panel1DblClick(Sender: TObject);
18.
private
19.
{ Private declarations }
20.
public
21.
{ Public declarations }
22.
end;
23.
var
24.
Form5: TForm5;
25.
implementation
26.
{$R *.dfm}
27.
procedure TForm5.Image2Click(Sender: TObject);
28.
begin
29.
image2.height:=505;
30.
image2.Width:=801;
31.
memo1.Visible:=false;
32.
panel1.Visible:=false;
33.
end;
34.
procedure TForm5.Image2DblClick(Sender: TObject);
35.
begin
36.
image2.height:=137;
37.
image2.Width:=217;
38.
memo1.Visible:=true;
39.
panel1.Visible:=true;
93
40.
end;
41.
procedure TForm5.Panel1Click(Sender: TObject);
А қосымшасының жалғасы
42.
begin
43.
mediaplayer1.Stop;
44.
end;
45.
procedure TForm5.Panel1DblClick(Sender: TObject);
46.
begin
47.
mediaplayer1.Play;
48.
end;
49.
end.
1.
unit Unit6;
2.
interface
3.
uses
4.
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
5.
Dialogs, MPlayer, Buttons, ExtCtrls, acPNG;
6.
type
7.
TForm6 = class(TForm)
8.
Panel1: TPanel;
9.
MediaPlayer1: TMediaPlayer;
10.
MediaPlayer2: TMediaPlayer;
11.
SpeedButton1: TSpeedButton;
12.
Image1: TImage;
13.
procedure SpeedButton1Click(Sender: TObject);
14.
private
15.
{ Private declarations }
16.
public
17.
{ Public declarations }
18.
end;
19.
var
20.
Form6: TForm6;
21.
implementation
22.
uses Unit3;
23.
{$R *.dfm}
24.
procedure TForm6.SpeedButton1Click(Sender: TObject);
25.
begin
26.
form6.Close;
27.
form3.show;
28.
end;
29.
end.
Достарыңызбен бөлісу: |