Пример #1
0
        private void Edit_user(object sender, RoutedEventArgs e)
        {
            Account_Data data = selected_Account;

            data.account  = UserAccount_txb.Text;
            data.password = PasswordBox.Text;
            data.email    = UserMail_txb.Text;
            data.LCID     = ((ComboBoxItem)libcardCombobox.SelectedItem).Tag.ToString();

            admin_control.Update_User_data(data);

            if (!string.IsNullOrEmpty(oldLCID))
            {
                LibCard_Data oldlibcard = admin_control.Retrive_libcard_data(oldLCID);
                oldlibcard.used = false;
                admin_control.update_libcard_useable(oldlibcard, oldlibcard.used);
            }
            if (!string.IsNullOrEmpty(data.LCID))
            {
                LibCard_Data newlibcard = admin_control.Retrive_libcard_data(data.LCID);
                newlibcard.used = true;
                admin_control.update_libcard_useable(newlibcard, newlibcard.used);
            }

            TestGUI_QLTV.PopUpWindow popup = new TestGUI_QLTV.PopUpWindow();
            popup.PopUpTB.Text = "Updated";
            popup.Owner        = Window.GetWindow(this);
            Window.GetWindow(this).IsHitTestVisible = false;
            popup.Show();
        }
Пример #2
0
        private void EditUserButton_Click(object sender, RoutedEventArgs e)
        {
            TestGUI_QLTV.EditUserGUI editUserGUI = new TestGUI_QLTV.EditUserGUI();

            if (UserDataListView.SelectedItems.Count > 1)
            {
                foreach (Account_Data data in UserDataListView.SelectedItems)
                {
                    admin_control.Delete_account(data.UID);
                }

                TestGUI_QLTV.PopUpWindow popup = new TestGUI_QLTV.PopUpWindow();
                popup.PopUpTB.Text = "Deleted";
                popup.Owner        = Window.GetWindow(this);
                Window.GetWindow(this).IsHitTestVisible = false;
                popup.Show();
            }
            else
            {
                editUserGUI.set_value((Account_Data)UserDataListView.SelectedItem);
                editUserGUI.Owner = Window.GetWindow(this);
                Window.GetWindow(this).IsHitTestVisible = false;
                editUserGUI.Show();
            }
        }
Пример #3
0
 void popup_message(string message)
 {
     TestGUI_QLTV.PopUpWindow popup = new TestGUI_QLTV.PopUpWindow();
     popup.PopUpTB.Text = message;
     popup.Owner        = Window.GetWindow(this);
     Window.GetWindow(this).IsHitTestVisible = false;
     popup.Show();
 }
Пример #4
0
 private void EditButton_Click(object sender, RoutedEventArgs e)
 {
     edit_book();
     //create a new popup window to notify success
     TestGUI_QLTV.PopUpWindow popup = new TestGUI_QLTV.PopUpWindow();
     popup.PopUpTB.Text = "Updated";
     popup.Owner        = Window.GetWindow(this);
     Window.GetWindow(this).IsHitTestVisible = false;
     popup.Show();
 }
Пример #5
0
 private void DeleteButton_Click(object sender, RoutedEventArgs e)
 {
     admin_control.delete_book(selected_book.BID);
     TestGUI_QLTV.PopUpWindow popup = new TestGUI_QLTV.PopUpWindow();
     popup.PopUpTB.Text = "Deleted";
     popup.Owner        = Window.GetWindow(this.Owner);
     this.Close();
     Window.GetWindow(this.Owner).IsHitTestVisible = false;
     popup.Show();
 }
Пример #6
0
 private void EditBookButton_Click(object sender, RoutedEventArgs e)
 {
     TestGUI_QLTV.EditBookGUI editBookGUI = new TestGUI_QLTV.EditBookGUI();
     if (BookDataListView.SelectedItems.Count > 1)
     {
         foreach (Book_Data data in BookDataListView.SelectedItems)
         {
             admin_control.delete_book(data.BID);
         }
         TestGUI_QLTV.PopUpWindow popup = new TestGUI_QLTV.PopUpWindow();
         popup.PopUpTB.Text = "Deleted";
         popup.Owner        = Window.GetWindow(this);
         Window.GetWindow(this).IsHitTestVisible = false;
         popup.Show();
     }
     else
     {
         editBookGUI.set_value_from_item((Book_Data)BookDataListView.SelectedItems[0]);
         editBookGUI.Owner = Window.GetWindow(this);
         Window.GetWindow(this).IsHitTestVisible = false;
         editBookGUI.Show();
     }
 }