123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- $PBExportHeader$w_workprice_workhour_mod.srw
- forward
- global type w_workprice_workhour_mod from w_publ_base
- end type
- type dw_1 from u_dw_rbtnfilter within w_workprice_workhour_mod
- end type
- type cb_1 from uo_imflatbutton within w_workprice_workhour_mod
- end type
- end forward
- global type w_workprice_workhour_mod from w_publ_base
- integer width = 3611
- integer height = 1664
- string title = "设定工价表工时"
- boolean minbox = false
- windowtype windowtype = response!
- dw_1 dw_1
- cb_1 cb_1
- end type
- global w_workprice_workhour_mod w_workprice_workhour_mod
- type variables
- String ins_sqlerrtext
- long ins_mtrlid
- end variables
- on w_workprice_workhour_mod.create
- int iCurrent
- call super::create
- this.dw_1=create dw_1
- this.cb_1=create cb_1
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.dw_1
- this.Control[iCurrent+2]=this.cb_1
- end on
- on w_workprice_workhour_mod.destroy
- call super::destroy
- destroy(this.dw_1)
- destroy(this.cb_1)
- end on
- event open;call super::open;ins_mtrlid = Message.DoubleParm
- String ls_mtrlcode,ls_mtrlname,ls_mtrlmode
- SELECT mtrlcode,mtrlname,mtrlmode
- INTO :ls_mtrlcode,:ls_mtrlname,:ls_mtrlmode
- FROM u_mtrldef
- Where mtrlid = :ins_mtrlid;
- IF sqlca.SQLCode <> 0 THEN
- MessageBox('Error','查询物料资料失败'+sqlca.SQLErrText)
- Close(THIS)
- END IF
- THIS.Title = THIS.Title + '物料编码:'+ls_mtrlcode +' 名称:'+ls_mtrlname+' 规格:'+ls_mtrlmode
- dw_1.SetTransObject(sqlca)
- dw_1.Retrieve(ins_mtrlid)
- end event
- type cb_func from w_publ_base`cb_func within w_workprice_workhour_mod
- boolean visible = false
- integer y = 1404
- boolean enabled = false
- end type
- type cb_exit from w_publ_base`cb_exit within w_workprice_workhour_mod
- integer x = 1984
- integer y = 1440
- integer width = 302
- string text = "取消"
- end type
- type dw_1 from u_dw_rbtnfilter within w_workprice_workhour_mod
- integer width = 3602
- integer height = 1396
- boolean bringtotop = true
- string title = "none"
- string dataobject = "dw_workprice_workhour_mod"
- boolean hscrollbar = true
- boolean vscrollbar = true
- end type
- event dberror;ins_sqlerrtext = SQLErrText
- RETURN 1
- end event
- event rbuttondown;Long ll_row,ll_column
- ll_row = THIS.GetRow()
- ll_column = THIS.GetColumn()
- IF ll_row <= 0 THEN RETURN
- IF ll_column <= 0 THEN RETURN
- IF Left( THIS.Describe( dwo.Name+ ".coltype"),4) = 'date' THEN
- s_calender_arg s_calender
-
- s_calender.PointerX = THIS.PointerX()
- s_calender.PointerY = THIS.PointerY()
- s_calender.X = THIS.X + PARENT.X
- s_calender.Y = THIS.Y + PARENT.Y
-
- OpenWithParm(w_calendar,s_calender)
- THIS.SetItem(ll_row,ll_column,id_date_selected)
- END IF
- end event
- event rowfocuschanged;call super::rowfocuschanged;IF currentrow <= 0 THEN RETURN
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(currentrow,TRUE)
- end event
- event clicked;call super::clicked;IF row <= 0 THEN RETURN
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(row,TRUE)
- this.setrow(row)
- end event
- type cb_1 from uo_imflatbutton within w_workprice_workhour_mod
- integer x = 1161
- integer y = 1440
- integer height = 96
- integer taborder = 20
- boolean bringtotop = true
- string text = "保存"
- string normalpicname = "save.bmp"
- end type
- event clicked;call super::clicked;dw_1.AcceptText()
- String ls_errmsg
- //更新修改人,修改时间
- Long ll_row
- Long ll_i
- FOR ll_i = 0 TO dw_1.RowCount() - 1
- ll_row = dw_1.GetNextModified(ll_i, Primary!)
- IF ll_row > 0 THEN
- dw_1.Object.u_sc_workprice_moddate_gs[ll_row] = DateTime(Today(),Now())
- dw_1.Object.u_sc_workprice_modrep_gs[ll_row] = publ_operator
- END IF
- NEXT
- IF dw_1.Update() = -1 THEN
- IF Pos(ins_sqlerrtext,"cannot insert duplicate key row") > 0 OR Pos(ins_sqlerrtext,"unique key") > 0 THEN
- ls_errmsg = "关键内容重复"
- ELSE
- ls_errmsg = "因为网络或其他原因>"+ins_sqlerrtext
- END IF
- ROLLBACK;
- MessageBox ("系统提示",ls_errmsg+",保存操作失败!",exclamation!,ok!)
- RETURN
- ELSE
- COMMIT;
- MessageBox ("系统提示","保存操作成功!",exclamation!,ok!)
- Close(PARENT)
- END IF
- end event
|