w_cust_rep_add.srw 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. $PBExportHeader$w_cust_rep_add.srw
  2. forward
  3. global type w_cust_rep_add from w_publ_base
  4. end type
  5. type dw_1 from datawindow within w_cust_rep_add
  6. end type
  7. type cb_2 from uo_imflatbutton within w_cust_rep_add
  8. end type
  9. type cb_1 from uo_imflatbutton within w_cust_rep_add
  10. end type
  11. end forward
  12. global type w_cust_rep_add from w_publ_base
  13. integer width = 1774
  14. integer height = 1516
  15. string title = "客户联系人"
  16. boolean minbox = false
  17. windowtype windowtype = response!
  18. dw_1 dw_1
  19. cb_2 cb_2
  20. cb_1 cb_1
  21. end type
  22. global w_cust_rep_add w_cust_rep_add
  23. type variables
  24. s_cust_rep s_rep_open
  25. uo_crm uo_cus
  26. end variables
  27. forward prototypes
  28. public function integer wf_save ()
  29. public function integer wf_insertrow ()
  30. end prototypes
  31. public function integer wf_save ();Int rslt = 1
  32. Long li_row
  33. dw_1.AcceptText()
  34. li_row = dw_1.GetRow()
  35. IF li_row <= 0 THEN
  36. MessageBox('提示','记录错误',information!,ok!)
  37. rslt = 0
  38. GOTO ext
  39. END IF
  40. s_cust_rep s_rep
  41. String arg_msg
  42. s_rep.repid = dw_1.Object.repid[li_row]
  43. s_rep.cusid = dw_1.Object.cusid[li_row]
  44. s_rep.repname = Trim(dw_1.Object.repname[li_row])
  45. s_rep.deptname = Trim(dw_1.Object.deptname[li_row])
  46. s_rep.duty = Trim(dw_1.Object.duty[li_row])
  47. s_rep.sex = Trim(dw_1.Object.sex[li_row])
  48. s_rep.officetel = Trim(dw_1.Object.officetel[li_row])
  49. s_rep.handtel = Trim(dw_1.Object.handtel[li_row])
  50. s_rep.faxno = Trim(dw_1.Object.faxno[li_row])
  51. s_rep.email = Trim(dw_1.Object.email[li_row])
  52. s_rep.interest = Trim(dw_1.Object.interest[li_row])
  53. s_rep.mainproduct = Trim(dw_1.Object.mainproduct[li_row])
  54. s_rep.dscrp = Trim(dw_1.Object.dscrp[li_row])
  55. IF uo_cus.uof_add_rep(s_rep,publ_operator,arg_msg,TRUE) = 0 THEN
  56. MessageBox('错误',arg_msg,stopsign!,ok!)
  57. rslt = 0
  58. GOTO ext
  59. END IF
  60. ext:
  61. RETURN rslt
  62. end function
  63. public function integer wf_insertrow ();Long ll_row
  64. ll_row = dw_1.InsertRow(0)
  65. dw_1.Object.cusid[ll_row] = s_rep_open.cusid
  66. dw_1.SetFocus()
  67. dw_1.SetColumn('repname')
  68. RETURN 1
  69. end function
  70. on w_cust_rep_add.create
  71. int iCurrent
  72. call super::create
  73. this.dw_1=create dw_1
  74. this.cb_2=create cb_2
  75. this.cb_1=create cb_1
  76. iCurrent=UpperBound(this.Control)
  77. this.Control[iCurrent+1]=this.dw_1
  78. this.Control[iCurrent+2]=this.cb_2
  79. this.Control[iCurrent+3]=this.cb_1
  80. end on
  81. on w_cust_rep_add.destroy
  82. call super::destroy
  83. destroy(this.dw_1)
  84. destroy(this.cb_2)
  85. destroy(this.cb_1)
  86. end on
  87. event open;call super::open;dw_1.SetTransObject(sqlca)
  88. s_rep_open = Message.PowerObjectParm
  89. uo_cus = CREATE uo_crm
  90. IF s_rep_open.repid = 0 THEN
  91. wf_insertrow()
  92. ELSE
  93. dw_1.Retrieve(s_rep_open.repid)
  94. END IF
  95. end event
  96. event close;call super::close;destroy uo_cus
  97. end event
  98. type cb_func from w_publ_base`cb_func within w_cust_rep_add
  99. boolean visible = false
  100. integer x = 1056
  101. integer y = 580
  102. boolean enabled = false
  103. end type
  104. type cb_exit from w_publ_base`cb_exit within w_cust_rep_add
  105. integer x = 1335
  106. integer y = 1296
  107. integer taborder = 30
  108. string text = "取消"
  109. end type
  110. type dw_1 from datawindow within w_cust_rep_add
  111. event key pbm_dwnkey
  112. event dwnkey pbm_dwnkey
  113. integer x = 41
  114. integer y = 48
  115. integer width = 1669
  116. integer height = 1172
  117. integer taborder = 10
  118. boolean bringtotop = true
  119. string dataobject = "dw_cust_crm_rep_add"
  120. boolean livescroll = true
  121. borderstyle borderstyle = stylelowered!
  122. end type
  123. event dwnkey;IF Key = KeyDownArrow! THEN RETURN 1
  124. IF Key = keyenter! OR Key = KeyDownArrow! THEN //
  125. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  126. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  127. RETURN 0
  128. ELSEIF Key = keyuparrow! THEN
  129. keybd_event ( 16, 0, 0 , 0 )
  130. keybd_event ( 9, 0, 0 , 0 )
  131. keybd_event ( 9, 0, 2, 0 )
  132. keybd_event ( 16, 0, 2, 0 )
  133. RETURN 0
  134. END IF
  135. end event
  136. event rbuttondown;Long ll_row,ll_column
  137. ll_row = THIS.GetRow()
  138. ll_column = THIS.GetColumn()
  139. IF ll_row <= 0 THEN RETURN
  140. IF ll_column <= 0 THEN RETURN
  141. IF Left( THIS.Describe( dwo.Name+ ".coltype"),4) = 'date' THEN
  142. s_calender_arg s_calender
  143. s_calender.PointerX = THIS.PointerX()
  144. s_calender.PointerY = THIS.PointerY()
  145. s_calender.X = THIS.X + PARENT.X
  146. s_calender.Y = THIS.Y + PARENT.Y
  147. OpenWithParm(w_calendar,s_calender)
  148. THIS.SetItem(ll_row,ll_column,id_date_selected)
  149. end if
  150. end event
  151. type cb_2 from uo_imflatbutton within w_cust_rep_add
  152. integer x = 763
  153. integer y = 1296
  154. integer width = 407
  155. integer height = 96
  156. integer taborder = 40
  157. string text = "保存[C^+S]"
  158. string normalpicname = "save.bmp"
  159. end type
  160. event clicked;call super::clicked;if wf_save() = 0 then return
  161. close(parent)
  162. end event
  163. type cb_1 from uo_imflatbutton within w_cust_rep_add
  164. integer x = 110
  165. integer y = 1296
  166. integer width = 489
  167. integer height = 96
  168. integer taborder = 40
  169. string text = "保存&新增[&S]"
  170. string normalpicname = "save.bmp"
  171. end type
  172. event clicked;call super::clicked;IF wf_save() = 0 THEN RETURN
  173. wf_insertrow()
  174. end event