Exemplo n.º 1
0
        public c_DataUpdateObject checkUpdate()
        {
            c_DataUpdateObject d        = new c_DataUpdateObject();
            string             username = _dbh.getUserName();

            username = "******";
            string data = "";

            if (username != null)
            {
                data = createConnection("http://wpss.atoldavid.hu/api/check_update.php", $"username={username}");
            }


            if (data != "")
            {
                var jr = JObject.Parse(data)["Count of outdated data"].Children();
                d.Name = "Updatable Data Count";
                foreach (JToken v in jr)
                {
                    d.Add(v.Path.Split('.').Last(), v.First.ToString());
                }
            }

            return(d);
        }
Exemplo n.º 2
0
        public dataObject getUpdate()
        {
            dataObject dObj = new dataObject();

            string username = _dbh.getUserName();

            username = "******";
            string data = "";

            if (username != null)
            {
                data = createConnection("http://wpss.atoldavid.hu/api/get_data.php", $"username={username}");
            }

            if (data != "")
            {
                //TODO:::FIX DIS BS
                var obj = JObject.Parse(data)["Data to update:"].Children();

                foreach (JToken v in obj)
                {
                    var o = v.First;
                    c_DataUpdateObject d = new c_DataUpdateObject();
                    d.Name = o.First().First().ToString();
                    foreach (var vv in o.Children())
                    {
                        d.Add(vv.Path.Split('.').Last(), vv.First().ToString());
                    }
                    dObj.Add(d);
                }
            }

            return(dObj);
        }