public void AddEnchanceTicket(enhanceTicket enh) { enh.TicketId = enhanceTickets.Count() == 0 ? 1 : enhanceTickets.Max(e => e.TicketId) + 1; StreamWriter sw = new StreamWriter("enh.txt", true); sw.WriteLine($"{enh.TicketId},{enh.summary},{enh.status},{enh.priority},{enh.submitter},{enh.assigned},{enh.watching},{enh.software},{enh.cost},{enh.reason},{enh.estimate}"); sw.Close(); enhanceTickets.Add(enh); sw.Close(); }
public void readTicket() { StreamReader sr = new StreamReader("bug.txt"); while (!sr.EndOfStream) { string lineOfCode = sr.ReadLine(); string[] parsedLineOfCode = lineOfCode.Split(','); bugTicket bTicket = new bugTicket { TicketId = ulong.Parse(parsedLineOfCode[0]), summary = parsedLineOfCode[1], status = parsedLineOfCode[2], priority = parsedLineOfCode[3], submitter = parsedLineOfCode[4], assigned = parsedLineOfCode[5], watching = parsedLineOfCode[6], severity = parsedLineOfCode[7], }; bugTickets.Add(bTicket); } sr.Close(); StreamReader srr = new StreamReader("enh.txt"); while (!srr.EndOfStream) { string lineOfCode = srr.ReadLine(); string[] parsedLineOfCode = lineOfCode.Split(','); enhanceTicket eTicket = new enhanceTicket { TicketId = ulong.Parse(parsedLineOfCode[0]), summary = parsedLineOfCode[1], status = parsedLineOfCode[2], priority = parsedLineOfCode[3], submitter = parsedLineOfCode[4], assigned = parsedLineOfCode[5], watching = parsedLineOfCode[6], software = parsedLineOfCode[7], cost = parsedLineOfCode[8], reason = parsedLineOfCode[7], estimate = parsedLineOfCode[9], }; enhanceTickets.Add(eTicket); } srr.Close(); StreamReader srrr = new StreamReader("task.txt"); while (!srrr.EndOfStream) { string lineOfCode = srrr.ReadLine(); string[] parsedLineOfCode = lineOfCode.Split(','); taskTicket tTicket = new taskTicket { TicketId = ulong.Parse(parsedLineOfCode[0]), summary = parsedLineOfCode[1], status = parsedLineOfCode[2], priority = parsedLineOfCode[3], submitter = parsedLineOfCode[4], assigned = parsedLineOfCode[5], watching = parsedLineOfCode[6], projectName = parsedLineOfCode[7], dueDate = parsedLineOfCode[8], }; taskTickets.Add(tTicket); } srrr.Close(); }