Beispiel #1
0
        //***********************   MANAGER PATH   ************************//


        /// <summary>
        /// Insert new Path
        /// </summary>
        /// <param name="IdUser"></param>
        /// <param name="Namepath"></param>
        /// <param name="path"></param>
        /// <returns></returns>
        public string CreatePath(string IdUser, string Namepath, string[] path)
        {
            if (path.Length != 0)
            {
                int Lengpoint = path.Length / 3;
                var arr       = new List <PointPath>();

                for (var i = 0; i < path.Length; i = i + 3)
                {
                    int       idArray = i / 3;
                    PointPath pts     = new PointPath
                    {
                        NamePoint = path[i],
                        Lat       = double.Parse(path[i + 1]),
                        Lg        = double.Parse(path[i + 2]),
                    };
                    arr.Add(pts);
                }

                return(MapProvider.CreatPath(IdUser, Namepath, arr.ToArray()));
            }
            else
            {
                return("false");
            }
        }