public async Task <IActionResult> DeleteDetails(int?id)
        {
            if (id == null)
            {
                ModelState.AddModelError(string.Empty, "There was an error while getting student!");
            }

            Studenti studenti = new Studenti();

            using (var httpClient = new HttpClient())
            {
                studenti = await GetAPI.GetStudentiAsync(httpClient, id);

                Drejtimet drejtimet = await GetAPI.GetDrejtimiAsync(httpClient, studenti.DrejtimiId);

                List <Statuset> MyStatusets = await GetAPI.GetStatusiListAsync(httpClient);

                studenti.Drejtimi = drejtimet;

                foreach (var status in MyStatusets)
                {
                    if (studenti.StatusiId == status.StatusiId)
                    {
                        studenti.Statusi = status;
                    }
                }
            }

            if (studenti == null)
            {
                ModelState.AddModelError(string.Empty, "There was an error while getting student!");
            }

            return(View(studenti));
        }
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                ModelState.AddModelError(string.Empty, "There was an error while getting student!");
            }

            Provimet provimi = new Provimet();

            using (var httpClient = new HttpClient())
            {
                provimi = await GetAPI.GetProvimetAsync(httpClient, id);

                Lendet lendet = await GetAPI.GetLendetAsync(httpClient, provimi.LendaId);

                Studenti studenti = await GetAPI.GetStudentiAsync(httpClient, provimi.StudentiId);

                Profesoret profesoret = await GetAPI.GetProfesoretAsync(httpClient, provimi.ProfesoriId);

                provimi.Lenda     = lendet;
                provimi.Studenti  = studenti;
                provimi.Profesori = profesoret;
            }

            if (provimi == null)
            {
                ModelState.AddModelError(string.Empty, "There was an error while getting student!");
            }

            return(View(provimi));
        }
        public async Task <IActionResult> EditForm(int id)
        {
            Studenti studenti = new Studenti();

            using (var httpClient = new HttpClient())
            {
                studenti = await GetAPI.GetStudentiAsync(httpClient, id);

                List <Drejtimet> MyDrejtimets = await GetAPI.GetDrejtimiListAsync(httpClient);

                List <Statuset> MyStatusets = await GetAPI.GetStatusiListAsync(httpClient);

                ViewData["DrejtimiId"] = new SelectList(MyDrejtimets, "DrejtimetId", "EmriDrejtimit");
                ViewData["StatusiId"]  = new SelectList(MyStatusets, "StatusiId", "Statusi");
            }

            return(View(studenti));
        }