Re: [RESOLVED] Need Help on this Bank Program!
Quote:
Originally Posted by
rocky_upadhaya
What I want to do is open that new form on top of existing form.
I think this should be enough:
Code:
frm2.StartPosition = FormStartPosition.CenterParent; // here you can choose the start position
frm2.ShowDialog(this); // shows the form as a modal window, this means you cannot switch to the main form until you close it
Re: Need Help on this Bank Program!
Thanks for your constant support but the piece of code posted by you contains bug. Now It shows error at the compile time. Also if this code was to run it would delete 'accountToDelete' which is a copy of selected a. What i wanted to do is delete the selected 'a' from the List ie Delete the Account Premanently.
Type Of Error Showed:
Argument '1': cannot convert from 'System.Collections.Generic.IEnumerable<WindowsFormsApplication1.Account1>' to 'WindowsFormsApplication1.Account1' C:\Documents and Settings\Munni\My Documents\Visual Studio 2008\Projects\Bank\WindowsFormsApplication1\Initial.cs 75 39 Bank
Re: Need Help on this Bank Program!
can you upload your updated bank program with the latest changes?
Re: [RESOLVED] Need Help on this Bank Program!
Quote:
Originally Posted by
memeloo
Code:
public static bool DeleteAccount(int id, string pass)
{
var accountToDelete =
from a in AccountList
where a.Account_ID == id && a.Pass == pass
select a;
return AccountList.Remove(accountToDelete);
}
The linq query is return a IEnumarble<T> in this case
try
Code:
public static bool DeleteAccount(int id, string pass)
{
var accountToDelete =
(from a in AccountList
where a.Account_ID == id && a.Pass == pass
select a).FirstOrDefault();
return AccountList.Remove(accountToDelete);
}
Not sure what happens here if accountToDelete is null. Try and see if there does not occure an error.
Re: Need Help on this Bank Program!
Thanks Worked Perfectly!! I have also posted updated bank Program at the top of the first page and is named Updated_Bank.zip I will still spending much of my time on this Program so will be expecting help from both of you guys. cheers!!
Re: Need Help on this Bank Program!
I have worked my way up and almost finished this program But the last thing that is giving me a headache is adding Transfer Money Facility. for this 2 id values and 1 amount value needed to be passed to [public static Account1 TranM(int id1, int id2, int amount)] method .
This method needs to subtract amount from balance with Account id id1 and add it to account with id id2.......
Re: Need Help on this Bank Program!
Now that I have finally Finished this Bank Program! I want to thank Memelo and dannystommen for helping me on this program. I wanted to learn C# through practical approach and quiet Succeeded on that I will now post the final release of Bank Program so that other Beginner programmer of C# could take refrence of it. The Bank.zip You see on the first program is the final one. And If You download it and go through it so that you get better way for doing anything please kindly post on this forum thread. Thank You!!! :)