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; }
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); }
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); }
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); }
public void AddAccount(string name, string institutionName) { Institution instit = GetInstitution(institutionName); instit.AddAccount(name, instit.Ccy); }
public void AddInstitution(Institution instit) { _Institutions.Add(instit); instit.ModifyAmountEventHandler += this.UpdateTotalAmount; }