public static void Delete(Cota pFavoritos) { DataBase db = GetDataBase(); var query = from c in db.Cotacoes where c.id == pFavoritos.id select c; db.Cotacoes.DeleteOnSubmit(query.ToList()[0]); db.SubmitChanges(); }
private void onSelecionChange(object sender, SelectionChangedEventArgs e) { pagina = (sender as ListBox).SelectedItem as Cota; }
public static void Create(Cota pFavoritos) { DataBase db = GetDataBase(); db.Cotacoes.InsertOnSubmit(pFavoritos); db.SubmitChanges(); }
private Cota ParseJson(string pJson) { if (pJson != null) { //faz o parse para um tipo jobject JObject jobject = JObject.Parse(pJson); CotaDoJson = new Cota { indice = (double)jobject["indice"], data_consulta = (string)jobject["atual"] }; } return CotaDoJson; }