/// <summary> /// NAME: Jesse Tomash /// DATE: 3/30/2020 /// /// Approver: Brandyn T. Coverdill /// Approver: /// /// This is the method used to test updating the fake orders /// </summary> /// <remarks> /// UPDATED BY: /// UPDATE DATE: /// WHAT WAS CHANGED: /// </remarks> /// <param name="oldOrderInvoice">The old invoice to be changed</param> /// <param name="newOrderInvoice">The invoice with the new values</param> /// <returns></returns> public int UpdateSpecialOrder(SpecialOrder oldOrder, SpecialOrder newOrder) { int result = 0; if (!oldOrder.Equals(newOrder)) { oldOrder.SpecialOrderID = newOrder.SpecialOrderID; oldOrder.UserID = newOrder.UserID; result = 1; } return(result); }
private void createBrailleGroupFromFilteredNode(object filteredNode, ref int startYPosition) { //Erst einen eigenen Teilbaum mit allen Kindern erzeugen und diesen anschließend dem Braille-Baum hinzufügen OSMElements.OSMElement osmGroup = new OSMElements.OSMElement(); osmGroup.brailleRepresentation.isVisible = true; osmGroup.properties.controlTypeFiltered = "GroupElement"; osmGroup.brailleRepresentation.typeOfView = grantTrees.TextviewObject.typeOfView; osmGroup.brailleRepresentation.screenName = grantTrees.TextviewObject.screenName; OSMElements.OSMElement osmFiltered = strategyMgr.getSpecifiedTree().GetData(filteredNode); osmGroup.brailleRepresentation.viewName = osmFiltered.properties.IdGenerated; int depth = strategyMgr.getSpecifiedTree().Depth(filteredNode) * shiftingPerDepth; int startXPosition = depth; osmGroup.properties.boundingRectangleFiltered = new Rect(startXPosition, startYPosition, 120 - startXPosition, 5);//TODO: richtig machen osmGroup.properties.IdGenerated = treeOperation.generatedIds.generatedIdBrailleNode(osmGroup); String brailleParentId = null; if (treeOperation.searchNodes.getBrailleTreeOsmElementById(osmGroup.properties.IdGenerated).Equals(new OSMElements.OSMElement())) { object parent = strategyMgr.getSpecifiedTree().Parent(filteredNode); if (parent != null && strategyMgr.getSpecifiedTree().GetData(parent) != null) { List <string> ids = treeOperation.searchNodes.getConnectedBrailleTreenodeIds(strategyMgr.getSpecifiedTree().GetData(parent).properties.IdGenerated); if (ids != null && ids.Count > 0) {//die richtige Id raussuchen (screen & typeOfView) //parent (Groupelement) foreach (String id in ids) { List <Object> nodeList = treeOperation.searchNodes.getNodeList(id, grantTrees.brailleTree); if (nodeList != null && nodeList.Count > 0) { foreach (object o in nodeList) { Object parentGroupelement = strategyMgr.getSpecifiedTree().Parent(o); OSMElements.OSMElement osmTmp = strategyMgr.getSpecifiedTree().GetData(parentGroupelement); if (osmTmp.brailleRepresentation.screenName.Equals(grantTrees.TextviewObject.screenName) && osmTmp.brailleRepresentation.typeOfView.Equals(grantTrees.TextviewObject.typeOfView)) { brailleParentId = strategyMgr.getSpecifiedTree().GetData(parentGroupelement).properties.IdGenerated; break; } } } if (brailleParentId != null) { break; } } } } // osmGroup.properties.IdGenerated = treeOperation.updateNodes.addNodeInBrailleTree(osmGroup, brailleParentId);//hier wird ggf. nur das Gruppen-(Start-)Element hinzugefügt String idResult = treeOperation.updateNodes.addNodeInBrailleTree(osmGroup, brailleParentId);//hier wird ggf. nur das Gruppen-(Start-)Element hinzugefügt if (idResult == null) { return; } } Object brailleSubtree = strategyMgr.getSpecifiedTree().NewTree(); Object brailleSubtreeParent = strategyMgr.getSpecifiedTree().AddChild(brailleSubtree, osmGroup); List <TextviewElement> order; SpecialOrder so = textViewspecialOrderContainsControltype(osmFiltered.properties.controlTypeFiltered); if (!so.Equals(new SpecialOrder())) { order = so.order; } else { order = grantTrees.TextviewObject.orders.defaultOrder; } foreach (TextviewElement tve in order) { #region Zeichen für Beginn der Aufzählung if (grantTrees.TextviewObject.itemEnumerate != null && !grantTrees.TextviewObject.itemEnumerate.Equals("") && tve.order == 0) { strategyMgr.getSpecifiedTree().AddChild(brailleSubtreeParent, addSeparatorElementInBrailleTree(grantTrees.TextviewObject.itemEnumerate, ref startXPosition, startYPosition)); startXPosition += grantTrees.TextviewObject.itemEnumerate.Length * 3 + 2; } #endregion #region Separator if (tve.separator != null && !tve.separator.Equals("") && tve.order > 0) { strategyMgr.getSpecifiedTree().AddChild(brailleSubtreeParent, addSeparatorElementInBrailleTree(tve.separator, ref startXPosition, startYPosition)); startXPosition += tve.separator.Length * 3 + 2; } #endregion object objectText = GeneralProperties.getPropertyElement(tve.property, osmFiltered.properties); String text = (objectText != null ? objectText.ToString() : null); text = treeOperation.updateNodes.useAcronymForText(text); int width = (text.Length * 3) < tve.minWidth ? tve.minWidth : (text.Length * 3); strategyMgr.getSpecifiedTree().AddChild(brailleSubtreeParent, addElementInBrailleTree(filteredNode, tve, width, ref startXPosition, startYPosition)); startXPosition += width + 2; } startYPosition += 5; addSubtreeInBrailleTree(strategyMgr.getSpecifiedTree().Root(brailleSubtreeParent), brailleParentId); }