Exemple #1
0
 public void Initialize(PostCase entity)
 {
     Initialize();
     SelectedId           = entity.Id;
     Context.Text         = entity.Context;
     Created.SelectedDate = entity.Created;
     Thread.SelectedItem  = entity.Thread;
     Account.SelectedItem = entity.Account;
 }
Exemple #2
0
 private void Update_Click(object sender, RoutedEventArgs e)
 {
     if (PostTable.SelectedIndex >= 0)
     {
         PostCase Item = (dynamic)PostTable.SelectedItem;
         PostEditView.IsEnabled  = true;
         PostEditView.Visibility = Visibility.Visible;
         PostEditView.Initialize(Item);
         EditHeight.Height = new GridLength(120);
     }
 }
Exemple #3
0
        private void Remove_Click(object sender, RoutedEventArgs e)
        {
            var result = MessageBox.Show("Are you sure to delete selected data?", "Требуется подстверждение!", MessageBoxButton.YesNo, MessageBoxImage.Warning);

            if (result == MessageBoxResult.Yes && PostTable.SelectedIndex >= 0)
            {
                PostCase Item = (dynamic)PostTable.SelectedItem;
                db.Posts.Remove(db.Posts.Where(e => e.Id == Item.Id).Single());
                db.SaveChanges();
                Initialize();
            }
        }