Example #1
0
 public void ACTFActivosDAL_Insert(Activos activos)
 {
     client = new FireSharp.FirebaseClient(config);
     if (client != null)
     {
         SetResponse resp = client.Set("Activos/" + activos.id.ToString(), activos);
     }
 }
Example #2
0
 public void ActivoDelete(Activos activos)
 {
     client = new FireSharp.FirebaseClient(config);
     if (client != null)
     {
         string path = "Activos/" + activos.id.ToString();
         client.Delete(path);
     }
 }
Example #3
0
        public List <Activos> ActivosList()
        {
            Settings settings = new Settings();
            var      data     = new List <Activos>();

            client = new FireSharp.FirebaseClient(config);
            if (client != null)
            {
                FirebaseResponse response = client.Get("Activos");
                var json = response.Body;
                if (json != null && json != "null")
                {
                    var Jsondata = JObject.Parse(json);
                    foreach (KeyValuePair <string, JToken> property in Jsondata)
                    {
                        Activos ActivosResult = JsonConvert.DeserializeObject <Activos>(property.Value.ToString());

                        Activos activos = new Activos();
                        activos.id           = ActivosResult.id;
                        activos.symbol       = ActivosResult.symbol;
                        activos.name         = ActivosResult.name;
                        activos.type         = ActivosResult.type;
                        activos.region       = ActivosResult.region;
                        activos.marketOpen   = ActivosResult.marketOpen;
                        activos.marketClose  = ActivosResult.marketClose;
                        activos.timezone     = ActivosResult.timezone;
                        activos.currency     = ActivosResult.currency;
                        activos.matchScore   = ActivosResult.matchScore;
                        activos.creationDate = ActivosResult.creationDate;

                        data.Add(activos);
                    }
                }
            }

            return(data);
        }