w_cust_plan_add.srw 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. $PBExportHeader$w_cust_plan_add.srw
  2. forward
  3. global type w_cust_plan_add from w_publ_base
  4. end type
  5. type dw_1 from datawindow within w_cust_plan_add
  6. end type
  7. type cb_2 from uo_imflatbutton within w_cust_plan_add
  8. end type
  9. type cb_1 from uo_imflatbutton within w_cust_plan_add
  10. end type
  11. end forward
  12. global type w_cust_plan_add from w_publ_base
  13. integer width = 1979
  14. integer height = 1672
  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_plan_add w_cust_plan_add
  23. type variables
  24. s_cust_plan s_plan_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_plan s_plan
  41. String arg_msg
  42. s_plan.planid = dw_1.Object.planid[li_row]
  43. s_plan.cusid = dw_1.Object.cusid[li_row]
  44. s_plan.saler = Trim(dw_1.Object.saler[li_row])
  45. s_plan.plandate = dw_1.Object.plandate[li_row]
  46. s_plan.planrep = Trim(dw_1.Object.planrep[li_row])
  47. s_plan.plancontent = Trim(dw_1.Object.plancontent[li_row])
  48. s_plan.planaccomplishdate = dw_1.Object.planaccomplishdate[li_row]
  49. s_plan.accomplishdate = dw_1.Object.accomplishdate[li_row]
  50. s_plan.accomplishrslt = Trim(dw_1.Object.accomplishrslt[li_row])
  51. s_plan.dscrp = Trim(dw_1.Object.dscrp[li_row])
  52. IF uo_cus.uof_add_plan(s_plan,publ_operator,arg_msg,TRUE) = 0 THEN
  53. MessageBox('错误',arg_msg,stopsign!,ok!)
  54. rslt = 0
  55. GOTO ext
  56. END IF
  57. ext:
  58. RETURN rslt
  59. end function
  60. public function integer wf_insertrow ();Long ll_row
  61. ll_row = dw_1.InsertRow(0)
  62. dw_1.Object.cusid[ll_row] = s_plan_open.cusid
  63. dw_1.SetFocus()
  64. dw_1.SetColumn('saler')
  65. RETURN 1
  66. end function
  67. on w_cust_plan_add.create
  68. int iCurrent
  69. call super::create
  70. this.dw_1=create dw_1
  71. this.cb_2=create cb_2
  72. this.cb_1=create cb_1
  73. iCurrent=UpperBound(this.Control)
  74. this.Control[iCurrent+1]=this.dw_1
  75. this.Control[iCurrent+2]=this.cb_2
  76. this.Control[iCurrent+3]=this.cb_1
  77. end on
  78. on w_cust_plan_add.destroy
  79. call super::destroy
  80. destroy(this.dw_1)
  81. destroy(this.cb_2)
  82. destroy(this.cb_1)
  83. end on
  84. event open;call super::open;dw_1.SetTransObject(sqlca)
  85. s_plan_open = Message.PowerObjectParm
  86. uo_cus = CREATE uo_crm
  87. IF s_plan_open.planid = 0 THEN
  88. wf_insertrow()
  89. ELSE
  90. dw_1.Retrieve(s_plan_open.planid)
  91. END IF
  92. end event
  93. event close;call super::close;destroy uo_cus
  94. end event
  95. type cb_func from w_publ_base`cb_func within w_cust_plan_add
  96. boolean visible = false
  97. integer x = 1056
  98. integer y = 580
  99. boolean enabled = false
  100. end type
  101. type cb_exit from w_publ_base`cb_exit within w_cust_plan_add
  102. integer x = 1349
  103. integer y = 1456
  104. integer taborder = 30
  105. string text = "取消"
  106. end type
  107. type dw_1 from datawindow within w_cust_plan_add
  108. event key pbm_dwnkey
  109. event dwnkey pbm_dwnkey
  110. integer x = 91
  111. integer y = 32
  112. integer width = 1783
  113. integer height = 1368
  114. integer taborder = 10
  115. boolean bringtotop = true
  116. string dataobject = "dw_cust_crm_plan_add"
  117. boolean livescroll = true
  118. borderstyle borderstyle = stylelowered!
  119. end type
  120. event dwnkey;IF Key = KeyDownArrow! THEN RETURN 1
  121. IF Key = keyenter! OR Key = KeyDownArrow! THEN //
  122. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  123. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  124. RETURN 0
  125. ELSEIF Key = keyuparrow! THEN
  126. keybd_event ( 16, 0, 0 , 0 )
  127. keybd_event ( 9, 0, 0 , 0 )
  128. keybd_event ( 9, 0, 2, 0 )
  129. keybd_event ( 16, 0, 2, 0 )
  130. RETURN 0
  131. END IF
  132. end event
  133. event rbuttondown;Long ll_row,ll_column
  134. ll_row = THIS.GetRow()
  135. ll_column = THIS.GetColumn()
  136. IF ll_row <= 0 THEN RETURN
  137. IF ll_column <= 0 THEN RETURN
  138. IF Left( THIS.Describe( dwo.Name+ ".coltype"),4) = 'date' THEN
  139. s_calender_arg s_calender
  140. s_calender.PointerX = THIS.PointerX()
  141. s_calender.PointerY = THIS.PointerY()
  142. s_calender.X = THIS.X + PARENT.X
  143. s_calender.Y = THIS.Y + PARENT.Y
  144. OpenWithParm(w_calendar,s_calender)
  145. THIS.SetItem(ll_row,ll_column,id_date_selected)
  146. end if
  147. end event
  148. type cb_2 from uo_imflatbutton within w_cust_plan_add
  149. integer x = 777
  150. integer y = 1456
  151. integer width = 407
  152. integer height = 96
  153. integer taborder = 40
  154. string text = "保存[C^+S]"
  155. string normalpicname = "save.bmp"
  156. end type
  157. event clicked;call super::clicked;if wf_save() = 0 then return
  158. close(parent)
  159. end event
  160. type cb_1 from uo_imflatbutton within w_cust_plan_add
  161. integer x = 123
  162. integer y = 1456
  163. integer width = 489
  164. integer height = 96
  165. integer taborder = 40
  166. string text = "保存&新增[&S]"
  167. string normalpicname = "save.bmp"
  168. end type
  169. event clicked;call super::clicked;IF wf_save() = 0 THEN RETURN
  170. wf_insertrow()
  171. end event