private void EditButton_Click(object sender, RoutedEventArgs e) { bool bGender; if (GenderComboBox.SelectedItem.ToString().Contains("Male")) { bGender = true; } else { bGender = false; } List <Account_Data> account_list = admin_control.all_accounts_data().Where(x => x.LCID == selected_libcard.LCID).ToList(); if (account_list.Count > 0) { account_list[0].DOB = selected_libcard.DOB; account_list[0].name = selected_libcard.name; account_list[0].account_type = selected_libcard.account_type; account_list[0].gender = selected_libcard.gender; account_list[0].identity_card = selected_libcard.identity_card; admin_control.Update_User_data(account_list[0]); } if (admin_control.edit_libcard(this.selected_libcard.LCID, AccountTypeComboBox.Text, IDTextBox.Text, NameTextBox.Text, DOBTextBox.Text, bGender)) { PopUpWindow popup = new PopUpWindow(); Window.GetWindow(this).IsHitTestVisible = false; popup.Owner = Window.GetWindow(this); popup.PopUpTB.Text = "Created"; popup.Show(); } }
private void open_popup(string message) { PopUpWindow popup = new PopUpWindow(); popup.PopUpTB.Text = message; Window.GetWindow(this.Owner).IsHitTestVisible = false; popup.Owner = Window.GetWindow(this.Owner); popup.Show(); Window.GetWindow(this).Close(); }
void popup_message(string sMessage) { PopUpWindow popup = new PopUpWindow(); popup.PopUpTB.Text = sMessage; Window.GetWindow(this).IsHitTestVisible = false; popup.Owner = Window.GetWindow(this); popup.Closing += Popup_Closing; popup.Show(); }
private void BorrowButton_Click(object sender, System.Windows.RoutedEventArgs e) { foreach (Book_Data data in Data_Context.onWishList) { User_Control.add_borrow_data(data.BID, Data_Context.currentUID, Date_picker.DisplayDate, User_Control.retrieve_usertype(Data_Context.currentAccount.account_type).borrow_time); } //clear all books Data_Context.onWishList.Clear(); ICart.ItemsSource = null; PopUpWindow popup = new PopUpWindow(); popup.PopUpTB.Text = "Borrow data sent"; popup.Owner = Window.GetWindow(this); Window.GetWindow(this).IsHitTestVisible = false; popup.Show(); }
private void AddButton_Click(object sender, RoutedEventArgs e) { bool bGender; if (GenderComboBox.SelectedItem.ToString().Contains("Male")) { bGender = true; } else { bGender = false; } if (admin_control.create_new_libcard(AccountTypeComboBox.Text, IDTextBox.Text, NameTextBox.Text, DOBPicker.Text, bGender)) { PopUpWindow popup = new PopUpWindow(); Window.GetWindow(this).IsHitTestVisible = false; popup.Owner = Window.GetWindow(this); popup.PopUpTB.Text = "created"; popup.Show(); } }