Ejemplo n.º 1
0
 public IActionResult Create(string id, Patient.Chart c)
 {
     if (ModelState.IsValid)
     {
         chartService.Create(id, c);
         return(RedirectToAction("Index", new { id = Url.ActionContext.RouteData.Values["id"] }));
     }
     return(View(c));
 }
Ejemplo n.º 2
0
        public static void CreateTestChart(string chartId)
        {
            var chartService = new ChartService();

            chartService.Create(new OptionsCreateNewChart
            {
                ChartId      = chartId,
                TemplateName = "Berlin"
            });
        }
Ejemplo n.º 3
0
        public static void CreateUpdateRemoveList()
        {
            var chartService          = new ChartService();
            var optionsCreateNewChart = new OptionsCreateNewChart
            {
                ChartId      = "CreateUpdateRemoveListChart",
                TemplateName = "Berlin"
            };
            var resultChart = chartService.Create(optionsCreateNewChart);

            if (!resultChart.IsSuccess)
            {
                Console.WriteLine(resultChart.Error);
            }

            var optionsUpdateChart = new OptionsUpdateChart
            {
                NewChartId      = "CreateUpdateRemoveListChartNewUpdated",
                NewTemplateName = "London",
                OldChartId      = "CreateUpdateRemoveListChart"
            };

            resultChart = chartService.Update(optionsUpdateChart);
            if (!resultChart.IsSuccess)
            {
                Console.WriteLine(resultChart.Error);
            }

            var optionsList = new OptionsList
            {
                Skip = 0,
                Take = 10,
                WildcardSearchPattern = "*NewUpdated*"
            };

            var resultList = chartService.ListDescriptors(optionsList);


            if (!resultList.IsSuccess)
            {
                Console.WriteLine(resultList.Error);
            }

            var optionsChart = new OptionsChart
            {
                ChartId = "CreateUpdateRemoveListChartNewUpdated"
            };

            var resultRemove = chartService.Remove(optionsChart);

            if (!resultRemove.IsSuccess)
            {
                Console.WriteLine(resultRemove.Error);
            }
        }
Ejemplo n.º 4
0
        public static void HelloOrgChart()
        {
            var chartService = new ChartService();
            var options      = new OptionsCreateNewChart
            {
                ChartId      = "HelloOrgChart",
                TemplateName = "Sofia"
            };

            var result = chartService.Create(options);

            if (result.IsSuccess)
            {
                Console.WriteLine("Hello OrgChart. Successfully created chart with id HelloOrgChart and template Sofia!");
            }
            else
            {
                Console.WriteLine(result.Error);
                Console.WriteLine("Failed! Verify ApiAccessKey!");
            }
        }
Ejemplo n.º 5
0
        public static void AddEmployees()
        {
            var chartService = new ChartService();
            var options      = new OptionsCreateNewChart
            {
                ChartId      = "AddEmployees",
                TemplateName = "Sofia",
                Empty        = true
            };
            var resultCreate = chartService.Create(options);

            if (!resultCreate.IsSuccess)
            {
                Console.WriteLine(resultCreate.Error);
            }

            var optionsAddNode = new OptionsAddNode
            {
                ChartId = "AddEmployees",
                Node    = new Dictionary <string, string>
                {
                    { "id", "1" },
                    { "Name", "John Smith" }
                }
            };

            var resultAddNode = chartService.AddNode(optionsAddNode);

            if (!resultAddNode.IsSuccess)
            {
                Console.WriteLine(resultAddNode.Error);
            }


            optionsAddNode = new OptionsAddNode
            {
                ChartId = "AddEmployees",
                Node    = new Dictionary <string, string>
                {
                    { "id", "2" },
                    { "pid", "1" },
                    { "Name", "Jack Daniels" }
                }
            };

            resultAddNode = chartService.AddNode(optionsAddNode);

            if (!resultAddNode.IsSuccess)
            {
                Console.WriteLine(resultAddNode.Error);
            }

            optionsAddNode = new OptionsAddNode
            {
                ChartId = "AddEmployees",
                Node    = new Dictionary <string, string>
                {
                    { "id", "3" },
                    { "pid", "1" },
                    { "Name", "Mickey Mouse" },
                    { "tags", "blue,assistant" }
                }
            };

            resultAddNode = chartService.AddNode(optionsAddNode);

            if (!resultAddNode.IsSuccess)
            {
                Console.WriteLine(resultAddNode.Error);
            }


            optionsAddNode = new OptionsAddNode
            {
                ChartId = "AddEmployees",
                Node    = new Dictionary <string, string>
                {
                    { "id", "4" },
                    { "pid", "1" },
                    { "Name", "Ana Garson" },
                    { "Photo", "https://cdn.balkan.app/shared/2.jpg" },
                    { "Country", "USA" },
                    { "City", "Las Vegas" },
                    { "JobTitle", "IT Manager" },
                    { "Email", "*****@*****.**" }
                }
            };

            resultAddNode = chartService.AddNode(optionsAddNode);

            if (!resultAddNode.IsSuccess)
            {
                Console.WriteLine(resultAddNode.Error);
            }
        }