diff --git a/StudentHouseDashboard/Data/CommentRepository.cs b/StudentHouseDashboard/Data/CommentRepository.cs index 495dd9a..225807a 100644 --- a/StudentHouseDashboard/Data/CommentRepository.cs +++ b/StudentHouseDashboard/Data/CommentRepository.cs @@ -210,7 +210,19 @@ public class CommentRepository : ICommentRepository public void CreateCommentOnComplaint(User author, string description, string title, DateTime publishDate, int complaintId) { - + Comment comment = CreateComment(author, description, title, publishDate); + using (SqlConnection connection = SqlConnectionHelper.CreateConnection()) + { + string sql = "INSERT INTO ComplaintsComments (ComplaintID, CommentID) VALUES (@complaintID, @commentID);"; + SqlCommand cmd = new SqlCommand(sql, connection); + cmd.Parameters.AddWithValue("@complaintID", complaintId); + cmd.Parameters.AddWithValue("@commentID", comment.ID); + int writer = cmd.ExecuteNonQuery(); + if (writer != 1) + { + throw new DatabaseOperationException("Database error: Complaint comment not created"); + } + } } public List GetAllCommentsOnComplaint(int complaintId) diff --git a/StudentHouseDashboard/Data/ComplaintRepository.cs b/StudentHouseDashboard/Data/ComplaintRepository.cs index 3e4c8d2..f7b03ca 100644 --- a/StudentHouseDashboard/Data/ComplaintRepository.cs +++ b/StudentHouseDashboard/Data/ComplaintRepository.cs @@ -68,10 +68,13 @@ namespace Data List complaints = new List(); UserRepository userRepository = new UserRepository(); User user = userRepository.GetUserById(userId); - string sql = "SELECT * FROM Complaints ORDER BY ID DESC OFFSET @start ROWS FETCH NEXT @count ROWS ONLY;"; + // Status 3 is Archived status + // no need to list archived complaints for now + // future revision: add an option to see archived complaints? + string sql = "SELECT * FROM Complaints WHERE Status != 3 ORDER BY ID DESC OFFSET @start ROWS FETCH NEXT @count ROWS ONLY;"; if (user.Role == UserRole.TENANT) { - sql = $"SELECT * FROM Complaints WHERE Author = {userId} ORDER BY ID DESC OFFSET @start ROWS FETCH NEXT @count ROWS ONLY;"; + sql = $"SELECT * FROM Complaints WHERE Author = {userId} AND Status != 3 ORDER BY ID DESC OFFSET @start ROWS FETCH NEXT @count ROWS ONLY;"; } if (c == null) { diff --git a/StudentHouseDashboard/Logic/CommentManager.cs b/StudentHouseDashboard/Logic/CommentManager.cs index e97cb6a..04a4a33 100644 --- a/StudentHouseDashboard/Logic/CommentManager.cs +++ b/StudentHouseDashboard/Logic/CommentManager.cs @@ -15,11 +15,15 @@ namespace Logic this.commentRepository = commentRepository; } - public void CreateCommentToAnnouncement(User author, string description, string title, DateTime publishDate, int announcementId) + public Comment GetCommentById(int id) + { + return commentRepository.GetCommentById(id); + } + public void CreateCommentOnAnnouncement(User author, string description, string title, DateTime publishDate, int announcementId) { commentRepository.CreateCommentOnAnnouncement(author, description, title, publishDate, announcementId); } - public void CreateResponseToComment(User author, string description, string title, DateTime publishDate, int commentId) + public void CreateResponseOnComment(User author, string description, string title, DateTime publishDate, int commentId) { commentRepository.CreateResponseOnComment(author, description, title, publishDate, commentId); } @@ -35,5 +39,13 @@ namespace Logic { commentRepository.DeleteResponseOnComment(responseId, commentId); } + public List GetAllCommentsOnComplaint(int complaintId) + { + return commentRepository.GetAllCommentsOnComplaint(complaintId); + } + public void CreateCommentOnComplaint(User author, string description, string title, DateTime publishDate, int complaintId) + { + commentRepository.CreateCommentOnComplaint(author, description, title, publishDate, complaintId); + } } } diff --git a/StudentHouseDashboard/Models/Comment.cs b/StudentHouseDashboard/Models/Comment.cs index 562cf64..a49b81a 100644 --- a/StudentHouseDashboard/Models/Comment.cs +++ b/StudentHouseDashboard/Models/Comment.cs @@ -7,6 +7,10 @@ namespace Models { public class Comment : GenericMessage { + public Comment() + { + + } public Comment(int id, User author, string description, string title, DateTime publishDate) : base(id, author, description, title, publishDate) { Responses = new List(); diff --git a/StudentHouseDashboard/StudentHouseDashboard.sln b/StudentHouseDashboard/StudentHouseDashboard.sln index b9b90f3..ee6a592 100644 --- a/StudentHouseDashboard/StudentHouseDashboard.sln +++ b/StudentHouseDashboard/StudentHouseDashboard.sln @@ -7,13 +7,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApp", "WebApp\WebApp.csp EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinForms", "WinForms\WinForms.csproj", "{3967DDCF-BA8E-45CD-895D-626CE346D419}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logic", "Logic\Logic.csproj", "{1AA9B921-CE97-4139-995E-95435B3110C0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Logic", "Logic\Logic.csproj", "{1AA9B921-CE97-4139-995E-95435B3110C0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Data", "Data\Data.csproj", "{FDF2FED1-3113-4BA6-8582-BBE97C301D66}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Data", "Data\Data.csproj", "{FDF2FED1-3113-4BA6-8582-BBE97C301D66}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Models", "Models\Models.csproj", "{F7DC7AD1-7A0A-403B-A535-24267BD07628}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Models", "Models\Models.csproj", "{F7DC7AD1-7A0A-403B-A535-24267BD07628}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{5AB881E8-B8FE-43A5-A74B-40CF15B20AE8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests", "Tests\Tests.csproj", "{5AB881E8-B8FE-43A5-A74B-40CF15B20AE8}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/StudentHouseDashboard/WebApp/Pages/AddComment.cshtml b/StudentHouseDashboard/WebApp/Pages/AddComment.cshtml new file mode 100644 index 0000000..649d260 --- /dev/null +++ b/StudentHouseDashboard/WebApp/Pages/AddComment.cshtml @@ -0,0 +1,35 @@ +@page +@using Models; +@model WebApp.Pages.AddCommentModel +@{ + ViewData["Title"] = "Add comment"; + GenericMessage parentMessage = (GenericMessage)ViewData["parent"]; +} + +

