public static void Delete(EncomendasTramps DELSalvos)
        {
            DataBase db = GetDataBase();
            var query = from c in db.DBSalvos
                        where c.IdEncomenda == DELSalvos.IdEncomenda
                        select c;
            db.DBSalvos.DeleteOnSubmit(query.ToList()[0]);
            db.SubmitChanges();

        }
        private void vaiparapagerastrear(object sender, EventArgs e)
        {
            try
            {
                EncomendasTramps Riot = new EncomendasTramps
                {
                    IdEncomenda = TxtCodigo.Text

                };
                if (Riot != null)
                {
                    RepositorioTramps.Adicionar(Riot);
                    MessageBox.Show("Encomenda Adicionada");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Ops nada selecionado");
            }
            //NavigationService.Navigate(new Uri("/Paginas/MinhasEncomenda.xaml", UriKind.Relative));
        }
 private void onSelecioChange(object sender, SelectionChangedEventArgs e)
 {
     enc = (sender as ListBox).SelectedItem as EncomendasTramps;
 }
 public static void Adicionar(EncomendasTramps IDSalvos)
 {
     DataBase db = GetDataBase();
     db.DBSalvos.InsertOnSubmit(IDSalvos);
     db.SubmitChanges();
 }