Ejemplo n.º 1
0
 private void BtnClearSearch_Click(object sender, RoutedEventArgs e)
 {
     isCreate = false;
     TxtBoxSearch.Text = "";
     dgContentList.SelectedItem = null;
     dgContentList.SelectedIndex = -1;
     selectedUID = -1;
     ShowHide();
     //SearchList.ItemsSource = null;
     Page_default p = new Page_default();
     FrmContent.Navigate(p);
 }
Ejemplo n.º 2
0
        private void BtnYes_Click(object sender, RoutedEventArgs e)
        {
            using (CVDBContext db = new CVDBContext())
            {
                Users userToDelete = db.Users.Find(selectedUID);
                db.Users.Remove(userToDelete);
                db.SaveChanges();
            }
            //delete user, never to return!
            txtbxtest.Text = "Användare med id: " + selectedUID + " borttagen.";
            PopupDelete.IsOpen = false;
            dgContentList.SelectedIndex = -1;
            ShowHide();
            dgContentList.UpdateGrid();
            Page_default p = new Page_default();
            FrmContent.Navigate(p);

        }