From 0942bfcbcc6bed1c733ca325ac15b0c935397ba8 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Tue, 8 Mar 2016 14:26:26 +0000 Subject: [PATCH] Some error handling and ensure we are an admin to delete requests. Also started on the approval of everything --- .../ApplicationSettingsException.cs | 48 +++++++ .../PlexRequests.Helpers.csproj | 2 + PlexRequests.Helpers/UriHelper.cs | 12 +- .../PlexAvailabilityChecker.cs | 21 ++- PlexRequests.Store/GenericRepository.cs | 10 ++ PlexRequests.Store/RequestedModel.cs | 13 +- PlexRequests.Store/SqlTables.sql | 6 +- PlexRequests.UI/Content/custom.css | 1 + PlexRequests.UI/Content/requests.js | 70 +++++++++- PlexRequests.UI/Content/search.js | 49 ++++++- PlexRequests.UI/Content/site.js | 36 +----- PlexRequests.UI/Models/JsonResponseModel.cs | 34 +++++ PlexRequests.UI/Models/RequestViewModel.cs | 1 + PlexRequests.UI/Modules/ApprovalModule.cs | 120 ++++++++++++++++++ PlexRequests.UI/Modules/RequestsModule.cs | 22 +++- PlexRequests.UI/PlexRequests.UI.csproj | 5 +- PlexRequests.UI/Views/Index.cshtml | 2 - PlexRequests.UI/Views/Requests/Index.cshtml | 42 +++++- 18 files changed, 436 insertions(+), 58 deletions(-) create mode 100644 PlexRequests.Helpers/Exceptions/ApplicationSettingsException.cs create mode 100644 PlexRequests.UI/Models/JsonResponseModel.cs create mode 100644 PlexRequests.UI/Modules/ApprovalModule.cs delete mode 100644 PlexRequests.UI/Views/Index.cshtml diff --git a/PlexRequests.Helpers/Exceptions/ApplicationSettingsException.cs b/PlexRequests.Helpers/Exceptions/ApplicationSettingsException.cs new file mode 100644 index 000000000..6539fc4cb --- /dev/null +++ b/PlexRequests.Helpers/Exceptions/ApplicationSettingsException.cs @@ -0,0 +1,48 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2016 Jamie Rees +// File: ApplicationSettingsException.cs +// Created By: Jamie Rees +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// ************************************************************************/ +#endregion +using System; + +namespace PlexRequests.Helpers.Exceptions +{ + public class ApplicationSettingsException : Exception + { + + public ApplicationSettingsException(string message) : base(message) + { + + } + public ApplicationSettingsException(string message, Exception innerException) : base(message, innerException) + { + + } + + public ApplicationSettingsException() + { + + } + } +} \ No newline at end of file diff --git a/PlexRequests.Helpers/PlexRequests.Helpers.csproj b/PlexRequests.Helpers/PlexRequests.Helpers.csproj index 1e7744f75..04d967f00 100644 --- a/PlexRequests.Helpers/PlexRequests.Helpers.csproj +++ b/PlexRequests.Helpers/PlexRequests.Helpers.csproj @@ -47,6 +47,7 @@ + @@ -59,6 +60,7 @@ +