public int NewEnhanceTicket(string ticketSummary, string ticketStatus, string ticketPriority, Person ticketSubmitter, Person ticketAssigned, List <Person> watchers) { EnhanceTicket enhanceTicket = new EnhanceTicket(ticketSummary, ticketStatus, ticketPriority, ticketSubmitter, ticketAssigned, watchers); EnhanceTickets.Add(enhanceTicket); return(enhanceTicket.ReturnTicketNumber()); }
private int GetMainTicketDetails(string ticketType, BugTicket bugTicket) { // Ticket: Status Console.SetCursorPosition(75, 7); var ticketStatus = "New"; Console.WriteLine("Ticket Status : {0}", ticketStatus); // Ticket: Priority var prioritySelection = new List <string> { "Low", "Routine", "Priority", "Emergency" }; Console.SetCursorPosition(0, 7); Console.WriteLine("Please choose Ticket Priority:"); var ticketPriority = MenuItemSelection(prioritySelection); Console.SetCursorPosition(75, 8); Console.WriteLine("Ticket Priority : {0}", ticketPriority); Console.SetCursorPosition(0, 7); ConsoleSpaces(50, 10); // Ticket: Summary Console.SetCursorPosition(0, 7); var ticketSummary = GetStringValue("Please enter the Ticket Summary"); Console.SetCursorPosition(75, 9); Console.WriteLine("Ticket Summary : {0}", ticketSummary); Console.SetCursorPosition(0, 7); ConsoleSpaces(50, 10); // Ticket: Submitter Console.SetCursorPosition(0, 7); Console.WriteLine("Who is submitting this ticket?"); var ticketSubmitter = MenuItemPersonSelection(); Console.SetCursorPosition(75, 10); Console.WriteLine("Ticket Submitter: {0}", ticketSubmitter); Console.SetCursorPosition(0, 7); ConsoleSpaces(50, 10); // Ticket: Assigned Console.SetCursorPosition(0, 7); Console.WriteLine("Please assign this ticket: "); var ticketAssigned = MenuItemPersonSelection(); Console.SetCursorPosition(75, 11); Console.WriteLine("Ticket Assigned : {0}", ticketAssigned); // Ticket: Watchers ConsoleKey userResponse; //string Key; var watchers = new List <Person>(); do { Console.SetCursorPosition(0, 7); ConsoleSpaces(60, 10); Console.SetCursorPosition(0, 7); Console.WriteLine("Please choose who will watch this ticket:"); var watcher = MenuItemPersonSelection(); watchers.Add(watcher); Console.SetCursorPosition(75, 11 + watchers.Count()); Console.WriteLine("Watcher #{0}: {1}", watchers.Count(), watcher); Console.SetCursorPosition(0, 7); ConsoleSpaces(60, 20); Console.SetCursorPosition(0, 7); Console.WriteLine("Would you like to add another Watcher? (Y/N): "); userResponse = Console.ReadKey(true).Key; Console.SetCursorPosition(0, 7); ConsoleSpaces(60, 20); } while (userResponse == ConsoleKey.Y); Console.SetCursorPosition(10, 5); switch (ticketType) { case "Bug/Defect Ticket": var bugTicket = ListController.BugTickets; return(bugTicket); case "Enhancement Ticket": EnhanceTicket enhanceTicket = new EnhanceTicket(ticketSummary, ticketStatus, ticketPriority, ticketSubmitter, ticketAssigned, watchers); return(enhanceTicket.ReturnTicketNumber()); case "Task Ticket": TaskTicket taskTicket = new TaskTicket(ticketSummary, ticketStatus, ticketPriority, ticketSubmitter, ticketAssigned, watchers); return(taskTicket.ReturnTicketNumber()); default: return(0); } }