Eczane Stok Programı

'E-F' forumunda ÜmiT KoTaN tarafından 5 Ocak 2009 tarihinde açılan konu

  1. Eczane Stok Programı konusu Pascalda hazırlanmış çok güzel ve kullanışlı bir stok programı...uses crt,graph;
    type
    kayit=record
    adi:string[20];
    sn:string[30];
    firma:string[20];
    af:string[20];
    sf:string[20];
    eadi:string[15];
    f:char;
    end;
    var
    dosya:file of kayit;
    kay:kayit;
    tus,t:char;
    i,kod:integer;
    {-----------------------cerceve------------------------------------}
    procedure cerceve;
    var
    i,k:byte;
    begin
    textcolor(green);
    {----st cerceve---- }
    gotoxy(0,0); write(#201);
    for i:=1 to 77 do begin
    k:=k+1; write(#205);
    end;
    write(#187);
    k:=0;
    for i:=1 to 3 do begin
    k:=k+1; gotoxy(79,1+k); writeln(#186);
    end;
    gotoxy(79,4); write(#188);
    k:=0;
    for i:=1 to 77 do begin
    k:=k+1; gotoxy(1+k,4); write(#205);
    end;
    gotoxy(1,4); write(#200);
    k:=0;
    for i:=1 to 2 do begin
    k:=k+1; gotoxy(1,1+k); write(#186);
    end;
    {----sol cerceve---- }
    gotoxy(1,5); write(#201);
    k:=0;
    for i:=1 to 18 do begin
    k:=k+1;
    gotoxy(1,5+k); writeln(#186);
    end;
    write(#200);
    k:=0;
    for i:=0 to 13 do begin
    k:=k+1; write(#205);
    end;
    write(#188);
    k:=0;
    for i:=1 to 18 do begin
    k:=k+1;
    gotoxy(16,5+k); write(#186);
    end;
    gotoxy(16,5); write(#187);
    k:=0;
    for i:=1 to 14 do begin
    k:=k+1;
    gotoxy(1+k,5); write(#205);
    end;
    {----orta ‡er‡eve----}
    gotoxy(20,5); write(#201);
    k:=0;
    for i:=1 to 18 do begin
    k:=k+1;
    gotoxy(20,5+k); write(#186);
    end;
    gotoxy(20,24); write(#200);
    k:=0;
    for i:=1 to 32 do begin
    k:=k+1;
    gotoxy(20+k,5); write(#205);
    end;
    write(#187);
    k:=0;
    for i:=1 to 18 do begin
    k:=k+1;
    gotoxy(53,5+k); write(#186);
    end;
    gotoxy(53,24); write(#188);
    k:=0;
    for i:=1 to 32 do begin
    k:=k+1;
    gotoxy(20+k,24); write(#205);
    end;
    gotoxy(30,3); write(' ECZANES˜ ');
    {----sa§ ‡er‡eve----}
    gotoxy(58,5); write(#201);
    k:=0;
    for i:=1 to 18 do begin
    k:=k+1;
    gotoxy(58,5+k); write(#186);
    end;
    gotoxy(58,24); write(#200);
    k:=0;
    for i:=1 to 18 do begin
    k:=k+1;
    gotoxy(58+k,24); write(#205);
    end;
    write(#188);
    k:=0;
    for i:=1 to 18 do begin
    k:=k+1;
    gotoxy(77,5+k); write(#186);
    end;
    gotoxy(77,5); write(#187);
    k:=0;
    for i:=1 to 18 do begin
    k:=k+1;
    gotoxy(58+k,5); write(#205);
    end;
    {----se‡im----}
    k:=0;
    for i:=1 to 32 do begin
    k:=k+1;
    gotoxy(20+k,21); write(#205);
    end;
    end;

    procedure bilgigirisi;
    var
    k:byte;
    begin
    assign(dosya,'tarik.dat');
    {$i-} reset(dosya);kod:=ioresult;{$i+};
    if kod<>0 then rewrite(dosya);
    repeat
    clrscr;
    gotoxy(0,0); write(#201);
    for i:=1 to 77 do begin
    k:=k+1; write(#205);
    end;
    write(#187);
    k:=0;
    for i:=1 to 3 do begin
    k:=k+1; gotoxy(79,1+k); writeln(#186);
    end;
    gotoxy(79,4); write(#188);
    k:=0;
    for i:=1 to 77 do begin
    k:=k+1; gotoxy(1+k,4); write(#205);
    end;
    gotoxy(1,4); write(#200);
    k:=0;
    for i:=1 to 2 do begin
    k:=k+1; gotoxy(1,1+k); write(#186);
    end;
    gotoxy(30,3); write(' ECZANES˜');
    gotoxy(10,8);write('ilacin adini giriniz=================>');readln(kay.adi);
    if kay.adi=" then
    begin
    close(dosya);
    exit;
    end;

    gotoxy(10,10);write('ilacin seri numarasi=================>');readln(kay.sn);
    gotoxy(10,12);write('ilacin hangi firmadan alindigi=======>');readln(kay.firma);
    gotoxy(10,14);write('ilacin alis fiyatini giriniz=========>');readln(kay.af);
    gotoxy(10,16);write('ilacin satis fiyatini giriniz========>');readln(kay.sf);

    gotoxy(25,20);write('bilgi kaydedilsin mi? [e/h]');
    repeat
    tus:=upcase(readkey);
    until tus in ['E','H'];
    if tus='E'then
    begin
    kay.f:='*';
    seek(dosya,filesize(dosya));
    write(dosya,kay);
    end;
    until 1=2;
    end;
    {----------------------------------bilgi listeleme--------------------------}
    procedure bilgilisteleme;
    var
    s,k:integer;
    begin
    assign(dosya,'tarik.dat');
    {$i-} reset(dosya);kod:=ioresult;{$i+}
    if i<>0 then
    begin clrscr;
    gotoxy(35,20);
    writeln('dosya yok.....');
    tus:=readkey;exit;
    end;
    clrscr;
    gotoxy(0,0); write(#201);
    for i:=1 to 77 do begin
    k:=k+1; write(#205);
    end;
    write(#187);
    k:=0;
    for i:=1 to 3 do begin
    k:=k+1; gotoxy(79,1+k); writeln(#186);
    end;
    gotoxy(79,4); write(#188);
    k:=0;
    for i:=1 to 77 do begin
    k:=k+1; gotoxy(1+k,4); write(#205);
    end;
    gotoxy(1,4); write(#200);
    k:=0;
    for i:=1 to 2 do begin
    k:=k+1; gotoxy(1,1+k); write(#186);
    end;
    gotoxy(1,6);
    write('ilacn ad seri no alnan firma adi ');
    writeln('alŸ fiyat satŸ fiyat '); ;
    write('------------ ---------- ----------------- ');
    writeln('------------- ------------- ');
    s:=7;
    for i:=0 to filesize(dosya)-1 do
    begin
    seek(dosya,i);read(dosya,kay);
    if kay.f='*'then
    begin
    s:=s+1;
    gotoxy(1,s);write(kay.adi);
    gotoxy(15,s);write(' ',kay.sn);
    gotoxy(30,s);write(' ',kay.firma);
    gotoxy(50,s);write(' ',kay.af);
    gotoxy(65,s);write(' ',kay.sf);
    gotoxy(30,3); write(' ECZANES˜ ');
    end;
    if s>48 then
    begin
    gotoxy(20,50);
    write('diger sayfa icin bir tusa basiniz............');
    tus:=readkey;
    s:=0;
    clrscr;
    end;
    end;
    gotoxy(20,21);write('listelenecek kayitlar bitti............');
    gotoxy(20,23);write('devam etmek icin bir tusa basiniz......');
    tus:=readkey;
    close(dosya);
    end;
    {-------------------------------silme---------------------------------}
    procedure bilgisilme;
    var
    ara :string[30];
    begin
    assign(dosya,'tarik.dat');
    {$i-} reset (dosya); kod:=ioresult;{$i+}
    if kod <> 0 then
    begin
    gotoxy(30,20); write('dosya yok.................');
    tus:=readkey; exit;
    end;
    clrscr;

    gotoxy(5,23);write('silmek istediginiz ilacin adini giriniz======>');readln(ara);
    for i:=0 to filesize(dosya)-1 do
    begin
    seek(dosya,i); read(dosya,kay);
    if (ara=kay.adi) and (kay.f='*') then
    begin
    clrscr;

    gotoxy(10,9);write('ilacin adini giriniz====================>',kay.adi);
    gotoxy(10,11);write('ilacin seri numarasini giriniz==========>',kay.sn);
    gotoxy(10,13);write('ilacin hangi firmadan alindigi==================>',kay.firma);
    gotoxy(10,15);write('ilacin alis fiyati ============>',kay.af);
    gotoxy(10,17);write('ilacin satis fiyati===========>',kay.sf);
    gotoxy(10,19);write('eczane adini giriniz===========>',kay.eadi);

    gotoxy(25,31); write('silinecek kayit bu mu ? [e/h]');
    repeat
    tus:=upcase(readkey);
    until tus in ['E','H'];
    if tus='E' then
    begin
    kay.f:='s';
    seek(dosya,i);write(dosya,kay);
    clrscr;
    gotoxy(30,25);write('kayit silindi...........');
    close(dosya);
    tus:=readkey;
    exit;
    end;
    end; {if}
    end; {for}
    clrscr;
    gotoxy(30,25);write('kayit yok...............');
    close(dosya);tus:=readkey;
    end;
    {-----------------------------------arama-----------------------------}
    procedure bilgiarama;
    var
    ara :string[30];
    begin
    assign(dosya,'tarik.dat');
    {$i-} reset(dosya); kod:=ioresult; {$i+}
    if kod<>0 then
    begin
    clrscr;
    gotoxy(20,20);writeln('dosya yok....');
    tus:=readkey; exit;
    end;
    repeat
    clrscr;

    gotoxy(5,23);write('aramak istediginiz ilacin adini giriniz==>');readln(ara);
    if ara =" then
    begin
    close(dosya); exit;
    end;
    for i:=0 to filesize(dosya)-1 do
    begin
    seek(dosya,i);read(dosya,kay);
    if (kay.f='*') and (kay.adi=ara) then
    begin
    clrscr;

    gotoxy(10,9);write('ilacin adini giriniz ====================>',kay.adi);
    gotoxy(10,11);write('ilacin seri numarasini giriniz ==========>',kay.sn);
    gotoxy(10,13);write('ilacin hangi firmadan alindigi==================>',kay.firma);
    gotoxy(10,15);write('ilacin alis fiyati============>',kay.af);
    gotoxy(10,17);write('ilacin satis fiyati===========>',kay.sf);
    gotoxy(10,19);write('eczane adini giriniz===========>',kay.eadi);

    gotoxy(20,35); write('aradiginiz kayit bu mu ? [e/h]');
    repeat
    tus:=upcase(readkey);
    until tus in ['E','H'];
    if tus='E' then
    begin
    close(dosya); exit;
    end;
    end;
    end;
    writeln;
    clrscr;

    gotoxy(20,27);write('aradiginiz kayit yok..................');
    gotoxy(20,29);write('devam etmek icin bir tusa basiniz.....');
    tus:=readkey;
    until 1=2;
    end;
    {---------------------------bilgi duzeltme------------------------}
    procedure bilgiduzeltme;
    var
    k:byte;
    ara:string[30];
    begin
    assign(dosya,'tarik.dat');
    {ži-} reset (dosya); kod:=ioresult; {ži+}
    if kod <>0 then
    begin
    gotoxy(20,20); write('dosya yok.....');
    tus:=readkey;
    exit;
    end;
    clrscr;

    gotoxy(5,23);write('duzeltmek istediginiz malin adini giriniz==>');readln(ara);
    for i:=0 to filesize(dosya)-1 do
    begin
    seek(dosya,i); read(dosya,kay);
    if (ara=kay.adi) and (kay.f='*') then
    begin
    clrscr;
    gotoxy(0,0); write(#201);
    for i:=1 to 77 do begin
    k:=k+1; write(#205);
    end;
    write(#187);
    k:=0;
    for i:=1 to 3 do begin
    k:=k+1; gotoxy(79,1+k); writeln(#186);
    end;
    gotoxy(79,4); write(#188);
    k:=0;
    for i:=1 to 77 do begin
    k:=k+1; gotoxy(1+k,4); write(#205);
    end;
    gotoxy(1,4); write(#200);
    k:=0;
    for i:=1 to 2 do begin
    k:=k+1; gotoxy(1,1+k); write(#186);
    end;
    gotoxy(30,3); write(' ECZANES˜');
    gotoxy(10,9);write('ilacin adini giriniz==============>',kay.adi);
    gotoxy(10,11);write('ilacin seri numarasi==============>',kay.sn);
    gotoxy(10,13);write('ilacin hangi firmadan alindigi====>',kay.firma);
    gotoxy(10,15);write('ilacin alis fiyati================>',kay.af);
    gotoxy(10,17);write('ilacin satis fiyati===============>',kay.sf);
    gotoxy(10,19);write('eczane adini giriniz==============>',kay.eadi);
    begin
    textcolor(4);
    gotoxy(30,24); write('duzeltilecek kayit bu mu ? [e/h]');
    end;
    repeat
    tus:=upcase(readkey);
    until tus in ['E','H'];
    if tus='E' then
    repeat
    clrscr;

    gotoxy(10,5);write('[1]- ilacin adini giriniz====================>',kay.adi);
    gotoxy(10,7);write('[2]-ilacin seri numarasi==========>',kay.sn);
    gotoxy(10,9);write('[3]-ilacin hangi firmadan alindigi==================>',kay.firma);
    gotoxy(10,11);write('[4]-ilacin alis fiyati============>',kay.af);
    gotoxy(10,13);write('[5]-ilacin satis fiyati===========>',kay.sf);
    gotoxy(10,15);write('[6]- islem sonu--------------------');
    gotoxy(10,17);write('[1/6]=seciminiz-------------------');

    gotoxy(45,33);
    repeat
    tus:=readkey;
    until tus in ['1'..'6', #27];
    if tus<>#27 then
    case tus of
    '1':begin
    clrscr;
    gotoxy(14,10);write('ilacin adini giriniz===================>');readln(kay.adi);
    end;
    '2':begin
    clrscr;
    gotoxy(14,10);write('ilacin seri numarasi=========>');readln(kay.sn);
    end;
    '3':begin
    clrscr;
    gotoxy(14,10);write('ilacin hangi firmadan alindigi==================>');readln(kay.firma);
    end;
    '4':begin
    clrscr;
    gotoxy(14,10);write('ilacin alis fiyati============>');readln(kay.af);
    end;
    '5':begin
    clrscr;
    gotoxy(14,10);write('ilacin satis fiyati===========>');readln(kay.sf);
    end;
    '6':begin
    seek(dosya,i);
    write(dosya,kay);
    clrscr;
    gotoxy(20,22);
    write('islem tamamlandi...............');
    close(dosya);
    tus:=readkey;
    exit;
    end;
    end;
    until 1=2;
    end;
    end;
    clrscr;
    gotoxy(25,23);write('kayit yok....................');
    close(dosya);
    tus:=readkey;
    end;

    {--------------------ana program-------------------}
    begin
    textbackground(0);
    repeat
    clrscr;
    cerceve;
    textcolor(15);
    gotoxy(63,9); write('2005-2006');
    gotoxy(61,11); writeln('E§itim-™§retim');
    gotoxy(65,13); write('Yl');
    gotoxy(61,15); write('Proje ™devi');
    textcolor(green);
    gotoxy(26,8); write('....::::MENš::::....');
    gotoxy(23,10);write('-----1-bilgi girisi--------');
    gotoxy(23,12);write('-----2-bilgi listeleme-----');
    gotoxy(23,14);write('-----3-bilgi duzeltme------');
    gotoxy(23,16);write('-----4-bilgi silme---------');
    gotoxy(23,18);write('-----5-bilgi arama---------');
    gotoxy(25,22);write('seciminiz (esc=cikis)');

    repeat
    t:=readkey;
    if t=#27 then halt;
    until t in ['1'..'5',#27];
    case t of
    '1' :bilgigirisi;
    '2' :bilgilisteleme;
    '3' :bilgiduzeltme;
    '4' :bilgisilme;
    '5' :bilgiarama;
    end;
    until false;
    end.
     

Bu Sayfayı Paylaş