Exemplo n.º 1
0
        private static void DisplaySkiRunDetail()
        {
            SkiRunRepositorySQL skiRunRepository = new SkiRunRepositorySQL();
            List<SkiRun> skiRuns;
            SkiRun skiRun = new SkiRun();
            int skiRunID;

            using (skiRunRepository)
            {
                skiRuns = skiRunRepository.SelectAllSkiRuns();
            }

            skiRunID = ConsoleView.GetSkiRunID(skiRuns);

            using (skiRunRepository)
            {
                skiRun = skiRunRepository.SelectSkiRun(skiRunID);
            }

            ConsoleView.DisplaySkiRun(skiRun);
            ConsoleView.DisplayContinuePrompt();
        }
Exemplo n.º 2
0
        private static void UpdateSkiRun()
        {
            SkiRunRepositorySQL skiRunRepository = new SkiRunRepositorySQL();
            List<SkiRun> skiRuns = skiRunRepository.SelectAllSkiRuns();
            SkiRun skiRun = new SkiRun();
            int skiRunID;

            using (skiRunRepository)
            {
                skiRuns = skiRunRepository.SelectAllSkiRuns();
            }

            skiRunID = ConsoleView.GetSkiRunID(skiRuns);

            using (skiRunRepository)
            {
                skiRun = skiRunRepository.SelectSkiRun(skiRunID);
            }

            skiRun = ConsoleView.UpdateSkiRun(skiRun);

            using (skiRunRepository)
            {
                skiRunRepository.UpdateSkiRun(skiRun);
            }
        }