附件显示数量

by 金波 2013.7.23 15:22

注:脚本执行有风险,对于客户正式环境请在研发指导下执行。

页面上附件显示附件数量可以分两种处理:

1、平台提供的公共栏目上的附件按钮,只要名称为Attachment,自动会显示附件数量;

       如果公共栏的附件对应DataGrid记录,一个附件对多条记录,可以在model增加MainID自定义字段,光标获取时给当前记录MainID赋值,其他为空,查找附件时优先取MainID.

2、可以通过调用服务查找出附件数量,然后修改lable的text=名称+附件数量;

            int count = 0;
            UFIDA.U9.Query.QueryCaseBP.Proxy.GetAttachmentCountProxy bpGetAttachmentCount = new UFIDA.U9.Query.QueryCaseBP.Proxy.GetAttachmentCountProxy();
            bpGetAttachmentCount.EntityFullName = FullName;
            bpGetAttachmentCount.EntityIDS = ids;
            List<UFIDA.U9.Query.QueryCaseBP.EntityAttachmentCountData> attachCountList = bpGetAttachmentCount.Do();
            if (attachCountList.Count > 0)
            {
                count = attachCountList[0].Count;
            }
            if (count > 0)
            {
                   this.lblAttachment47.Text = "附件(" + count + ")";
             }

附:如果想单独增加一个控件表示某个实体对应的附件或做成参照模式

控件:在弹出附件画面传入实体EntityID、FullName

NameValueCollection param = new NameValueCollection();
param.Add("EntityID", focusRcd.WBSTask_ProjectMaster.ToString());
param.Add("FullName", "UFIDA.U9.PMM.PROJ.ProjMaster");
this.ShowModalDialog("7fa90cca-cfdd-4c8d-977f-b3c8e083937e", "", "800", "300", null, param, false, true); 

参照:首先设置附件参照,然后绑定具体的实体;

//设置参照
this.Attachment47.RefType = "7fa90cca-cfdd-4c8d-977f-b3c8e083937e";
this.Attachment47.RefWidth = 800;
this.Attachment47.RefHeight = 300;
this.Attachment47.RefPkField = "AttachmentRef";
this.Attachment47.RefCodeField = "AttachmentRef_Code";
this.Attachment47.RefDisplayNameField = "AttachmentRef_Name";
//绑定实体
this.Attachment47.AddTypeParams("FullName", "UFIDA.U9.PMM.Perform.TaskOutputPerform");
this.Attachment47.AddTypeParams("EntityID", id.ToString());

Tags:

评论 (2) -

ดูแลผู้สูงอายุ 美国 wrote at 2015/3/9 16:51:07 #

Thanks , I've just been looking for information about this subject for a while and yours is the best I've found out so far. However, what concerning the conclusion? Are you positive about the source?

กางเกงฟิตติ้ง top slim 美国 wrote at 2016/6/26 23:47:53 #

Saved as a favorite, I really like your site!

添加评论



biuquote
微笑得意调皮害羞酷大笑惊讶发呆喜欢可怜尴尬闭嘴噘嘴皱眉伤心抓狂呕吐坏笑漫骂发怒
Loading


RecentComments

评论 RSS

Statistics

989 篇文章
0 个单页
589487 条评论
11 次评分
558355 次访问
访问统计开始于 2019年9月14日
平均日访问 8333 次
当前 157 人在线