Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select grid3_f
- if reccount() = 0
- return
- endif
- issue_d = strtran(this.parent.issue_da.text,"/","")
- ser_no_o = alltrim(this.parent.ser_no.text)
- sql = "delete fas.dbo.drawing_issue where prj_no = '" + prj_no_i + "' and ddr_no = '" + ser_no_o + "'"
- res = sqlexec(han3,sql)
- if res < 0
- =messagebox("Delete Issue table error : " + alltrim(message()) + chr(13) + sql,16,"錯誤訊息")
- endif
- idx= 3
- select grid3_f
- go top
- do while !eof()
- scatter memvar
- sql1 = "update fas.dbo.xmitl_dtl set kao_iss_flag = 'Y' where prj_no = '" + prj_no_i
- sql2 = "' and equip_no = '" + m.equ_no + "' and ctci_no = '" + m.dwg_no + "' and iss_rev = '" + m.rev_no + "'"
- sql = sql1 + sql2
- res = sqlexec(han3,sql)
- if res < 0
- =messagebox("Update DWG Xmitl table error : " + chr(13) + alltrim(message()) + chr(13) + sql,16,"Error Message Window")
- endif
- for i = 1 to 28
- idx1 = idx + i
- sec_s = 'm.sect' + alltrim(str(i,2))
- col_s = 'thisform.grid2.column' + alltrim(str(idx1,2)) + '.header1.caption'
- sel_na = &col_s
- select cpy_set_f
- go top
- locate for alltrim(dept_na) == alltrim(sel_na)
- if found()
- dept_cd1 = cpy_set_f.dept_cd
- if cpy_set_f.hand_sw = 1
- han_sw = 1
- tel_no_t = ' '
- else
- han_sw = 0
- tel_no_t = alltrim(cpy_set_f.tel_txt)
- endif
- else
- dept_cd1 = '9999'
- han_sw = 1
- tel_no_t = ''
- endif
- sec_qty_s = &sec_s
- if len(alltrim(sec_qty_s)) > 0 and dept_cd1 <> '9999'
- j = at('P',sec_qty_s)
- if j > 0
- m.qty = val(left(sec_qty_s,j-1))
- else
- m.qty = val(sec_qty_s)
- endif
- sql1 = "insert fas.dbo.drawing_issue (prj_no,ctci_no,iss_rev,iss_date_eg,"
- sql2 = "dept_cd,dept_qty,hand_sw,tel_nos,ddr_no,equip_no) values('" + prj_no_i + "','" + alltrim(m.dwg_no)
- sql3 = "','" + alltrim(m.rev_no) + "','" + alltrim(issue_d) + "','"
- sql4 = dept_cd1 + "'," + str(m.qty) + "," + str(han_sw,1) + ",'" + tel_no_t
- sql5 = "','" + ser_no_o + "','" + m.equ_no + "')"
- sql = sql1 + sql2 + sql3 + sql4 + sql5
- res = sqlexec(han3,sql)
- if res < 0
- =messagebox("Insert DWG Issue table error : " + chr(13) + alltrim(message()) + chr(13) + sql,16,"Error message Window")
- endif
- endif
- next
- select grid3_f
- skip
- enddo
- this.parent.cmdPrint.enabled = .t.
- this.parent.pj_no.enabled = .t.
- thisform.preview_chk.enabled = .t.
- save_sw = 1
- thisform.refresh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement