예제 #1
0
        /// <summary>
        /// Add a new skill from a csv file
        /// </summary>
        public void CreateSkill()
        {
            try
            {
                string[]     lines        = System.IO.File.ReadAllLines(@"C:\Dev\purecloud\createskill.csv");
                RoutingSkill routingSkill = new RoutingSkill();

                // Display the file contents by using a foreach loop.
                Console.WriteLine("Contents of WriteLines2.txt = ");
                foreach (string line in lines)
                {
                    // Use a tab to indent each line of the file.
                    Console.WriteLine("\t" + line);

                    routingSkill.Name = line;

                    routingApi.PostRoutingSkills(routingSkill);
                }
            }
            catch (Exception ex)
            {
                AddLog($"Error in CreateSkill: {ex.Message}");
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #2
0
        /// <summary>
        /// Create skill from a csv file
        /// </summary>
        /// <param name="filename"></param>
        public void CreateSkillFromCsv(string filename)
        {
            try
            {
                string[]     lines        = System.IO.File.ReadAllLines(filename);
                RoutingSkill routingSkill = new RoutingSkill();

                foreach (string line in lines)
                {
                    routingSkill.Name = line;

                    try
                    {
                        routingApi.PostRoutingSkills(routingSkill);

                        AddLog("Skill is created : " + line);
                    }
                    catch (Exception ex)
                    {
                        AddLog($"Error in CreateSkill: {ex.Message}");
                        //MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
            catch (Exception ex)
            {
                AddLog($"Error in CreateSkill: {ex.Message}");
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #3
0
        public void PostSkillsTest()
        {
            // TODO: add unit test for the method 'PostSkills'
            RoutingSkill body     = null; // TODO: replace null with proper value
            var          response = instance.PostSkills(body);

            Assert.IsInstanceOf <RoutingSkill> (response, "response is RoutingSkill");
        }
예제 #4
0
        /// <summary>
        /// Add a new skill with the name
        /// </summary>
        /// <param name="nom"></param>
        public void CreateSkill(string name)
        {
            try
            {
                RoutingSkill routingSkill = new RoutingSkill();

                routingSkill.Name = name;

                routingApi.PostRoutingSkills(routingSkill);
            }
            catch (Exception ex)
            {
                AddLog($"Error in CreateSkill on {name} : {ex.Message}");
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #5
0
 public void Init()
 {
     instance = new RoutingSkill();
 }