public AddMoneyPage() { InitializeComponent(); string sum; EnterViaCardNumber viaCardNumber = new EnterViaCardNumber(); if (viaCardNumber.cardNumberExists == true) { using (var context = new BankSystemContext()) { currentAccount = context.Accounts.Where(account => account.Id.Equals(viaCardNumber.currentAccountId)).FirstOrDefault(); sum = currentAccount.Sum.ToString(); } currentSumText.Text = "У вас на счету " + sum + " тг."; } else { EnterViaIIN viaIIN = new EnterViaIIN(); using (var context = new BankSystemContext()) { currentAccount = context.Accounts.Where(account => account.Id.Equals(viaIIN.currentAccountId)).FirstOrDefault(); sum = currentAccount.Sum.ToString(); } currentSumText.Text = "У вас на счету " + sum + " тг."; } }
public MainPage() { InitializeComponent(); string name; EnterViaCardNumber viaCardNumber = new EnterViaCardNumber(); if (viaCardNumber.cardNumberExists == true) { using (var context = new BankSystemContext()) { name = context.Accounts.Where(account => account.Id.Equals(viaCardNumber.currentAccountId)) .Select(account => account.FullName).FirstOrDefault(); } greetingText.Text = "Здравствуйте, " + name + "!"; } else { EnterViaIIN viaIIN = new EnterViaIIN(); using (var context = new BankSystemContext()) { name = context.Accounts.Where(account => account.Id.Equals(viaIIN.currentAccountId)) .Select(account => account.FullName).FirstOrDefault(); } greetingText.Text = "Здравствуйте, " + name + "!"; } }