起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 617|回复: 4

只读问题

[复制链接]
发表于 2011-9-8 14:59:43 | 显示全部楼层 |阅读模式
X3中,我该怎么实现一个数据集中,某几条数据只读,某几条可以编辑,代码怎么写~!
回复

使用道具 举报

发表于 2011-9-8 15:34:22 | 显示全部楼层
procedure TFSCTNEW.dsFeeAfterScroll(DataSet: TDataSet);
begin
   if DataSet.FieldByName('MVSP_KPWCH_ID').AsString<>WorkID then  //非本班数据不让修改
   begin
       btnDelete.Enabled:= False;
       btnModify.Enabled:= False;
       DataSet.FieldByName('VALID').ReadOnly:= True; //有效标志[]
       DataSet.FieldByName('CHRG_PRJ').ReadOnly:= True;//收费业务项目[]
       DataSet.FieldByName('INVC_CD').ReadOnly:= True; //发票号[]
       DataSet.FieldByName('PAY_WAY').ReadOnly:= True; //付款方式
       DataSet.FieldByName('IN_OUT_PT').ReadOnly:= True;// 进出口
       DataSet.FieldByName('AMT').ReadOnly:= True;      //金额
       DataSet.FieldByName('TRNS_P1').ReadOnly:= True;  //办理人
       DataSet.FieldByName('TRNS_P2').ReadOnly:= True;
       DataSet.FieldByName('TRNS_TM').ReadOnly:= True;  //办理时间
       DataSet.FieldByName('RMK').ReadOnly:= True;      //备注
   end
   else begin
       if not lEdit then
       begin
         btnModify.Enabled:= true;
         btnDelete.Enabled:= true;
       end
       else begin
         btnModify.Enabled:= False;
         btnDelete.Enabled:= False;
         {if not (dsFee.DataSet.state in [TdatasetState.dsEdit,TdatasetState.dsInsert]) then
         dsFee.DataSet.Edit; }
       end;
       DataSet.FieldByName('PAY_WAY').ReadOnly:= false; //付款方式
       DataSet.FieldByName('VALID').ReadOnly:= false; //有效标志[]
       DataSet.FieldByName('CHRG_PRJ').ReadOnly:= false;//  收费业务项目[]
       DataSet.FieldByName('INVC_CD').ReadOnly:= false; //发票号[]
       DataSet.FieldByName('IN_OUT_PT').ReadOnly:= false;// 进出口
       DataSet.FieldByName('AMT').ReadOnly:= false;     //金额
       DataSet.FieldByName('TRNS_P1').ReadOnly:= false;
       DataSet.FieldByName('TRNS_P2').ReadOnly:= false; //办理人
       DataSet.FieldByName('TRNS_TM').ReadOnly:= false; //办理时间
       DataSet.FieldByName('RMK').ReadOnly:= false;     //备注
   end;
end;
回复 支持 反对

使用道具 举报

 楼主| 发表于 2011-9-8 15:57:16 | 显示全部楼层
可是我需要把记录全部都显示出来啊
回复 支持 反对

使用道具 举报

 楼主| 发表于 2011-9-8 15:58:21 | 显示全部楼层
并非说显示的数据为只读或者可编辑状态~!
回复 支持 反对

使用道具 举报

发表于 2011-9-9 13:19:51 | 显示全部楼层
自己去弄吧,我多J8管闲事。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2024-4-20 02:00 , Processed in 0.043973 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表