@ViewData["Title"]

+ +

Responding to:

+
+
+
+ @parentMessage.Title +
+
@parentMessage.Author.Name
+

@parentMessage.Description.PadRight(100).Substring(0,100).Trim()

+
+
+ +
+
+ + +
+
+ + +
+ + + + +
\ No newline at end of file diff --git a/StudentHouseDashboard/WebApp/Pages/AddComment.cshtml.cs b/StudentHouseDashboard/WebApp/Pages/AddComment.cshtml.cs new file mode 100644 index 0000000..3a1b63c --- /dev/null +++ b/StudentHouseDashboard/WebApp/Pages/AddComment.cshtml.cs @@ -0,0 +1,82 @@ +using Logic; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; +using Models; +using System.Security.Claims; + +namespace WebApp.Pages +{ + public class AddCommentModel : PageModel + { + [BindProperty] + public Comment Comment { get; set; } + + [BindProperty] + public string Type { get; set; } + + [BindProperty] + public int ParentId { get; set; } + + [BindProperty] + public string PreviousPage { get; set; } + + private readonly IAnnouncementRepository _announcementRepository; + private readonly ICommentRepository _commentRepository; + private readonly IComplaintRepository _complaintRepository; + private readonly IUserRepository _userRepository; + + public AddCommentModel(ICommentRepository commentRepository, IAnnouncementRepository announcementRepository, IComplaintRepository complaintRepository, IUserRepository userRepository) + { + _announcementRepository = announcementRepository; + _commentRepository = commentRepository; + _complaintRepository = complaintRepository; + _userRepository = userRepository; + } + + public void OnGet(string t, int id) + { + AnnouncementManager announcementManager = new AnnouncementManager(_announcementRepository); + CommentManager commentManager = new CommentManager(_commentRepository); + ComplaintManager complaintManager = new ComplaintManager(_complaintRepository); + Type = t; + ParentId = id; + PreviousPage = Request.Headers["Referer"].ToString(); + switch (Type) + { + case "announcement": + ViewData["parent"] = announcementManager.GetAnnouncementById(ParentId); + break; + case "comment": + ViewData["parent"] = commentManager.GetCommentById(ParentId); + break; + case "complaint": + ViewData["parent"] = complaintManager.GetComplaintById(ParentId); + break; + default: + break; + } + } + public RedirectResult OnPost() + { + CommentManager commentManager = new CommentManager(_commentRepository); + UserManager userManager = new UserManager(_userRepository); + User currentUser = userManager.GetUserById(int.Parse(User.FindFirstValue("id"))); + switch (Type) + { + case "announcement": + commentManager.CreateCommentOnAnnouncement(currentUser, Comment.Description, Comment.Title, DateTime.Now, ParentId); + break; + case "comment": + commentManager.CreateResponseOnComment(currentUser, Comment.Description, Comment.Title, DateTime.Now, ParentId); + break; + case "complaint": + commentManager.CreateCommentOnComplaint(currentUser, Comment.Description, Comment.Title, DateTime.Now, ParentId); + break; + default: + break; + } + return Redirect(PreviousPage); + } + } +} diff --git a/StudentHouseDashboard/WebApp/Pages/Announcement.cshtml b/StudentHouseDashboard/WebApp/Pages/Announcement.cshtml index de0cc19..7656d50 100644 --- a/StudentHouseDashboard/WebApp/Pages/Announcement.cshtml +++ b/StudentHouseDashboard/WebApp/Pages/Announcement.cshtml @@ -30,6 +30,7 @@

