private static BranchID CreateNewBranch(ConditionalJumpNode splitNode)
        {
            BranchID newBranch = new BranchID(splitNode);

            splitNode.CreatedBranches.Add(newBranch);
            return(newBranch);
        }
Example #2
0
 public override int GetHashCode()
 {
     return
         (BranchID.GetHashCode() ^
          AccountID.GetHashCode() ^
          SubID.GetHashCode() ^
          ProjectID.GetHashCode() ^
          TaskID.GetHashCode() ^
          CostCodeID.GetHashCode() ^
          InventoryID.GetHashCode());
 }
Example #3
0
        public void EqualsTest()
        {
            int k1 = "Uhre-Krarup-kybæk".CompareTo("Uhre-Krarup-kybæk");
            int k2 = "Uhre-Krarup-kybæk".CompareTo("Uhre-Krarup-kybaek");
            int k3 = "hre-Krarup-kybæk".CompareTo("Uhre-Krarup-kybaek");

            int k4 = "ae".CompareTo("æ");


            BranchID target = new BranchID()
            {
                Branchname = "Uhre-Krarup-kybæk", StartChainage = 0
            };
            BranchID other = new BranchID()
            {
                Branchname = "Uhre-Krarup-kybaek", StartChainage = 0
            };

            Assert.IsFalse(target.Equals(other));
            Assert.AreNotEqual(target.GetHashCode(), other.GetHashCode());
        }
Example #4
0
        protected override void BindControls()
        {
            if (OptionsListForm.ServerMode)
            {
                return;
            }


            var subExport = XtraBarHelper.MoveIntoBarSubItem(miExport, "ექსპოსტი", miExport.Glyph);

            miExport.Glyph = null;
            XtraBarHelper.AddBarButtonItem(subExport, "ექსპორტი აპექსში", null, miExportApex);


            bsBranch.DataSource  = DictionaryManager.GetDictionary(ObjectNames.Branch);
            lookBranch.EditValue = BranchID.ToString();

            bsCurrency.DataSource = DictionaryManager.GetDictionary(ObjectNames.CurrencyWithLastRate, -1);
            CurrencyCode          = GlobalVariable.MyCompanyDefaultTradingCurrencyCode;

            bsMedicamentCategory.DataSource    = DictionaryManager.GetDictionary(ObjectNames.MedicamentCategory);
            bsMedicamentSubcategory.DataSource = DictionaryManager.GetDictionary(ObjectNames.MedicamentSubcategoryWithMedicamentCategoryID);
        }
Example #5
0
        private static void ActOnCurrentNode(InstructionNode currentNode, Dictionary <InstructionNode, MergeNodeTraceData> mergingNodesData, InstructionNode lastNode, ref StateProviderCollection stateProviders, out bool reachedMergeNodeNotLast)
        {
            if (currentNode.BranchProperties.MergingNodeProperties.IsMergingNode)
            {
                lock (mergingNodesData)
                {
                    mergingNodesData[currentNode].ReachedNodes.Add(lastNode);
                    BranchID emptyBranchToMe = null;
                    IEnumerable <BranchID> nonEmptyBranchesToMe = null;
                    if ((lastNode is ConditionalJumpNode))
                    {
                        emptyBranchToMe = ((ConditionalJumpNode)lastNode).CreatedBranches.FirstOrDefault(x => x.BranchNodes.SequenceEqual(new[] { currentNode }));
                    }
                    if (emptyBranchToMe == null)
                    {
                        nonEmptyBranchesToMe = lastNode.BranchProperties.Branches.Intersect(currentNode.BranchProperties.MergingNodeProperties.MergedBranches);
                    }
                    if (emptyBranchToMe != null || nonEmptyBranchesToMe.Any())
                    {
                        mergingNodesData[currentNode].AccumelatedStateProviders.AddRange(stateProviders.ToList());
                        var  mergedBrachesNonEmpty    = currentNode.ProgramFlowBackRoutes.Where(x => x.BranchProperties.Branches.Any(y => currentNode.BranchProperties.MergingNodeProperties.MergedBranches.Contains(y)));
                        var  mergedBrachesEmpty       = currentNode.ProgramFlowBackRoutes.Where(x => x is ConditionalJumpNode).Cast <ConditionalJumpNode>().Where(x => x.CreatedBranches.Intersect(currentNode.BranchProperties.MergingNodeProperties.MergedBranches).Any());
                        var  splitMergeMergedBranches = mergedBrachesEmpty.Concat(mergedBrachesNonEmpty).ToList();
                        bool allBranchesReached       = !splitMergeMergedBranches.Except(mergingNodesData[currentNode].ReachedNodes).Any();
                        if (allBranchesReached)
                        {
                            stateProviders = new StateProviderCollection(mergingNodesData[currentNode].AccumelatedStateProviders);
                            mergingNodesData[currentNode].AccumelatedStateProviders.Clear();
                            //prepare for next run (for loops)
                            mergingNodesData[currentNode].ReachedNodes.Clear();
                        }
                        else
                        {
                            reachedMergeNodeNotLast = true;
                            return;
                        }
                    }
                    else
                    {
                    }
                }
            }
            var newStoreStateProviders = StoreDynamicDataStateProvider.GetMatchingStateProvider(currentNode);

            if (newStoreStateProviders != null)
            {
                foreach (var newStateProvider in newStoreStateProviders)
                {
                    stateProviders.AddNewProvider(newStateProvider);
                }
            }
            IDynamicDataLoadNode loadNode = currentNode as IDynamicDataLoadNode;

            if (loadNode != null)
            {
                foreach (var stateProvider in stateProviders.MatchLoadToStore(currentNode))
                {
                    stateProvider.ConnectToLoadNode((InstructionNode)loadNode);
                    //have to change this to abstract
                }
            }
            reachedMergeNodeNotLast = false;
        }
Example #6
0
 /// <summary>
 ///     Compares this instance to a specified Branch and returns an indication
 ///     of their relative values.
 /// </summary>
 ///
 /// <param name="obj">
 ///      The Branch to compare with this instance.
 /// </param>
 ///
 /// <returns>
 ///     A 32-bit signed integer that indicates whether this instance precedes, follows,
 ///     or appears in the same position in the sort order as the value parameter.Value
 ///     Condition Less than zero This instance precedes obj. Zero This instance has
 ///     the same position in the sort order as obj. Greater than zero This instance
 ///     follows obj.-or- obj is null.
 ///</returns>
 public int CompareTo(object obj)
 {
     return(BranchID.CompareTo(((Branch)obj).BranchID));
 }
Example #7
0
 public override string ToString()
 {
     return(BankID.ToString() + ' ' + BranchID.ToString());
 }
 private static void MarkMergeNode(InstructionNode currentNode, BranchID mergedBranch)
 {
     currentNode.BranchProperties.MergingNodeProperties.IsMergingNode = true;
     currentNode.BranchProperties.MergingNodeProperties.MergedBranches.Add(mergedBranch);
     mergedBranch.MergingNode = currentNode;
 }