• 氚云后台代码小栗子,点击按钮进行计算并同步数据到另外一张表单


        protected override void OnSubmit(string actionName, H3.SmartForm.SmartFormPostValue postValue, H3.SmartForm.SubmitSmartFormResponse response)
        {
            if(actionName == "BtnJiShuan")
            {
                //评估数据对象
                BizObject pgsjObj = this.Request.BizObject;
                if((string) pgsjObj["F0000045"] == "已计算")
                {
                    return;
                }
    
                BizObjectSchema schema = this.Request.Engine.BizObjectManager.GetPublishedSchema("D101303ZXDF");
                BizObject zxdfobj = new BizObject(this.Request.Engine, schema, this.Request.UserContext.UserId);
    
                pgsjObj["F0000045"] = "已计算";
                //赋值
                zxdfobj["F0000011"] = this.Request.BizObjectId;//关联
                zxdfobj["F0000001"] = pgsjObj["F0000001"];//标题
                //明细赋值
                BizObject[] details = (BizObject[]) pgsjObj["D101303PGSJMX"]; //获取子表属性并强制转换为对象数组
                if(details != null && details.Length > 0)
                {
                    List < H3.DataModel.BizObject > lstObject = new List<H3.DataModel.BizObject>();
                    foreach(BizObject detail in details)
                    {
                        string type = (string) detail["F0000046"];
                        BizObjectSchema mxschema = this.Request.Engine.BizObjectManager.GetPublishedSchema("D101303ZXDFMX");
                        BizObject zxdfmxobj = new BizObject(this.Request.Engine, mxschema, this.Request.UserContext.UserId);
                        zxdfmxobj["F0000002"] = detail["F0000044"];
                        double r = 0.00;
                        zxdfmxobj["F0000008"] = r;
                        lstObject.Add(zxdfmxobj);
                    }
                    double avgmss = summss / countmss;
                    double avgxs = sumxs / countxs;
                    double avgxz = sumxz / countxz;
    
                    zxdfobj["D101303ZXDFMX"] = lstObject.ToArray();
                    zxdfobj.Status = BizObjectStatus.Effective;
                    zxdfobj.Create();
                    pgsjObj.Update();
                }
            }
            base.OnSubmit(actionName, postValue, response);
        }
    View Code
  • 相关阅读:
    关注底层:IL部分
    腾讯与敏捷开发(zz)
    关于腾讯敏捷框架TAPD (ZZ)
    最新苹果官方iphone sdk 与 xcode 下载网址汇总
    松山湖之行
    [zz]在C#程序中实现插件架构
    华为与敏捷(zz)
    OK6410 tftp下载内核、文件系统以及nand flash地址相关整理、总结
    T400换风扇解决开机fan error问题
    校园故事一个非典型工科男的电子设计之路(整理版)
  • 原文地址:https://www.cnblogs.com/miaololi/p/15242234.html
Copyright © 2020-2023  润新知