Base_Entry_Body子类创建详细说明_第1页
Base_Entry_Body子类创建详细说明_第2页
Base_Entry_Body子类创建详细说明_第3页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、base_entry_body子类创建详细说明1. 新建 base_entry_body 子类窗体:file一new本工程页选择继承 frm_base_entry_body 窗体2. 设置 form.namc如:firnnv_chcckin_b> form.caption 功能模块名称,女口:"待检入 库单制单"3. 放置好必要之控件。4. 定义好各控件的检查onexih基类定义好了大部分这样的处理过程;如果功能不强,可 自己扩充;基类没有的自己定义,可使用sys_global屮预定义的过程/函数,连好必要 的代码提示onkcydown基类全部冇,5. 注意界面的美观

2、大方。到此为止,界面设计完毕。6. 紧接着是实现三个基类的虚拟过程/函数:初始化控件过程,根据当前行的值,给相应的control属性赋值.procedure initcontrols; override;表体数据行保存procedure savebodydata; override; 吗入缓存 耍 post/ currentstatus 窗体当前状况:'partedit','alledit','add'/ enablecontrols返回哪些控件可用:如:'edt_qty, edt_billqty/表示这些控件町川. 如果子类未定义此过程

3、默认当currentstatus=tartedif吋所有控件disable,否则 /currentstatus<>,partedit,时,所冇控件 enableprocedure sctstatus(cuitcntstatus: string;var enablecontrols: string); 实例说明:procedure tfrm_lnv_checkln_b.initcontrols;bill_id:string;begin/初始化form上的控件setfocus_control:=edt_polineno;/动态设置新增时要聚焦的 wincontrol讦 param 1

4、二'over' thenformcap(ion:二彳寺检超订单入库制单:inherited;adoqry_t mp.closc;adoqry_tmp.sql.text:=*select pmparamvaiuen from pmparam*+' where pmparamcode=hforwarddaysdeny"adoqry_t mp.open;ffdays:=adoqry_tmp.fieldbyname(,pmparamvaluen,).asstring;adoqry_t mp.close;adoqr)_tmp.sql.text:=,select pmpa

5、ramvaluen from pmparamf+' where pmparamcode=hbackwarddaysdeny,m;adoqry_tmp.open;fbdays:=adoqry_tmp.ficldbynamc( pm param valuen1). asstring;adoqry_t mp.close;adoqry_tmp.sql.text:-select pmparamvaluen from pmparam'+' where pmparamcode=hoverqtydeny_percenth,;adoqry_t mp.open;foqty:=adoqry_

6、tmp.fieldbyname( pmparamvaluen.asstring;initusablewhcmbx(adoqry_tmp,usercode,cmbx_warehouse,false);取得单据idif statuso'add* thenbeginadoqry_tmp.close;whereadoqry_tmp.sql.text:='select oncheckbillld from oncheckbill' +,oncheckbillno="'+adoqry_head.fieldbyname('onchcckbilln(y).as

7、string+""adoqry_t mp.open;bill_ld:=adoqry_tmp.fieldbyname(,oncheckbillid,).asstring; endelsebill_id:=-r;设置表体adoqry_body当前sql语句(注意要能与表头关联)adoqry_body.close;adoq_body.sql.text:='select oncheckbillline.polineno1+,oncheckbillline.itemcode,+,itcm.itcmnamc'+;uom.uomname'+r,oncheckbil

8、lline.oncheckqty'+' from oncheckbillline,+' join item on oncheckbillline.itemcode=item.itemcode,+' join uom on itcm.uomcodc=uom.uomcodc'+' where oncheckbillline.oncheckbillld二'+bill_id+”;adoqry_body.open;adoqry_body.sort:='polineno'with adoqry_head dobegin/把根据表头当前

9、数据初始化,表头控件initcmbxtext(cmbx_warehouse,fieldbyname('whcode').asstring); cmbx_warehouse.onchange(cmbx_warehouse);edt_pono.text:=fieldbynamecpono').asstring;ajedt_vendorcode.text:=fieldbyname(,vendorcode,).asstring;lblvcndornamc.captionficldbynamccvcndornainc.asstring; if statuso'add

10、9; thenedt_billno.text:二 fieldbyname('oncheckbillno').asstringelseedt_billno.text:=h;if statuso'add' thenmedt_billdate.text:=fieldbyname('oncheckdate').asstring elsemedt.billdate.textformatdatetimecyyyy.mm.ddnow);lbl_billtypecaption:=fieldbyname(blltypename')asstring;end;

11、end;procedure tfrmnv_checkin_d savebodydata;begininherited;with adoqry_body do/写入缓存beginfieldbyname(,polineno,).asstring:=edt_polineno.text; fieldbyname(titemcode,).asstring:=lbl_itemcode.caption; fieldbyname(ttemname').asstring:二 lbl _itemname. caption; ficldbynamc('uomnamc')assting:二 l

12、bl_uomnamccaption; fieldbyname('oncheckqty').asstring:=edt_billqty.text;post;end;end;procedure tfrm_inv_chcckin_d.sctstatus(currcntstatus: string;var enablecontrols: string);begininherited;if currentstatus=,add, thenbeginif linecount=1 thenbeginadoqry_t mp.close;adoqry_tmp.sql.text:=,select billlines'+' from billtypc'+' where biutypecode=m+,l 102*+m,;adoqry_tmp.open;linecount:=adoqry_tmp.fieldbynamecbilllines

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论