Hello C# Programmers, here is my question and problem. I am practicing my C# skills, and designed a simple GUI app for a library. Well, I have the class Member, and a button Search, user types the member code in a textbox, my program gets the value and finds the member in the list of "signed" members, else throws a fancy message box. Everything is fine, my problem is, a member does a Loan from library clicking the New Loan button, and within the code :
.loans is not in the Member class, it is a field of the class MainWindow, Member class has it's own loans private field and Loans property that gets the loans returned.
My problem is, if I type another member code as "user" of the program and press Search, it gets me the new member.Name,..e tc , but I have in my mind that each Member is a different instance. But when i press Search button and I Change Member, current loans from the previous and all members are visible to lstLoans,
I want somehow, clearing the list when I get another member and also to show only this members Loans to the lstLoans, and not all loans done.
If you need any code inform me, or just reply ideas.
Thanks in advance.
Code:
public MainWindow() { lstLoans.ItemsSource = loans; }
My problem is, if I type another member code as "user" of the program and press Search, it gets me the new member.Name,..e tc , but I have in my mind that each Member is a different instance. But when i press Search button and I Change Member, current loans from the previous and all members are visible to lstLoans,
I want somehow, clearing the list when I get another member and also to show only this members Loans to the lstLoans, and not all loans done.
If you need any code inform me, or just reply ideas.
Thanks in advance.
Comment