public IActionResult NewReservation(ReservationForm model, string returnUrl = null)
        {
            ShowLoggedUser();
            ViewData["Materials"] = MaterialLogic.MaterialNames();

            if (ModelState.IsValid)
            {
                model.AvaibleDateTime = ReservationLogic.IsDateTimeAvaible(model.RequstedDate);

                if (model.RequstedDate < DateTime.Now)
                {
                    model.AvaibleDateTime = false;
                }

                if (model.AvaibleDateTime)
                {
                    try
                    {
                        ReservationLogic.CreateReservation(
                            _userSession.GetLoggedUser(HttpContext).User.Id,
                            model.RequstedDate,
                            model.Material,
                            model.MaterialAmount);

                        return(RedirectToAction("ReservationList"));
                    }
                    catch (DatabaseException e)
                    {
                        return(View("Error", new ErrorViewModel()
                        {
                            RequestId = e.Message
                        }));
                    }
                }
            }


            return(View(model));
        }