private Item GetItemType(String ItemType) { Item result = inn.newItem(); String AMLStr = "<AML>" + "<Item type='ItemType' action='get' where=\"[ItemType].name='" + ItemType + "'\" select='*'>" + "<Relationships>" + "<Item type='Property' action='get' select='name,data_type,data_source'>" + "</Item>" + "<Item type='RelationshipType' action='get' select='*'>" + "<related_id>" + "<Item type='ItemType' action='get' select='*'>" + "<Relationships>" + "<Item type='Property' action='get' select='name,data_type,data_source'>" + "</Item>" + "</Relationships>" + "</Item>" + "</related_id>" + "</Item>" + "</Relationships>" + "</Item>" + "</AML>"; result = inn.applyAML(AMLStr); return(result); }
/// <summary> /// 删除项目根据Id /// </summary> /// <param name="inn"></param> /// <param name="id"></param> /// <returns></returns> public static Item DeleteProjectManageById(Innovator inn, string id) { string strAml = "<AML><Item type='B_PROJECTMANAGE' action='delete' id='" + id + "'></Item></AML>"; Item result = inn.applyAML(strAml); return(result); }
/// <summary> /// 根据ID删除委托 /// </summary> /// <param name="inn"></param> /// <param name="id"></param> /// <returns></returns> public static Item DeleteAgentSetById(Innovator inn, string id) { string strAml = "<AML><Item type='b_AgentSet' action='delete' id='" + id + "'></Item></AML>"; Item result = inn.applyAML(strAml); return(result); }
public static void setAliasName(Item user, CallContext CCO) { string aliasId = CCO.Identity.GetUserAliases(user.getID()); Innovator inn = user.getInnovator(); Item userAlias = inn.getItemById("Identity", aliasId); string aml = "<AML>"; aml += "<Item type='ItemType' action='get'>"; aml += " <name>User</name>"; aml += " <Relationships>"; aml += " <Item type='Property' select='name,keyed_name_order' orderBy='keyed_name_order'>"; aml += " <keyed_name_order condition = 'is not null' />"; aml += " </Item>"; aml += " </Relationships>"; aml += "</Item>"; aml += "</AML>"; Item userType = inn.applyAML(aml); XmlNodeList ndsList = userType.node.SelectNodes("Relationships/Item[@type='Property']/name"); string tagName = ""; for (int i = 0; i < ndsList.Count; i++) { string propName = ndsList[i].InnerText; tagName = tagName + " " + user.getProperty(propName); } tagName = tagName.Trim(); if (tagName != "") { string sql = "UPDATE [innovator].[IDENTITY] set name='{0}' WHERE id='{1}'"; sql = string.Format(sql, tagName, aliasId); Item temp = inn.applySQL(sql); } }
/// <summary> /// 根据项目名称获取项目 /// </summary> /// <param name="inn"></param> /// <param name="name"></param> /// <returns></returns> public static Item GetProjectManageByName(Innovator inn, string name) { string strAml = "<AML><Item type='B_PROJECTMANAGE' action='get'><b_projectname>" + name + "</b_projectname></Item></AML>"; Item result = inn.applyAML(strAml); return(result); }
/// <summary> /// 删除角色 /// </summary> /// <param name="innovator"></param> /// <param name="amlStr"></param> /// <returns></returns> public static Item DeleteRoleManage(Innovator innovator, string id) { string amlStr = "<AML><Item type='IDENTITY' action='delete' id='" + id + "'></Item></AML>"; var result = innovator.applyAML(amlStr); return(result); }
/// <summary> /// Applies methodName or aml string. /// </summary> /// <param name="methodName">Method Name. if empty - applies aml</param> /// <param name="aml">Aml string.</param> /// <returns>Response Item object.</returns> private string _Apply(string methodName, string aml) { CheckAuthorization(); Item response = (methodName == null) ? inn.applyAML(aml) : inn.applyMethod(methodName, aml); if (response.isError()) { this.ThrowException(response); } XmlNode resultNode = response.dom.DocumentElement.SelectSingleNode("/*[local-name()='Envelope']/*[local-name()='Body']/*[local-name(.)='Result']"); if (resultNode != null) { return(resultNode.OuterXml); } else { XmlNode bodyNode = response.dom.DocumentElement.SelectSingleNode("/*[local-name()='Envelope']/*[local-name()='Body']"); if (bodyNode != null) { return(bodyNode.InnerXml); } else { return(response.dom.OuterXml); } } }
/// <summary> ///获取拥有的菜单权限 /// </summary> /// <param name="innovator"></param> /// <param name="id"></param> /// <returns></returns> public static Item GetMenuAuthByIdentity(Innovator innovator, string id) { string str = ""; //获取权限字符串 var enumDescriptions = EnumDescription.GetFieldTexts <SystemMenuList>(true); if (enumDescriptions != null && enumDescriptions.Count > 0) { for (int i = 0; i < enumDescriptions.Count; i++) { if (i == (enumDescriptions.Count - 1)) { str = str + "'" + enumDescriptions[i].FieldName + "'"; } else { str = str + "'" + enumDescriptions[i].FieldName + "',"; } } } string amlStr = "<AML><Item type='ITEMTYPE' action='get'><keyed_name condition ='in'>" + str + "</keyed_name><Relationships><Item type='TOC Access' action='get'><related_id condition='in'>" + id + "</related_id></Item></Relationships></Item></AML>"; //获取是否有角色管理访问权限 //string strSql = "select g.KEYED_NAME from innovator.ITEMTYPE g inner join innovator.TOC_ACCESS t on g.ID = t.SOURCE_ID inner join innovator.[IDENTITY] y on t.RELATED_ID = y.ID where y.ID = '" + id + "'"; Item result = innovator.applyAML(amlStr); return(result); }
/// <summary> /// 删除报销明细 /// </summary> /// <param name="inn"></param> /// <param name="id"></param> public static void DeleteExpenseReimbursementItem(Innovator inn, string id) { //询价信息 var R_ReimbursementItem = inn.newItem("R_ReimbursementItem", "get"); R_ReimbursementItem.setAttribute("where", "source_id='" + id + "'"); R_ReimbursementItem.setAttribute("select", "related_id"); var oldItems = R_ReimbursementItem.apply(); string whereItem = ""; string requestIds = ""; if (oldItems.getItemCount() > 0) { for (int i = 0; i < oldItems.getItemCount(); i++) { var item = oldItems.getItemByIndex(i); whereItem += item.getProperty("related_id") + ","; requestIds += item.getProperty("id") + ","; } whereItem = whereItem.Substring(0, whereItem.LastIndexOf(',')); requestIds = requestIds.Substring(0, requestIds.LastIndexOf(',')); string amlStr = "<AML><Item type='R_ReimbursementItem' action='purge' idlist='" + requestIds + "'></Item><Item type='b_ReimbursementItem' action='purge' idlist='" + whereItem + "'></Item></AML>"; var result = inn.applyAML(amlStr); } }
/// <summary> /// 获取活动根据Id /// </summary> /// <returns></returns> public static Item GetActivityById(Innovator inn, string id) { string strAML = "<AML><Item type='ACTIVITY' action='get' id='" + id + "'></Item></AML>"; var returnItem = inn.applyAML(strAML); return(returnItem); }
/// <summary> /// 删除费用类别 /// </summary> /// <param name="inn"></param> /// <param name="id"></param> /// <returns></returns> public static Item DeleteExpenseCategoryById(Innovator inn, string id) { string strAml = "<AML><Item type='b_ExpenseCategory' action='delete' id='" + id + "'></Item></AML>"; Item result = inn.applyAML(strAml); return(result); }
/// <summary> /// 获取角色管理列表 /// </summary> /// <returns></returns> public static Item GetRoleManageList(Innovator innovator) { string amlStr = "<AML><Item type='IDENTITY' action='get'><is_alias>0</is_alias><Relationships><Item type='MEMBER' action='get'></Item></Relationships></Item></AML>"; var result = innovator.applyAML(amlStr); return(result); }
/// <summary> /// 添加管理权限 /// </summary> /// <param name="ItemId"></param> /// <param name="identityId"></param> public static string AddPrManageAuthById(Innovator inn, string ItemId, string identityId, List <string> names) { string strError = ""; //根据任务名称获取任务 Item activitys = ActivityDA.GetActivityByNames(inn, names, ItemId, "innovator.B_PRMANAGE"); //获取当前任务已经存在的处理人 if (!activitys.isError()) { //获取任务Id string strAml = "<AML>"; for (var i = 0; i < activitys.getItemCount(); i++) { var item = activitys.getItemByIndex(i); string source_id = item.getProperty("id"); Item activityAssignments = ActivityAssignmentDA.GetActivityAssignment(inn, source_id); string ids = ""; if (!activityAssignments.isError() && activityAssignments.getItemCount() > 0) { for (int index = 0; index < activityAssignments.getItemCount(); index++) { var activityAssignment = activityAssignments.getItemByIndex(index); string id = activityAssignment.getProperty("id"); if (index != activityAssignments.getItemCount() - 1) { ids += id + ","; } else { ids += id; } } } if (!string.IsNullOrEmpty(ids)) { ActivityAssignmentDA.deleteActivityAssignment(inn, ids); } strAml += "<Item type = 'ACTIVITY ASSIGNMENT' action = 'add'>"; strAml += "<source_id>" + source_id + "</source_id><related_id>"; strAml += "<Item type='IDENTITY' action='get' id='" + identityId + "'>"; strAml += "</Item></related_id></Item>"; } strAml += "</AML>"; var result = inn.applyAML(strAml); if (result.isError()) { strError = result.getErrorString(); } } else { strError = activitys.getErrorString(); return(strError); } return(strError); }
/// <summary> /// 根据 Identity 获取User /// </summary> /// <param name="inn"></param> /// <param name="IdentityId"></param> /// <returns></returns> public static Item GetUserByIdentityId(Innovator inn, string IdentityId) { string amlStr = "<AML><Item type='USER' action='get'><owned_by_id>{0}</owned_by_id></Item></AML>"; amlStr = string.Format(amlStr, IdentityId); var result = inn.applyAML(amlStr); return(result); }
public static void sgmAddIdentityToRoleUseDept(Item user, string role, CallContext CCO) { string identityId = CCO.Identity.GetIdentityIdByUserId(user.getID()); Innovator inn = user.getInnovator(); Item Identity = inn.getItemById("Identity", identityId); string aml = "<AML>"; aml += "<Item type='List' action='get'>"; aml += " <name>{0}</name>"; aml += " <Relationships>"; aml += " <Item type='Value' select='lable,value'>"; aml += " </Item>"; aml += " </Relationships>"; aml += "</Item>"; aml += "</AML>"; aml = string.Format(aml, role); Item list = inn.applyAML(aml); XmlNodeList ndsList = list.node.SelectNodes("Relationships/Item[@type='Value']/value"); List <string> deptList = new List <string>(); for (int i = 0; i < ndsList.Count; i++) { string dept = ndsList[i].InnerText; deptList.Add(dept); } string user_dept = user.getProperty("department"); int index = deptList.FindIndex(s => s == user_dept); Item Role = inn.getItemById("Identity", CCO.Identity.GetIdentityIdByName(role)); if (index >= 0) { if (!isMember(Role, Identity, inn)) { Item member = inn.newItem("Member", "add"); member.setProperty("source_id", Role.getID()); member.setProperty("related_id", identityId); member = member.apply(); } } else { if (isMember(Role, Identity, inn)) { string sql = "DELETE FROM Member WHERE source_id ='{0}' and related_id='{1}'"; sql = string.Format(sql, Role.getID(), identityId); Item temp = inn.applySQL(sql); } } }
public void ApplyAml(string aml) { HttpServerConnection connection = ServerConnectionFactory.GetServerConnection(this); Innovator innovator = new Innovator(connection); Item result = innovator.applyAML(aml); if (result.isError()) { Logger.Instance.Log(LogLevel.Error, result.ToString()); throw new Exception(string.Format(CultureInfo.InvariantCulture, "Failed to apply AML {0}.", aml)); } }
/// <summary> /// 验证域登录帐号是否存在 /// </summary> /// <param name="inn"></param> /// <param name="loginName"></param> /// <returns></returns> public static bool ValidLoginNameIsExist(Innovator inn, string loginName) { string amlStr = "<AML><Item type='USER' action='get'><login_name>{0}</login_name></Item></AML>"; amlStr = string.Format(amlStr, loginName); var result = inn.applyAML(amlStr); if (result.getItemCount() > 0) { return(true); } else { return(false); } }
/// <summary> /// 根据项目名称获取多个项目 /// </summary> /// <param name="inn"></param> /// <param name="name"></param> /// <returns></returns> public static bool GetProjectManageNoBy(Innovator inn, string name) { string strAml = "<AML><Item type='B_PROJECTMANAGE' action='get'><b_projectname>" + name + "</b_projectname></Item></AML>"; strAml = string.Format(strAml, name); var result = inn.applyAML(strAml); if (result.getItemCount() > 0) { return(true); } else { return(false); } }
///// <summary> ///// 完成任务 ///// </summary> //public static string CompleteActivity(Innovator inn, string strAML) //{ // Item resItem = inn.applyAML(strAML); // if (resItem.isError()) return resItem.getErrorString(); // return ""; //} /// <summary> /// 完成任务 /// </summary> /// <param name="activityId">任务ID</param> /// <param name="activityAssignmentId">权限ID</param> /// <param name="path">选择路线</param> /// <param name="delegateTo">委托到</param> /// <returns></returns> public static string CompleteActivity(Innovator inn, string activityId, string activityAssignmentId, string pathId, string pathName, string delegateTo, string comments, UserInfo userInfo = null) { if (userInfo != null && string.IsNullOrEmpty(delegateTo)) { string delegateName = ""; ACTIVITY_ASSIGNMENT activity_assignment = WorkFlowDA.GetInnvatorByAgent(inn, userInfo, activityId, activityAssignmentId, ref delegateName); if (activity_assignment != null) { activityAssignmentId = activity_assignment.ID; comments = "使用 " + delegateName + " 代理权限审核完成。备注:" + comments; } } //获取委托的ID string delegateToId = ""; if (!string.IsNullOrEmpty(delegateTo)) { delegateToId = UserDA.GetUserByKeyedName(delegateTo).ID; } string MD5Auth = ""; string AuthMode = ""; var strAML = "<AML><Item type='Activity' action='EvaluateActivity'>"; strAML += "<Activity>" + activityId + "</Activity>"; strAML += "<ActivityAssignment>" + activityAssignmentId + "</ActivityAssignment>"; strAML += "<Paths>"; strAML += "<Path id='" + pathId + "'>" + pathName + "</Path>"; strAML += "</Paths>"; strAML += "<DelegateTo>" + delegateToId + "</DelegateTo>"; strAML += "<Tasks>"; strAML += "</Tasks>"; strAML += "<Variables></Variables>"; strAML += "<Authentication mode='" + AuthMode + "'>" + MD5Auth + "</Authentication>"; strAML += "<Comments>" + comments + "</Comments>"; strAML += "<Complete>1</Complete>"; strAML += "</Item></AML>"; Item resItem = inn.applyAML(strAML); if (resItem.isError()) { return(resItem.getErrorString()); } return(""); }
internal static void CheckAmlApplicability(DatabaseComponent databaseComponent) { Logger.Instance.Log(LogLevel.Info, "Checking that we can apply AML to '{0}' component", databaseComponent.Id); HttpServerConnection connection = ServerConnectionFactory.GetServerConnection(databaseComponent); Innovator innovator = new Innovator(connection); string aml = "<AML />"; Item result = innovator.applyAML(aml); if (result.isError()) { Logger.Instance.Log(LogLevel.Error, result.ToString()); throw new ValidationException(string.Format(CultureInfo.InvariantCulture, "Failed to apply AML: {0}.", aml)); } Logger.Instance.Log(LogLevel.Info, "OK"); }
public JsonResult ApplyAML(string aml) { Dictionary <string, object> jo = new Dictionary <string, object>(); Innovator inn = (Innovator)Session["innovator"]; string message = ""; if (inn != null) { try { aml = aml.Replace("<", "<").Replace(">", ">").Replace("\\n", ""); Item itm = inn.applyAML(aml); if (itm.isError()) { message = itm.getErrorString(); jo.Add("status", "Error"); jo.Add("message", message); } else { jo.Add("status", "OK"); } } catch (Exception ex) { message = ex.ToString(); jo.Add("status", "Error"); jo.Add("message", message); } } else { jo.Add("status", "Error"); jo.Add("message", "Login is error."); } return(Json(jo)); }
private void checkConnectionClick(object sender, RoutedEventArgs e) { string error; HttpServerConnection serverConnection = null; try { serverConnection = IomFactory.CreateHttpServerConnection( Server, Database, UserName, Password); Innovator innovator = new Innovator(serverConnection); Item checkConnectionItem = innovator.applyAML("<AML><Item type=\"ItemType\" action=\"get\"><name>ItemType</name></Item></AML>"); error = checkConnectionItem.isError() ? checkConnectionItem.getErrorDetail() : null; } catch (Exception exception) { error = exception.ToString(); } finally { if (serverConnection != null) { serverConnection.Logout(); } } if (string.IsNullOrEmpty(error)) { MessageBox.Show("Works fine", "OK", MessageBoxButton.OK, MessageBoxImage.Information); } else { MessageBox.Show(error, "An error occured", MessageBoxButton.OK, MessageBoxImage.Error); } }
public void Complete_Promote(Core.DocumentProperties properties, OfficeConnectorExtensionAddinRibbon MyRibbon) { //execute the AML to promote if ((inn = Connect_to_Aras(MyRibbon)) != null) { Item result = inn.applyAML(AddtoItem(Settings.Default.promoteAML.Replace("document.id=", "document.id='" + properties[Settings.Default.ArasDocumentId].Value + "'\">"), "state", MyRibbon.NextStateComboBox.Text)); XmlReader readerresult = XmlReader.Create(new StringReader(result.ToString())); if (readerresult.ReadToDescendant("faultcode")) { readerresult.Read(); string error = readerresult.Value; if (error.Contains("IsLocked")) { System.Windows.Forms.MessageBox.Show("Document needs to be locked before promoting"); } else { System.Windows.Forms.MessageBox.Show(error); } } //Updatelabels(properties, MyRibbon); } }
/// <summary> /// 添加活动审核 /// </summary> /// <param name="inn"></param> /// <param name="ItemId">数据ID</param> /// <param name="identityId">权限ID</param> /// <param name="names">节点名称列表</param> /// <param name="tableName">主表名称</param> /// <param name="voting_weight">权重</param> public static void AddActivityAuth(Innovator inn, string ItemId, string identityId, List <string> names, string tableName, int voting_weight = 100, string activityStatus = "Pending") { //根据任务名称获取任务 Item activitys = ActivityDA.GetActivityByNames(inn, names, ItemId, tableName, activityStatus); if (!activitys.isError()) { string strAml = "<AML>"; for (var i = 0; i < activitys.getItemCount(); i++) { var item = activitys.getItemByIndex(i); string source_id = item.getProperty("id"); Item activityAssignments = ActivityAssignmentDA.GetActivityAssignment(inn, source_id); strAml += "<Item type = 'ACTIVITY ASSIGNMENT' action = 'add'>"; strAml += "<voting_weight>" + voting_weight + "</voting_weight>"; strAml += "<source_id>" + source_id + "</source_id><related_id>"; strAml += "<Item type='IDENTITY' action='get' id='" + identityId + "'>"; strAml += "</Item></related_id></Item>"; } strAml += "</AML>"; var result = inn.applyAML(strAml); } }
public string CallAction(string action, string input, IProgressCallback progressReporter) { XmlNode fault; XmlDocument outputDoc = null; var inputDoc = new XmlDocument(); inputDoc.LoadXml(input); if (_userInfo == null) { _userInfo = _inn.applyAML(string.Format("<AML><Item type='User' action='get' select='default_vault' expand='1'><id>{0}</id><Relationships><Item type='ReadPriority' action='get' select='priority, related_id' expand='1' orderBy='priority'/></Relationships></Item></AML>", _inn.getUserID())); } if (action == "ApplyItem" || action == "ApplyAML") { var fileNodes = XPathCache.SelectNodes("descendant-or-self::Item[@type='File' and (@action='add' or @action='update' or @action='create') and actual_filename]", inputDoc.DocumentElement); XmlNode locatedNode; if (fileNodes.Count > 0) { Item fileItem = _inn.newItem(); foreach (var fileNode in fileNodes.OfType <XmlElement>()) { if (string.IsNullOrEmpty(fileNode.Attribute("id"))) { fileNode.Attr("id", _inn.getNewID()); } fileNode.Elem("checkedout_path", Path.GetDirectoryName(fileNode.Element("actual_filename", ""))); fileNode.Elem("filename", Path.GetFileName(fileNode.Element("actual_filename", ""))); locatedNode = XPathCache.SelectSingleNode("Relationships/Item[@type='Located']/related_id", fileNode); if (locatedNode == null) { fileItem.dom = inputDoc; fileItem.node = (XmlElement)fileNode; fileItem.nodeList = null; fileItem.attachPhysicalFile(fileNode.Element("actual_filename", ""), _userInfo.getProperty("default_vault")); } } var firstItem = XPathCache.SelectSingleNode("//Item[1]", inputDoc.DocumentElement); IList <XmlElement> items; if (firstItem.ParentNode == null) { items = new XmlElement[] { (XmlElement)firstItem }; } else { items = firstItem.Parent().Elements("Item").ToList(); } Item result; XmlElement resultNode = null; for (var i = 0; i < items.Count; i++) { fileItem.dom = items[i].OwnerDocument; fileItem.node = items[i]; fileItem.nodeList = null; result = fileItem.apply(); fault = XPathCache.SelectSingleNode(faultXPath, result.dom.DocumentElement); if (fault != null) { fault.AppendChild(result.dom.CreateElement("original_query")).InnerText = input; return(result.dom.DocumentElement.OuterXml); } else if (result.isError()) { throw new InvalidOperationException(); } if (outputDoc == null) { outputDoc = result.dom; resultNode = XPathCache.SelectSingleNode("//Item[1]", outputDoc.DocumentElement).Parent() as XmlElement; } else { resultNode.AppendChild(outputDoc.ImportNode(result.node, true)); } if (progressReporter != null) { progressReporter.ReportProgress(i + 1, items.Count); } } return(outputDoc.OuterXml); } } outputDoc = new XmlDocument(); outputDoc.Elem("Empty"); _inn.getConnection().CallAction(action, inputDoc, outputDoc); fault = XPathCache.SelectSingleNode(faultXPath, outputDoc.DocumentElement); if (fault != null) { fault.AppendChild(outputDoc.CreateElement("original_query")).InnerText = input; } return(outputDoc.DocumentElement.OuterXml); }
//------------------------------------------------------------------------------------------------------ private void btn_Start_Click(object sender, EventArgs e) { try { if (mc_innovator == null) { throw new Exception("Please Connection To Aras First."); } if (string.IsNullOrEmpty(txt_SearchAML.Text.Trim())) { throw new Exception("Please Enter Search AML ."); } if (string.IsNullOrEmpty(txt_DataList.Text.Trim())) { txt_DataList.Focus(); throw new Exception("Please Enter Check Data ."); } mc_replaceType = replaceType.None; TreeNode l_rootNode = new TreeNode("Garment Style", 0, 0); string[] l_getDataRow = txt_DataList.Text.Trim().Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); int l_columnIdx = 0; for (int rowIDX = 0; rowIDX < l_getDataRow.Length; rowIDX++) { #region process parameter string[] l_getDataColumn = l_getDataRow[rowIDX].Split(new char[] { '\t' }); if (l_getDataColumn != null && l_getDataColumn.Length != 0) { l_columnIdx = l_getDataColumn.Length; } //type logic if (mc_replaceType == replaceType.None) { if (l_columnIdx == 4) { mc_replaceType = replaceType.Fabirc; } else if (l_columnIdx == 3) { mc_replaceType = replaceType.PLU; } else { throw new Exception("No Support Type"); } } string l_AML = ""; string l_tempAML = txt_SearchAML.Text.Trim(); for (int columnIDX = 0; columnIDX < l_columnIdx; columnIDX++) { l_tempAML = l_tempAML.Replace("$" + (columnIDX + 1), l_getDataColumn[columnIDX]); } l_AML = "<AML>" + l_tempAML + "</AML>"; #endregion #region get item and check Item l_GetItem = mc_innovator.applyAML(l_AML); if (l_GetItem.isError()) { throw new Exception("AML Run Have Error[" + l_GetItem.getErrorCode() + "]" + l_GetItem.getErrorDetail()); } if (l_GetItem.getItemCount() == 0) { throw new Exception("AML Return Item Zero Error[" + l_GetItem.getErrorCode() + "]" + l_GetItem.getErrorDetail()); } #endregion SettingProcess(l_getDataRow.Length, rowIDX + 1); //clear node tre_Item.Nodes.Clear(); #region process garment style for (int garmentIDX = 0; garmentIDX < l_GetItem.getItemCount(); garmentIDX++) { Item l_garmentStyle_Item = l_GetItem.getItemByIndex(garmentIDX); TreeNode l_garmentStyle_Item_Node = new TreeNode(l_garmentStyle_Item.getProperty("item_number", "-"), 0, 0); l_garmentStyle_Item_Node.Tag = l_garmentStyle_Item.getProperty("item_number", "-"); #region process Garment Style Option Item l_GarmentStyleContainsOption_Item = l_GetItem.getRelationships("Garment Style Contains Option"); for (int garOptIDX = 0; garOptIDX < l_GarmentStyleContainsOption_Item.getItemCount(); garOptIDX++) { Item l_GarmentStyleOption_Item = l_GarmentStyleContainsOption_Item.getItemByIndex(garOptIDX).getRelatedItem(); TreeNode l_GarmentStyleOption_Item_Node = new TreeNode(l_GarmentStyleOption_Item.getProperty("option_no", "option_no") + "<-->" + l_GarmentStyleOption_Item.getProperty("cn_body_pattern", "cn_body_pattern") + "<-->" + l_GarmentStyleOption_Item.getProperty("cn_plu", "cn_plu"), 0, 0); l_GarmentStyleOption_Item_Node.Tag = l_GarmentStyleOption_Item.getProperty("id", ""); l_GarmentStyleOption_Item_Node.ToolTipText = l_getDataColumn[2]; #region process Garment BOM Item l_GarmentStyleOptionBOM = l_GarmentStyleOption_Item.getRelationships("Garment Style Option BOM"); for (int garOptBomIDX = 0; garOptBomIDX < l_GarmentStyleOptionBOM.getItemCount(); garOptBomIDX++) { Item l_GarmentBOM_Item = l_GarmentStyleOptionBOM.getItemByIndex(garOptIDX).getRelatedItem(); TreeNode l_GarmentBOM_Item_Node = new TreeNode(l_GarmentBOM_Item.getProperty("cn_bom_type", "cn_bom_type"), 0, 0); #region process Garment BOM Part Item l_GarmentBOMPart_Item = l_GarmentBOM_Item.getRelationships("Garment BOM Part"); for (int partIDX = 0; partIDX < l_GarmentBOMPart_Item.getItemCount(); partIDX++) { Item l_part_Item = l_GarmentBOMPart_Item.getItemByIndex(garOptIDX).getRelatedItem(); TreeNode l_part_Node = new TreeNode(l_part_Item.getProperty("item_number", "item_number"), 0, 0); l_part_Node.Tag = l_GarmentBOMPart_Item.getItemByIndex(garOptIDX).getProperty("id", ""); l_part_Node.ToolTipText = l_getDataColumn[2]; l_GarmentBOM_Item_Node.Nodes.Add(l_part_Node); } #endregion l_GarmentStyleOption_Item_Node.Nodes.Add(l_GarmentBOM_Item_Node); } #endregion l_garmentStyle_Item_Node.Nodes.Add(l_GarmentStyleOption_Item_Node); } #endregion l_rootNode.Nodes.Add(l_garmentStyle_Item_Node); } #endregion tre_Item.Nodes.Add(l_rootNode); } } catch (Exception ex) { ShowError("check data error:" + ex.Message); } }
/// <summary> /// 根据名称获取ItemType /// </summary> /// <returns></returns> public static Item GetItemTypeByName(Innovator innovator, string name) { string amlStr = "<AML><Item type='ITEMTYPE' action='get'><name>" + name + "</name></Item></AML>"; return(innovator.applyAML(amlStr)); }
public static void deleteActivityAssignment(Innovator inn, string ids) { string amlStr = "<AML><Item type='ACTIVITY ASSIGNMENT' action='purge' idlist='" + ids + "'></Item></AML>"; var result = inn.applyAML(amlStr); }
public static void AddActivityAssignment(Innovator inn, string source_id, string related_id, int voting_weight) { string amlStr = "<AML><Item type='ACTIVITY ASSIGNMENT' action='add'><source_id>" + source_id + "</source_id><related_id>" + related_id + "</related_id><voting_weight>" + voting_weight + "</voting_weight></Item></AML>"; var errorStr = inn.applyAML(amlStr).getErrorString(); }
public Item ApplyAML(string aml) { return(innovatorInstance.applyAML(aml)); }