1: dw_barprint.Reset()
2:
3: long ll_cycle
4: long ll_cycle2
5: long ll_rowcount
6: long ll_row
7: integer i
8: string ls_equipName
9: string ls_equipSpec
10: string ls_cardCode
11: string ls_printedFlag
12: string ls_temp
13: string ls_message
14: string ls_picPath
15: string ls_picName
16:
17: boolean lb_filter
18: boolean lb_rePrint
19: boolean lb_printCheck
20:
21: lb_printCheck = TRUE
22: lb_rePrint = TRUE
23:
24: string ls_Buffer
25: string ls_run
26:
27: //==生成图形条码====================================================
28: //赋值
29: ole_1.Object.barcodetype = 10 //条码类型
30: ole_1.Object.barcodealign = 1 //条码对齐方式
31: ole_1.Object.orientation = 0
32: ole_1.Object.scaling = 0
33: ole_1.Object.Refresh
34: //==================================================================
35: boolean lb_rtn
36: string ls_dir
37: ls_dir = "./tmppic" //要创建的目录名称
38: IF FileExists (ls_dir) THEN
39: else
40: lb_rtn = CreateDirectoryA(ls_dir,0)
41: if not lb_rtn then
42: Messagebox( "提示 ", "临时条码目录创建失败,请在程序运行目录下手动创建tmppic文件夹")
43: End if
44: end if
45:
46: //Long ll_rc
47: //ll_rc = DLLRegisterServer()
48: //messagebox('',ll_rc)
49:
50: ll_rowcount = dw_query.RowCount()
51: IF ll_rowcount <= 0 THEN RETURN
52: SetPointer(HourGlass!)
53:
54: FOR ll_cycle = 1 TO ll_rowcount
55: ls_printedFlag = dw_query.GetItemString(ll_cycle,"PRINT_BARCODE_FLAG")
56: ls_cardCode = Trim(dw_query.GetItemString(ll_cycle,"hospital_card_code"))
57: //只显示前20条已打印的编码
58: //IF lb_filter THEN CONTINUE
59: IF lb_printCheck THEN
60: IF ls_printedFlag = '1' THEN
61: IF NOT lb_rePrint THEN CONTINUE
62: ls_message = ls_cardCode
63: FOR ll_cycle2 = ll_cycle + 1 TO ll_rowcount
64: ls_printedFlag = dw_query.GetItemString(ll_cycle2,"PRINT_BARCODE_FLAG")
65: IF ls_printedFlag = '1' THEN
66: ls_temp = dw_query.GetItemString(ll_cycle2,"hospital_card_code")
67: i++
68: IF i >= 19 THEN
69: ls_message += '、' + ls_temp + '...'
70: EXIT
71: END IF
72: ls_message += '、' + ls_temp
73: END IF
74: NEXT
75: IF MessAgeBox("信息提示","部分资产卡片的条码已打印过,是否重新打印这些条码?"+"~n"+ls_message,Question!,YESNO!,1) = 2 THEN
76: lb_rePrint = FALSE
77: lb_printCheck = TRUE
78: CONTINUE
79: END IF
80: lb_printCheck = FALSE
81: END IF
82: END IF
83: ls_equipName = dw_query.GetItemString(ll_cycle,"equip_name")
84: ls_equipSpec = dw_query.GetItemString(ll_cycle,"equip_spec")
85: // IF f_checknull(ls_cardCode) THEN CONTINUE
86: ll_row = dw_barprint.InsertRow(0)
87: dw_barprint.SetItem(ll_row,"equip_name",ls_equipName)
88: dw_barprint.SetItem(ll_row,"equip_spec",ls_equipSpec)
89: dw_barprint.SetItem(ll_row,"barcode",ls_cardCode)
90: //dw_barprint.SetItem(ll_row,"barcode",wf_128code(ls_cardCode))
91: //要求是一唯128条码前加""B-""
92: dw_barprint.SetItem(ll_row,"printcode","B-"+ls_cardCode)
93: ole_1.Object.Caption = ls_cardCode //为条码赋值 此处写条码号
94: ole_1.Object.Refresh //刷新
95: //c盘根目录生成条码
96: ls_picPath = ls_dir + '/barcode' + Trim(ls_cardCode) + '.bmp'
97: //FileDelete(ls_picPath)//先删除图片 再创建
98: IF FileExists(ls_picPath) THEN
99: dw_barprint.SetItem(ll_row,"mappath",ls_picPath)
100: ELSE
101: ole_1.Object.CreateBMP(ls_picPath,160,40) //生产条码图片文件
102: dw_barprint.SetItem(ll_row,"mappath",ls_picPath)
103: END IF
104:
105: NEXT
106:
107: if dw_barprint.RowCount() <= 0 then return
108:
109: Super::EVENT Clicked()
110:
111: //pf_retrieve()
112: