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 void AddAccount(string name, string institutionName) { Institution instit = GetInstitution(institutionName); instit.AddAccount(name, instit.Ccy); }