예제 #1
0
        public async Task <IActionResult> IndexAsync()
        {
            List <Users> MyUsers  = new List <Users>();
            List <Rolet> MyRolets = new List <Rolet>();

            using (var httpClient = new HttpClient())
            {
                MyUsers = await GetAPI.GetUserListAsync(httpClient);

                MyRolets = await GetAPI.GetRoletListAsync(httpClient);

                ViewBag.JsonUser = await GetJsonXml.GetJsonUser(httpClient);

                ViewBag.XmlUser = await GetJsonXml.GetXmlUser(httpClient);

                ViewBag.JsonRolet = await GetJsonXml.GetJsonRolet(httpClient);

                ViewBag.XmlRolet = await GetJsonXml.GetXmlRolet(httpClient);
            }

            foreach (var user in MyUsers)
            {
                foreach (var role in MyRolets)
                {
                    if (user.RoleId == role.RoletId)
                    {
                        user.Role = role;
                    }
                }
            }

            return(View(MyUsers));
        }
예제 #2
0
        public async Task <IActionResult> Index()
        {
            List <Lendet>    MyLendets    = new List <Lendet>();
            List <Drejtimet> MyDrejtimets = new List <Drejtimet>();

            using (var httpClient = new HttpClient())
            {
                MyLendets = await GetAPI.GetLendetListAsync(httpClient);

                MyDrejtimets = await GetAPI.GetDrejtimiListAsync(httpClient);

                ViewBag.JsonDrejtimet = await GetJsonXml.GetJsonDrejtimet(httpClient);

                ViewBag.XmlDrejtimet = await GetJsonXml.GetXmlDrejtimet(httpClient);

                ViewBag.JsonLendet = await GetJsonXml.GetJsonLendet(httpClient);

                ViewBag.XmlLendet = await GetJsonXml.GetXmlLendet(httpClient);
            }

            foreach (var lende in MyLendets)
            {
                foreach (var drejtim in MyDrejtimets)
                {
                    if (lende.DrejtimiId == drejtim.DrejtimetId)
                    {
                        lende.Drejtimi = drejtim;
                    }
                }
            }

            return(View(MyLendets));
        }
        public async Task <IActionResult> Index()
        {
            List <Profesoret> MyProfesorets = new List <Profesoret>();
            List <Lendet>     MyLendets     = new List <Lendet>();

            using (var httpClient = new HttpClient())
            {
                MyProfesorets = await GetAPI.GetProfesoretListAsync(httpClient);

                MyLendets = await GetAPI.GetLendetListAsync(httpClient);

                ViewBag.JsonProfesoret = await GetJsonXml.GetJsonProfesoret(httpClient);

                ViewBag.XmlProfesoret = await GetJsonXml.GetXmlProfesoret(httpClient);

                ViewBag.JsonLendet = await GetJsonXml.GetJsonLendet(httpClient);

                ViewBag.XmlLendet = await GetJsonXml.GetXmlLendet(httpClient);
            }

            foreach (var profesor in MyProfesorets)
            {
                foreach (var lende in MyLendets)
                {
                    if (profesor.LendaId == lende.LendetId)
                    {
                        profesor.Lenda = lende;
                    }
                }
            }

            return(View(MyProfesorets));
        }
예제 #4
0
        public async Task <IActionResult> Index()
        {
            List <Drejtimet> MyDrejtimets = new List <Drejtimet>();

            using (var httpClient = new HttpClient())
            {
                MyDrejtimets = await GetAPI.GetDrejtimiListAsync(httpClient);

                ViewBag.Json = await GetJsonXml.GetJsonDrejtimet(httpClient);

                ViewBag.Xml = await GetJsonXml.GetXmlDrejtimet(httpClient);
            }

            return(View(MyDrejtimets));
        }
