Günlük Döviz Kurlarını Alan Program

murat335

New member
Mekez Bankası Verilerini Alıp Liste Yapan Program...

Kod Yazarı : MURAT335

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, xmldom, XMLIntf, msxmldom, XMLDoc, StdCtrls, Grids, ExtCtrls,
jpeg, ExtDlgs;

type
TForm1 = class(TForm)
StringGrid1: TStringGrid;
Button1: TButton;
Label1: TLabel;
XMLDocument1: TXMLDocument;
Button2: TButton;
Label2: TLabel;
Timer1: TTimer;
Label9: TLabel;
Label10: TLabel;
Button3: TButton;
Image1: TImage;
Image2: TImage;
Button4: TButton;
OpenDialog1: TOpenDialog;
Button5: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure StringGrid1SelectCell(Sender: TObject; ACol, ARow: Integer;
var CanSelect: Boolean);
procedure Timer1Timer(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Label10DblClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
baslangic:IXMLNode;
isim,alis,satis,balis,bsatis,euro:WideString;
sat,sut:integer;
ism,als,sati,bals,bsati,eur:string;
dosyaAdi:string;
kontrol:integer=0;
implementation

uses Unit2, Unit3;

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
StringGrid1.Cells[0,0]:='Para Birimi';
StringGrid1.Cells[1,0]:='Alış Fiyatı';
StringGrid1.Cells[2,0]:='Satış Fiyatı';
StringGrid1.Cells[3,0]:='Banka Alış Fiyatı';
StringGrid1.Cells[4,0]:='Banka Satış Fiyatı';
StringGrid1.Cells[5,0]:='1 Euro Karşılığı';
Button1.Click;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
if kontrol=0 then
begin
XMLDocument1.Active:=false;
XMLDocument1.FileName:='http://www.tcmb.gov.tr/kurlar/today.xml';
XMLDocument1.Active:=true;
end;
i:=1;
baslangic:=XMLDocument1.DocumentElement.ChildNodes.FindNode('Currency');
repeat
isim:=baslangic.ChildNodes.Nodes['Isim'].Text;
alis:=baslangic.ChildNodes.Nodes['ForexBuying'].Text;
satis:=baslangic.ChildNodes.Nodes['ForexSelling'].Text;
balis:=baslangic.ChildNodes.Nodes['BanknoteBuying'].Text;
bsatis:=baslangic.ChildNodes.Nodes['BanknoteSelling'].Text;
euro:=baslangic.ChildNodes.Nodes['CrossRateEuro'].Text;
StringGrid1.Cells[0,i]:=isim;
StringGrid1.Cells[1,i]:=alis;
StringGrid1.Cells[2,i]:=satis;
StringGrid1.Cells[3,i]:=balis;
StringGrid1.Cells[4,i]:=bsatis;
StringGrid1.Cells[5,i]:=euro;
i:=i+1;
baslangic:=baslangic.NextSibling;
Until baslangic=nil;

end;

procedure TForm1.Button2Click(Sender: TObject);
begin
ism:=StringGrid1.Cells[0,sat];
als:=StringGrid1.Cells[1,sat];
if (als='') and (bals='') then eur:=StringGrid1.Cells[5,sat];
sati:=StringGrid1.Cells[2,sat];
bals:=StringGrid1.Cells[3,sat];
bsati:=StringGrid1.Cells[4,sat];
form2:=TForm2.Create(Self);
form2.Showmodal;
Form2.Free;

{ ShowMessage(inttostr(sat));
ShowMessage(inttostr(sut));
ShowMessage(ism);
ShowMessage(yedek);}
end;

procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol,
ARow: Integer; var CanSelect: Boolean);
begin
sat:=Arow;
sut:=Acol;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
var
gun:String;
begin
case DayOfWeek(Date) of
1: gun:='Pazar';
2: gun:='Pazartesi';
3: gun:='Salı';
4: gun:='Çarşamba';
5: gun:='Perşembe';
6: gun:='Cuma';
7: gun:='Cumartesi';
end;
Form1.Caption:='Döviz Kurları Hesap '+datetostr(date)+ ' - ' + Gun + ' ' + timetostr(time);
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
XMLDocument1.SaveToFile('C:\'+datetostr(date)+'.xml');
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
OpenDialog1.Execute;
//ShowMessage(OpenDialog1.FileName);
if Opendialog1.FileName<>'' then
begin
XMLDocument1.Active:=false;
XMLDocument1.FileName:=OpenDialog1.FileName;
XMLDocument1.Active:=true;
kontrol:=1;
Button1.Click;
end;
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
kontrol:=0;
Button1.Click;
end;

procedure TForm1.Label10DblClick(Sender: TObject);
begin
form3:=TForm3.Create(Self);
Form3.ShowModal;
Form3.Free;
end;
Bu da EXE Dosyası
İNNDİR
 

HTML

Üst