public Guid AddDepositAccount(ClientC person, double money) { Guid Id = Guid.NewGuid(); ClientList[ClientList.FindIndex(pers => pers == person)].AllAccounts.Add(new DepositAccount(Id, LimitForDeposit, money, ProcentForDepositM(money))); return(Id); }
public bool RemoveClient(Client client) { var mayInd = ClientList.FindIndex(c => c.Hwnd == client.Hwnd); if (mayInd != -1) { // アイコンが生成されないとインデックスが不一致になる Logger.Info($"removed {client.Title}"); ClientList.RemoveAt(mayInd); if (mayInd < IconList.Count) { var icon = IconList[mayInd]; RemoveIcon(mayInd); icon?.Dispose( ); } else { Logger.Warn($" can't find {mayInd} in Icon "); } Logger.Warn($"all Client {ClientTitles.ToJson( ) }"); return(true); } return(false); }
public Guid AddCreditAccount(ClientC person) { Guid Id = Guid.NewGuid(); ClientList[ClientList.FindIndex(pers => pers == person)].AllAccounts.Add(new CreditAccount(Id, LimitForCredit, CommisionForCredit)); return(Id); }
public Guid AddDebetAccount(ClientC person) { Guid Id = Guid.NewGuid(); ClientList[ClientList.FindIndex(pers => pers == person)].AllAccounts.Add(new DebetAccount(Id, 0, ProcentOnModForDebet)); return(Id); }
public void SpendMoney(Guid Id, ClientC person, double money) { if (((ClientList.Find(pers => pers == person).TakeAdress() == "") || (ClientList.Find(pers => pers == person).TakePassport() == -1)) && (money > MutnyTipLimit)) { throw new MutnyTipException(); } ClientList[ClientList.FindIndex(pers => pers == person)].AllAccounts.Find(acc => acc.GetID() == Id).SpendMoney(money); }
public void TransferMoney(Guid Id1, Guid Id2, ClientC person1, ClientC person2, double money) { if (((ClientList.Find(pers => pers == person1).TakeAdress() == "") || (ClientList.Find(pers => pers == person1).TakePassport() == -1)) && (money > MutnyTipLimit)) { throw new MutnyTipException(); } ClientList[ClientList.FindIndex(pers => pers == person1)].AllAccounts.Find(acc => acc.GetID() == Id1).TransferMoney(money, person2.AllAccounts.Find(acc => acc.GetID() == Id2)); TransactionList.Add(new CTransaction(money, person1, person2, Id1, Id2)); }
public void OnNavigatedTo(NavigationContext navigationContext) { int personID = (int)navigationContext.Parameters["id"]; if (personID > 0) { PersonModel = _ps.GetPersonByID(personID); SelectedClient = _cs.GetClientByID(PersonModel.CurrentAssociationID); InitialClient = ClientList.FindIndex(c => c.ToString() == SelectedClient.ToString()); PersonModel.AddressModel = _as.GetAddressByID(PersonModel.AddressID); RecordSearches = new ObservableCollection <RecordSearch>( _rss.GetPartialRecordSearchesByCriteria("WHERE RequestorID = " + personID) ); } }
public void AddMoney(Guid Id, ClientC person, double money) { ClientList[ClientList.FindIndex(pers => pers == person)].AllAccounts.Find(acc => acc.GetID() == Id).AddMoney(money); }
public double FoundProcent(Guid Id, ClientC person, DateTime date) { return(ClientList[ClientList.FindIndex(pers => pers == person)].AllAccounts.Find(acc => acc.GetID() == Id).CalculateProcent(date)); }
public double TakeMoneyValue(Guid Id, ClientC person) { return(ClientList[ClientList.FindIndex(pers => pers == person)].AllAccounts.Find(acc => acc.GetID() == Id).MoneyValue()); }