氚云后台代码小栗子,流程表单新增完成反写源单状态

 1  protected override void OnSubmit(string actionName, H3.SmartForm.SmartFormPostValue postValue, H3.SmartForm.SubmitSmartFormResponse response)
 2         {
 3             try
 4             {
 5                 if (actionName == "Submit")
 6                 {
 7                     H3.DataModel.BizObject currentObject = this.Request.BizObject;//获取当前表单对象;
 8                     string pid = currentObject["F0000001"] + string.Empty;
 9                     H3.DataModel.BizObject[] details = (H3.DataModel.BizObject[])currentObject["D101303Fladqx9gunqpevlb9vucp3kux1"]; //获取子表
10                     if (details != null && details.Length > 0)
11                     {
12                         foreach (H3.DataModel.BizObject e in details)
13                         {
14                             List<H3.Data.Database.Parameter> pars = new List<H3.Data.Database.Parameter>();
15                             //添加参数
16                             pars.Add(new H3.Data.Database.Parameter(
17                                 "@pid", //参数名(与sql中的@name一致)
18                                 System.Data.DbType.String, //参数值类型
19                                 pid//参数值    
20                             ));
21                             string bm = e["F0000020"] + string.Empty;
22                             pars.Add(new H3.Data.Database.Parameter(
23                                 "@bm", //参数名(与sql中的@name一致)
24                                 System.Data.DbType.String, //参数值类型
25                                 bm //参数值    
26                             ));
27 
28                             string sql = "UPDATE i_D101303Fed91560blxwdoxm1eu107gg22 SET f0000014='审核中' WHERE parentobjectid=@pid AND f0000020=@bm";
29                             this.Engine.Query.QueryTable(sql, pars.ToArray());
30                         }
31                     }
32                 }
33             }
34             catch (Exception ex)
35             {
36 
37             }
38             base.OnSubmit(actionName, postValue, response);
39         }

参考文档地址

氚云帮助中心 https://help.h3yun.com/contents/890/1007.html 《带Parameter   sql执行示例:》部分

      https://help.h3yun.com/contents/242/278.html  《如何获取/修改子表数据?》部分

原文地址:https://www.cnblogs.com/miaololi/p/15190301.html