$PBExportHeader$w_rapmoney_mod.srw forward global type w_rapmoney_mod from w_publ_base end type type dw_1 from datawindow within w_rapmoney_mod end type type cb_2 from uo_imflatbutton within w_rapmoney_mod end type type cb_1 from uo_imflatbutton within w_rapmoney_mod end type type gb_1 from groupbox within w_rapmoney_mod end type end forward global type w_rapmoney_mod from w_publ_base integer width = 1879 integer height = 1172 string title = "出纳帐录入" boolean minbox = false windowtype windowtype = response! long backcolor = 80269524 dw_1 dw_1 cb_2 cb_2 cb_1 cb_1 gb_1 gb_1 end type global w_rapmoney_mod w_rapmoney_mod type variables s_edit_index_tran s_tran uo_rapmoney uo_rap end variables forward prototypes public function integer wf_save () end prototypes public function integer wf_save ();int rslt = 1 long li_row dw_1.accepttext() li_row = dw_1.getrow() if li_row <= 0 then messagebox('提示','记录错误',information!,ok!) rslt = 0 goto ext end if long arg_accountid long arg_rapid datetime arg_takedate string arg_billcode string arg_dscrp decimal arg_msttakeamt decimal arg_takeamt string arg_msg long arg_banktypeid string arg_takeemp long arg_scid string arg_relcode arg_accountid = dw_1.object.accountid[li_row] arg_rapid = dw_1.object.rapmoneyid[li_row] arg_takedate = dw_1.object.takedate[li_row] arg_billcode = dw_1.object.billcode[li_row] arg_dscrp = dw_1.object.dscrp[li_row] arg_msttakeamt = dw_1.object.msttakeamt[li_row] arg_takeamt = dw_1.object.takeamt[li_row] arg_takeemp = dw_1.object.takeemp[li_row] arg_banktypeid = dw_1.object.banktypeid[li_row] arg_scid = dw_1.object.scid[li_row] arg_relcode = dw_1.object.relcode[li_row] uo_rap.commit_transaction = sqlca if arg_rapid = 0 then if uo_rap.add_raprec(arg_scid,arg_accountid,arg_takedate,arg_takeemp,arg_dscrp,arg_msttakeamt,arg_takeamt,arg_billcode,0,0,0,publ_operator,arg_msg,true,arg_banktypeid,arg_relcode) = 0 then messagebox('错误',arg_msg,stopsign!,ok!) rslt = 0 goto ext end if else if uo_rap.mod_raprec(arg_scid,arg_accountid,arg_rapid,arg_takedate,arg_takeemp,arg_msttakeamt,arg_takeamt,arg_dscrp,arg_billcode,0,publ_operator,arg_msg,true,0,arg_banktypeid,arg_relcode) = 0 then messagebox('错误',arg_msg,stopsign!,ok!) rslt = 0 goto ext end if end if ext: return rslt end function on w_rapmoney_mod.create int iCurrent call super::create this.dw_1=create dw_1 this.cb_2=create cb_2 this.cb_1=create cb_1 this.gb_1=create gb_1 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.dw_1 this.Control[iCurrent+2]=this.cb_2 this.Control[iCurrent+3]=this.cb_1 this.Control[iCurrent+4]=this.gb_1 end on on w_rapmoney_mod.destroy call super::destroy destroy(this.dw_1) destroy(this.cb_2) destroy(this.cb_1) destroy(this.gb_1) end on event open;call super::open;dw_1.SetTransObject(sqlca) s_tran = Message.PowerObjectParm uo_rap = Create uo_rapmoney Int li_opentype Long li_rapid,li_accountsid Long li_row li_opentype = s_tran.b_long li_accountsid = s_tran.c_long li_rapid = s_tran.d_long IF li_opentype = 1 THEN dw_1.SetRedraw(False) li_row = dw_1.InsertRow(0) dw_1.Object.accountid[li_row] = li_accountsid dw_1.SetRedraw(True) ELSE dw_1.Retrieve(li_rapid,li_accountsid) END IF datawindowchild childdw dw_1.SetTransObject (sqlca) dw_1.GetChild("scid",childdw) childdw.SetTransObject (sqlca) IF childdw.Retrieve(sys_user_scid) = 0 THEN childdw.InsertRow(0) END IF end event event close;call super::close;destroy uo_rap end event type cb_func from w_publ_base`cb_func within w_rapmoney_mod boolean visible = false integer x = 325 integer y = 836 end type type cb_exit from w_publ_base`cb_exit within w_rapmoney_mod integer x = 1477 integer y = 956 integer taborder = 30 string text = "取消" end type type dw_1 from datawindow within w_rapmoney_mod event key pbm_dwnkey event dwnkey pbm_dwnkey integer x = 18 integer y = 56 integer width = 1774 integer height = 880 integer taborder = 10 boolean bringtotop = true string dataobject = "dw_rapmoney_mod" boolean livescroll = true borderstyle borderstyle = stylelowered! end type event dwnkey;if key = KeyDownArrow! then return 1 string ls_itemcode string ls_itemname string ls_itemtype int li_itemflag long ll_itemid,li_row dw_1.accepttext() li_row=dw_1.getrow() if dw_1.getcolumnname ( )='u_itemdef_itemcode' and key = keyenter! then // ls_itemcode=trim(dw_1.object.u_itemdef_itemcode[li_row]) // select itemid,itemname,itemflag,itemtype into :ll_itemid,:ls_itemname,:li_itemflag,:ls_itemtype from u_itemdef where itemcode=:ls_itemcode; // dw_1.setredraw(false) // if sqlca.sqlcode<>0 then // dw_1.triggerevent(doubleclicked!) // return 0 // else // dw_1.object.u_iteminput_itemid[li_row]=ll_itemid // dw_1.object.u_itemdef_itemname[li_row]=ls_itemname // dw_1.object.u_itemdef_itemtype[li_row]=ls_itemtype // dw_1.object.u_itemdef_itemflag[li_row]=li_itemflag // end if // dw_1.setredraw(true) // dw_1.setcolumn("u_iteminput_outamt") // return 0 else if key = keyenter! or key = keydownarrow! then // keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab return 0 elseif key = keyuparrow! then keybd_event ( 16, 0, 0 , 0 ) keybd_event ( 9, 0, 0 , 0 ) keybd_event ( 9, 0, 2, 0 ) keybd_event ( 16, 0, 2, 0 ) return 0 end if end if end event event doubleclicked;//string ls_itemcode //long li_row //dw_1.accepttext() //li_row=dw_1.getrow() // //ls_itemcode=trim(dw_1.object.u_itemdef_itemcode[li_row]) // //if not isvalid(w_itemdef) then // s_edit_index_tran s_ch_tran //传递参数使用 // s_ch_tran.if_retrieve_all=local_retrieve_all //是否一次retrieve所有行 // s_ch_tran.work_mode=1 //0-单纯编辑模式 1-选择\编辑模式 // s_ch_tran.arg_pkid=0 //目标定位pkid (备用) // s_ch_tran.arg_string_code=ls_itemcode //查询列(物料编码)部分内容,用于初步筛选 // // openwithparm(w_itemdef,s_ch_tran) //调用 // // s_itemdef s_inscust // s_inscust=message.powerobjectparm //接受返回结构 // // if s_inscust.itemid > 0 then //正常返回值则可以取以下值 // dw_1.setredraw(false) // dw_1.object.u_iteminput_itemid[li_row]=s_inscust.itemid // dw_1.object.u_itemdef_itemcode[li_row]=s_inscust.itemcode // dw_1.object.u_itemdef_itemname[li_row]=s_inscust.itemname // dw_1.object.u_itemdef_itemtype[li_row]=s_inscust.itemtype // dw_1.object.u_itemdef_itemflag[li_row]=s_inscust.itemflag // dw_1.setcolumn("u_iteminput_outamt") // dw_1.setredraw(true) // end if //end if // // 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 type cb_2 from uo_imflatbutton within w_rapmoney_mod integer x = 1152 integer y = 956 integer width = 329 integer height = 96 integer taborder = 40 string text = "保存[C^+S]" end type event clicked;call super::clicked;if wf_save() = 0 then return close(parent) end event type cb_1 from uo_imflatbutton within w_rapmoney_mod integer x = 750 integer y = 956 integer width = 407 integer height = 96 integer taborder = 40 string text = "保存&新增[&S]" end type event clicked;call super::clicked;if wf_save() = 0 then return long ll_row dw_1.reset() ll_row = dw_1.insertrow(0) dw_1.object.accountid[ll_row] = s_tran.c_long dw_1.setfocus() dw_1.setcolumn('billcode') end event type gb_1 from groupbox within w_rapmoney_mod integer width = 1824 integer height = 1068 integer taborder = 30 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 string text = "资料录入" end type