@Html.Raw(announcement.Description.Replace(Environment.NewLine, "
"))


Comments

+Add comment @if (announcement.Comments.Count() == 0) {

No comments found

@@ -55,9 +56,7 @@ else
@comment.Author.Name @Html.Raw((comment.Author.Role == UserRole.ADMIN || comment.Author.Role == UserRole.MANAGER) ? $"({CultureInfo.CurrentCulture.TextInfo.ToTitleCase(comment.Author.Role.ToString().ToLower())})" : "")
@comment.PublishDate.ToString("g")

@Html.Raw(comment.Description.Replace(Environment.NewLine, "
"))

- Like - Dislike - Reply + Reply @if (comment.Responses.Count != 0) { diff --git a/StudentHouseDashboard/WebApp/Pages/Announcement.cshtml.cs b/StudentHouseDashboard/WebApp/Pages/Announcement.cshtml.cs index 3a71f2f..e0ad809 100644 --- a/StudentHouseDashboard/WebApp/Pages/Announcement.cshtml.cs +++ b/StudentHouseDashboard/WebApp/Pages/Announcement.cshtml.cs @@ -19,7 +19,7 @@ namespace WebApp.Pages public void OnGet(int id) { AnnouncementManager announcementManager = new AnnouncementManager(_announcementRepository); - ViewData.Add("announcement", announcementManager.GetAllAnnouncements().First(x => x.ID == id)); + ViewData.Add("announcement", announcementManager.GetAnnouncementById(id)); } } } diff --git a/StudentHouseDashboard/WebApp/Pages/Announcements.cshtml b/StudentHouseDashboard/WebApp/Pages/Announcements.cshtml index 2cf7b98..ae8aeb5 100644 --- a/StudentHouseDashboard/WebApp/Pages/Announcements.cshtml +++ b/StudentHouseDashboard/WebApp/Pages/Announcements.cshtml @@ -11,18 +11,29 @@ currentPage = Convert.ToInt32(ViewData["page"]); } } - -Create new announcement - -
-
-

- - - -

-
-
+
+ Create new announcement + +
+
+ + +
+ + +
+
+ + +
+
+ + +
+ +
+
+
@foreach (Announcement announcement in announcements) diff --git a/StudentHouseDashboard/WebApp/Pages/Announcements.cshtml.cs b/StudentHouseDashboard/WebApp/Pages/Announcements.cshtml.cs index 2a12b95..52c1e2d 100644 --- a/StudentHouseDashboard/WebApp/Pages/Announcements.cshtml.cs +++ b/StudentHouseDashboard/WebApp/Pages/Announcements.cshtml.cs @@ -34,10 +34,31 @@ namespace WebApp.Pages ViewData.Add("count", c); ViewData.Add("allCount", AnnouncementManager.GetAllAnnouncements().Count); } - public void OnGetSearch(string s) // search + public void OnGetFilter(string s, bool asc, bool des, bool imp) // search, ascending, descending order, isImportant { AnnouncementManager = new AnnouncementManager(_announcementRepository); - ViewData.Add("announcements", AnnouncementManager.SearchAnnouncements(s)); + List announcements = new List(); + if (!string.IsNullOrEmpty(s)) + { + announcements = AnnouncementManager.SearchAnnouncements(s); + } + else + { + announcements = AnnouncementManager.GetAllAnnouncements(); + } + if (imp) + { + announcements = announcements.Where(x => x.IsImportant).ToList(); + } + if (asc) + { + announcements = announcements.OrderBy(x => x.PublishDate).ToList(); + } + else if (des) + { + announcements = announcements.OrderByDescending(x => x.PublishDate).ToList(); + } + ViewData.Add("announcements", announcements); } } } diff --git a/StudentHouseDashboard/WebApp/Pages/Complaint.cshtml b/StudentHouseDashboard/WebApp/Pages/Complaint.cshtml new file mode 100644 index 0000000..f82ce6b --- /dev/null +++ b/StudentHouseDashboard/WebApp/Pages/Complaint.cshtml @@ -0,0 +1,71 @@ +@page +@using Models; +@using System.Globalization +@using System.Security.Claims; +@model WebApp.Pages.ComplaintModel +@{ + Complaint complaint = (Complaint)ViewData["complaint"]; + ViewData["Title"] = $"{complaint.Title}"; +} +

+ @complaint.Title +

+

+ Filed @complaint.PublishDate.ToString("g") by @complaint.Author.Name +

+

+ @complaint.Status - @complaint.Severity +

+
+

@Html.Raw(complaint.Description.Replace(Environment.NewLine, "
"))

+
+

Comments

+@if (complaint.Responses.Count() == 0) +{ +

No comments found

+} +else +{ + foreach (Comment comment in complaint.Responses) + { + DisplayComment(comment, 0); + } +} +Add reply + +@{ + void DisplayComment(Comment comment, int level) + { +
+ @for (int i = 0; i < level; i++) + { + + } +
+
+
@comment.Author.Name @Html.Raw((comment.Author.Role == UserRole.ADMIN || comment.Author.Role == UserRole.MANAGER) ? $"({CultureInfo.CurrentCulture.TextInfo.ToTitleCase(comment.Author.Role.ToString().ToLower())})" : "")
+
@comment.PublishDate.ToString("g")
+

@Html.Raw(comment.Description.Replace(Environment.NewLine, "
"))

+
+ @if (comment.Responses.Count != 0) + { + foreach (var response in comment.Responses) + { + DisplayComment(response, level + 1); + } + } +
+
+ } +} \ No newline at end of file diff --git a/StudentHouseDashboard/WebApp/Pages/Complaint.cshtml.cs b/StudentHouseDashboard/WebApp/Pages/Complaint.cshtml.cs new file mode 100644 index 0000000..be8479f --- /dev/null +++ b/StudentHouseDashboard/WebApp/Pages/Complaint.cshtml.cs @@ -0,0 +1,25 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; +using Logic; +using Models; +using Data; + +namespace WebApp.Pages +{ + [Authorize] + public class ComplaintModel : PageModel + { + private readonly IComplaintRepository _complaintRepository; + + public ComplaintModel(IComplaintRepository complaintRepository) + { + _complaintRepository = complaintRepository; + } + public void OnGet(int id) + { + ComplaintManager complaintManager = new ComplaintManager(_complaintRepository); + ViewData.Add("complaint", complaintManager.GetComplaintById(id)); + } + } +} diff --git a/StudentHouseDashboard/WebApp/Pages/CreateComplaint.cshtml b/StudentHouseDashboard/WebApp/Pages/CreateComplaint.cshtml index 99dc4f6..0a5102d 100644 --- a/StudentHouseDashboard/WebApp/Pages/CreateComplaint.cshtml +++ b/StudentHouseDashboard/WebApp/Pages/CreateComplaint.cshtml @@ -14,7 +14,7 @@
-
diff --git a/StudentHouseDashboard/WebApp/Pages/CreateComplaint.cshtml.cs b/StudentHouseDashboard/WebApp/Pages/CreateComplaint.cshtml.cs index 98e11b9..8862847 100644 --- a/StudentHouseDashboard/WebApp/Pages/CreateComplaint.cshtml.cs +++ b/StudentHouseDashboard/WebApp/Pages/CreateComplaint.cshtml.cs @@ -1,4 +1,3 @@ -using Data; using Logic; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -13,13 +12,20 @@ namespace WebApp.Pages { [BindProperty] public Complaint Complaint { get; set; } + private readonly IComplaintRepository _complaintRepository; + private readonly IUserRepository _userRepository; + public CreateComplaintModel(IComplaintRepository complaintRepository, IUserRepository userRepository) + { + _complaintRepository = complaintRepository; + _userRepository = userRepository; + } public void OnGet() { } public IActionResult OnPost() { - ComplaintManager complaintManager = new ComplaintManager(new ComplaintRepository()); - UserManager userManager = new UserManager(new UserRepository()); + ComplaintManager complaintManager = new ComplaintManager(_complaintRepository); + UserManager userManager = new UserManager(_userRepository); User user = userManager.GetUserById(int.Parse(User.FindFirstValue("id"))); complaintManager.CreateComplaint(Complaint.Title, Complaint.Description, user, DateTime.Now, ComplaintStatus.FILED, Complaint.Severity); return RedirectToPage("Complaints"); diff --git a/StudentHouseDashboard/WinForms/AnnouncementForm.cs b/StudentHouseDashboard/WinForms/AnnouncementForm.cs index 979c87d..d0181c0 100644 --- a/StudentHouseDashboard/WinForms/AnnouncementForm.cs +++ b/StudentHouseDashboard/WinForms/AnnouncementForm.cs @@ -124,7 +124,7 @@ namespace WinForms private void btnCreateComment_Click(object sender, EventArgs e) { - CommentForm form = new CommentForm(null, false, currentUser, true, announcement.ID); + CommentForm form = new CommentForm(null, false, currentUser, "announcement", announcement.ID); form.ShowDialog(); RefreshComments(); } diff --git a/StudentHouseDashboard/WinForms/CommentForm.cs b/StudentHouseDashboard/WinForms/CommentForm.cs index f504c64..a9a914d 100644 --- a/StudentHouseDashboard/WinForms/CommentForm.cs +++ b/StudentHouseDashboard/WinForms/CommentForm.cs @@ -17,7 +17,8 @@ namespace WinForms { Comment? comment; User currentUser; - bool announcementResponse; + string responseType; + bool complaint; int parentId; public CommentForm(Comment? comment, bool readOnly, User currentUser) { @@ -62,9 +63,9 @@ namespace WinForms lblAuthor.Text = $"Created by: {currentUser.Name}"; } } - public CommentForm(Comment? comment, bool readOnly, User? currentUser, bool announcementResponse, int parentId) : this(comment, readOnly, currentUser) + public CommentForm(Comment? comment, bool readOnly, User? currentUser, string responseType, int parentId) : this(comment, readOnly, currentUser) { - this.announcementResponse = announcementResponse; + this.responseType = responseType; this.parentId = parentId; } private void btnSave_Click(object sender, EventArgs e) @@ -77,13 +78,19 @@ namespace WinForms } if (this.comment == null) { - if (announcementResponse) + switch (responseType) { - commentManager.CreateCommentToAnnouncement(currentUser, tbDescription.Text, tbTitle.Text, dtpPublishDate.Value, parentId); - } - else - { - commentManager.CreateResponseToComment(currentUser, tbDescription.Text, tbTitle.Text, dtpPublishDate.Value, parentId); + case "announcement": + commentManager.CreateCommentOnAnnouncement(currentUser, tbDescription.Text, tbTitle.Text, dtpPublishDate.Value, parentId); + break; + case "comment": + commentManager.CreateResponseOnComment(currentUser, tbDescription.Text, tbTitle.Text, dtpPublishDate.Value, parentId); + break; + case "complaint": + commentManager.CreateCommentOnComplaint(currentUser, tbDescription.Text, tbTitle.Text, dtpPublishDate.Value, parentId); + break; + default: + break; } } else @@ -142,7 +149,7 @@ namespace WinForms private void btnCreateComment_Click(object sender, EventArgs e) { - CommentForm form = new CommentForm(null, false, currentUser, false, comment.ID); + CommentForm form = new CommentForm(null, false, currentUser, "comment", comment.ID); form.ShowDialog(); RefreshComments(); } diff --git a/StudentHouseDashboard/WinForms/ComplaintForm.cs b/StudentHouseDashboard/WinForms/ComplaintForm.cs index 1ac7c33..a0597f9 100644 --- a/StudentHouseDashboard/WinForms/ComplaintForm.cs +++ b/StudentHouseDashboard/WinForms/ComplaintForm.cs @@ -132,7 +132,7 @@ namespace WinForms private void btnCreateComment_Click(object sender, EventArgs e) { - CommentForm form = new CommentForm(null, false, currentUser, true, complaint.ID); + CommentForm form = new CommentForm(null, false, currentUser, "complaint", complaint.ID); form.ShowDialog(); RefreshComments(); } diff --git a/StudentHouseDashboard/WinForms/Dashboard.cs b/StudentHouseDashboard/WinForms/Dashboard.cs index 6e903bc..4a30bdf 100644 --- a/StudentHouseDashboard/WinForms/Dashboard.cs +++ b/StudentHouseDashboard/WinForms/Dashboard.cs @@ -202,8 +202,8 @@ namespace WinForms if (MessageBox.Show($"Are you sure you want to archive\n{currentComplaint.Title}\nCreated at {currentComplaint.PublishDate.ToString("g")} by {currentComplaint.Author.Name}", "Archive complaint", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { - AnnouncementManager announcementManager = new AnnouncementManager(new AnnouncementRepository()); - announcementManager.DeleteAnnouncement(currentComplaint.ID); + ComplaintManager complaintManager = new ComplaintManager(new ComplaintRepository()); + complaintManager.UpdateComplaint(currentComplaint.ID, currentComplaint.Title, currentComplaint.Description, ComplaintStatus.ARCHIVED, currentComplaint.Severity); } RefreshLists(); } diff --git a/StudentHouseDashboard/WinForms/Login.cs b/StudentHouseDashboard/WinForms/Login.cs index 49dfe79..89f986a 100644 --- a/StudentHouseDashboard/WinForms/Login.cs +++ b/StudentHouseDashboard/WinForms/Login.cs @@ -19,10 +19,10 @@ namespace WinForms { MessageBox.Show("Wrong username or password", "Login failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } - /*else if (user.Role == UserRole.TENANT) + else if (user.Role == UserRole.TENANT) { - MessageBox.Show("This application is for the management. Please use the web portal", "Access denied", MessageBoxButtons.OK, MessageBoxIcon.Error); - }*/ + MessageBox.Show("This application is for the management. Please use the web portal!", "Access denied", MessageBoxButtons.OK, MessageBoxIcon.Error); + } else { Dashboard dashboard = new Dashboard(this, user);