/// <summary>
        /// This method shows the information of the selected module which ID is given
        /// <example>GET: Modules/Details/5</example>
        /// <example>GET: Modules/Details/3</example>
        /// </summary>
        /// <param name="id">ID of selected module</param>
        /// <returns>Shows details of the selected module</returns>
        //
        public ActionResult Details(int id)
        {
            ShowModule showModule = new ShowModule();

            //Get the current module
            string url = "ModuleData/FindModule/" + id;
            HttpResponseMessage response = client.GetAsync(url).Result;

            if (response.IsSuccessStatusCode)
            {
                ModuleDto SelectedModule = response.Content.ReadAsAsync <ModuleDto>().Result;
                showModule.module = SelectedModule;

                //Get the classe to which the current module belongs to
                url      = "ModuleData/GetModuleClasse/" + id;
                response = client.GetAsync(url).Result;
                ClasseDto SelectedClasse = response.Content.ReadAsAsync <ClasseDto>().Result;
                showModule.classe = SelectedClasse;
                return(View(showModule));
            }
            else
            {
                return(RedirectToAction("Error"));
            }
        }
        /// <summary>
        /// Thhis method permits to display the information of the module to be updated
        /// <example>Modules/Edit/1</example>
        /// <example>Modules/Edit/5</example>
        /// </summary>
        /// <param name="id">ID of the selected module</param>
        /// <returns>displays module for editing</returns>

        public ActionResult Edit(int id)
        {
            EditModule editModule = new EditModule();

            //Getting the module from the database
            string url = "ModuleData/FindModule/" + id;
            HttpResponseMessage response = client.GetAsync(url).Result;

            if (response.IsSuccessStatusCode)
            {
                //Put data into player data transfer object
                ModuleDto selectedModule = response.Content.ReadAsAsync <ModuleDto>().Result;
                editModule.module = selectedModule;

                //Getting from the database the Classe object to which the current module belongs to
                url      = "ModuleData/GetClasses";
                response = client.GetAsync(url).Result;
                IEnumerable <ClasseDto> allClasses = response.Content.ReadAsAsync <IEnumerable <ClasseDto> >().Result;
                editModule.allClasses = allClasses;
                return(View(editModule));
            }
            else
            {
                return(RedirectToAction("Error"));
            }
        }