Example #1
0
        static void Main(string[] args)
        {
            List <Ticket> TicketList = new List <Ticket>();

            TicketList.Add(new InternalTicket("VITORC", "Vitor", "*****@*****.**", "blah blah blah"));

            TicketList.Add(new ExternalTicket("Jorge", "*****@*****.**", "another blah blah"));
            TicketList.Add(new ExternalTicket("Julia", "*****@*****.**", "I have a problem"));
            TicketList.Add(new ExternalTicket("Caldas", "*****@*****.**", "oq ta acontecendo?"));

            TicketList.Add(new InternalTicket("RAFAC", "Rafa", "*****@*****.**", "Password Change"));
            TicketList.Add(new InternalTicket("VIKAC", "Vika", "*****@*****.**", "Screen freezes for 2 minutes every time the Submit button is pressed"));

            //before
            TicketStats.ShowStats();

            Console.WriteLine("\nPrinting Tickets:\n");
            foreach (var ticket in TicketList)
            {
                ticket.ShowTicket();
            }


            //after
            TicketStats.ShowStats();

            Console.WriteLine("\nPrinting Tickets:\n");
            foreach (var ticket in TicketList)
            {
                ticket.ResponseToTicket(2006, "The issue has been resolved. Please check.");
                ticket.ShowTicket();
            }
        }
Example #2
0
 public ExternalTicket(string name, string email, string description)
 {
     externalID       = GetLastTicketID();
     this.name        = name;
     this.email       = email;
     this.description = description;
     TicketStats.NewTicket();
 }
 public override void ResponseToTicket(int numTicket, string response)
 {
     if (internalID == numTicket)
     {
         this.response = response;
         ticket_status = "Closed";
         TicketStats.CloseTicket();
     }
 }
 public InternalTicket(string staffID, string name, string email, string description)
 {
     internalID       = GetLastTicketID() + 2000;
     this.staffID     = staffID;
     this.name        = name;
     this.email       = email;
     this.description = description;
     TicketStats.NewTicket();
     if (description.Contains("Password Change"))
     {
         PasswordChange();
         ticket_status = "Closed";
         TicketStats.CloseTicket();
     }
 }