Exemplo n.º 1
0
        public void TestAuthorization1()
        {
            string login    = "******";
            string password = "******";
            int    expected = -1;
            int    actual   = 0;

            using (var db = new ResourceModel())
            {
                actual = db.Authorization(login, password);
            }
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 2
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (!pb)
     {
         PB_Password.Password = TB_Password.Text;
     }
     using (var db = new ResourceModel())
     {
         int id = db.Authorization(TB_Login.Text, PB_Password.Password);
         if (id != -1)
         {
             (new MainWindow(id)).Show();
             this.Close();
         }
         else
         {
             MessageBox.Show("Неверный логин или пароль");
         }
     }
 }