Example #1
0
        private void SolveIncidence()
        {
            Console.WriteLine("INCIDENCES SOLVER TESTER");
            Console.WriteLine("------------------------");
            Console.WriteLine("INSERT INCIDENCE ID");
            string id = Console.ReadLine();

            if (CommonLib.ValidateNumEntrance(id))
            {
                bool      finished  = false;
                Incidence incidence = _adminMgm.GetIncidence(int.Parse(id));
                do
                {
                    Console.WriteLine("ADD COMMENT ");
                    incidence.Comments.Add(new Comment
                    {
                        CommentDate = System.DateTime.Now,
                        Text        = Console.ReadLine(),
                        IncidenceID = incidence.ID,
                        Incidence   = incidence
                    });
                } while (!finished);

                bool solved = false;
                Console.WriteLine("SOLVED? (Y/N)");
                if (Console.ReadLine().ToUpper() != "Y")
                {
                    solved = true;
                }

                incidence.Solved = solved;
            }
        }