diff --git a/Data/Data.csproj b/Data/Data.csproj index 740445a..ddabada 100644 --- a/Data/Data.csproj +++ b/Data/Data.csproj @@ -4,6 +4,7 @@ net8.0 enable enable + AnyCPU;x64 diff --git a/DbBackup/asurvey.bak b/DbBackup/asurvey.bak new file mode 100644 index 0000000..026504e Binary files /dev/null and b/DbBackup/asurvey.bak differ diff --git a/Model/Answer.cs b/Model/Answer.cs index de24d04..034fc9c 100644 --- a/Model/Answer.cs +++ b/Model/Answer.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; + namespace Model { public class Answer diff --git a/Model/Banner.cs b/Model/Banner.cs index 66c871d..81b9a67 100644 --- a/Model/Banner.cs +++ b/Model/Banner.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; @@ -12,6 +13,8 @@ namespace Model public int Id { get; set; } [Required] + + public string? Title { get; set; } [Required] public string? Description { get; set; } diff --git a/SurveyVista.sln b/SurveyVista.sln index 4cae7e5..5e67626 100644 --- a/SurveyVista.sln +++ b/SurveyVista.sln @@ -14,25 +14,43 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {0A90A5D7-CBD6-4956-B8EC-4E368736113F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0A90A5D7-CBD6-4956-B8EC-4E368736113F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0A90A5D7-CBD6-4956-B8EC-4E368736113F}.Debug|x64.ActiveCfg = Debug|Any CPU + {0A90A5D7-CBD6-4956-B8EC-4E368736113F}.Debug|x64.Build.0 = Debug|Any CPU {0A90A5D7-CBD6-4956-B8EC-4E368736113F}.Release|Any CPU.ActiveCfg = Release|Any CPU {0A90A5D7-CBD6-4956-B8EC-4E368736113F}.Release|Any CPU.Build.0 = Release|Any CPU + {0A90A5D7-CBD6-4956-B8EC-4E368736113F}.Release|x64.ActiveCfg = Release|Any CPU + {0A90A5D7-CBD6-4956-B8EC-4E368736113F}.Release|x64.Build.0 = Release|Any CPU {6EE5F607-221D-4DFF-B027-06D190BCD536}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6EE5F607-221D-4DFF-B027-06D190BCD536}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6EE5F607-221D-4DFF-B027-06D190BCD536}.Debug|x64.ActiveCfg = Debug|Any CPU + {6EE5F607-221D-4DFF-B027-06D190BCD536}.Debug|x64.Build.0 = Debug|Any CPU {6EE5F607-221D-4DFF-B027-06D190BCD536}.Release|Any CPU.ActiveCfg = Release|Any CPU {6EE5F607-221D-4DFF-B027-06D190BCD536}.Release|Any CPU.Build.0 = Release|Any CPU + {6EE5F607-221D-4DFF-B027-06D190BCD536}.Release|x64.ActiveCfg = Release|Any CPU + {6EE5F607-221D-4DFF-B027-06D190BCD536}.Release|x64.Build.0 = Release|Any CPU {D03B56FD-361D-49C5-B0D3-B48DDE90A217}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D03B56FD-361D-49C5-B0D3-B48DDE90A217}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D03B56FD-361D-49C5-B0D3-B48DDE90A217}.Debug|x64.ActiveCfg = Debug|x64 + {D03B56FD-361D-49C5-B0D3-B48DDE90A217}.Debug|x64.Build.0 = Debug|x64 {D03B56FD-361D-49C5-B0D3-B48DDE90A217}.Release|Any CPU.ActiveCfg = Release|Any CPU {D03B56FD-361D-49C5-B0D3-B48DDE90A217}.Release|Any CPU.Build.0 = Release|Any CPU + {D03B56FD-361D-49C5-B0D3-B48DDE90A217}.Release|x64.ActiveCfg = Release|x64 + {D03B56FD-361D-49C5-B0D3-B48DDE90A217}.Release|x64.Build.0 = Release|x64 {61EE2AF3-6434-4DE4-BD66-222DC6E9AC4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {61EE2AF3-6434-4DE4-BD66-222DC6E9AC4B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {61EE2AF3-6434-4DE4-BD66-222DC6E9AC4B}.Debug|x64.ActiveCfg = Debug|Any CPU + {61EE2AF3-6434-4DE4-BD66-222DC6E9AC4B}.Debug|x64.Build.0 = Debug|Any CPU {61EE2AF3-6434-4DE4-BD66-222DC6E9AC4B}.Release|Any CPU.ActiveCfg = Release|Any CPU {61EE2AF3-6434-4DE4-BD66-222DC6E9AC4B}.Release|Any CPU.Build.0 = Release|Any CPU + {61EE2AF3-6434-4DE4-BD66-222DC6E9AC4B}.Release|x64.ActiveCfg = Release|Any CPU + {61EE2AF3-6434-4DE4-BD66-222DC6E9AC4B}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Web/.config/dotnet-tools.json b/Web/.config/dotnet-tools.json new file mode 100644 index 0000000..b0e38ab --- /dev/null +++ b/Web/.config/dotnet-tools.json @@ -0,0 +1,5 @@ +{ + "version": 1, + "isRoot": true, + "tools": {} +} \ No newline at end of file diff --git a/Web/Areas/Admin/Controllers/AdminController.cs b/Web/Areas/Admin/Controllers/AdminController.cs index 817d2e1..dfc384c 100644 --- a/Web/Areas/Admin/Controllers/AdminController.cs +++ b/Web/Areas/Admin/Controllers/AdminController.cs @@ -10,7 +10,7 @@ namespace Web.Areas.Admin.Controllers { - [Authorize(Roles ="Admin")] + [Authorize(Roles = "Admin")] public class AdminController : Controller { private readonly SignInManager _signInManager; diff --git a/Web/Areas/Admin/Controllers/QuestionnaireController.cs b/Web/Areas/Admin/Controllers/QuestionnaireController.cs index 796b3ba..bfc5589 100644 --- a/Web/Areas/Admin/Controllers/QuestionnaireController.cs +++ b/Web/Areas/Admin/Controllers/QuestionnaireController.cs @@ -403,7 +403,7 @@ namespace Web.Areas.Admin.Controllers // If deletion is successful, you can redirect to a success page or return a success message return Json(new { success = true, message = "Item deleted successfully" }); } - catch (Exception ex) + catch (Exception) { // Log the exception or handle it appropriately return StatusCode(500, "An error occurred while processing your request."); diff --git a/Web/Areas/Admin/Views/Questionnaire/Details.cshtml b/Web/Areas/Admin/Views/Questionnaire/Details.cshtml index cca96bc..229e3e3 100644 --- a/Web/Areas/Admin/Views/Questionnaire/Details.cshtml +++ b/Web/Areas/Admin/Views/Questionnaire/Details.cshtml @@ -6,7 +6,7 @@ -
+
Back to List @@ -37,7 +37,7 @@
- +
diff --git a/Web/Areas/Admin/Views/Questionnaire/Index.cshtml b/Web/Areas/Admin/Views/Questionnaire/Index.cshtml index a55b5f5..7d1df4e 100644 --- a/Web/Areas/Admin/Views/Questionnaire/Index.cshtml +++ b/Web/Areas/Admin/Views/Questionnaire/Index.cshtml @@ -5,30 +5,30 @@ } -
+
-
+
Questionnaire

Questionnaire list

Create New

-
ID
- +
+ - - - - + + + + - + - + @foreach (var item in Model) { @@ -41,9 +41,7 @@ - @@ -84,31 +82,3 @@ - -@section Scripts{ - - - -} \ No newline at end of file diff --git a/Web/Areas/Admin/Views/Shared/_AdminLayout.cshtml b/Web/Areas/Admin/Views/Shared/_AdminLayout.cshtml index 6af27c3..e86e3aa 100644 --- a/Web/Areas/Admin/Views/Shared/_AdminLayout.cshtml +++ b/Web/Areas/Admin/Views/Shared/_AdminLayout.cshtml @@ -69,7 +69,7 @@ Toggle Menu @@ -77,27 +77,25 @@
IdTitleTotal Questions Questions | Type | Answers IdTitleTotal Questions Questions | Type | Answers ActionAction
- @* *@ + Questions @item.Questions?.Count() @@ -67,11 +65,11 @@ - Delete | - Edit| - Details | - Send + + Delete + Edit + Details + Send
+
@@ -256,16 +256,16 @@
-
+
-
+
-
+
-
-
+
+
diff --git a/Web/Areas/Admin/Views/newsletters/Index.cshtml b/Web/Areas/Admin/Views/newsletters/Index.cshtml index c764e6f..726ffaf 100644 --- a/Web/Areas/Admin/Views/newsletters/Index.cshtml +++ b/Web/Areas/Admin/Views/newsletters/Index.cshtml @@ -195,8 +195,8 @@
-
-
+
+

Real-Time Email Tracking @@ -204,7 +204,7 @@

View email tracking with chart

-

+
@@ -222,12 +222,12 @@ - +
RecipientUnsubscribed
- + @section Scripts{ diff --git a/Web/Controllers/SubscriptionController.cs b/Web/Controllers/SubscriptionController.cs index 3204a0d..f1fbda4 100644 --- a/Web/Controllers/SubscriptionController.cs +++ b/Web/Controllers/SubscriptionController.cs @@ -153,7 +153,7 @@ namespace Web.Controllers TempData["success"] = "Subscription successful. Please confirm your email."; return RedirectToAction("", "home"); } - catch (Exception ex) + catch (Exception) { TempData["error"] = "Failed to subscribe."; return RedirectToAction("", "home"); diff --git a/Web/Extesions/ServicesExtesions.cs b/Web/Extesions/ServicesExtesions.cs index 2217455..86d81d4 100644 --- a/Web/Extesions/ServicesExtesions.cs +++ b/Web/Extesions/ServicesExtesions.cs @@ -1,14 +1,20 @@ using Data; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.EntityFrameworkCore; using Model; using OpenAI_API; using Services.Implemnetation; using Services.Interaces; +using System.Net; using Web.AIConfiguration; namespace Web.Extesions { + + public static class ServicesExtesions { public static void ConfigureSQLConnection(this IServiceCollection services, IConfiguration configuration) diff --git a/Web/Program.cs b/Web/Program.cs index cf78299..6af26c2 100644 --- a/Web/Program.cs +++ b/Web/Program.cs @@ -1,9 +1,5 @@ using Data; -using Microsoft.AspNetCore.Mvc.Razor; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; using Services.Implemnetation; -using Services.Interaces; using Web.Extesions; using Web.ViewComponents; diff --git a/Web/Views/Home/Index.cshtml b/Web/Views/Home/Index.cshtml index 083a5b5..3504bb2 100644 --- a/Web/Views/Home/Index.cshtml +++ b/Web/Views/Home/Index.cshtml @@ -6,8 +6,6 @@ - -
diff --git a/Web/appsettings.json b/Web/appsettings.json index 3028c58..755616b 100644 --- a/Web/appsettings.json +++ b/Web/appsettings.json @@ -7,25 +7,26 @@ }, "AllowedHosts": "*", - "ConnectionStrings": { - "SurveyVista": "data source=SEO-PC; initial catalog=SurveyVista;integrated security=True; TrustServerCertificate=True;" - }, + "ConnectionStrings": { + "SurveyVista": "data source=SEO-PC; initial catalog=SurveyVista;integrated security=True; TrustServerCertificate=True;" + }, + //"ConnectionStrings": { + // "SurveyVista": "data source=mssql11.curanet.dk; initial catalog=yacht_view_com;User Id=yacht_view; Password=P-S@bH49As; TrustServerCertificate=True;" + //}, + //"ConnectionStrings": { + // "SurveyVista": "data source=SQL1003.site4now.net; Initial Catalog=db_ab8a17_vistasurvey;User Id=db_ab8a17_vistasurvey_admin,Password=1!QaisYousuf;integrated security=True; TrustServerCertificate=True;" + //}, "Email": { "From": "mr.qais.yousuf@gmail.com", "ApplicationName": "Online Survey", "ConfirmEmailPath": "Subscription/Confirmation", "unsubscribePath": "Subscription/UnsubscribeConfirmation", - "Questionnaire": "QuestionnaireResponse/DisplayQuestionnaire", - + "Questionnaire": "QuestionnaireResponse/DisplayQuestionnaire" }, "MailJet": { "ApiKey": "f545eee3a4743464b9d25fb9c5ab3f6c", "SecretKey": "8df3cf0337a090b1d6301f312ca51413" - }, - "OpenAI": { - "ApiKey": "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" - } }