Transaksi onetoone
Upcoming SlideShare
Loading in...5
×
 

Transaksi onetoone

on

  • 448 views

 

Statistics

Views

Total Views
448
Views on SlideShare
448
Embed Views
0

Actions

Likes
0
Downloads
8
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Transaksi onetoone Transaksi onetoone Document Transcript

  • TMI Borland Delphi Transaksi One to One1. Buat table Trans_Beli Field Name Type Size Key Nofak A 5 * Tgl D Jml N Total N Kobar A 5 Kosup A 32. Desain Form Objek Keterangan Name : tbarang DatabaseName : Pembelian_NIM TableName :barang Name : tsupplier DatabaseName : Pembelian_NIM TableName :supplier Name : ttransaksi DatabaseName : Pembelian_NIM TableName :trans_beliCreated by Titik Misriati
  • TMI Borland DelphiListing Program:public { Public declarations } procedure bersih; procedure tampil; procedure nonaktif; procedure aktif; procedure nomor; end;var Form2: TForm2;implementation{$R *.dfm}procedure TForm2.bersih;begineno.Text:=;ckosup.ItemIndex:=-1;enasup.Text:=;ealamat.Text:=;etelp.Text:=;ekobar.Text:=;enabar.Text:=;eharga.Text:=;ejml.Text:=;etoha.Text:=;end;procedure TForm2.aktif;begineno.Enabled:=true;ckosup.Enabled:=true;enasup.Enabled:=true;ealamat.Enabled:=true;etelp.Enabled:=true;ekobar.Enabled:=true;enabar.Enabled:=true;eharga.Enabled:=true;ejml.Enabled:=true;etoha.Enabled:=true;end;procedure TForm2.nonaktif;begineno.Enabled:=false;etgl.Enabled:=false;ckosup.Enabled:=false;enasup.Enabled:=false;ealamat.Enabled:=false;Created by Titik Misriati
  • TMI Borland Delphietelp.Enabled:=false;ekobar.Enabled:=false;enabar.Enabled:=false;eharga.Enabled:=false;ejml.Enabled:=false;etoha.Enabled:=false;end;procedure TForm2.nomor;var no:integer; nofaktur:string;beginno:=ttransaksi.RecordCount+1;shortdateformat:=yyyy+mm; if ttransaksi.RecordCount<10 then begin nofaktur:=000+inttostr(no); end else if ttransaksi.RecordCount<100 then begin nofaktur:=inttostr(no); end; eno.Text:=datetostr(date)+(nofaktur);end;procedure Tform2.tampil;beginenasup.Text:=tsupplier[nasup];ealamat.Text:=tsupplier[alamat];etelp.Text:=tsupplier[telp];end;procedure TForm2.FormCreate(Sender: TObject);beginwhile not tsupplier.Eof dobegin ckosup.Items.Add(tsupplier[kosup]); tsupplier.Next;end;etgl.Text:=datetostr(date);end;procedure TForm2.FormActivate(Sender: TObject);beginbersih;nonaktif;bsimpan.Enabled:=false;bbatal.Enabled:=false;end;procedure TForm2.ckosupClick(Sender: TObject);Created by Titik Misriati
  • TMI Borland Delphibegin if tsupplier.FindKey([ckosup.Text]) then begin tampil; end; ekobar.Enabled:=True; ekobar.SetFocus;end;procedure TForm2.btambahClick(Sender: TObject);beginaktif;bersih;nomor;eno.SetFocus;bsimpan.Enabled:=true;bbatal.Enabled:=true;btambah.Enabled:=false;end;procedure TForm2.ekobarKeyPress(Sender: TObject; var Key: Char);beginif key=#13 thenbegin if tbarang.Findkey([uppercase(ekobar.Text)]) then begin enabar.Text:=tbarang[nabar]; eharga.Text:=tbarang[harga]; ejml.SetFocus; end else begin messagedlg(Kode barang tidak ada,mtWarning,[mbOK],0); ekobar.Text:=; ekobar.SetFocus; end; end;end;procedure TForm2.bkeluarClick(Sender: TObject);beginclose;end;procedure TForm2.ejmlKeyPress(Sender: TObject; var Key: Char);beginif key=#13 thenbeginetoha.Text:=IntToStr(StrToInt(eharga.Text)*StrToInt(ejml.Text));end;end;Created by Titik Misriati
  • TMI Borland Delphiprocedure TForm2.bsimpanClick(Sender: TObject);beginttransaksi.Append;ttransaksi[nofak]:=eno.Text;ttransaksi[tgl]:=etgl.Text;ttransaksi[kosup]:=ckosup.Text;ttransaksi[kobar]:=ekobar.Text;ttransaksi[jml]:=strtoint(ejml.Text);ttransaksi[total]:=strtoint(etoha.Text);ttransaksi.Post;tbarang.Edit;tbarang[stok]:=tbarang[stok]+strtoint(ejml.Text);tbarang.Post;bersih;nonaktif;bsimpan.Enabled:=false;bbatal.Enabled:=false;btambah.Enabled:=true;end;procedure TForm2.bbatalClick(Sender: TObject);beginbersih;nonaktif;bsimpan.Enabled:=false;bbatal.Enabled:=false;btambah.Enabled:=true;end;end.Created by Titik Misriati