Ejemplo n.º 1
0
        private void ExecuteConfirmCommand(object param)
        {
            var users = de.GetUserList();

            for (int i = 0; i < users.Count; i++)
            {
                if (users[i].phone_number == "Admin" && users[i].password == PasswordText)
                {
                    if (choice == false)
                    {
                        VisibilityLol = System.Windows.Visibility.Hidden;

                        de.PassBook(book_id);
                        MyMsgBox msg = new MyMsgBox("Книги сдана!");
                        msg.Show();
                        return;
                    }
                    if (choice == true)
                    {
                        for (int j = 0; j < users.Count; j++)
                        {
                            if (users[j].user_id == user_id)
                            {
                                VisibilityLol = System.Windows.Visibility.Hidden;

                                Issue issue = new Issue(users[j].phone_number, book_id);
                                issue.Show();

                                MyMsgBox msg = new MyMsgBox("Книга выдана!");
                                msg.Show();
                                return;
                            }
                        }
                    }
                }
                if (i == users.Count() - 1)
                {
                    MyMsgBox msg1 = new MyMsgBox("Пароль введен неверно!");
                    msg1.Show();
                    break;
                }
            }

            // НЕ РАБОТАЕТ
        }