/// <summary>
        /// Add account to database using storage structures
        /// </summary>
        /// <param name="account">Additing account</param>
        public void Add(Account.Account account)
        {
            using (AccountsStorageContext context = new AccountsStorageContext())
            {
                PersonInfo pi = new PersonInfo(account.Id, account.Name, account.SurName, account.Mail, account.Bonus);
                context.Persons.Add(pi);

                foreach (var cashInfo in account.Cash)
                {
                    CashInfo ci = new CashInfo(cashInfo.Value.Id, cashInfo.Value.Amount, (int)cashInfo.Key, (int)cashInfo.Value.GetCashType());
                    context.Cashes.Add(ci);

                    PersonToCashLink link = new PersonToCashLink(account.Id, cashInfo.Value.Id, GenerateLinkId());
                    context.Links.Add(link);
                }

                context.SaveChanges();
            }
        }
        /// <summary>
        /// Remove account from database
        /// </summary>
        /// <param name="accId">Account id</param>
        public void Remove(string accId)
        {
            using (AccountsStorageContext context = new AccountsStorageContext())
            {
                PersonInfo pi = context.Persons.SingleOrDefault(person => person.Id == accId);

                if (pi != null)
                {
                    context.Persons.Remove(pi);

                    List <PersonToCashLink> links = context.Links.Where(link => link.PersonId == pi.Id).ToList();
                    foreach (PersonToCashLink link in links)
                    {
                        CashInfo ci = context.Cashes.SingleOrDefault(cashInfo => cashInfo.Id == link.CashId);
                        context.Cashes.Remove(ci);

                        context.Links.Remove(link);
                    }

                    context.SaveChanges();
                }
            }
        }