if(actionName == "generateFunctionSupervisionPlanList")
        {
            List < Dictionary < string, object >> childBoList = this.Deserialize<List<Dictionary<string, object>>>(this.Request["childBoList"]);
            foreach(Dictionary < string, object > childBo in childBoList)
            {
                //任务清单的对象
                H3.DataModel.BizObjectSchema schema = this.Request.Engine.BizObjectManager.GetPublishedSchema("D002033D002033FunctionSupervisionPlanList");
                H3.DataModel.BizObject targetBo = new H3.DataModel.BizObject(this.Engine, schema, this.Request.UserContext.UserId);

                //加一个list集合,将数据添加至集合中
                List < H3.DataModel.BizObject > childList = new List<H3.DataModel.BizObject>();
                targetBo["joinHowToDoFunctionSupervision"] = childBo["joinHowToDoFunctionSupervision"] + string.Empty;//重点监督到位标准
                targetBo["FunctionSupervisionSub"] = childBo["FunctionSupervisionSub"] + string.Empty;//职能监督范围
                targetBo["HowToDoFunctionSupervisionSub"] = childBo["HowToDoFunctionSupervisionSub"] + string.Empty;//职能监督内容
                targetBo["isFocus"] = childBo["isFocus"] + string.Empty;//重点监督项目

                string sql1 = "SELECT c.objectid FROM i_D002033HowToDoFunctionSupervision a " +
                    " JOIN i_D002033FunctionSupervision b ON a.joinFunctionSupervision = b.objectid " +
                    " JOIN i_D002033organiztionSetup c ON b.joinSupervisionDepartment = c.objectid " +
                    " WHERE a.objectid = '" + childBo["joinHowToDoFunctionSupervision"] + "'";
                System.Data.DataTable dt1 = this.Request.Engine.Query.QueryTable(sql1, null);
                if(dt1 != null && dt1.Rows.Count > 0)
                {
                    H3.DataModel.BizObject deptSetupBo = H3.DataModel.BizObject.Load(this.Request.UserContext.UserId, this.Engine, "D002033organiztionSetup", dt1.Rows[0]["objectid"] + string.Empty, false);

                    targetBo["SupervisionDepartment"] = deptSetupBo["department"];
                    targetBo["supervisionDepartmentHead"] = deptSetupBo["head"];
                }
                string[] planTimeSlots = (childBo["planTimeSlot"] + string.Empty).Split(';');
                foreach(string planTimeSlot in planTimeSlots)
                {
                    //任务清单的开始时间和结束时间的子表对象
                    H3.DataModel.BizObject tchildBo = new H3.DataModel.BizObject(this.Request.Engine, schema.GetChildSchema("D002033FSPlanTimeSlot"), H3.Organization.User.SystemUserId);
                    string[] startAndFinish = planTimeSlot.Split(',');
                    tchildBo["planStartDate"] = startAndFinish[0];
                    tchildBo["planEndDate"] = startAndFinish[1];
                    childList.Add(tchildBo);
                }
                targetBo["D002033FSPlanTimeSlot"] = childList.ToArray();
                targetBo.Status = H3.DataModel.BizObjectStatus.Effective;
                targetBo.Create();
            }
        }
  // 提交校验
    OnValidate: function( actionControl ) {
        if( actionControl.Action == "buttons" ) {
            $.SmartForm.PostForm( "generateFunctionSupervisionPlanList", { childBoList: this.D002033FunctionSupervisionPlanList.GetValue() }, function( data ) {  //从后台获取当前用户的是否为人事角色,“是/否” 
                if( data.Errors && data.Errors.length ) {
                } else {
                    $.IShowSuccess("执行成功");
                }
            });
        }
        return true;
    },

 

posted on 2022-05-15 00:44  天涯何  阅读(61)  评论(0编辑  收藏  举报