public void AddEnhancement(Enhancement e)
        {
            TicketFile tf = new TicketFile();
            TaskFile   tkf = new TaskFile();
            int        i = new[] { tf.GetMaxTicketID(), tkf.GetMaxTaskID(), GetMaxEnhID() }.Max() + 1;

            StreamWriter sw = new StreamWriter(filePath, append: true);

            sw.WriteLine($"\n{i},{e.summary},{e.status},{e.priority},{e.submitter},{e.assigned},{e.watchrgoup},{e.software},{e.cost},{e.reason},{e.estimate}");
            Enhancemnet.Add(e);
            sw.Close();

            //try
            //{
            //    //first generate movie id
            //    t.recordID = Ticket.Max(m => m.recordID) + 1;

            //    StreamWriter sw = new StreamWriter(filePath);
            //    sw.WriteLine($"\n{t.recordID},{t.summary},{t.status},{t.priority},{t.submitter},{t.assigned},{t.watchrgoup},{t.severity}");
            //    sw.Close();
            //    Ticket.Add(t);
            //    logger.Info("Ticket id {Id} added", t.recordID);

            //}
            //catch (Exception ex)
            //{
            //    logger.Error(ex.Message);
            //}
        }
        public void AddEnhancement()
        {
            Format f = new Format();

            Console.Clear();
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("\n    --------------------------------------------------------------------------------------------------------------------------------------------------------------\n" +
                              "    Add Enhancement\n" +
                              "    --------------------------------------------------------------------------------------------------------------------------------------------------------------\n");
            Console.ResetColor();


            string          file        = "../../Files/Enhancements.txt";
            EnhancementFile ef          = new EnhancementFile(file);
            Enhancement     enhancement = new Enhancement();

            Console.Write("    Enter Enhancement Summary: ");
            enhancement.summary = Console.ReadLine();

            Console.Write("\n    Enter Ticket Priority: ");

            enhancement.priority = f.validateInt(Console.ReadLine());
            if (enhancement.priority > 3)
            {
                Console.Write("    Please Enter a valid proiroity 1 - 3 ");
                enhancement.priority = f.validateInt(Console.ReadLine());
            }

            ef.AddEnhancement(enhancement);
            Console.Write("    Enhancement succesfully added! Press any key ro return to the main menu: ");
            Console.ReadKey();
        }
        public EnhancementFile(string path)
        {
            Enhancemnet = new List <Enhancement>();
            filePath    = path;

            //try
            //{
            StreamReader sr = new StreamReader(filePath);

            // first line contains column headers
            // sr.ReadLine();
            while (!sr.EndOfStream)
            {
                // create instance of Movie class
                Enhancement enhancement = new Enhancement();
                string      line        = sr.ReadLine();

                string[] ticketDetails = line.Split(',');
                enhancement.recordID   = Int32.Parse(ticketDetails[0]);
                enhancement.summary    = ticketDetails[1];
                enhancement.status     = Int32.Parse(ticketDetails[2]);
                enhancement.priority   = Int32.Parse(ticketDetails[3]);
                enhancement.submitter  = Int32.Parse(ticketDetails[4]);
                enhancement.assigned   = Int32.Parse(ticketDetails[5]);
                enhancement.watchrgoup = Int32.Parse(ticketDetails[6]);
                enhancement.software   = Int32.Parse(ticketDetails[7]);
                enhancement.cost       = Convert.ToDouble(ticketDetails[8]);
                enhancement.reason     = Int32.Parse(ticketDetails[9]);
                enhancement.estimate   = Convert.ToDouble(ticketDetails[10]);

                Enhancemnet.Add(enhancement);
            }
            // close file when done
            sr.Close();
            logger.Info("Tickets in file {Count}", Enhancemnet.Count);
            //}
            //catch (Exception ex)
            //{
            //    logger.Error(ex.Message);
            //}
        }