예제 #5
0
        public async Task <IActionResult> Index()
        {
            List <Rolet> MyRolets = new List <Rolet>();

            using (var httpClient = new HttpClient())
            {
                MyRolets = await GetAPI.GetRoletListAsync(httpClient);

                ViewBag.JsonRolet = await GetJsonXml.GetJsonRolet(httpClient);

                ViewBag.XmlRolet = await GetJsonXml.GetXmlRolet(httpClient);
            }

            return(View(MyRolets));
        }
예제 #6
0
        public async Task <IActionResult> Index()
        {
            List <Studenti>  MyStudents   = new List <Studenti>();
            List <Drejtimet> MyDrejtimets = new List <Drejtimet>();
            List <Statuset>  MyStatusets  = new List <Statuset>();

            using (var httpClient = new HttpClient())
            {
                MyStudents = await GetAPI.GetStudentiListAsync(httpClient);

                MyDrejtimets = await GetAPI.GetDrejtimiListAsync(httpClient);

                MyStatusets = await GetAPI.GetStatusiListAsync(httpClient);

                ViewBag.JsonStudenti = await GetJsonXml.GetJsonStudenti(httpClient);

                ViewBag.XmlStudenti = await GetJsonXml.GetXmlStudenti(httpClient);

                ViewBag.JsonDrejtimet = await GetJsonXml.GetJsonDrejtimet(httpClient);

                ViewBag.XmlDrejtimet = await GetJsonXml.GetXmlDrejtimet(httpClient);

                ViewBag.JsonStatusi = await GetJsonXml.GetJsonStatusi(httpClient);

                ViewBag.XmlStatusi = await GetJsonXml.GetXmlStatusi(httpClient);
            }

            foreach (var student in MyStudents)
            {
                foreach (var drejtim in MyDrejtimets)
                {
                    if (student.DrejtimiId == drejtim.DrejtimetId)
                    {
                        student.Drejtimi = drejtim;
                    }
                }

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

            return(View(MyStudents));
        }
예제 #7
0
        public async Task <IActionResult> Index()
        {
            List <Provimet>   MyProvimets   = new List <Provimet>();
            List <Lendet>     MyLendets     = new List <Lendet>();
            List <Studenti>   MyStudentis   = new List <Studenti>();
            List <Profesoret> MyProfesorets = new List <Profesoret>();

            using (var httpClient = new HttpClient())
            {
                MyProvimets = await GetAPI.GetProvimetListAsync(httpClient);

                MyLendets = await GetAPI.GetLendetListAsync(httpClient);

                MyStudentis = await GetAPI.GetStudentiListAsync(httpClient);

                MyProfesorets = await GetAPI.GetProfesoretListAsync(httpClient);

                ViewBag.JsonProvimet = await GetJsonXml.GetJsonProvimet(httpClient);

                ViewBag.XmlProvimet = await GetJsonXml.GetXmlProvimet(httpClient);

                ViewBag.JsonLendet = await GetJsonXml.GetJsonLendet(httpClient);

                ViewBag.XmlLendet = await GetJsonXml.GetXmlLendet(httpClient);

                ViewBag.JsonProfesoret = await GetJsonXml.GetJsonProfesoret(httpClient);

                ViewBag.XmlProfesoret = await GetJsonXml.GetXmlProfesoret(httpClient);

                ViewBag.JsonStudenti = await GetJsonXml.GetJsonStudenti(httpClient);

                ViewBag.XmlStudenti = await GetJsonXml.GetXmlStudenti(httpClient);
            }

            foreach (var provim in MyProvimets)
            {
                foreach (var lenda in MyLendets)
                {
                    if (provim.LendaId == lenda.LendetId)
                    {
                        provim.Lenda = lenda;
                    }
                }

                foreach (var student in MyStudentis)
                {
                    if (provim.StudentiId == student.StudentId)
                    {
                        provim.Studenti = student;
                    }
                }

                foreach (var prof in MyProfesorets)
                {
                    if (provim.ProfesoriId == prof.ProfesoretId)
                    {
                        provim.Profesori = prof;
                    }
                }
            }

            return(View(MyProvimets));
        }