private static void PrepareUpdateOrgOrGroups(XmlDocument xmlDoc, XmlDocument xsdDoc, Dictionary <object, object> context) { XmlNode nodeSet = xmlDoc.DocumentElement.SelectSingleNode(".//SET"); XmlNode aNode = nodeSet.SelectSingleNode(".//ALL_PATH_NAME"); if (aNode != null) { CheckAllPathNameInSystem(aNode.InnerText); } XmlNode mNode = XmlHelper.AppendNode(nodeSet, "MODIFY_TIME", "GETDATE()"); XmlHelper.AppendAttr(mNode, "type", "other"); DataExtraCheck(xmlDoc, nodeSet.ParentNode.LocalName); //附加的数据检查 string strSql = InnerCommon.GetUpdateSqlStr(xmlDoc, xsdDoc); if (xmlDoc.DocumentElement.FirstChild.LocalName == "ORGANIZATIONS") { strSql += " \n ; \n " + UpdataOrganizationsChildrens(xmlDoc); } context.Add("Sql", strSql); }
private static void PrepareUpdateUserInOrganization(XmlDocument xmlDoc, XmlDocument userXsd, XmlDocument orgUserXsd, Dictionary <object, object> context) { XmlNode nodeSet = xmlDoc.DocumentElement.SelectSingleNode(".//SET"); XmlNode aNode = nodeSet.SelectSingleNode(".//ALL_PATH_NAME"); if (aNode != null) { CheckAllPathNameInSystem(aNode.InnerText); } DataExtraCheck(xmlDoc, "USERS", "OU_USERS"); XmlDocument userXml = new XmlDocument(); userXml.LoadXml("<Update><USERS><SET/></USERS></Update>"); XmlDocument orgUserXml = new XmlDocument(); orgUserXml.LoadXml("<Update><OU_USERS><SET/></OU_USERS></Update>"); XmlDocToUsersAndOrgUsers(xmlDoc, userXml, userXsd, orgUserXml, orgUserXsd); string strSql = string.Empty; if (userXml.DocumentElement.SelectSingleNode(".//SET").ChildNodes.Count > 0) { strSql = InnerCommon.GetUpdateSqlStr(userXml, userXsd); } Debug.WriteLine(strSql, "USERS"); if (orgUserXml.DocumentElement.SelectSingleNode(".//SET").ChildNodes.Count > 0) { strSql += " \n \n " + InnerCommon.GetUpdateSqlStr(orgUserXml, orgUserXsd); } Debug.WriteLine(strSql, "OU_USERS"); context.Add("Sql", strSql); }