随笔 - 95,  文章 - 0,  评论 - 0,  阅读 - 14111

列表设计中添加复制一行按钮

复制代码
 string[] objectIds = (string[]) postValue.Data["ObjectIds"];
        // response.Message = string.Join(",", objectIds);
        //判断是否选择数据
        if(objectIds == null || objectIds.Length == 0)
        {
            response.Message = "选择数据";
            return;
        }
        //复制一行
        if(actionName == "Copy")
        {
            foreach(string item in objectIds)
            {
                //获得表单对象
                H3.DataModel.BizObject biz = H3.DataModel.BizObject.Load(this.Request.UserContext.UserId, this.Engine, "D0020332ad93ef554ac4621be51171f6f9dda1f", item, false);
                H3.DataModel.BizObject newbiz = new H3.DataModel.BizObject(this.Engine, this.Engine.BizObjectManager.GetPublishedSchema("D0020332ad93ef554ac4621be51171f6f9dda1f"), this.Request.UserContext.UserId);
                newbiz["F0000001"] = biz["F0000001"];
                newbiz["F0000002"] = biz["F0000002"];
                newbiz["F0000003"] = biz["F0000003"];
                newbiz.Status = H3.DataModel.BizObjectStatus.Effective;
                
复制代码

当在里面添加新的控件时需要刷新数据,在数据库里面刷新

 //当添加新的控件,需要刷新数据,在sql表中重新加载数据
        string uqSql="update I_D0020335ddedab210ff42b9a7454015eacee74d set numMoney=prodPice*prodNumber";
        this.Engine.Query.QueryTable(uqSql,null);

也可以用业务规则

新建一个表,当表提交时,刷新目标表的数据

posted on   天涯何  阅读(113)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示