예제 #1
0
        private void removeUserButton_Click(object sender, EventArgs e)
        {
            Repository <LoginGateway, LoginUser> repository = new Repository <LoginGateway, LoginUser>();
            LoginUser loginUser = repository.Delete(new LoginUser(userTextBox.Text));

            if (loginUser.Equals(null))
            {
                MessageBox.Show("Error!");
            }
            else
            {
                MessageBox.Show("Userul cu numele " + loginUser.User + " a fost sters");
                this.Close();
            }
        }
        private void updateButton_Click(object sender, EventArgs e)
        {
            Repository <LoginGateway, LoginUser> repository = new Repository <LoginGateway, LoginUser>();
            LoginUser loginUser = repository.Update(new LoginUser(userTextBox.Text, passwordTextBox.Text, typeTextBox.Text));

            if (loginUser.Equals(null))
            {
                MessageBox.Show("Error!");
            }
            else
            {
                MessageBox.Show("Userul cu numele " + loginUser.User + " a fost updatat");
                this.Close();
            }
        }
예제 #3
0
 private void Login()
 {
     Main.lUser.Username = LoginUser;
     Main.lUser.Email    = LoginUser;
     Main.lUser.Password = LoginPassword;
     if (Main.sql && LoginUser.Equals("admin") && LoginPassword.Equals("admin"))
     {
         var admin = new FAdmin();
         Hide();
         admin.Show();
     }
     else
     if (!Main.con.Login())
     {
         MessageBox.Show("Invalid data.");
     }
     else
     {
         Hide();
         main.Show();
     }
 }