Modul transaksi master detail
Source code
untuk melakukan penyimpanan data
dm_contract_unit.qu_crt_gab.SQL.Text :=
'insert into bju_crt_gabungan(id_crt_gab, '+
'code_cabang,id_quotation,code_kacab,id_wilayah, '+
'code_bank,tgl_crt,jm_crt,tgl_str_crt,jm_str_crt,tgl_end_crt,end_jm_crt,
'+
'periode,rental_rate,tot_unit,tot_rent,user_konek, '+
'tgl_konek,jm_konek,keterangan)
'+
'values(:id_crt_gab,:code_cabang,:id_quotation,:code_kacab,:id_wilayah,
'+
':code_bank,:tgl_crt,:jm_crt,:tgl_str_crt,:jm_str_crt,:tgl_end_crt,:end_jm_crt,:periode,
'+
':rental_rate,:tot_unit,:tot_rent,:user_konek,:tgl_konek,:jm_konek,:keterangan)';
dm_contract_unit.qu_crt_gab.ParamByName('id_crt_gab').AsString :=
ed_id_contract_induk.EditValue;
dm_contract_unit.qu_crt_gab.ParamByName('code_cabang').AsString
:= ed_com_cbg.EditValue;
dm_contract_unit.qu_crt_gab.ParamByName('id_quotation').AsString :=
ed_id_quotation_final.EditValue;
dm_contract_unit.qu_crt_gab.ParamByName('code_kacab').AsString :=
ed_id_kacab.EditValue;
dm_contract_unit.qu_crt_gab.ParamByName('id_wilayah').AsString :=
ed_id_direksi.EditValue;
dm_contract_unit.qu_crt_gab.ParamByName('code_bank').AsString :=
ed_id_bank.EditValue;
dm_contract_unit.qu_crt_gab.ParamByName('tgl_crt').AsDate
:= dm_BJU.TanggalJam;
dm_contract_unit.qu_crt_gab.ParamByName('jm_crt').AsTime :=
dm_BJU.TanggalJam;
dm_contract_unit.qu_crt_gab.ParamByName('tgl_str_crt').AsDate :=
dm_BJU.TanggalJam;
dm_contract_unit.qu_crt_gab.ParamByName('jm_str_crt').AsTime :=
dm_BJU.TanggalJam;
dm_contract_unit.qu_crt_gab.ParamByName('tgl_end_crt').AsDate :=
dm_BJU.TanggalJam;
dm_contract_unit.qu_crt_gab.ParamByName('end_jm_crt').AsTime :=
dm_BJU.TanggalJam;
dm_contract_unit.qu_crt_gab.ParamByName('periode').AsFloat :=
ed_periode.EditValue;
dm_contract_unit.qu_crt_gab.ParamByName('rental_rate').AsCurrency :=
ed_rental_rate.EditValue;
dm_contract_unit.qu_crt_gab.ParamByName('tot_unit').AsFloat :=
ed_total_unit.EditValue;
dm_contract_unit.qu_crt_gab.ParamByName('tot_rent').AsCurrency
:= ed_total_rental_rate.EditValue;
dm_contract_unit.qu_crt_gab.ParamByName('user_konek').AsString :=
userkonek;
dm_contract_unit.qu_crt_gab.ParamByName('tgl_konek').AsDate :=
dm_BJU.TanggalJam;
dm_contract_unit.qu_crt_gab.ParamByName('jm_konek').AsTime
:= dm_BJU.TanggalJam;
dm_contract_unit.qu_crt_gab.ParamByName('keterangan').AsString := 'LAGI
DI TESS';
dm_contract_unit.qu_crt_gab.ExecSQL;
dm_contract_unit.qu_crt_gab_detail.Sql.text:=
'insert into bju_crt_gabungan_detail '+
'(id_crt_gab,id_crt_unit,no_mesin,no_rangka, '+
'no_polisi,merek,vehice_type,model)
'+
'values(:id_crt_gab,:id_crt_unit,:no_mesin,:no_rangka, '+
':no_polisi,:merek,:vehice_type,:model)';
dm_contract_unit.qu_crt_gab_detail.ParamByName('id_crt_gab').AsString :=
tv_crtunit.Columns[0].EditValue;
dm_contract_unit.qu_crt_gab_detail.ParamByName('id_crt_unit').AsString
:= tv_crtunit.Columns[1].EditValue;
dm_contract_unit.qu_crt_gab_detail.ParamByName('no_mesin').AsString :=
tv_crtunit.Columns[2].EditValue;
dm_contract_unit.qu_crt_gab_detail.ParamByName('no_rangka').AsString :=
tv_crtunit.Columns[3].EditValue;
dm_contract_unit.qu_crt_gab_detail.ParamByName('no_polisi').AsString
:= tv_crtunit.Columns[4].EditValue;
dm_contract_unit.qu_crt_gab_detail.ParamByName('merek').AsString :=
tv_crtunit.Columns[5].EditValue;
dm_contract_unit.qu_crt_gab_detail.ParamByName('vehice_type').AsString
:= tv_crtunit.Columns[6].EditValue;
dm_contract_unit.qu_crt_gab_detail.ParamByName('model').AsString :=
tv_crtunit.Columns[7].EditValue;
dm_contract_unit.qu_crt_gab_detail.ExecSQL;
MessageDlg('Data
Tersimpan',mtConfirmation,[mbOK],0);
init_query_nonactive;
0 komentar:
Posting Komentar