Example #1
0
        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();
        }
Example #2
0
 private void onSelecionChange(object sender, SelectionChangedEventArgs e)
 {
     pagina = (sender as ListBox).SelectedItem as Cota;
 }
Example #3
0
 public static void Create(Cota pFavoritos)
 {
     DataBase db = GetDataBase();
     db.Cotacoes.InsertOnSubmit(pFavoritos);
     db.SubmitChanges();
 }
Example #4
0
        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;
        }