public IActionResult Details(int id)
        {
            lstructure str        = new lstructure();
            structure  structures = str.Structures.Single(emp => emp.code == id);

            return(View(structures));
        }
        public IActionResult Lstruct()
        {
            lstructure       liste      = new lstructure();
            List <structure> structures = liste.Structures.ToList();

            return(View(structures));
        }
        public JsonResult check(int code)
        {
            lstructure verif = new lstructure();
            structuse  str   = new structuse();

            str = verif.verifier(code);
            if (str.codeuse == true)
            {
                return(Json(1));
            }
            else
            {
                return(Json(0));
            }
        }
        public IActionResult Create(IFormCollection formcollection)
        {
            structure str = new structure();

            str.code       = Convert.ToInt32(formcollection["code"]);
            str.abr        = formcollection["abr"].ToString();
            str.desig      = formcollection["desig"].ToString();
            str.adr        = formcollection["adr"].ToString();
            str.telephone  = (formcollection["telephone"]).ToString();
            str.fax        = (formcollection["fax"]).ToString();
            str.IDattaché  = Convert.ToInt32(formcollection["idattaché"]);
            str.IDpersonne = Convert.ToInt32(formcollection["idpersonne"]);
            lstructure liste = new lstructure();

            liste.addstructure(str);



            return(RedirectToAction("Lstruct"));
        }