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


        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
  • 相关阅读:
    微信公众平台开发(6) 微信退款接口
    shiro 认证和授权原理
    Shiro架构
    微信公众平台开发(5) 微信客服消息接口
    微信公众平台开发(4) 微信模板消息接口
    微信公众平台开发(3) 企业付款
    微信公众平台开发(1) 通用的工具类CommonUtil
    spring 源码构建
    springMvc配置拦截器无效
    IIdea使用CXF开发WebService
  • 原文地址:https://www.cnblogs.com/miaololi/p/15242234.html
Copyright © 2020-2023  润新知