コード例 #1
0
ファイル: LogIn.cs プロジェクト: NickPonikiewski/Budget_final
        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);
            }
        }
コード例 #2
0
 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;
 }
コード例 #3
0
 public TransactionAdd()
 {
     InitializeComponent();
     Database = new BudgetDatabaseEntities();
 }