示例#1
0
        //Runs when "Login" button is clicked. Checks the password.
        private void btnLogin_Click(object sender, EventArgs e)
        {
            banking_dbContext db = new banking_dbContext();

            if (txtUsr.Text != "" || txtPsd.Text != "")
            {
                var user1 = db.AdminsTable.FirstOrDefault(a => a.Username.Equals(txtUsr.Text));
                if (txtUsr != null)
                {
                    if (user1.Password.Equals(txtPsd.Text))
                    {
                        Menu menu = new Menu();
                        menu.ShowDialog();
                    }
                    else
                    {
                        MessageBox.Show("Грешна парола!");
                    }
                }
                else
                {
                    MessageBox.Show("Грешна стойност!");
                }
            }
            else
            {
                MessageBox.Show("Моля, въведете потребителско име и парола!");
            }
        }
示例#2
0
 public UserAccountController()
 {
     context = new banking_dbContext();
 }
示例#3
0
 public UserAccountController(banking_dbContext cont)
 {
     this.context = cont;
 }
 public TransferController()
 {
     context = new banking_dbContext();
 }
 public TransferController(banking_dbContext cont)
 {
     this.context = cont;
 }
 public DepositController()
 {
     context = new banking_dbContext();
 }
 public DepositController(banking_dbContext cont)
 {
     this.context = cont;
 }