//
        // GET: /Buildings/BuildingsByAdmin

        public ActionResult DepartmentByBuilding(int?Id)
        {
            BuildingModel buildin = dbcont.Buildings.Find(Id);


            return(PartialView("~/Views/Departament/Index.cshtml", buildin.Departments));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            BuildingModel buildingModel = dbcont.Buildings.Find(id);

            dbcont.Buildings.Remove(buildingModel);
            dbcont.SaveChanges();
            return(RedirectToAction("Index", "Manage"));
        }
 public ActionResult Edit([Bind(Include = "BuildingID,Cuit,Telephone,Address,Category,Identity_ID")] BuildingModel buildingModel)
 {
     if (ModelState.IsValid)
     {
         dbcont.Entry(buildingModel).State = EntityState.Modified;
         dbcont.SaveChanges();
         return(RedirectToAction("Index", "Manage"));
     }
     return(View(buildingModel));
 }
        public ActionResult Create([Bind(Include = "ID,Cuit,Telephone,Address,Category,Administrador")] BuildingModel buildingModel)
        {
            if (ModelState.IsValid)
            {
                dbcont.Buildings.Add(buildingModel);

                dbcont.SaveChanges();
                return(View("~/Views/Manage/Index.cshtml"));
            }

            return(View(buildingModel));
        }
        // GET: BuildingModels/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BuildingModel buildingModel = dbcont.Buildings.Find(id);

            if (buildingModel == null)
            {
                return(HttpNotFound());
            }
            return(View(buildingModel));
        }