int ls_bianhao,ls_age
date ls_riqi
String ls_zygw,ls_kehu,ls_sex,ls_phone,ls_adress,ls_beizhu,ls_fangshi,ls_zhiye
double ls_zzdj,ls_spdj,ls_xzldj,ls_zzmj,ls_spmj,ls_xzlmj
ls_bianhao= integer(sle_1.text)
ls_riqi =date(em_1.text)
ls_zygw= ddlb_1.text
ls_fangshi=ddlb_2.text
ls_kehu = sle_2.text
ls_sex= ddplb_1.text
ls_age=integer(sle_5.text)
ls_phone = sle_3.text
ls_adress = sle_4.text
ls_zhiye = ddlb_3.text
ls_beizhu = mle_1.text
ls_zzmj=double(sle_6.text)
ls_spmj=double(sle_7.text)
ls_xzlmj=double(sle_8.text)
ls_zzdj=double(sle_9.text)
ls_spdj= double(sle_10.text)
ls_xzldj=double(sle_11.text)
if sle_2.text='' or sle_3.text = '' or sle_4.text='' or sle_5.text='' or ddlb_1.text='' or ddplb_1.text=''or ddlb_2.text='' or ddlb_3.text='' then
Messagebox('提示','請完整客戶資料!')
return
else
insert into lfdjb(bianhao,riqi,fangshi,zygw,kehu,sex,age,phone,adress,zhiye)
VALUES (:ls_bianhao,:ls_riqi,:ls_fangshi,:ls_zygw,:ls_kehu,:ls_sex,:ls_age,:ls_phone,:ls_adress,:ls_zhiye );
end if
if sqlca.sqldbcode <> 0 then
messagebox("錯誤",sqlca.sqlerrtext)
elseif Messagebox('提示','提交完成!')=1 then
close(parent)
else
return
end if
//居住區域選擇
if rb_1.checked = true then
update lfdjb set juqy = '清河區' where bianhao = :ls_bianhao;
elseif rb_2.checked = true then
update lfdjb set juqy = '清浦區' where bianhao = :ls_bianhao;
elseif rb_3.checked = true then
update lfdjb set juqy = '開發區' where bianhao = :ls_bianhao;
elseif rb_4.checked = true then
update lfdjb set juqy = '楚州區' where bianhao = :ls_bianhao;
elseif rb_5.checked = true then
update lfdjb set juqy = '淮陰區' where bianhao = :ls_bianhao;
elseif rb_6.checked = true then
update lfdjb set juqy = '金湖縣' where bianhao = :ls_bianhao;
elseif rb_7.checked = true then
update lfdjb set juqy = '盱眙縣' where bianhao = :ls_bianhao;
elseif rb_8.checked = true then
update lfdjb set juqy = '洪澤縣' where bianhao = :ls_bianhao;
elseif rb_9.checked = true then
update lfdjb set juqy = '漣水縣' where bianhao = :ls_bianhao;
elseif rb_11.checked = true then
update lfdjb set juqy = '其它地區' where bianhao = :ls_bianhao;
end if
//置業目的選擇
if rb_11.checked = true then
update lfdjb set zymd = '自住' where bianhao = :ls_bianhao;
elseif rb_12.checked = true then
update lfdjb set zymd = '投資' where bianhao = :ls_bianhao;
elseif rb_13.checked = true then
update lfdjb set zymd = '自住+投資' where bianhao = :ls_bianhao;
end if
///戶型需求選擇
if rb_14.checked = true then
update lfdjb set hxxq = '住宅' where bianhao = :ls_bianhao;
update lfdjb set yxdj1 = :ls_zzdj where bianhao = :ls_bianhao;
update lfdjb set zzmj = :ls_zzmj where bianhao = :ls_bianhao;
elseif rb_16.checked = true then
update lfdjb set hxxq = '公寓寫字樓' where bianhao = :ls_bianhao;
update lfdjb set yxdj3 = :ls_xzldj where bianhao = :ls_bianhao;
update lfdjb set xzlmj = :ls_xzlmj where bianhao = :ls_bianhao;
elseif rb_15.checked = true then
update lfdjb set hxxq = '商鋪' where bianhao = :ls_bianhao;
update lfdjb set yxdj2 = :ls_spdj where bianhao = :ls_bianhao;
update lfdjb set spmj = :ls_spmj where bianhao = :ls_bianhao;
end if
//認識途徑
if rb_17.checked = true then
update lfdjb set rstj = '報紙' where bianhao = :ls_bianhao;
elseif rb_18.checked = true then
update lfdjb set rstj = '廣播電視' where bianhao = :ls_bianhao;
elseif rb_19.checked = true then
update lfdjb set rstj = '公交站臺' where bianhao = :ls_bianhao;
elseif rb_20.checked = true then
update lfdjb set rstj = '戶外廣告' where bianhao = :ls_bianhao;
elseif rb_21.checked = true then
update lfdjb set rstj = '朋友介紹' where bianhao = :ls_bianhao;
elseif rb_22.checked = true then
update lfdjb set rstj = '路過' where bianhao = :ls_bianhao;
elseif rb_23.checked = true then
update lfdjb set rstj = '短信房產蘇果' where bianhao = :ls_bianhao;
elseif rb_24.checked = true then
update lfdjb set rstj = '其它' where bianhao = :ls_bianhao;
end if
if mle_1.text<>'' then
update lfdjb set beizhu = :ls_beizhu where bianhao = :ls_bianhao;
end if
if sqlca.sqldbcode <> 0 then
messagebox("錯誤",sqlca.sqlerrtext)
elseif Messagebox('提示','提交完成!')=1 then
close(parent)
else
return
end if
uj5u.com熱心網友回復:
錯誤提示 null object reference at line 37 in clicked event of object cb_1 of w_lfuj5u.com熱心網友回復:
37行是哪行啊?害得我數了半天,暈 !更暈的是,以上代碼即使有錯也不會出現"null object reference ....."
錯誤應該不在這里,你發帖玩我啊?
uj5u.com熱心網友回復:
如果是有錯誤,那么不一定是37行,PB的有一個缺點是對報錯的行數報告不準去。呵呵,如果我是老板看見你寫得這個代碼早就請你去另謀高就了。
1.資料庫設計垃圾之極,幾乎以后沒有擴展性(好像遵照了第零范式,呵呵)
2.代碼風格弱的不行
你這個東西完全可以再30-50行代碼搞定
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/99411.html
標籤:數據庫相關
