private static void EditTicketOptions(int ID)
        {
            string currentUsername     = _db.RetrieveCurrentUserFromDatabase();
            string currentUsernameRole = _db.RetrieveCurrentUsernameRoleFromDatabase();

            string edit    = "Edit Ticket Comment";
            string assign  = "Edit Ticket's User assignment";
            string back    = "\r\nBack";
            string editMsg = "\r\nChoose one of the following options to continue:\r\n";

            while (true)
            {
                string EditCommentAndAssignment = SelectMenu.MenuColumn(new List <string> {
                    edit, assign, back
                }, currentUsername, editMsg).option;

                if (EditCommentAndAssignment == edit)
                {
                    string ticketComment = print.TicketComment();
                    _db.EditCommentOfOpenTicket(ID, ticketComment);
                }
                else if (EditCommentAndAssignment == assign)
                {
                    string newUserAssignment = AssignTroubleTickets.AssignTicketToUser();
                    AssignTroubleTickets.ChangeUserAssignmentToOpenTicket(ID, newUserAssignment);
                }
                else if (EditCommentAndAssignment == back)
                {
                    print.QuasarScreen(currentUsername);
                    ActiveUserFunctions.UserFunctionMenuScreen(currentUsernameRole);
                }
            }
        }
예제 #2
0
        public static void OpenTicket()
        {
            var _db   = new ConnectToServer();
            var print = new OutputControl();

            string currentUsername = _db.RetrieveCurrentUserFromDatabase();
            string comment         = print.TicketComment();
            string userAssignedTo  = AssignTroubleTickets.AssignTicketToUser();

            _db.OpenNewTechnicalTicket(currentUsername, userAssignedTo, comment);
            Console.WriteLine("\n\nPress any key to return");
            Console.ReadKey();
            ManageTroubleTickets.OpenOrCloseTroubleTicket();
        }