Exemple #1
0
        public void MainMenu()
        {
            while (true)
            {
                Console.WriteLine("---|Menu|----");
                Console.WriteLine("Add teacher : 1");
                Console.WriteLine("Add group : 2");
                Console.WriteLine("Add group to teacher: 3");
                Console.WriteLine("Start activity : 4");
                Console.WriteLine("Get Info : 5");
                Console.WriteLine("Get groups grades : 6");
                Console.WriteLine("Settings : 7");
                Console.WriteLine("Exit : 8");
                choise = Console.ReadLine();
                Console.WriteLine(" ");
                switch (choise)
                {
                case "1":
                    AddTeacher(ChoiceSubject());
                    break;

                case "2":
                    AddGroup();
                    break;

                case "3":
                    AddGroupToteacher();
                    break;

                case "4":
                    StartActivity(ChoiceSubject());
                    break;

                case "5":
                    Console.WriteLine(infoService.GetInfo());
                    break;

                case "6":
                    int n = NumberCheck("\n -|Choise Group| -\n" + infoService.GetGroup(),
                                        infoService.GetGroupCount());
                    Console.WriteLine(infoService.GetGroupsGrades(n));
                    break;

                case "7":
                    settingsMenu.SetSettings();
                    break;

                case "8":
                    return;

                default:
                    Console.WriteLine("Interapt input");
                    break;
                }
                Console.WriteLine(" ");
            }
        }
        public async Task <IHttpActionResult> GetInfo()
        {
            InfoDTO infoDto = await service.GetInfo();

            InfoModel info = mapper.Map <InfoDTO, InfoModel>(infoDto);

            if (info != null)
            {
                return(Ok(new ResponseSheme(info, "EverythingOk", 200)));
            }
            return(BadRequest());
        }
        public async Task <IActionResult> Get()
        {
            try
            {
                var result = await _infoService.GetInfo();

                if (result == null)
                {
                    return(NotFound("Nenhum Registro Encontrado"));
                }
                return(Ok(result));
            }
            catch (Exception e)
            {
                return(this.StatusCode(StatusCodes.Status500InternalServerError, $"Erro ao tentar recuperar dados. Erro: {e.Message}"));
            }
        }
Exemple #4
0
        public IActionResult Get(string value)
        {
            var info = _infoService.GetInfo(value);

            return(Ok(info));
        }
 public Info Index()
 {
     return(_infoService.GetInfo());
 }
Exemple #6
0
        public IActionResult EditInfo()
        {
            var entity = _infoService.GetInfo();

            return(View(entity.EntityConvert <InfoModel>()));
        }
Exemple #7
0
        public IActionResult GetInfo(string id)
        {
            var model = _infoService.GetInfo(id);

            return(Ok(model));
        }
Exemple #8
0
 public async Task <WebSiteInfo> GetStatistics()
 {
     return(await _infoService.GetInfo());
 }