w_reg_apply.srw 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. $PBExportHeader$w_reg_apply.srw
  2. $PBExportComments$Generated About window
  3. forward
  4. global type w_reg_apply from window
  5. end type
  6. type em_1 from editmask within w_reg_apply
  7. end type
  8. type ddlb_1 from dropdownlistbox within w_reg_apply
  9. end type
  10. type st_5 from statictext within w_reg_apply
  11. end type
  12. type mle_dscrp from multilineedit within w_reg_apply
  13. end type
  14. type st_4 from statictext within w_reg_apply
  15. end type
  16. type em_phonecount from editmask within w_reg_apply
  17. end type
  18. type em_basecount from editmask within w_reg_apply
  19. end type
  20. type st_3 from statictext within w_reg_apply
  21. end type
  22. type sle_cusname from singlelineedit within w_reg_apply
  23. end type
  24. type cb_1 from commandbutton within w_reg_apply
  25. end type
  26. type st_2 from statictext within w_reg_apply
  27. end type
  28. type st_1 from statictext within w_reg_apply
  29. end type
  30. type dw_1 from datawindow within w_reg_apply
  31. end type
  32. end forward
  33. global type w_reg_apply from window
  34. integer x = 777
  35. integer y = 436
  36. integer width = 3095
  37. integer height = 2340
  38. boolean titlebar = true
  39. string title = "注册申请"
  40. boolean controlmenu = true
  41. windowtype windowtype = response!
  42. long backcolor = 16777215
  43. em_1 em_1
  44. ddlb_1 ddlb_1
  45. st_5 st_5
  46. mle_dscrp mle_dscrp
  47. st_4 st_4
  48. em_phonecount em_phonecount
  49. em_basecount em_basecount
  50. st_3 st_3
  51. sle_cusname sle_cusname
  52. cb_1 cb_1
  53. st_2 st_2
  54. st_1 st_1
  55. dw_1 dw_1
  56. end type
  57. global w_reg_apply w_reg_apply
  58. on w_reg_apply.create
  59. this.em_1=create em_1
  60. this.ddlb_1=create ddlb_1
  61. this.st_5=create st_5
  62. this.mle_dscrp=create mle_dscrp
  63. this.st_4=create st_4
  64. this.em_phonecount=create em_phonecount
  65. this.em_basecount=create em_basecount
  66. this.st_3=create st_3
  67. this.sle_cusname=create sle_cusname
  68. this.cb_1=create cb_1
  69. this.st_2=create st_2
  70. this.st_1=create st_1
  71. this.dw_1=create dw_1
  72. this.Control[]={this.em_1,&
  73. this.ddlb_1,&
  74. this.st_5,&
  75. this.mle_dscrp,&
  76. this.st_4,&
  77. this.em_phonecount,&
  78. this.em_basecount,&
  79. this.st_3,&
  80. this.sle_cusname,&
  81. this.cb_1,&
  82. this.st_2,&
  83. this.st_1,&
  84. this.dw_1}
  85. end on
  86. on w_reg_apply.destroy
  87. destroy(this.em_1)
  88. destroy(this.ddlb_1)
  89. destroy(this.st_5)
  90. destroy(this.mle_dscrp)
  91. destroy(this.st_4)
  92. destroy(this.em_phonecount)
  93. destroy(this.em_basecount)
  94. destroy(this.st_3)
  95. destroy(this.sle_cusname)
  96. destroy(this.cb_1)
  97. destroy(this.st_2)
  98. destroy(this.st_1)
  99. destroy(this.dw_1)
  100. end on
  101. event open;string arg_msg
  102. f_init_yunregcom(ref arg_msg)
  103. if (arg_msg <> '') then
  104. MessageBox('提示', '加载云注册模块失败:' + arg_msg)
  105. Close(this)
  106. return
  107. end if
  108. DataStore ds_module
  109. ds_module = Create DataStore
  110. ds_module.DataObject = 'ds_sys_module_kf'
  111. ds_module.RowsCopy(1, ds_module.RowCount(), Primary!, dw_1, 1, Primary!)
  112. destroy ds_module
  113. oleObject curRegMsg
  114. curRegMsg = Message.PowerObjectParm
  115. IF NOT IsValid(curRegMsg) THEN RETURN
  116. oleObject moduleinfos,item
  117. Long i, row
  118. em_basecount.Text = String(curRegMsg.GetInt('basecount'))
  119. em_phonecount.Text = String(curRegMsg.GetInt('phonecount'))
  120. moduleinfos = curRegMsg.GetPBArray('moduleinfos')
  121. IF moduleinfos.Count = 0 THEN RETURN
  122. FOR i = 1 TO moduleinfos.Count
  123. item = moduleinfos.GetPBDictionary(i - 1)
  124. row = dw_1.Find("moduleid = "+String(item.GetInt('ModuleID')),1,dw_1.RowCount())
  125. IF row > 0 THEN
  126. dw_1.Object.ch[row] = 1
  127. dw_1.Object.overdate[row] = String(item.GetDateTime('overdate'),'yyyy-MM-dd')
  128. END IF
  129. NEXT
  130. end event
  131. type em_1 from editmask within w_reg_apply
  132. event ue_keyup pbm_keyup
  133. integer x = 1001
  134. integer y = 400
  135. integer width = 457
  136. integer height = 84
  137. integer taborder = 70
  138. integer textsize = -9
  139. integer weight = 400
  140. fontcharset fontcharset = gb2312charset!
  141. fontpitch fontpitch = variable!
  142. string facename = "宋体"
  143. long textcolor = 33554432
  144. string text = "1900-01-01"
  145. borderstyle borderstyle = stylelowered!
  146. maskdatatype maskdatatype = datemask!
  147. string mask = "yyyy-MM-dd"
  148. boolean spin = true
  149. end type
  150. event ue_keyup;this.post event modified( )
  151. end event
  152. event modified;string temp
  153. temp = Trim(this.Text)
  154. long i
  155. if (temp = '') then
  156. dw_1.SetRedraw(false)
  157. for i = 1 to dw_1.RowCount()
  158. dw_1.Object.overdate[i] = ''
  159. next
  160. dw_1.SetRedraw(true)
  161. return
  162. end if
  163. if (not IsDate(temp)) then return
  164. datetime dt
  165. dt = datetime(temp)
  166. temp = string(dt, 'yyyy-MM-dd')
  167. dw_1.SetRedraw(false)
  168. for i = 1 to dw_1.RowCount()
  169. dw_1.Object.overdate[i] = temp
  170. next
  171. dw_1.SetRedraw(true)
  172. end event
  173. event constructor;this.Text = String(Today(),'yyyy-MM-dd')
  174. end event
  175. type ddlb_1 from dropdownlistbox within w_reg_apply
  176. integer x = 416
  177. integer y = 400
  178. integer width = 549
  179. integer height = 668
  180. integer taborder = 60
  181. integer textsize = -9
  182. integer weight = 400
  183. fontcharset fontcharset = gb2312charset!
  184. fontpitch fontpitch = variable!
  185. string facename = "宋体"
  186. long textcolor = 33554432
  187. boolean autohscroll = true
  188. boolean sorted = false
  189. borderstyle borderstyle = stylelowered!
  190. end type
  191. event selectionchanged;datetime dtNow
  192. dtNow = datetime(today())
  193. string temp
  194. temp = Trim(this.Text)
  195. long days
  196. if (temp = '30天') then
  197. days = 30
  198. elseif (temp = '90天') then
  199. days = 90
  200. elseif (temp = '180天') then
  201. days = 180
  202. elseif (temp = '365天') then
  203. days = 365
  204. elseif (temp = '两年') then
  205. days = 365*2
  206. elseif (temp = '三年') then
  207. days = 365*3
  208. else
  209. return
  210. end if
  211. em_1.Text = string(RelativeDate(today(), days), 'yyyy-MM-dd')
  212. em_1.post event modified( )
  213. end event
  214. event constructor;this.Reset()
  215. this.InsertItem(' 30天', 0)
  216. this.InsertItem(' 90天', 0)
  217. this.InsertItem('180天', 0)
  218. this.InsertItem('365天', 0)
  219. this.InsertItem(' 两年', 0)
  220. this.InsertItem(' 三年', 0)
  221. end event
  222. type st_5 from statictext within w_reg_apply
  223. integer x = 41
  224. integer y = 416
  225. integer width = 347
  226. integer height = 56
  227. integer textsize = -9
  228. integer weight = 400
  229. fontcharset fontcharset = gb2312charset!
  230. fontpitch fontpitch = variable!
  231. string facename = "宋体"
  232. long backcolor = 16777215
  233. string text = "期限(批设置)"
  234. alignment alignment = right!
  235. boolean focusrectangle = false
  236. end type
  237. type mle_dscrp from multilineedit within w_reg_apply
  238. integer x = 416
  239. integer y = 152
  240. integer width = 2661
  241. integer height = 204
  242. integer taborder = 50
  243. integer textsize = -9
  244. integer weight = 400
  245. fontcharset fontcharset = gb2312charset!
  246. fontpitch fontpitch = variable!
  247. string facename = "宋体"
  248. long textcolor = 33554432
  249. borderstyle borderstyle = stylelowered!
  250. end type
  251. type st_4 from statictext within w_reg_apply
  252. integer x = 229
  253. integer y = 168
  254. integer width = 160
  255. integer height = 48
  256. integer textsize = -9
  257. integer weight = 400
  258. fontcharset fontcharset = gb2312charset!
  259. fontpitch fontpitch = variable!
  260. string facename = "宋体"
  261. long textcolor = 33554432
  262. string text = "备注"
  263. alignment alignment = right!
  264. boolean focusrectangle = false
  265. end type
  266. type em_phonecount from editmask within w_reg_apply
  267. integer x = 978
  268. integer y = 32
  269. integer width = 160
  270. integer height = 84
  271. integer taborder = 40
  272. integer textsize = -9
  273. integer weight = 400
  274. fontcharset fontcharset = gb2312charset!
  275. fontpitch fontpitch = variable!
  276. string facename = "宋体"
  277. long textcolor = 33554432
  278. string text = "0"
  279. alignment alignment = right!
  280. borderstyle borderstyle = stylelowered!
  281. string mask = "########0"
  282. end type
  283. type em_basecount from editmask within w_reg_apply
  284. integer x = 416
  285. integer y = 32
  286. integer width = 160
  287. integer height = 84
  288. integer taborder = 40
  289. integer textsize = -9
  290. integer weight = 400
  291. fontcharset fontcharset = gb2312charset!
  292. fontpitch fontpitch = variable!
  293. string facename = "宋体"
  294. long textcolor = 33554432
  295. string text = "0"
  296. alignment alignment = right!
  297. borderstyle borderstyle = stylelowered!
  298. string mask = "########0"
  299. end type
  300. type st_3 from statictext within w_reg_apply
  301. integer x = 1198
  302. integer y = 48
  303. integer width = 160
  304. integer height = 48
  305. integer textsize = -9
  306. integer weight = 400
  307. fontcharset fontcharset = gb2312charset!
  308. fontpitch fontpitch = variable!
  309. string facename = "宋体"
  310. long textcolor = 33554432
  311. string text = "公司"
  312. alignment alignment = right!
  313. boolean focusrectangle = false
  314. end type
  315. type sle_cusname from singlelineedit within w_reg_apply
  316. integer x = 1381
  317. integer y = 28
  318. integer width = 1691
  319. integer height = 84
  320. integer taborder = 10
  321. integer textsize = -9
  322. integer weight = 400
  323. fontcharset fontcharset = gb2312charset!
  324. fontpitch fontpitch = variable!
  325. string facename = "宋体"
  326. long textcolor = 33554432
  327. borderstyle borderstyle = stylelowered!
  328. end type
  329. type cb_1 from commandbutton within w_reg_apply
  330. integer x = 2656
  331. integer y = 2164
  332. integer width = 411
  333. integer height = 84
  334. integer taborder = 30
  335. integer textsize = -9
  336. integer weight = 400
  337. fontcharset fontcharset = gb2312charset!
  338. fontpitch fontpitch = variable!
  339. string facename = "宋体"
  340. string text = "申请"
  341. end type
  342. event clicked;IF Integer(em_basecount.Text) = 0 THEN
  343. MessageBox('ERROR', '请填写基础站点')
  344. RETURN
  345. END IF
  346. IF sle_cusname.Text = '' THEN
  347. MessageBox('ERROR', '请填写公司')
  348. RETURN
  349. END IF
  350. String arg_msg
  351. oleobject getNewRegInfoRequest,getNewRegInfoResponse
  352. getNewRegInfoRequest = RegCom.NewPBDictionary()
  353. getNewRegInfoResponse = RegCom.DoExecute('GetNewRegInfo',getNewRegInfoRequest)
  354. arg_msg = getNewRegInfoResponse.getString('ErrMsg')
  355. IF arg_msg <> '' THEN
  356. MessageBox('ERROR', '申请失败:' + arg_msg)
  357. RETURN
  358. END IF
  359. oleobject newRegRequest,newRegResponse
  360. newRegRequest = getNewRegInfoResponse.GetPBDictionary('newRegInfo')
  361. newRegRequest.SetString('cusname',sle_cusname.Text)
  362. newRegRequest.SetInt('basecount',Integer(em_basecount.Text))
  363. newRegRequest.SetInt('phonecount',Integer(em_phonecount.Text))
  364. newRegRequest.SetString('dscrp',mle_dscrp.Text)
  365. oleobject list, Item
  366. list = YunRegCom.NewPBArray()
  367. DateTime maxDate
  368. maxDate = DateTime(Today())
  369. Long i, cnt = 0
  370. FOR i = 1 To dw_1.RowCount()
  371. If (dw_1.Object.ch[i] <> 1) THEN CONTINUE
  372. cnt ++
  373. Item = YunRegCom.NewPBDictionary()
  374. Item.SetInt('ModuleID', dw_1.Object.moduleid[i])
  375. Item.SetString('overdate', dw_1.Object.overdate[i])
  376. list.AddObject(Item)
  377. NEXT
  378. If (cnt <= 0) THEN
  379. MessageBox('ERROR','请选中至少一个模块')
  380. RETURN
  381. END IF
  382. newRegRequest.SetObject('moduleinfos', list)
  383. getNewRegInfoResponse = YunRegCom.DoExecute('NewReg',newRegRequest)
  384. arg_msg = getNewRegInfoResponse.getString('ErrMsg')
  385. IF arg_msg <> '' THEN
  386. MessageBox('ERROR', '申请失败:' + arg_msg)
  387. RETURN
  388. END IF
  389. oleobject saveRegMsgResponse
  390. saveRegMsgResponse = RegCom.DoExecute('SaveRegMsg', getNewRegInfoResponse)
  391. arg_msg = saveRegMsgResponse.getString('ErrMsg')
  392. IF arg_msg <> '' THEN
  393. MessageBox('ERROR', '保存注册申请信息失败:' + arg_msg)
  394. RETURN
  395. END IF
  396. MessageBox('ERROR', '申请成功!')
  397. Close(Parent)
  398. end event
  399. type st_2 from statictext within w_reg_apply
  400. integer x = 649
  401. integer y = 48
  402. integer width = 302
  403. integer height = 48
  404. integer textsize = -9
  405. integer weight = 400
  406. fontcharset fontcharset = gb2312charset!
  407. fontpitch fontpitch = variable!
  408. string facename = "宋体"
  409. long textcolor = 33554432
  410. string text = "手机站点"
  411. alignment alignment = right!
  412. boolean focusrectangle = false
  413. end type
  414. type st_1 from statictext within w_reg_apply
  415. integer x = 91
  416. integer y = 48
  417. integer width = 302
  418. integer height = 48
  419. integer textsize = -9
  420. integer weight = 400
  421. fontcharset fontcharset = gb2312charset!
  422. fontpitch fontpitch = variable!
  423. string facename = "宋体"
  424. long textcolor = 33554432
  425. string text = "基础站点"
  426. alignment alignment = right!
  427. boolean focusrectangle = false
  428. end type
  429. type dw_1 from datawindow within w_reg_apply
  430. integer x = 9
  431. integer y = 520
  432. integer width = 3063
  433. integer height = 1624
  434. integer taborder = 10
  435. string title = "none"
  436. string dataobject = "dw_reg_sys_module"
  437. boolean hscrollbar = true
  438. boolean vscrollbar = true
  439. boolean livescroll = true
  440. borderstyle borderstyle = stylelowered!
  441. end type