procedure
TF_mhs.BitBtn1Click(Sender: TObject);
begin // tombol baru
Edit1.SetFocus;
F_Menu.Tmhs.Append;
ComboBox1.Text:='';
ComboBox2.Text:='';
ComboBox3.Text:='';
edit1.Clear;
Edit2.Clear;
Edit3.Clear;
end;
procedure
TF_mhs.BitBtn2Click(Sender: TObject);
begin //tombol simpan
F_Menu.TmhsNIM.Value:=Edit1.Text;
F_Menu.TmhsNama.Value:=Edit2.Text;
F_Menu.TmhsJK.Value:=ComboBox1.Text;
F_Menu.TmhsKProdi.Value:=ComboBox2.Text;
F_Menu.TmhsKjur.Value:=ComboBox3.Text;
F_Menu.Tmhsangkatan.Value:=StrToInt(edit3.Text);
F_Menu.Tmhs.Post;
ShowMessage('Tersimpan');
end;
procedure
TF_mhs.BitBtn3Click(Sender: TObject);
begin // tombol
hapus
if MessageDlg('data akan dihapus, anda yakin ?',
mtConfirmation,[mbYes,mbNo],0)=mrYes then
begin
F_Menu.Tmhs.Delete;
end;
end;
procedure
TF_mhs.BitBtn4Click(Sender: TObject);
begin // tombol ubah
Edit1.Text:=F_Menu.TmhsNIM.Value;
Edit2.Text:=F_Menu.TmhsNama.Value;
ComboBox1.Text:=F_menu.TmhsJK.Value;
ComboBox2.Text:=F_menu.TmhsKProdi.Value;
ComboBox3.Text:=F_menu.TmhsKjur.Value;
Edit3.Text:=IntToStr(F_Menu.Tmhsangkatan.Value);
F_Menu.Tmhs.Edit;
end;
procedure
TF_mhs.ComboBox2Click(Sender: TObject);
begin // comboProdi
Qtampil.Sql.Clear;
Qtampil.Sql.Text:=' select NamaP from prodi
'+
' where kodeP = '+QuotedStr(ComboBox2.Text);
Qtampil.Close;Qtampil.Open;
ShowMessage(Qtampil.Sql.Text);
label7.Caption:=Qtampil.FieldValues['NamaP'];
end;
procedure
TF_mhs.ComboBox3Click(Sender: TObject);
begin //combo
jurusan
Qtampil.Sql.Clear;
Qtampil.Sql.Text:=' select NamaJ from
Jurusan '+
' where kodeJ = '+QuotedStr(ComboBox3.Text);
Qtampil.Close;Qtampil.Open;
label8.Caption:=Qtampil.FieldValues['NamaJ'];
end;
Tidak ada komentar:
Posting Komentar