Example #1
0
        public void TestReadTable()
        {
            SCBClient reader = new SCBClient("api.scb.se/OV0104");

            SCBNode node = new SCBNode
            {
                path = "http://api.scb.se/OV0104/v1/doris/en/ssd/BE/BE0401/BE0401A/BefolkPrognRevN",
                type = "t",
                id   = "BefProgFoddaMedel19"
            };

            SCBMetaData meta = reader.GetMetaData(node.path).Result;

            SCBQuery query = new SCBQuery {
                response = new SCBResponse("json")
            };

            query.SetUp(meta.variables);

            query.SetSelection(meta.variables.Find(s => s.code == "Fodelseregion"), SCBQuery.Filter.item, new List <string>()
            {
                "13"
            });
            query.SetSelection(meta.variables.Find(s => s.code == "Kon"), SCBQuery.Filter.item, new List <string>()
            {
                "1"
            });
            query.SetSelection(meta.variables.Find(s => s.code == "Tid"), SCBQuery.Filter.item, new List <string>()
            {
                "2020"
            });

            SCBTable table = reader.GetTable(node, query).Result;
        }
Example #2
0
 private void radioButtonAll_CheckedChanged(object sender, System.EventArgs e)
 {
     if (radioButtonAll.Checked)
     {
         if (listBoxVariables.SelectedItem is SCBVariable var)
         {
             if (!_currentQuery._items[var.code].selection.filter.Equals(SCBSelection.allString))
             {
                 _currentQuery.SetSelection(var, SCBQuery.Filter.all, null);
             }
         }
     }
 }