Exemplo 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;
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo n.º 5
0
        public void AddAccount(string name, string institutionName)
        {
            Institution instit = GetInstitution(institutionName);

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