Exemplo n.º 1
0
        public void AddTaskTicket(taskTicket task)
        {
            task.TicketId = taskTickets.Count() == 0 ? 1 : taskTickets.Max(t => t.TicketId) + 1;


            StreamWriter sw = new StreamWriter("task.txt", true);

            sw.WriteLine($"{task.TicketId},{task.summary},{task.status},{task.priority},{task.submitter},{task.assigned},{task.watching},{task.projectName},{task.dueDate}");
            sw.Close();

            taskTickets.Add(task);
            sw.Close();
        }
Exemplo n.º 2
0
        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();
        }