excel单据提交后 BILL_TEMPLATE_PATH 为空,这时候允许个人在新建单据里直接修改,如果有一张excel单据引用到这张单据的数据,引用通过bill_id 建立关联,那么 原单据 BILL_TEMPLATE_PATH 或写入 汇总单据的 bill_id,汇总单据的 BILL_TEMPLATE_PATH 则会写入所有关的 bill_id ,id将引号和逗号隔开。
涉及代码:
Dim strFiledAndValue0(0) As String strFiledAndValue0(0) = "BILL_TEMPLATE_PATH〓" & sVBills DBBase.AppDB.UpdateData(sysParams, "TBILL", "bill_id", sBill_ID, False, strFiledAndValue0) Dim sUpdate As String = "update TBILL set BILL_TEMPLATE_PATH=‘" & sBill_ID & "‘ where bill_id in (" & sVBills & ")" DBBase.AppDB.getDataSet(sysParams, sUpdate)
Dim sSql As String = "select BILL_TEMPLATE_PATH from TBILL where bill_id=‘" & mBillID & "‘)" Dim ds As DataSet = DBBase.AppDB.getDataSet(sysParams, sSql) If ds.Tables(0).Rows.Count > 0 Then Dim dr As DataRow = ds.Tables(0).Rows(0) If dr.Item("BILL_TEMPLATE_PATH").ToString.IndexOf("‘") > -1 Then Dim sUpdate As String = "update TBILL set BILL_TEMPLATE_PATH=‘‘ where bill_id in (" & dr.Item("BILL_TEMPLATE_PATH").ToString & ")" DBBase.AppDB.getDataSet(sysParams, sUpdate) End If End If
本文出自 “德润软件开发” 博客,谢绝转载!
原文地址:http://iderun.blog.51cto.com/6445088/1681661