Hi,
I made a new form on my project that allows my user to search using specific search criteria.
Once the record is found, i need to be able to open the Account Management form, so i have a code that looks like this:
Code Snippet
private
void doEditAccount(IAccount account)
{
AccountManageForm form = new AccountManageForm(account);
form.ShowDialog();
}
private void searchBtn1_Click(object sender, EventArgs e)
{
try
{
string fileName = "Account_Data.xml";
XPathDocument doc = new XPathDocument(fileName);
XPathNavigator nav = doc.CreateNavigator();
XPathExpression expr;
expr = nav.Compile(
"//Account[@ID='" + accountIDInput.Text + "']");
XPathNodeIterator iterator = nav.Select(expr);
iterator = nav.Select(expr);
if (iterator.MoveNext())
{
XPathNavigator nav2 = iterator.Current.Clone();
string tmpAccID = (nav2.GetAttribute("ID", ""));
nav2.MoveToFirstChild();
string tmpName = (nav2.Value);
nav2.MoveToNext();
string tmpLastName = (nav2.Value);
nav2.MoveToNext();
string tmpBalance = (nav2.Value);
nav2.MoveToNext();
string tmpOverDraftLimit = (nav2.Value);
nav2.MoveToNext();
string tmpFullAddress = (nav2.Value);
doEditAccount(tmpName);
this.Close();
}
else
{
MessageBox.Show("Sorry, I could not find any account for\r\nAccount ID : " + accountIDInput.Text + "", "Friendly Bank");
}
}
catch (Exception ex)
{
MessageBox.Show("Error : " + ex.Message);
}
}
When i try to build the solution, i am getting these two errors:
Code Snippet
Error 1 - The best overloaded method match for 'FriendlyBank.AdvSearchForm.doEditAccount(AccountManagement.IAccount)' has some invalid arguments
Error 2 - cannot convert from 'string' to 'AccountManagement.IAccount'
Could someone help me out, where im i going wrong? the code looks right to me, but the compiler begs to differ 
Any help/info would be much appreciated. This is quite urgement, so im awaiting any response ...