Beispiel #1
0
        static void Main(string[] args)
        {
            Configuration.ApiAccessKey = "ak_8252286e-1af0-4f6c-a9a8-c572f7afbf74";
            //REPLACE ak_06d16bd3-6ac3-4097-ae77-42395a6da98c2 with your Access API Key

            HelloOrgChart();

            var chartService = new ChartService();
            var tokenService = new TokenService();
            var userService  = new UserService();
            var imageService = new ImageService();

            chartService.Empty();
            //tokenService.Empty();
            userService.Empty();
            imageService.Empty();


            Charts.AddEmployees();
            Charts.AddNodes();
            Charts.UpdateNode();
            Charts.RemoveNode();
            Charts.GetNode();
            Charts.GetNodes();
            Charts.Search();
            Charts.CreateUpdateRemoveList();
            Charts.GenerateNodeIds();


            Users.InviteAndCreateGuests();
            Users.UpdateGuest();
            Users.ListGuests();
            Users.RemoveGuest();

            Image.Upload();

            Token.CreateAccess();
            Token.CreateSession();
        }
Beispiel #2
0
        public static void Upload()
        {
            Charts.CreateTestChart("ImageUploadChart");
            var imageService = new ImageService();

            var resultUpload = imageService.Upload(new List <string> {
                "alf.jpg"
            });

            if (!resultUpload.IsSuccess)
            {
                Console.WriteLine(resultUpload.Error);
            }
            else
            {
                foreach (var image in resultUpload.Images)
                {
                    Console.WriteLine(image.OriginalFileName);
                    Console.WriteLine(image.NewFileName);
                    Console.WriteLine(image.Url);
                }

                var imageUrl = resultUpload.Images[0].Url;

                var chartService     = new ChartService();
                var resultUpdateNode = chartService.UpdateNode(new OptionsUpdateNode
                {
                    ChartId = "ImageUploadChart",
                    Node    = new Dictionary <string, string>
                    {
                        { "id", "_sfWf" },
                        { "Name", "Alexandar Smith" },
                        { "Photo", imageUrl }
                    }
                });
            }
        }