w_eb_aifmb_requestquote.srw 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. $PBExportHeader$w_eb_aifmb_requestquote.srw
  2. forward
  3. global type w_eb_aifmb_requestquote from window
  4. end type
  5. type cb_2 from commandbutton within w_eb_aifmb_requestquote
  6. end type
  7. type cb_1 from commandbutton within w_eb_aifmb_requestquote
  8. end type
  9. type dw_1 from u_dw_rbtnfilter within w_eb_aifmb_requestquote
  10. end type
  11. end forward
  12. global type w_eb_aifmb_requestquote from window
  13. integer width = 2574
  14. integer height = 1624
  15. boolean titlebar = true
  16. string title = "请求报价"
  17. boolean controlmenu = true
  18. windowtype windowtype = response!
  19. long backcolor = 67108864
  20. string icon = "AppIcon!"
  21. boolean center = true
  22. cb_2 cb_2
  23. cb_1 cb_1
  24. dw_1 dw_1
  25. end type
  26. global w_eb_aifmb_requestquote w_eb_aifmb_requestquote
  27. type variables
  28. long ins_rslt = 0
  29. end variables
  30. on w_eb_aifmb_requestquote.create
  31. this.cb_2=create cb_2
  32. this.cb_1=create cb_1
  33. this.dw_1=create dw_1
  34. this.Control[]={this.cb_2,&
  35. this.cb_1,&
  36. this.dw_1}
  37. end on
  38. on w_eb_aifmb_requestquote.destroy
  39. destroy(this.cb_2)
  40. destroy(this.cb_1)
  41. destroy(this.dw_1)
  42. end on
  43. event close;closewithreturn(this, ins_rslt)
  44. end event
  45. event open;s_eb_aifmb_requestquote_parm s_tran
  46. s_tran = Message.PowerObjectParm
  47. Long i, row
  48. FOR i = 1 To UpperBound(s_tran.im_type)
  49. row = dw_1.InsertRow(0)
  50. dw_1.Object.im_type[row] = s_tran.im_type[i]
  51. dw_1.Object.im_id[row] = s_tran.im_id[i]
  52. dw_1.Object.mtrlcode[row] = s_tran.mtrlcode[i]
  53. dw_1.Object.mtrlname[row] = s_tran.mtrlname[i]
  54. dw_1.Object.numiid[row] = s_tran.numiid[i]
  55. NEXT
  56. end event
  57. type cb_2 from commandbutton within w_eb_aifmb_requestquote
  58. integer x = 2213
  59. integer y = 1412
  60. integer width = 320
  61. integer height = 116
  62. integer taborder = 30
  63. integer textsize = -9
  64. integer weight = 400
  65. fontcharset fontcharset = gb2312charset!
  66. fontpitch fontpitch = variable!
  67. string facename = "宋体"
  68. string text = "取消"
  69. end type
  70. event clicked;close(parent)
  71. end event
  72. type cb_1 from commandbutton within w_eb_aifmb_requestquote
  73. integer x = 1842
  74. integer y = 1412
  75. integer width = 320
  76. integer height = 116
  77. integer taborder = 20
  78. integer textsize = -9
  79. integer weight = 400
  80. fontcharset fontcharset = gb2312charset!
  81. fontpitch fontpitch = variable!
  82. string facename = "宋体"
  83. string text = "确定"
  84. end type
  85. event clicked;dw_1.AcceptText()
  86. Long i
  87. s_aifmb_requestquotedata s_data[]
  88. FOR i = 1 To dw_1.RowCount()
  89. s_data[i].ProductID = Long(dw_1.Object.numiid[i])
  90. s_data[i].Reason = dw_1.Object.QuoteReason[i]
  91. s_data[i].SaleQuantity = dw_1.Object.SaleQuantity[i]
  92. s_data[i].Capacity = dw_1.Object.Capacity[i]
  93. NEXT
  94. uo_aifmb = Create uo_aifmb
  95. Int rslt = 1
  96. String arg_msg
  97. IF uo_aifmb.uf_requestquote(s_data, arg_msg) <> 1 THEN
  98. rslt = 0
  99. GOTO ext
  100. END IF
  101. Long im_type
  102. String im_id
  103. String ls_reason
  104. FOR i = 1 To dw_1.RowCount()
  105. im_type = dw_1.Object.im_type[i]
  106. im_id = dw_1.Object.im_id[i]
  107. ls_reason = dw_1.Object.QuoteReason[i]
  108. UPDATE eb_import_mtrlname SET quoteflag = 1, QuoteReason = :ls_reason
  109. Where im_type = :im_type And im_id = :im_id;
  110. IF sqlca.SQLCode <> 0 THEN
  111. rslt = 0
  112. arg_msg = '更新请求报价原因失败,' + sqlca.SQLErrText
  113. GOTO ext
  114. END IF
  115. NEXT
  116. ext:
  117. Destroy uo_aifmb
  118. IF rslt = 1 THEN
  119. ins_rslt = 1
  120. COMMIT;
  121. Close(Parent)
  122. ELSE
  123. ROLLBACK;
  124. MessageBox('ERROR', arg_msg)
  125. END IF
  126. end event
  127. type dw_1 from u_dw_rbtnfilter within w_eb_aifmb_requestquote
  128. integer width = 2555
  129. integer height = 1408
  130. string dataobject = "dw_eb_aifmb_requestquote"
  131. boolean hscrollbar = true
  132. boolean vscrollbar = true
  133. boolean hsplitscroll = true
  134. end type