急,数据窗口多表更新问题,请各位仁兄帮忙

SIRIUS_ORA 2008-07-11 04:43:43
Int li_ResultUpdate,j
string ls_id
ls_id = dw_1.GetItemString(1, "code_id")
//dw_1.setitem(1,"sbd_print_color_code_id",ls_id)
if ls_id='' or isnull(ls_id) then
messagebox("系统提示","编码不能为空!")
dw_1.setfocus()
else
select count(*) into :j from sbd_print_color where code_id =:ls_id using sqlca;
if j >=1 then
messagebox("系统提示","该数据已经计算完成,不能重复计算!")
dw_1.setfocus()
else
//首先更新sbd_print_spend表
li_ResultUpdate= dw_1.Update(True,false)
//更新sbd_print_spend表成功执行,设置sbd_print_spend表为不可更新
If li_ResultUpdate= 1 Then
dw_1.ModIfy("sbd_print_spend_code_id.Update = 'no'")
dw_1.ModIfy("sbd_print_spend_machine_id.Update = 'No'")
dw_1.ModIfy("sbd_print_spend_ink_type.Update = 'No'")
dw_1.ModIfy("sbd_print_spend_print_stuff.Update = 'No'")
dw_1.ModIfy("sbd_print_spend_stuff_ply.Update = 'No'")
dw_1.ModIfy("sbd_print_spend_stuff_type.Update = 'No'")
dw_1.ModIfy("sbd_print_spend_theo_longth.Update = 'No'")
dw_1.ModIfy("sbd_print_spend_start_longth.Update = 'No'")
dw_1.ModIfy("sbd_print_spend_total_longth.Update = 'No'")
dw_1.ModIfy("sbd_print_spend_stuff_weight.Update = 'No'")
dw_1.ModIfy("sbd_print_spend_knife_spend.Update = 'No'")
dw_1.ModIfy("sbd_print_spend_print_spend.Update = 'No'")
dw_1.ModIfy("sbd_print_spend_thinner_spend.Update = 'No'")
dw_1.ModIfy("sbd_print_spend_dep_spend.Update = 'No'")
dw_1.ModIfy("sbd_print_spend_cots_spend.Update = 'No'")
dw_1.ModIfy("sbd_print_spend_elec_spend.Update = 'No'")
dw_1.ModIfy("sbd_print_spend_air_spend.Update = 'No'")
dw_1.ModIfy("sbd_print_spend_steam_spend.Update = 'No'")
dw_1.ModIfy("sbd_print_spend_total_spend.Update = 'No'")
dw_1.ModIfy("sbd_print_spend_code_id.Key = 'no'")

// 设置sbd_print_color表为可更新
dw_1.ModIfy("DataWindow.Table.UpdateTable = 'sbd_print_color'")
dw_1.ModIfy("sbd_print_color_code_id.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_color1.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color.proportion1.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_color2.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_proportion2.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_color3.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_proportion3.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_color4.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_proportion4.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_color5.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_proportion5.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_color6.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_proportion6.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_color7.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_proportion7.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_color8.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_proportion8.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_color9.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_proportion9.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_color10.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_proportion10.Update = 'Yes'")
dw_1.ModIfy("sbd_print_color_code_id.Key = 'Yes'")

//更新sbd_print_color表
li_ResultUpdate = dw_1.Update()
if li_ResultUpdate=1 Then
MessageBox("系统提示", "保存成功!")
Commit Using SQLCA;
Else
MessageBox("系统提示", "保存失败!")
Rollback Using SQLCA;
End If
//恢复数据窗口开始时的属性,以便下一次用户点击“保存”按钮时程序能够正确执行
dw_1.ModIfy("sbd_print_spend_code_id.Update = 'yes'")
dw_1.ModIfy("sbd_print_spend_machine_id.Update = 'yes'")
dw_1.ModIfy("sbd_print_spend_ink_type.Update = 'yes'")
dw_1.ModIfy("sbd_print_spend_print_stuff.Update = 'yes'")
dw_1.ModIfy("sbd_print_spend_stuff_ply.Update = 'yes'")
dw_1.ModIfy("sbd_print_spend_stuff_type.Update = 'yes'")
dw_1.ModIfy("sbd_print_spend_theo_longth.Update = 'yes'")
dw_1.ModIfy("sbd_print_spend_start_longth.Update = 'yes'")
dw_1.ModIfy("sbd_print_spend_total_longth.Update = 'yes'")
dw_1.ModIfy("sbd_print_spend_stuff_weight.Update = 'yes'")
dw_1.ModIfy("sbd_print_spend_knife_spend.Update = 'yes'")
dw_1.ModIfy("sbd_print_spend_print_spend.Update = 'yes'")
dw_1.ModIfy("sbd_print_spend_thinner_spend.Update = 'yes'")
dw_1.ModIfy("sbd_print_spend_dep_spend.Update = 'yes'")
dw_1.ModIfy("sbd_print_spend_cots_spend.Update = 'yes'")
dw_1.ModIfy("sbd_print_spend_elec_spend.Update = 'yes'")
dw_1.ModIfy("sbd_print_spend_air_spend.Update = 'yes'")
dw_1.ModIfy("sbd_print_spend_steam_spend.Update = 'yes'")
dw_1.ModIfy("sbd_print_spend_total_spend.Update = 'yes'")
dw_1.ModIfy("sbd_print_spend_code_id.Key = 'yes'")

dw_1.ModIfy("DataWindow.Table.UpdateTable = 'sbd_print_spend' ")
dw_1.ModIfy("sbd_print_color_code_id.Update = 'no'")
dw_1.ModIfy("sbd_print_color_color1.Update = 'no'")
dw_1.ModIfy("sbd_print_color.proportion1.Update = 'no'")
dw_1.ModIfy("sbd_print_color_color2.Update = 'no'")
dw_1.ModIfy("sbd_print_color_proportion2.Update = 'no'")
dw_1.ModIfy("sbd_print_color_color3.Update = 'no'")
dw_1.ModIfy("sbd_print_color_proportion3.Update = 'no'")
dw_1.ModIfy("sbd_print_color_color4.Update = 'no'")
dw_1.ModIfy("sbd_print_color_proportion4.Update = 'no'")
dw_1.ModIfy("sbd_print_color_color5.Update = 'no'")
dw_1.ModIfy("sbd_print_color_proportion5.Update = 'no'")
dw_1.ModIfy("sbd_print_color_color6.Update = 'no'")
dw_1.ModIfy("sbd_print_color_proportion6.Update = 'no'")
dw_1.ModIfy("sbd_print_color_color7.Update = 'no'")
dw_1.ModIfy("sbd_print_color_proportion7.Update = 'no'")
dw_1.ModIfy("sbd_print_color_color8.Update = 'no'")
dw_1.ModIfy("sbd_print_color_proportion8.Update = 'no'")
dw_1.ModIfy("sbd_print_color_color9.Update = 'no'")
dw_1.ModIfy("sbd_print_color_proportion9.Update = 'no'")
dw_1.ModIfy("sbd_print_color_color10.Update = 'no'")
dw_1.ModIfy("sbd_print_color_proportion10.Update = 'no'")
dw_1.ModIfy("sbd_print_color_code_id.Key = 'no'")
Else
MessageBox("系统提示","保存失败!")
Rollback Using SQLCA;
End If
end if
end if
...全文
105 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
SIRIUS_ORA 2008-07-11
  • 打赏
  • 举报
回复
问题已解决谢谢二位
AFIC 2008-07-11
  • 打赏
  • 举报
回复
这么长……
你弄个PFC,里边直接有多表更新的。
编程夜猫 2008-07-11
  • 打赏
  • 举报
回复
楼主 连出什么问题都不说!!怎么帮你看!
SIRIUS_ORA 2008-07-11
  • 打赏
  • 举报
回复
请帮忙看看里面有什么问题?

1,108

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