public ActionResult Create(FormCollection collection)
        {
            try
            {
                // TODO: Add insert logic here
                var userId = User.Identity.GetUserName();
                if (userRoleRepository.GetRoleByUserName(userId) != null && userRoleRepository.GetRoleByUserName(userId).IdUserType == "Admin")
                {
                    var alreadySetFloorLimit = 0;
                    var departmentItems      = departmentRepository.GetAllDepartments();
                    if (departmentItems != null && departmentItems.Count != 0)
                    {
                        ViewBag.datadepartments = departmentItems;
                    }

                    var buildingItems = buildingRepository.GetAllOfficeBuildings();
                    if (buildingItems != null && buildingItems.Count != 0)
                    {
                        ViewBag.databuildings = buildingItems;
                    }

                    FloorsModel floorModel = new FloorsModel();

                    floorModel.IdDepartment = Guid.Parse(Request.Form["Department"]);
                    floorModel.IdBuilding   = Guid.Parse(Request.Form["Building"]);


                    UpdateModel(floorModel);

                    //Check if allowed seats department limit is surpassed
                    //First calculate how many seats you would have with this additional entry
                    var floors = floorRepository.GetFloorByDepartmentId(floorModel.IdDepartment);

                    foreach (FloorsModel floor in floors)
                    {
                        alreadySetFloorLimit = floor.BookableSeats + alreadySetFloorLimit;
                    }

                    alreadySetFloorLimit = alreadySetFloorLimit + floorModel.BookableSeats;

                    //Check which is the maximum allowed overall space at department level
                    if (alreadySetFloorLimit <= departmentRepository.GetDepartmentById(floorModel.IdDepartment).MaximumSeatsPerDepartment)
                    {
                        if (floorRepository.IsDuplicateFloor(floorModel) == false)
                        {
                            floorRepository.InsertFloorBuilding(floorModel);

                            return(RedirectToAction("Index"));
                        }
                        else
                        {
                            return(RedirectToAction("IndexError"));
                        }
                    }
                    else
                    {
                        return(RedirectToAction("IndexError_MaximumSurpassed"));
                    }
                }
                else
                {
                    return(RedirectToAction("Contact", "Home"));
                }
            }
            catch
            {
                return(View("CreateFloor"));
            }
        }