Esempio n. 1
0
        public void AddInstitution(string name, Currency currency = null)
        {
            if (currency == null)
            {
                currency = Ccy;
            }
            Institution instit = new Institution(name, currency);

            _Institutions.Add(instit);
            instit.ModifyAmountEventHandler += this.UpdateTotalAmount;
        }
Esempio n. 2
0
        public Institution AddNewInstitution()
        {
            int    i          = 0;
            string newNameRef = "New Institution";
            string newName    = newNameRef;

            while (InstitutionsDictionary.ContainsKey(newName))
            {
                i++;
                newName = $"{newNameRef} - {i}";
            }
            AddInstitution(newName);
            Institution newInstit = GetInstitution(newName);

            newInstit.AddAccount("New Account");
            newInstit.ModifyAmountEventHandler += this.UpdateTotalAmount;
            return(newInstit);
        }
Esempio n. 3
0
        public bool ChangeName(string before, string after, NodeAddress nodeTag)
        {
            bool test = false;

            if (nodeTag.NodeType == NodeType.Institution)
            {
                if (InstitutionsDictionary.ContainsKey(before) && !InstitutionsDictionary.ContainsKey(after))
                {
                    Institution instit_before = GetInstitution(before);
                    instit_before.InstitutionName = after;
                    test = true;
                }
            }
            else
            {
                test = GetInstitution(nodeTag.Address[1]).ChangeName(before, after, nodeTag);
            }
            return(test);
        }
Esempio n. 4
0
        private void ReorgAccountingData(TreeViewMapping tvm)
        {
            List <Category> res = new List <Category> {
            };

            // Reorg each constituents
            foreach (var itemC in tvm)
            {
                Category cat = GetCategory(itemC.Name);
                foreach (var itemI in itemC.Nodes)
                {
                    Institution inst = GetInstitution(itemC.Name, itemI.Name);
                    inst.ReorgItems(itemI.Nodes.Select(x => x.Name));
                }
                cat.ReorgItems(itemC.Nodes.Select(x => x.Name));
                res.Add(cat.Copy());
            }
            _Data = res;
            _Map  = new TreeViewMapping(res);
        }
Esempio n. 5
0
        public void AddAccount(string name, string institutionName)
        {
            Institution instit = GetInstitution(institutionName);

            instit.AddAccount(name, instit.Ccy);
        }
Esempio n. 6
0
 public void AddInstitution(Institution instit)
 {
     _Institutions.Add(instit);
     instit.ModifyAmountEventHandler += this.UpdateTotalAmount;
 }