Exemple #1
0
        public static bool DeleteMap(string url, MangoMap map)
        {
            Dictionary <string, string> param = new Dictionary <string, string>();

            param["id"] = map.id.ToString();

            string    content = Post(url, param);
            ApiResult result  = JsonConvert.DeserializeObject <ApiResult>(content);

            return(result.success);
        }
Exemple #2
0
        public static bool UpdateMap(string url, MangoMap map)
        {
            var param = new Dictionary <string, string> {
                { "id", map.id.ToString() },
                { "name", map.name },
                { "type", map.type.ToString() },
                { "pid", map.pid.ToString() },
                { "idx", map.idx.ToString() },
                { "defaultLongitude", map.defaultLongitude.ToString() },
                { "defaultLatitude", map.defaultLatitude.ToString() },
                { "defaultZoomLevel", map.defaultZoomLevel.ToString() },
            };

            string content = Post(url, param);

            Console.WriteLine(content);

            return(true);
        }
Exemple #3
0
        public static bool InsertMap(string url, MangoMap map)
        {
            var param = new Dictionary <string, string> {
                { "name", map.name },
                { "type", map.type.ToString() },
                { "pid", map.pid.ToString() },
                { "idx", map.idx.ToString() },
                { "defaultLongitude", map.defaultLongitude.ToString() },
                { "defaultLatitude", map.defaultLatitude.ToString() },
                { "defaultZoomLevel", map.defaultZoomLevel.ToString() },
            };

            string    content = Post(url, param);
            ApiResult result  = JsonConvert.DeserializeObject <ApiResult>(content);

            if (result.success)
            {
                map.id = int.Parse(result.msg);
            }

            return(result.success);
        }