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

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

            sw.Close();
        }
示例#2
0
 public void displayBugInfo(BugDefect ticket)
 {
     Console.WriteLine("TicketID: {0}\n" +
                       "Summary: {1}\n" +
                       "Status: {2}\n" +
                       "Priority: {3}\n" +
                       "Submitter: {4}\n" +
                       "Assigned: {5}\n" +
                       "Watching: {6}\n" +
                       "Severity: {7}\n",
                       ticket.ticketID, ticket.summary, ticket.status, ticket.priority,
                       ticket.submitter, ticket.assigned, ticket.watching, ticket.severity);
 }
        public void readDisplayData(string file)
        {
            Console.WriteLine("\nList of Bug/Defect 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.displayBugInfo(ticket);
            }
            sr.Close();
        }
 public void addTicket(string file)
 {
     ticket = elicitTicketInformation(file);
     writeTicketToFile(file, ticket);
 }
 public BugManager()
 {
     ticket = new BugDefect();
 }