private void LogInbutton_Click(object sender, EventArgs e) { string Name = AccountNameBox.Text; int id = Convert.ToInt32(AccountIDBox.Text); BudgetDatabaseEntities Database = new BudgetDatabaseEntities(); if ((Database.Accounts.Where(c => c.Id == id).SingleOrDefault() != null) && (Database.Accounts.Where(c => c.Name == Name).SingleOrDefault() != null))// if user name and id does exist in the database { MainMenu MM = new MainMenu(); MM.LoadInfo(Name, id); this.Hide(); MM.ShowDialog(); } else { MessageBox.Show("User not in system", "Login Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public userInterface() { InitializeComponent(); budget = new BudgetDatabaseEntities(); textBox1.Enabled = false; textBox2.Enabled = false; textBox3.Enabled = false; textBox4.Enabled = false; textBox5.Enabled = false; textBox6.Enabled = false; textBox7.Enabled = false; textBox8.Enabled = false; textBox9.Enabled = false; textBox11.Enabled = false; textBox12.Enabled = false; textBox13.Enabled = false; textBox14.Enabled = false; }
public TransactionAdd() { InitializeComponent(); Database = new BudgetDatabaseEntities(); }