public void AddDebtor(string name, double initAmount) { DebtorModel tempDebtor = new DebtorModel(); Transaction tempTransaction = new Transaction(); tempDebtor.DebtorName = name; tempDebtor.TotalCredit = 0; tempDebtor.AddTransaction(DateTime.Now, initAmount); Debtors.Add(tempDebtor); }
public DebtorModel GetDebtorModel(string findName) { DebtorModel tempDebtor = new DebtorModel(); tempDebtor.DebtorName = findName; foreach (var debtorModel in _allDebtors) { if (debtorModel.DebtorName == tempDebtor.DebtorName) { return(debtorModel); } } return(tempDebtor); }
public double ShowDebt(string name) { DebtorModel tempDebtor = new DebtorModel(); tempDebtor.DebtorName = name; if (_allDebtors.Count != 0) { foreach (var DebtorModel in _allDebtors) { if (DebtorModel.DebtorName == tempDebtor.DebtorName) { return(DebtorModel.TotalCredit); } } } return(0); }