本文整理匯總了C#中Account.getaccountNumber方法的典型用法代碼示例。如果您正苦於以下問題:C# Account.getaccountNumber方法的具體用法?C# Account.getaccountNumber怎麽用?C# Account.getaccountNumber使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Account
的用法示例。
在下文中一共展示了Account.getaccountNumber方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: addAccount
//addAccount function
//if account is not already present then add account.
public void addAccount(Account anAccount)
{
accounts.Add(anAccount.getaccountNumber(), anAccount);
if (!accounts.ContainsKey(anAccount.getaccountNumber()))
{
accounts.Add(anAccount.getaccountNumber(), anAccount);
}//end of if
}//end of add account
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
//start of if
// if no session variable exists for HBos
//create session variable
if (Session["HBos"] == null)
{
hBos = new Bank();
}
else
{
hBos = (Bank)Session["HBos"];
}
//initialisng session variables.
login = Convert.ToString(Session["login"]);
pin = Convert.ToString(Session["pin"]);
hBos = (Bank)Session["HBos"];
//creating an instance of account
Account anAccount = new Account();
//setting aCustomer to equal the desired customer
var aCustomer = hBos.getBankCustomer()[login];
//setting anAccount to equal desired customers account.
anAccount = aCustomer.getAccount(pin);
//displaying account number, name, and balance
lblAcc.Text = Convert.ToString(anAccount.getaccountNumber());
lblName.Text = Convert.ToString(aCustomer.getforename() + " " + aCustomer.getsurname());
lblBal.Text = Convert.ToString(hBos.getBalance(login, pin));
Session.Add("HBos", hBos);
}
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
//start of if
// if no session variable exists for HBos
//create session variable
if (Session["HBos"] == null)
{
hBos = new Bank();
}
else
{
hBos = (Bank)Session["HBos"];
}
login = Convert.ToString(Session["login"]);
pin = Convert.ToString(Session["pin"]);
hBos = (Bank)Session["HBos"];
withdrawn = Convert.ToInt32(Session["Amount"]);
Account anAccount = new Account();
var aCustomer = hBos.getBankCustomer()[login];
anAccount = aCustomer.getAccount(pin);
lblAcc.Text = Convert.ToString(anAccount.getaccountNumber());
lblName.Text = Convert.ToString(aCustomer.getforename() + " " + aCustomer.getsurname());
lblBalance.Text = Convert.ToString(hBos.getBalance(login, pin));
lblWithdrawn.Text = Convert.ToString(withdrawn);
Session.Add("HBos", hBos);
Session.Add("Amount", withdrawn);
}