w_workprice_workhour_mod.srw 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. $PBExportHeader$w_workprice_workhour_mod.srw
  2. forward
  3. global type w_workprice_workhour_mod from w_publ_base
  4. end type
  5. type dw_1 from u_dw_rbtnfilter within w_workprice_workhour_mod
  6. end type
  7. type cb_1 from uo_imflatbutton within w_workprice_workhour_mod
  8. end type
  9. end forward
  10. global type w_workprice_workhour_mod from w_publ_base
  11. integer width = 3611
  12. integer height = 1664
  13. string title = "设定工价表工时"
  14. boolean minbox = false
  15. windowtype windowtype = response!
  16. dw_1 dw_1
  17. cb_1 cb_1
  18. end type
  19. global w_workprice_workhour_mod w_workprice_workhour_mod
  20. type variables
  21. String ins_sqlerrtext
  22. long ins_mtrlid
  23. end variables
  24. on w_workprice_workhour_mod.create
  25. int iCurrent
  26. call super::create
  27. this.dw_1=create dw_1
  28. this.cb_1=create cb_1
  29. iCurrent=UpperBound(this.Control)
  30. this.Control[iCurrent+1]=this.dw_1
  31. this.Control[iCurrent+2]=this.cb_1
  32. end on
  33. on w_workprice_workhour_mod.destroy
  34. call super::destroy
  35. destroy(this.dw_1)
  36. destroy(this.cb_1)
  37. end on
  38. event open;call super::open;ins_mtrlid = Message.DoubleParm
  39. String ls_mtrlcode,ls_mtrlname,ls_mtrlmode
  40. SELECT mtrlcode,mtrlname,mtrlmode
  41. INTO :ls_mtrlcode,:ls_mtrlname,:ls_mtrlmode
  42. FROM u_mtrldef
  43. Where mtrlid = :ins_mtrlid;
  44. IF sqlca.SQLCode <> 0 THEN
  45. MessageBox('Error','查询物料资料失败'+sqlca.SQLErrText)
  46. Close(THIS)
  47. END IF
  48. THIS.Title = THIS.Title + '物料编码:'+ls_mtrlcode +' 名称:'+ls_mtrlname+' 规格:'+ls_mtrlmode
  49. dw_1.SetTransObject(sqlca)
  50. dw_1.Retrieve(ins_mtrlid)
  51. end event
  52. type cb_func from w_publ_base`cb_func within w_workprice_workhour_mod
  53. boolean visible = false
  54. integer y = 1404
  55. boolean enabled = false
  56. end type
  57. type cb_exit from w_publ_base`cb_exit within w_workprice_workhour_mod
  58. integer x = 1984
  59. integer y = 1440
  60. integer width = 302
  61. string text = "取消"
  62. end type
  63. type dw_1 from u_dw_rbtnfilter within w_workprice_workhour_mod
  64. integer width = 3602
  65. integer height = 1396
  66. boolean bringtotop = true
  67. string title = "none"
  68. string dataobject = "dw_workprice_workhour_mod"
  69. boolean hscrollbar = true
  70. boolean vscrollbar = true
  71. end type
  72. event dberror;ins_sqlerrtext = SQLErrText
  73. RETURN 1
  74. end event
  75. event rbuttondown;Long ll_row,ll_column
  76. ll_row = THIS.GetRow()
  77. ll_column = THIS.GetColumn()
  78. IF ll_row <= 0 THEN RETURN
  79. IF ll_column <= 0 THEN RETURN
  80. IF Left( THIS.Describe( dwo.Name+ ".coltype"),4) = 'date' THEN
  81. s_calender_arg s_calender
  82. s_calender.PointerX = THIS.PointerX()
  83. s_calender.PointerY = THIS.PointerY()
  84. s_calender.X = THIS.X + PARENT.X
  85. s_calender.Y = THIS.Y + PARENT.Y
  86. OpenWithParm(w_calendar,s_calender)
  87. THIS.SetItem(ll_row,ll_column,id_date_selected)
  88. END IF
  89. end event
  90. event rowfocuschanged;call super::rowfocuschanged;IF currentrow <= 0 THEN RETURN
  91. THIS.SelectRow(0,FALSE)
  92. THIS.SelectRow(currentrow,TRUE)
  93. end event
  94. event clicked;call super::clicked;IF row <= 0 THEN RETURN
  95. THIS.SelectRow(0,FALSE)
  96. THIS.SelectRow(row,TRUE)
  97. this.setrow(row)
  98. end event
  99. type cb_1 from uo_imflatbutton within w_workprice_workhour_mod
  100. integer x = 1161
  101. integer y = 1440
  102. integer height = 96
  103. integer taborder = 20
  104. boolean bringtotop = true
  105. string text = "保存"
  106. string normalpicname = "save.bmp"
  107. end type
  108. event clicked;call super::clicked;dw_1.AcceptText()
  109. String ls_errmsg
  110. //更新修改人,修改时间
  111. Long ll_row
  112. Long ll_i
  113. FOR ll_i = 0 TO dw_1.RowCount() - 1
  114. ll_row = dw_1.GetNextModified(ll_i, Primary!)
  115. IF ll_row > 0 THEN
  116. dw_1.Object.u_sc_workprice_moddate_gs[ll_row] = DateTime(Today(),Now())
  117. dw_1.Object.u_sc_workprice_modrep_gs[ll_row] = publ_operator
  118. END IF
  119. NEXT
  120. IF dw_1.Update() = -1 THEN
  121. IF Pos(ins_sqlerrtext,"cannot insert duplicate key row") > 0 OR Pos(ins_sqlerrtext,"unique key") > 0 THEN
  122. ls_errmsg = "关键内容重复"
  123. ELSE
  124. ls_errmsg = "因为网络或其他原因>"+ins_sqlerrtext
  125. END IF
  126. ROLLBACK;
  127. MessageBox ("系统提示",ls_errmsg+",保存操作失败!",exclamation!,ok!)
  128. RETURN
  129. ELSE
  130. COMMIT;
  131. MessageBox ("系统提示","保存操作成功!",exclamation!,ok!)
  132. Close(PARENT)
  133. END IF
  134. end event