private void writeTicketToFile(string file, Enhancement ticket)
        {
            StreamWriter sw = new StreamWriter(file, append: true);

            // write line to file
            sw.WriteLine("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9}",
                         ticket.ticketID, ticket.summary, ticket.status, ticket.priority,
                         ticket.submitter, ticket.assigned, ticket.watching,
                         ticket.software, ticket.reason, ticket.estimate);

            sw.Close();
        }
Пример #2
0
 public void displayEnhancementInfo(Enhancement ticket)
 {
     Console.WriteLine("TicketID: {0}\n" +
                       "Summary: {1}\n" +
                       "Status: {2}\n" +
                       "Priority: {3}\n" +
                       "Submitter: {4}\n" +
                       "Assigned: {5}\n" +
                       "Watching: {6}\n" +
                       "Software: {7}\n" +
                       "Reason: {8}\n" +
                       "Estimate: {9}\n",
                       ticket.ticketID, ticket.summary, ticket.status, ticket.priority,
                       ticket.submitter, ticket.assigned, ticket.watching, ticket.software,
                       ticket.reason, ticket.estimate);
 }
        public void readDisplayData(string file)
        {
            Console.WriteLine("\nList of Enhancement Tickets\n");
            StreamReader sr = new StreamReader(file);

            // skip first line
            string line = sr.ReadLine();

            while (!sr.EndOfStream)
            {
                //Ticket ticket = new Ticket();
                line   = sr.ReadLine();
                ticket = readTicketInformation(line);
                display.displayEnhancementInfo(ticket);
            }
            sr.Close();
        }
 public void addTicket(string file)
 {
     ticket = elicitTicketInformation(file);
     writeTicketToFile(file, ticket);
 }
 public EnhancementManager()
 {
     ticket = new Enhancement();
 }